From b252e327376c390fc34920b026926e0f356eae6c Mon Sep 17 00:00:00 2001 From: eNDdy Date: Fri, 2 May 2025 18:34:35 -0600 Subject: [PATCH 01/15] first xcm test --- Cargo.lock | 2661 +++++++++++++---- Cargo.toml | 19 + emulated-test/Cargo.toml | 29 + .../chains/frequency-westend/Cargo.toml | 23 + .../chains/frequency-westend/src/genesis.rs | 69 + .../chains/frequency-westend/src/lib.rs | 52 + emulated-test/networks/westend/Cargo.toml | 14 + emulated-test/networks/westend/src/lib.rs | 30 + emulated-test/src/genesis.rs | 78 + emulated-test/src/lib.rs | 46 + .../test/frequency-westend/Cargo.toml | 23 + .../test/frequency-westend/src/lib.rs | 40 + .../test/frequency-westend/src/tests/mod.rs | 1 + .../frequency-westend/src/tests/teleport.rs | 24 + runtime/frequency/src/lib.rs | 12 +- runtime/frequency/src/xcm_config.rs | 4 +- 16 files changed, 2593 insertions(+), 532 deletions(-) create mode 100644 emulated-test/Cargo.toml create mode 100644 emulated-test/chains/frequency-westend/Cargo.toml create mode 100644 emulated-test/chains/frequency-westend/src/genesis.rs create mode 100644 emulated-test/chains/frequency-westend/src/lib.rs create mode 100644 emulated-test/networks/westend/Cargo.toml create mode 100644 emulated-test/networks/westend/src/lib.rs create mode 100644 emulated-test/src/genesis.rs create mode 100644 emulated-test/src/lib.rs create mode 100644 emulated-test/test/frequency-westend/Cargo.toml create mode 100644 emulated-test/test/frequency-westend/src/lib.rs create mode 100644 emulated-test/test/frequency-westend/src/tests/mod.rs create mode 100644 emulated-test/test/frequency-westend/src/tests/teleport.rs diff --git a/Cargo.lock b/Cargo.lock index 00379d6cf7..8fdeae0170 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,6 +105,156 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "alloy-core" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d8bcce99ad10fe02640cfaec1c6bc809b837c783c1d52906aa5af66e2a196f6" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb8e762aefd39a397ff485bc86df673465c4ad3ec8819cc60833a8a3ba5cdc87" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6beff64ad0aa6ad1019a3db26fef565aefeb011736150ab73ed3366c3cfd1b" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.2", + "indexmap 2.9.0", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" +dependencies = [ + "arrayvec 0.7.6", + "bytes", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10ae8e9a91d328ae954c22542415303919aabe976fe7a92eb06db1b68fd59f2" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ad5da86c127751bc607c174d6c9fe9b85ef0889a9ca0c641735d77d4f98f26" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck 0.5.0", + "indexmap 2.9.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3d30f0d3f9ba3b7686f3ff1de9ee312647aac705604417a2f40c604f409a9e" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.100", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d162f8524adfdfb0e4bd0505c734c985f3e2474eb022af32eef0d52a4f3935c" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43d5e60466a440230c07761aa67671d4719d46f43be8ea6e7ed334d8db4a9ab" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "const-hex", + "serde", +] + [[package]] name = "always-assert" version = "0.1.3" @@ -316,6 +466,24 @@ dependencies = [ "ark-std 0.5.0", ] +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.4.2" @@ -332,7 +500,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version", + "rustc_version 0.4.1", "zeroize", ] @@ -356,6 +524,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -376,6 +554,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -430,6 +620,16 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + [[package]] name = "ark-serialize" version = "0.4.2" @@ -477,6 +677,16 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -630,6 +840,170 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "asset-hub-westend-emulated-chain" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "asset-hub-westend-runtime", + "bp-bridge-hub-westend", + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "parachains-common", + "sp-core", + "sp-keyring", + "staging-xcm", + "staging-xcm-builder", + "testnet-parachains-constants", + "westend-emulated-chain", +] + +[[package]] +name = "asset-hub-westend-runtime" +version = "0.29.2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "assets-common", + "bp-asset-hub-rococo", + "bp-asset-hub-westend", + "bp-bridge-hub-rococo", + "bp-bridge-hub-westend", + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-weight-reclaim", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-asset-conversion", + "pallet-asset-conversion-ops", + "pallet-asset-conversion-tx-payment", + "pallet-asset-rewards", + "pallet-assets", + "pallet-assets-freezer", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-message-queue", + "pallet-migrations", + "pallet-multisig", + "pallet-nft-fractionalization", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-revive", + "pallet-session", + "pallet-state-trie-migration", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "pallet-xcm-bridge-hub-router", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "primitive-types 0.13.1", + "scale-info", + "serde_json", + "snowbridge-inbound-queue-primitives", + "snowbridge-outbound-queue-primitives", + "snowbridge-pallet-system-frontend", + "snowbridge-runtime-common", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", + "testnet-parachains-constants", + "westend-runtime-constants", + "xcm-runtime-apis", +] + +[[package]] +name = "asset-test-utils" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "frame-support", + "frame-system", + "pallet-asset-conversion", + "pallet-assets", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-timestamp", + "pallet-xcm", + "pallet-xcm-bridge-hub-router", + "parachains-common", + "parachains-runtimes-test-utils", + "parity-scale-codec", + "sp-io", + "sp-runtime", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "xcm-runtime-apis", +] + +[[package]] +name = "assets-common" +version = "0.21.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "impl-trait-for-tuples", + "pallet-asset-conversion", + "pallet-assets", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "tracing", +] + [[package]] name = "async-channel" version = "1.9.0" @@ -890,6 +1264,17 @@ dependencies = [ "url", ] +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -979,7 +1364,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "hash-db", "log", @@ -1034,15 +1419,30 @@ dependencies = [ ] [[package]] -name = "bip39" -version = "2.1.0" +name = "bip39" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" +dependencies = [ + "bitcoin_hashes 0.13.0", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" -dependencies = [ - "bitcoin_hashes 0.13.0", - "serde", - "unicode-normalization", -] +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitcoin-internals" @@ -1219,10 +1619,216 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "bp-asset-hub-rococo" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-bridge-hub-cumulus", + "bp-messages", + "bp-runtime", + "bp-xcm-bridge-hub-router", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-core", + "staging-xcm", + "testnet-parachains-constants", +] + +[[package]] +name = "bp-asset-hub-westend" +version = "0.16.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-bridge-hub-cumulus", + "bp-messages", + "bp-runtime", + "bp-xcm-bridge-hub-router", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-core", + "staging-xcm", + "testnet-parachains-constants", +] + +[[package]] +name = "bp-bridge-hub-cumulus" +version = "0.21.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-messages", + "bp-polkadot-core", + "bp-runtime", + "frame-support", + "frame-system", + "polkadot-primitives", + "sp-api", + "sp-std", +] + +[[package]] +name = "bp-bridge-hub-rococo" +version = "0.21.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-bridge-hub-cumulus", + "bp-messages", + "bp-runtime", + "bp-xcm-bridge-hub", + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bp-bridge-hub-westend" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-bridge-hub-cumulus", + "bp-messages", + "bp-runtime", + "bp-xcm-bridge-hub", + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bp-header-chain" +version = "0.20.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-runtime", + "finality-grandpa", + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-consensus-grandpa", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bp-messages" +version = "0.20.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-header-chain", + "bp-runtime", + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "bp-parachains" +version = "0.20.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-header-chain", + "bp-polkadot-core", + "bp-runtime", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bp-polkadot-core" +version = "0.20.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-messages", + "bp-runtime", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bp-relayers" +version = "0.20.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-header-chain", + "bp-messages", + "bp-parachains", + "bp-runtime", + "frame-support", + "frame-system", + "pallet-utility", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bp-runtime" +version = "0.20.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-support", + "frame-system", + "hash-db", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "trie-db", +] + +[[package]] +name = "bp-xcm-bridge-hub" +version = "0.6.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-messages", + "bp-runtime", + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", + "staging-xcm", +] + [[package]] name = "bp-xcm-bridge-hub-router" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -1285,6 +1891,9 @@ name = "bytes" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +dependencies = [ + "serde", +] [[package]] name = "bzip2-sys" @@ -1452,18 +2061,6 @@ dependencies = [ "unsigned-varint 0.7.2", ] -[[package]] -name = "cid" -version = "0.10.1" -source = "git+https://github.com/multiformats/rust-cid?tag=v0.10.1#1df4e3fe0f6bcb8845655d2ccefd9da5ef81a1cd" -dependencies = [ - "core2", - "multibase", - "multihash 0.18.1", - "serde", - "unsigned-varint 0.7.2", -] - [[package]] name = "cid" version = "0.11.1" @@ -1471,6 +2068,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3147d8272e8fa0ccd29ce51194dd98f79ddfb8191ba9e3409884e751798acf3a" dependencies = [ "core2", + "multibase", "multihash 0.19.3", "unsigned-varint 0.8.0", ] @@ -2056,7 +2654,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "clap", "parity-scale-codec", @@ -2073,7 +2671,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -2096,7 +2694,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-client-collator", @@ -2143,7 +2741,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -2173,7 +2771,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "anyhow", "async-trait", @@ -2188,7 +2786,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -2214,7 +2812,7 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2234,7 +2832,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2260,7 +2858,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -2297,7 +2895,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -2314,7 +2912,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -2349,7 +2947,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -2360,7 +2958,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -2373,7 +2971,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-weight-reclaim" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-storage-weight-reclaim", "derive-where", @@ -2392,7 +2990,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.19.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2407,7 +3005,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -2432,7 +3030,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "sp-api", "sp-consensus-aura", @@ -2441,7 +3039,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2457,7 +3055,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2471,7 +3069,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -2481,7 +3079,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-storage-weight-reclaim" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-proof-size-hostfunction", @@ -2498,7 +3096,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "sp-inherents", @@ -2508,7 +3106,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2525,7 +3123,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2549,7 +3147,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2568,7 +3166,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "async-trait", @@ -2602,7 +3200,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2642,7 +3240,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2663,7 +3261,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version", + "rustc_version 0.4.1", "subtle 2.6.1", "zeroize", ] @@ -2920,7 +3518,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", + "rustc_version 0.4.1", "syn 2.0.100", ] @@ -2930,7 +3528,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "derive_more-impl", + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", ] [[package]] @@ -2945,6 +3552,18 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "unicode-xid", +] + [[package]] name = "diff" version = "0.1.13" @@ -3088,6 +3707,12 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clonable" version = "0.9.2" @@ -3208,6 +3833,42 @@ dependencies = [ "zeroize", ] +[[package]] +name = "emulated-integration-tests-common" +version = "20.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "asset-test-utils", + "bp-messages", + "bp-xcm-bridge-hub", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "frame-support", + "hex-literal", + "pallet-assets", + "pallet-balances", + "pallet-bridge-messages", + "pallet-message-queue", + "pallet-xcm", + "pallet-xcm-bridge-hub", + "parachains-common", + "parity-scale-codec", + "paste", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-parachains", + "sc-consensus-grandpa", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-keyring", + "sp-runtime", + "staging-xcm", + "xcm-emulator", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -3335,6 +3996,47 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "ethabi-decode" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52029c4087f9f01108f851d0d02df9c21feb5660a19713466724b7f95bd2d773" +dependencies = [ + "ethereum-types", + "tiny-keccak", +] + +[[package]] +name = "ethbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde 0.5.0", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde 0.5.0", + "primitive-types 0.13.1", + "scale-info", + "uint 0.10.0", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -3424,6 +4126,28 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + [[package]] name = "fatality" version = "0.1.1" @@ -3561,7 +4285,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fork-tree" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", ] @@ -3594,7 +4318,7 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-support-procedural", @@ -3618,7 +4342,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "47.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "Inflector", "array-bytes", @@ -3692,7 +4416,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -3703,7 +4427,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3719,7 +4443,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "aquamarine", "frame-support", @@ -3761,7 +4485,7 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "const-hex", @@ -3777,7 +4501,7 @@ dependencies = [ [[package]] name = "frame-support" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "aquamarine", "array-bytes", @@ -3818,7 +4542,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "Inflector", "cfg-expr", @@ -3838,7 +4562,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", @@ -3850,7 +4574,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "proc-macro2", "quote", @@ -3860,7 +4584,7 @@ dependencies = [ [[package]] name = "frame-system" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cfg-if", "docify", @@ -3879,7 +4603,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -3893,7 +4617,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "parity-scale-codec", @@ -3903,7 +4627,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "parity-scale-codec", @@ -3973,6 +4697,23 @@ dependencies = [ "substrate-build-script-utils", ] +[[package]] +name = "frequency-emulated-chain" +version = "0.0.0" +dependencies = [ + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "frequency-runtime", + "parachains-common", + "polkadot-primitives", + "sp-core", + "sp-keyring", + "sp-runtime", + "staging-xcm", + "xcm-emulator", +] + [[package]] name = "frequency-runtime" version = "0.0.0" @@ -4158,6 +4899,24 @@ dependencies = [ "tokio", ] +[[package]] +name = "frequency-westend-integration-tests" +version = "0.0.0" +dependencies = [ + "asset-test-utils", + "emulated-integration-tests-common", + "frame-support", + "pallet-balances", + "pallet-message-queue", + "pallet-xcm", + "parachains-common", + "sp-runtime", + "staging-xcm", + "staging-xcm-executor", + "westend-runtime", + "westend-system-emulated-network", +] + [[package]] name = "fs-err" version = "2.11.0" @@ -4298,7 +5057,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.26", + "rustls", "rustls-pki-types", ] @@ -4594,6 +5353,7 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", ] [[package]] @@ -4640,6 +5400,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-conservative" @@ -4888,7 +5651,7 @@ dependencies = [ "hyper 1.6.0", "hyper-util", "log", - "rustls 0.23.26", + "rustls", "rustls-native-certs", "rustls-pki-types", "tokio", @@ -5137,6 +5900,15 @@ dependencies = [ "xmltree", ] +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + [[package]] name = "impl-codec" version = "0.7.1" @@ -5157,6 +5929,15 @@ dependencies = [ "uint 0.10.0", ] +[[package]] +name = "impl-rlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" +dependencies = [ + "rlp 0.6.1", +] + [[package]] name = "impl-serde" version = "0.4.0" @@ -5224,6 +6005,7 @@ checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", + "serde", ] [[package]] @@ -5464,7 +6246,7 @@ dependencies = [ "http 1.3.1", "jsonrpsee-core", "pin-project", - "rustls 0.23.26", + "rustls", "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.1", @@ -5590,13 +6372,23 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + [[package]] name = "keccak-hash" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" dependencies = [ - "primitive-types", + "primitive-types 0.13.1", "tiny-keccak", ] @@ -5655,6 +6447,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "lazycell" @@ -5981,7 +6776,7 @@ dependencies = [ "quinn", "rand 0.8.5", "ring 0.17.14", - "rustls 0.23.26", + "rustls", "socket2 0.5.9", "thiserror 1.0.69", "tokio", @@ -6071,9 +6866,9 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.11.3", + "rcgen", "ring 0.17.14", - "rustls 0.23.26", + "rustls", "rustls-webpki 0.101.7", "thiserror 1.0.69", "x509-parser 0.16.0", @@ -6294,18 +7089,17 @@ checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "litep2p" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa3aa5628ae2b2283aa01dfa58947f1926aedba0160dd25041e2cd4bc71534c9" +checksum = "d71056c23c896bb0e18113b2d2f1989be95135e6bdeedb0b757422ee21a073eb" dependencies = [ "async-trait", "bs58", "bytes", - "cid 0.10.1", + "cid 0.11.1", "ed25519-dalek", "futures", "futures-timer", - "hex-literal", "hickory-resolver", "indexmap 2.9.0", "libc", @@ -6315,12 +7109,9 @@ dependencies = [ "network-interface", "parking_lot 0.12.3", "pin-project", - "prost 0.12.6", + "prost 0.13.5", "prost-build", "rand 0.8.5", - "rcgen 0.10.0", - "ring 0.16.20", - "rustls 0.20.9", "serde", "sha2 0.10.8", "simple-dns", @@ -6411,6 +7202,17 @@ dependencies = [ "libc", ] +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "macro_magic" version = "0.5.1" @@ -6609,7 +7411,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "log", @@ -6628,7 +7430,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -6738,23 +7540,6 @@ dependencies = [ "unsigned-varint 0.7.2", ] -[[package]] -name = "multihash" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest 0.10.7", - "multihash-derive", - "sha2 0.10.8", - "sha3", - "unsigned-varint 0.7.2", -] - [[package]] name = "multihash" version = "0.19.3" @@ -6895,9 +7680,9 @@ dependencies = [ [[package]] name = "network-interface" -version = "1.1.4" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" +checksum = "c3329f515506e4a2de3aa6e07027a6758e22e0f0e8eaf64fa47261cec2282602" dependencies = [ "cc", "libc", @@ -7206,7 +7991,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7221,24 +8006,75 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-asset-conversion-ops" +version = "0.8.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-asset-conversion", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-asset-conversion-tx-payment" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "pallet-asset-rate" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "pallet-asset-rewards" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", + "sp-api", + "sp-arithmetic", "sp-core", + "sp-io", "sp-runtime", + "sp-std", ] [[package]] name = "pallet-asset-tx-payment" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7255,7 +8091,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7268,10 +8104,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-assets-freezer" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "log", + "pallet-assets", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + [[package]] name = "pallet-aura" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -7287,7 +8135,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -7302,7 +8150,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -7315,7 +8163,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7338,7 +8186,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "aquamarine", "docify", @@ -7359,7 +8207,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -7375,7 +8223,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -7394,7 +8242,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7419,7 +8267,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7433,10 +8281,29 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-bridge-messages" +version = "0.20.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-header-chain", + "bp-messages", + "bp-runtime", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", + "sp-trie", +] + [[package]] name = "pallet-broker" version = "0.19.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "frame-benchmarking", @@ -7483,7 +8350,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7501,7 +8368,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7520,7 +8387,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -7537,7 +8404,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7553,7 +8420,7 @@ dependencies = [ [[package]] name = "pallet-delegated-staking" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -7568,7 +8435,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7585,7 +8452,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7607,7 +8474,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7620,7 +8487,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7638,7 +8505,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -7709,7 +8576,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7779,7 +8646,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7795,7 +8662,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7814,7 +8681,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7829,7 +8696,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -7845,7 +8712,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "43.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "environmental", "frame-benchmarking", @@ -7912,7 +8779,7 @@ dependencies = [ [[package]] name = "pallet-meta-tx" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -7930,7 +8797,7 @@ dependencies = [ [[package]] name = "pallet-migrations" version = "10.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -7949,7 +8816,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "parity-scale-codec", @@ -8019,7 +8886,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "parity-scale-codec", @@ -8027,10 +8894,52 @@ dependencies = [ "scale-info", ] +[[package]] +name = "pallet-nft-fractionalization" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-nfts", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + +[[package]] +name = "pallet-nfts" +version = "34.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-nfts-runtime-api" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + [[package]] name = "pallet-nis" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -8040,7 +8949,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -8058,7 +8967,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8078,7 +8987,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8088,7 +8997,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -8103,7 +9012,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8126,7 +9035,7 @@ dependencies = [ [[package]] name = "pallet-parameters" version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -8167,7 +9076,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8183,7 +9092,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -8193,57 +9102,139 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-recovery" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-referenda" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-revive" +version = "0.5.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ + "alloy-core", + "derive_more 0.99.20", + "environmental", + "ethabi-decode", + "ethereum-types", "frame-benchmarking", "frame-support", "frame-system", + "hex-literal", "impl-trait-for-tuples", "log", + "num-bigint", + "num-integer", + "num-traits", + "pallet-revive-fixtures", + "pallet-revive-proc-macro", + "pallet-revive-uapi", + "pallet-transaction-payment", "parity-scale-codec", + "paste", + "polkavm 0.21.0", + "polkavm-common 0.21.0", + "rand 0.8.5", + "ripemd", + "rlp 0.6.1", "scale-info", + "serde", + "sp-api", "sp-arithmetic", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-slots", "sp-core", "sp-io", "sp-runtime", + "staging-xcm", + "staging-xcm-builder", + "substrate-bn", + "subxt-signer", ] [[package]] -name = "pallet-recovery" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +name = "pallet-revive-fixtures" +version = "0.3.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", + "anyhow", + "cargo_metadata", + "pallet-revive-uapi", + "polkavm-linker 0.21.0", + "sp-core", "sp-io", - "sp-runtime", + "toml 0.8.20", ] [[package]] -name = "pallet-referenda" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +name = "pallet-revive-proc-macro" +version = "0.3.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ - "assert_matches", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pallet-revive-uapi" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bitflags 1.3.2", + "pallet-revive-proc-macro", "parity-scale-codec", + "polkavm-derive 0.21.0", "scale-info", - "serde", - "sp-arithmetic", - "sp-io", - "sp-runtime", ] [[package]] name = "pallet-root-testing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -8257,7 +9248,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -8327,7 +9318,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "frame-system", @@ -8348,7 +9339,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8364,7 +9355,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8381,7 +9372,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8403,7 +9394,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "sp-arithmetic", @@ -8412,7 +9403,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "sp-api", @@ -8422,7 +9413,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "44.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8488,7 +9479,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -8524,7 +9515,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -8543,7 +9534,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8561,7 +9552,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8577,7 +9568,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8593,7 +9584,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8626,7 +9617,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -8642,10 +9633,24 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-uniques" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "pallet-utility" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8660,7 +9665,7 @@ dependencies = [ [[package]] name = "pallet-verify-signature" version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8676,7 +9681,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8690,7 +9695,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -8700,7 +9705,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8723,7 +9728,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8737,10 +9742,51 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "pallet-xcm-bridge-hub" +version = "0.16.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-messages", + "bp-runtime", + "bp-xcm-bridge-hub", + "frame-support", + "frame-system", + "log", + "pallet-bridge-messages", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "pallet-xcm-bridge-hub-router" +version = "0.18.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-xcm-bridge-hub-router", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", +] + [[package]] name = "parachains-common" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -8766,6 +9812,37 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "parachains-runtimes-test-utils" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-timestamp", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-runtime", + "sp-tracing", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-executor", + "xcm-runtime-apis", +] + [[package]] name = "parity-bip39" version = "2.0.1" @@ -8779,6 +9856,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "parity-bytes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b56e3a2420138bdb970f84dfb9c774aea80fa0e7371549eedec0d80c209c67" + [[package]] name = "parity-db" version = "0.4.13" @@ -8929,15 +10012,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - [[package]] name = "pem" version = "3.0.5" @@ -9123,7 +10197,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkadot-approval-distribution" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "futures-timer", @@ -9141,7 +10215,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "futures-timer", @@ -9156,7 +10230,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fatality", "futures", @@ -9179,7 +10253,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "fatality", @@ -9212,7 +10286,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "clap", "frame-benchmarking-cli", @@ -9236,7 +10310,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "fatality", @@ -9259,7 +10333,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -9270,7 +10344,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fatality", "futures", @@ -9292,7 +10366,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9306,7 +10380,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "futures-timer", @@ -9327,7 +10401,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "always-assert", "async-trait", @@ -9350,7 +10424,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "parity-scale-codec", @@ -9368,7 +10442,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "bitvec", @@ -9400,7 +10474,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting-parallel" version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -9424,7 +10498,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "futures", @@ -9443,7 +10517,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "fatality", @@ -9464,7 +10538,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9479,7 +10553,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -9501,7 +10575,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "polkadot-node-metrics", @@ -9515,7 +10589,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "futures-timer", @@ -9531,7 +10605,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fatality", "futures", @@ -9549,7 +10623,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -9566,7 +10640,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fatality", "futures", @@ -9580,7 +10654,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "fatality", @@ -9597,7 +10671,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "always-assert", "array-bytes", @@ -9625,7 +10699,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9638,7 +10712,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cpu-time", "futures", @@ -9664,7 +10738,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "polkadot-node-metrics", @@ -9679,7 +10753,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bs58", "futures", @@ -9696,7 +10770,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -9721,7 +10795,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "bounded-vec", @@ -9745,7 +10819,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "polkadot-node-subsystem-types", "polkadot-overseer", @@ -9754,7 +10828,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "derive_more 0.99.20", @@ -9782,7 +10856,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fatality", "futures", @@ -9813,7 +10887,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -9833,7 +10907,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bounded-collections", "derive_more 0.99.20", @@ -9849,7 +10923,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "18.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "hex-literal", @@ -9877,7 +10951,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9910,7 +10984,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitvec", "frame-benchmarking", @@ -9960,7 +11034,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bs58", "frame-benchmarking", @@ -9972,7 +11046,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10028,7 +11102,7 @@ dependencies = [ [[package]] name = "polkadot-sdk-frame" version = "0.9.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-benchmarking", @@ -10063,7 +11137,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "frame-benchmarking", @@ -10171,7 +11245,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "arrayvec 0.7.6", "bitvec", @@ -10194,7 +11268,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10209,9 +11283,22 @@ checksum = "dd044ab1d3b11567ab6b98ca71259a992b4034220d5972988a0e96518e5d343d" dependencies = [ "libc", "log", - "polkavm-assembler", - "polkavm-common", - "polkavm-linux-raw", + "polkavm-assembler 0.18.0", + "polkavm-common 0.18.0", + "polkavm-linux-raw 0.18.0", +] + +[[package]] +name = "polkavm" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd34e2f74206fff33482ae1718e275f11365ef8c4de7f0e69217f8845303867" +dependencies = [ + "libc", + "log", + "polkavm-assembler 0.21.0", + "polkavm-common 0.21.0", + "polkavm-linux-raw 0.21.0", ] [[package]] @@ -10223,6 +11310,15 @@ dependencies = [ "log", ] +[[package]] +name = "polkavm-assembler" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f512bc80cb10439391a7c13a9eb2d37cf66b7305e7df0a06d662eff4f5b07625" +dependencies = [ + "log", +] + [[package]] name = "polkavm-common" version = "0.18.0" @@ -10230,7 +11326,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" dependencies = [ "log", - "polkavm-assembler", + "polkavm-assembler 0.18.0", +] + +[[package]] +name = "polkavm-common" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c16b809cfd398f861261c045a8745e6c78b71ea7e0d3ef6f7cc553eb27bc17e" +dependencies = [ + "blake3", + "log", + "polkavm-assembler 0.21.0", ] [[package]] @@ -10239,7 +11346,16 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.18.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47239245f87329541932c0d7fec750a66a75b13aa87dfe4fbfd637bab86ad387" +dependencies = [ + "polkavm-derive-impl-macro 0.21.0", ] [[package]] @@ -10248,7 +11364,19 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" dependencies = [ - "polkavm-common", + "polkavm-common 0.18.0", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fd6c6215450c3e57511df5c38a82eb4bde208de15ee15046ac33852f3c3eaa" +dependencies = [ + "polkavm-common 0.21.0", "proc-macro2", "quote", "syn 2.0.100", @@ -10260,7 +11388,17 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" dependencies = [ - "polkavm-derive-impl", + "polkavm-derive-impl 0.18.1", + "syn 2.0.100", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36837f6b7edfd6f4498f8d25d81da16cf03bd6992c3e56f3d477dfc90f4fefca" +dependencies = [ + "polkavm-derive-impl 0.21.0", "syn 2.0.100", ] @@ -10275,7 +11413,23 @@ dependencies = [ "hashbrown 0.14.5", "log", "object 0.36.7", - "polkavm-common", + "polkavm-common 0.18.0", + "regalloc2 0.9.3", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linker" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bc764986c4a63f9ab9890c3f4eb9b4c13b6ff80d79685bd48ade147234aab4" +dependencies = [ + "dirs", + "gimli 0.31.1", + "hashbrown 0.14.5", + "log", + "object 0.36.7", + "polkavm-common 0.21.0", "regalloc2 0.9.3", "rustc-demangle", ] @@ -10286,6 +11440,12 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23eff02c070c70f31878a3d915e88a914ecf3e153741e2fb572dde28cce20fde" +[[package]] +name = "polkavm-linux-raw" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be6cd1d48c5e7814d287a3e12a339386a5dfa2f3ac72f932335f4cf56467f1b3" + [[package]] name = "polling" version = "2.8.0" @@ -10425,6 +11585,17 @@ dependencies = [ "elliptic-curve", ] +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec 0.6.0", + "uint 0.9.5", +] + [[package]] name = "primitive-types" version = "0.13.1" @@ -10432,8 +11603,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" dependencies = [ "fixed-hash", - "impl-codec", + "impl-codec 0.7.1", "impl-num-traits", + "impl-rlp", "impl-serde 0.5.0", "scale-info", "uint 0.10.0", @@ -10583,6 +11755,8 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ + "bit-set", + "bit-vec", "bitflags 2.9.0", "lazy_static", "num-traits", @@ -10590,6 +11764,8 @@ dependencies = [ "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax 0.8.5", + "rusty-fork", + "tempfile", "unarray", ] @@ -10698,6 +11874,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quick-protobuf" version = "0.8.1" @@ -10733,7 +11915,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.1", - "rustls 0.23.26", + "rustls", "socket2 0.5.9", "thiserror 2.0.12", "tokio", @@ -10752,7 +11934,7 @@ dependencies = [ "rand 0.9.1", "ring 0.17.14", "rustc-hash 2.1.1", - "rustls 0.23.26", + "rustls", "rustls-pki-types", "slab", "thiserror 2.0.12", @@ -10805,6 +11987,7 @@ dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", + "serde", ] [[package]] @@ -10918,25 +12101,13 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rcgen" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" -dependencies = [ - "pem 1.1.1", - "ring 0.16.20", - "time", - "yasna", -] - [[package]] name = "rcgen" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ - "pem 3.0.5", + "pem", "ring 0.16.20", "time", "yasna", @@ -11141,6 +12312,26 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" +dependencies = [ + "bytes", + "rustc-hex", +] + [[package]] name = "rocksdb" version = "0.21.0" @@ -11154,7 +12345,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "22.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "binary-merkle-tree", "bitvec", @@ -11252,7 +12443,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "polkadot-primitives", @@ -11301,13 +12492,67 @@ dependencies = [ ] [[package]] -name = "rtoolbox" -version = "0.0.3" +name = "rtoolbox" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cc970b249fbe527d6e02e0a227762c9108b2f49d81094fe357ffc6d14d7f6f" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "ruint" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a46eb779843b2c4f21fac5773e25d6d5b7c8f0922876c91541790d2ca27eef" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types 0.12.2", + "proptest", + "rand 0.8.5", + "rand 0.9.1", + "rlp 0.5.2", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cc970b249fbe527d6e02e0a227762c9108b2f49d81094fe357ffc6d14d7f6f" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "runtime-integration-tests" +version = "0.0.0" dependencies = [ - "libc", - "windows-sys 0.52.0", + "asset-hub-westend-emulated-chain", + "emulated-integration-tests-common", + "frequency-runtime", + "parachains-common", + "polkadot-primitives", + "sc-consensus-grandpa", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "westend-emulated-chain", + "westend-runtime", + "westend-runtime-constants", + "xcm-emulator", ] [[package]] @@ -11334,6 +12579,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.1" @@ -11406,17 +12660,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "ring 0.16.20", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.23.26" @@ -11464,7 +12707,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.26", + "rustls", "rustls-native-certs", "rustls-platform-verifier-android", "rustls-webpki 0.103.1", @@ -11507,6 +12750,18 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ruzstd" version = "0.4.0" @@ -11575,7 +12830,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "sp-core", @@ -11586,7 +12841,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -11614,7 +12869,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "log", @@ -11635,7 +12890,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "sp-api", @@ -11650,7 +12905,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "docify", @@ -11676,7 +12931,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -11687,7 +12942,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.51.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "chrono", @@ -11729,7 +12984,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fnv", "futures", @@ -11755,7 +13010,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "hash-db", "kvdb", @@ -11781,7 +13036,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -11804,7 +13059,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -11833,7 +13088,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "fork-tree", @@ -11869,7 +13124,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "jsonrpsee", @@ -11891,7 +13146,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -11925,7 +13180,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "jsonrpsee", @@ -11945,7 +13200,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11958,7 +13213,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "ahash", "array-bytes", @@ -12002,7 +13257,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "finality-grandpa", "futures", @@ -12022,7 +13277,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.50.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "assert_matches", "async-trait", @@ -12057,7 +13312,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -12080,7 +13335,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -12103,9 +13358,9 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ - "polkavm", + "polkavm 0.18.0", "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", @@ -12116,10 +13371,10 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", - "polkavm", + "polkavm 0.18.0", "sc-executor-common", "sp-wasm-interface", ] @@ -12127,7 +13382,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "anyhow", "log", @@ -12143,7 +13398,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "console", "futures", @@ -12159,7 +13414,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -12173,7 +13428,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -12200,8 +13455,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +version = "0.49.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12251,7 +13506,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -12261,7 +13516,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "ahash", "futures", @@ -12280,7 +13535,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12301,7 +13556,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12336,7 +13591,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "futures", @@ -12355,7 +13610,7 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.15.3" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bs58", "bytes", @@ -12374,7 +13629,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bytes", "fnv", @@ -12389,7 +13644,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "rand 0.8.5", - "rustls 0.23.26", + "rustls", "sc-client-api", "sc-network", "sc-network-types", @@ -12408,7 +13663,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12417,7 +13672,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "jsonrpsee", @@ -12449,7 +13704,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12469,7 +13724,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -12492,8 +13747,8 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +version = "0.49.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "futures", @@ -12525,7 +13780,7 @@ dependencies = [ [[package]] name = "sc-runtime-utilities" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "sc-executor", @@ -12540,7 +13795,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.50.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "directories", @@ -12604,7 +13859,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "parity-scale-codec", @@ -12615,7 +13870,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.24.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "clap", "fs4", @@ -12628,7 +13883,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12647,7 +13902,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "derive_more 0.99.20", "futures", @@ -12667,7 +13922,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "28.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "chrono", "futures", @@ -12686,7 +13941,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "chrono", "console", @@ -12713,8 +13968,8 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +version = "11.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -12725,7 +13980,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -12757,7 +14012,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -12774,7 +14029,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-channel 1.9.0", "futures", @@ -12818,7 +14073,7 @@ checksum = "f8ae9cc099ae85ff28820210732b00f019546f36f33225f509fe25d5816864a0" dependencies = [ "derive_more 1.0.0", "parity-scale-codec", - "primitive-types", + "primitive-types 0.13.1", "scale-bits", "scale-decode-derive", "scale-type-resolver", @@ -12845,7 +14100,7 @@ checksum = "5f9271284d05d0749c40771c46180ce89905fd95aa72a2a2fddb4b7c0aa424db" dependencies = [ "derive_more 1.0.0", "parity-scale-codec", - "primitive-types", + "primitive-types 0.13.1", "scale-bits", "scale-encode-derive", "scale-type-resolver", @@ -13013,16 +14268,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", -] - [[package]] name = "sec1" version = "0.7.3" @@ -13150,7 +14395,16 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.3", ] [[package]] @@ -13168,6 +14422,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + [[package]] name = "serde" version = "1.0.219" @@ -13177,6 +14440,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" +dependencies = [ + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.17" @@ -13309,6 +14581,16 @@ dependencies = [ "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -13401,7 +14683,7 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "enumn", "parity-scale-codec", @@ -13567,98 +14849,294 @@ dependencies = [ ] [[package]] -name = "smoldot-light" -version = "0.9.0" +name = "smoldot-light" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256b5bad1d6b49045e95fe87492ce73d5af81545d8b4d8318a872d2007024c33" +dependencies = [ + "async-channel 1.9.0", + "async-lock 2.8.0", + "base64 0.21.7", + "blake2-rfc", + "derive_more 0.99.20", + "either", + "event-listener 2.5.3", + "fnv", + "futures-channel", + "futures-lite 1.13.0", + "futures-util", + "hashbrown 0.14.5", + "hex", + "itertools 0.11.0", + "log", + "lru 0.11.1", + "no-std-net", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher 0.3.11", + "slab", + "smol 1.3.0", + "smoldot 0.11.0", + "zeroize", +] + +[[package]] +name = "smoldot-light" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a33b06891f687909632ce6a4e3fd7677b24df930365af3d0bcb078310129f3f" +dependencies = [ + "async-channel 2.3.1", + "async-lock 3.4.0", + "base64 0.22.1", + "blake2-rfc", + "bs58", + "derive_more 0.99.20", + "either", + "event-listener 5.4.0", + "fnv", + "futures-channel", + "futures-lite 2.6.0", + "futures-util", + "hashbrown 0.14.5", + "hex", + "itertools 0.13.0", + "log", + "lru 0.12.5", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher 1.0.1", + "slab", + "smol 2.0.2", + "smoldot 0.18.0", + "zeroize", +] + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "snow" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" +dependencies = [ + "aes-gcm", + "blake2 0.10.6", + "chacha20poly1305", + "curve25519-dalek", + "rand_core 0.6.4", + "ring 0.17.14", + "rustc_version 0.4.1", + "sha2 0.10.8", + "subtle 2.6.1", +] + +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "snowbridge-beacon-primitives" +version = "0.13.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "byte-slice-cast", + "frame-support", + "hex", + "parity-scale-codec", + "rlp 0.6.1", + "scale-info", + "serde", + "snowbridge-ethereum", + "snowbridge-milagro-bls", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "ssz_rs", + "ssz_rs_derive", +] + +[[package]] +name = "snowbridge-core" +version = "0.13.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "bp-relayers", + "ethabi-decode", + "frame-support", + "frame-system", + "hex-literal", + "log", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-ethereum" +version = "0.12.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "ethabi-decode", + "ethbloom", + "ethereum-types", + "hex-literal", + "parity-bytes", + "parity-scale-codec", + "rlp 0.6.1", + "scale-info", + "serde", + "serde-big-array", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "snowbridge-inbound-queue-primitives" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "alloy-core", + "frame-support", + "frame-system", + "hex-literal", + "log", + "parity-scale-codec", + "scale-info", + "snowbridge-beacon-primitives", + "snowbridge-core", + "snowbridge-verification-primitives", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-milagro-bls" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256b5bad1d6b49045e95fe87492ce73d5af81545d8b4d8318a872d2007024c33" +checksum = "026aa8638f690a53e3f7676024b9e913b1cab0111d1b7b92669d40a188f9d7e6" dependencies = [ - "async-channel 1.9.0", - "async-lock 2.8.0", - "base64 0.21.7", - "blake2-rfc", - "derive_more 0.99.20", - "either", - "event-listener 2.5.3", - "fnv", - "futures-channel", - "futures-lite 1.13.0", - "futures-util", - "hashbrown 0.14.5", "hex", - "itertools 0.11.0", - "log", - "lru 0.11.1", - "no-std-net", - "parking_lot 0.12.3", - "pin-project", + "lazy_static", + "parity-scale-codec", "rand 0.8.5", - "rand_chacha 0.3.1", - "serde", - "serde_json", - "siphasher 0.3.11", - "slab", - "smol 1.3.0", - "smoldot 0.11.0", + "scale-info", + "snowbridge-amcl", "zeroize", ] [[package]] -name = "smoldot-light" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a33b06891f687909632ce6a4e3fd7677b24df930365af3d0bcb078310129f3f" +name = "snowbridge-outbound-queue-primitives" +version = "0.2.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ - "async-channel 2.3.1", - "async-lock 3.4.0", - "base64 0.22.1", - "blake2-rfc", - "bs58", - "derive_more 0.99.20", - "either", - "event-listener 5.4.0", - "fnv", - "futures-channel", - "futures-lite 2.6.0", - "futures-util", - "hashbrown 0.14.5", - "hex", - "itertools 0.13.0", + "alloy-core", + "ethabi-decode", + "frame-support", + "frame-system", + "hex-literal", "log", - "lru 0.12.5", - "parking_lot 0.12.3", - "pin-project", - "rand 0.8.5", - "rand_chacha 0.3.1", - "serde", - "serde_json", - "siphasher 1.0.1", - "slab", - "smol 2.0.2", - "smoldot 0.18.0", - "zeroize", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "snowbridge-core", + "snowbridge-verification-primitives", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] -name = "snap" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +name = "snowbridge-pallet-system-frontend" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-xcm", + "parity-scale-codec", + "scale-info", + "snowbridge-core", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-executor", + "tracing", +] [[package]] -name = "snow" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" +name = "snowbridge-runtime-common" +version = "0.13.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ - "aes-gcm", - "blake2 0.10.6", - "chacha20poly1305", - "curve25519-dalek", - "rand_core 0.6.4", - "ring 0.17.14", - "rustc_version", - "sha2 0.10.8", - "subtle 2.6.1", + "frame-support", + "frame-system", + "log", + "pallet-xcm", + "parity-scale-codec", + "snowbridge-core", + "snowbridge-outbound-queue-primitives", + "sp-arithmetic", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-verification-primitives" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "snowbridge-beacon-primitives", + "sp-core", + "sp-std", ] [[package]] @@ -13715,7 +15193,7 @@ dependencies = [ [[package]] name = "sp-api" version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "hash-db", @@ -13737,7 +15215,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "Inflector", "blake2 0.10.6", @@ -13751,7 +15229,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -13763,7 +15241,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "integer-sqrt", @@ -13777,7 +15255,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -13789,7 +15267,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "sp-api", "sp-inherents", @@ -13799,7 +15277,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "futures", "parity-scale-codec", @@ -13818,7 +15296,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "futures", @@ -13832,7 +15310,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "parity-scale-codec", @@ -13848,7 +15326,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.42.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "parity-scale-codec", @@ -13866,7 +15344,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "24.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -13886,7 +15364,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "23.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "finality-grandpa", "log", @@ -13903,7 +15381,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.42.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -13914,7 +15392,7 @@ dependencies = [ [[package]] name = "sp-core" version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "ark-vrf", "array-bytes", @@ -13937,7 +15415,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "paste", - "primitive-types", + "primitive-types 0.13.1", "rand 0.8.5", "scale-info", "schnorrkel 0.11.4", @@ -13975,7 +15453,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "blake2b_simd", "byteorder", @@ -13988,7 +15466,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2503)", @@ -13998,7 +15476,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -14007,7 +15485,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "proc-macro2", "quote", @@ -14017,7 +15495,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "environmental", "parity-scale-codec", @@ -14027,7 +15505,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -14039,7 +15517,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -14051,8 +15529,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +version = "40.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bytes", "docify", @@ -14060,7 +15538,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.18.0", "rustversion", "secp256k1 0.28.2", "sp-core", @@ -14078,7 +15556,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "sp-core", "sp-runtime", @@ -14088,7 +15566,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -14099,7 +15577,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -14108,7 +15586,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-metadata 20.0.0", "parity-scale-codec", @@ -14118,7 +15596,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -14129,7 +15607,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "log", "parity-scale-codec", @@ -14146,7 +15624,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -14159,7 +15637,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "sp-api", "sp-core", @@ -14169,7 +15647,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "backtrace", "regex", @@ -14178,7 +15656,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -14188,7 +15666,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "binary-merkle-tree", "docify", @@ -14217,13 +15695,13 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "29.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", - "primitive-types", + "polkavm-derive 0.18.0", + "primitive-types 0.13.1", "sp-externalities", "sp-runtime-interface-proc-macro", "sp-std", @@ -14236,7 +15714,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "Inflector", "expander", @@ -14249,7 +15727,7 @@ dependencies = [ [[package]] name = "sp-session" version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "scale-info", @@ -14263,7 +15741,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -14276,7 +15754,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "hash-db", "log", @@ -14296,7 +15774,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "20.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -14320,12 +15798,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -14337,7 +15815,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "parity-scale-codec", @@ -14349,7 +15827,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "tracing", @@ -14360,7 +15838,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "sp-api", "sp-runtime", @@ -14369,7 +15847,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "async-trait", "parity-scale-codec", @@ -14383,7 +15861,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "ahash", "hash-db", @@ -14405,7 +15883,7 @@ dependencies = [ [[package]] name = "sp-version" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -14422,7 +15900,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -14434,7 +15912,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -14446,7 +15924,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "31.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -14503,6 +15981,29 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "ssz_rs" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057291e5631f280978fa9c8009390663ca4613359fc1318e36a8c24c392f6d1f" +dependencies = [ + "bitvec", + "num-bigint", + "sha2 0.9.9", + "ssz_rs_derive", +] + +[[package]] +name = "ssz_rs_derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f07d54c4d01a1713eb363b55ba51595da15f6f1211435b71466460da022aa140" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -14512,7 +16013,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -14525,7 +16026,7 @@ dependencies = [ [[package]] name = "staging-xcm" version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "bounded-collections", @@ -14545,8 +16046,8 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +version = "20.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "environmental", "frame-support", @@ -14570,7 +16071,7 @@ dependencies = [ [[package]] name = "staging-xcm-executor" version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "environmental", "frame-benchmarking", @@ -14681,7 +16182,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -14690,15 +16191,28 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" [[package]] name = "substrate-frame-rpc-system" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "docify", "frame-system-rpc-runtime-api", @@ -14718,7 +16232,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -14732,7 +16246,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14748,8 +16262,8 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +version = "26.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "array-bytes", "build-helper", @@ -14761,7 +16275,7 @@ dependencies = [ "merkleized-metadata", "parity-scale-codec", "parity-wasm", - "polkavm-linker", + "polkavm-linker 0.18.0", "sc-executor", "shlex", "sp-core", @@ -14810,7 +16324,7 @@ dependencies = [ "jsonrpsee", "parity-scale-codec", "polkadot-sdk", - "primitive-types", + "primitive-types 0.13.1", "scale-bits", "scale-decode 0.14.0", "scale-encode", @@ -14864,7 +16378,7 @@ dependencies = [ "keccak-hash", "parity-scale-codec", "polkadot-sdk", - "primitive-types", + "primitive-types 0.13.1", "scale-bits", "scale-decode 0.14.0", "scale-encode", @@ -14985,6 +16499,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560533fbd6914b94a8fb5cc803ed6801c3455668db3b810702c57612bac9412" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -15091,6 +16617,21 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" +[[package]] +name = "testnet-parachains-constants" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "polkadot-core-primitives", + "rococo-runtime-constants", + "smallvec", + "sp-runtime", + "staging-xcm", + "westend-runtime-constants", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -15297,7 +16838,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls 0.23.26", + "rustls", "tokio", ] @@ -15321,7 +16862,7 @@ checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" dependencies = [ "futures-util", "log", - "rustls 0.23.26", + "rustls", "rustls-native-certs", "rustls-pki-types", "tokio", @@ -15475,7 +17016,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "coarsetime", "polkadot-primitives", @@ -15486,7 +17027,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "expander", "proc-macro-crate 3.3.0", @@ -15571,7 +17112,7 @@ dependencies = [ "httparse", "log", "rand 0.9.1", - "rustls 0.23.26", + "rustls", "rustls-pki-types", "sha1", "thiserror 2.0.12", @@ -15872,6 +17413,15 @@ dependencies = [ "w3f-plonk-common", ] +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + [[package]] name = "waker-fn" version = "1.2.0" @@ -16361,16 +17911,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", -] - [[package]] name = "webpki-root-certs" version = "0.26.8" @@ -16386,10 +17926,29 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +[[package]] +name = "westend-emulated-chain" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "emulated-integration-tests-common", + "pallet-staking", + "parachains-common", + "polkadot-primitives", + "sc-consensus-grandpa", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "westend-runtime", + "westend-runtime-constants", +] + [[package]] name = "westend-runtime" version = "22.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "binary-merkle-tree", "bitvec", @@ -16498,7 +18057,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "polkadot-primitives", @@ -16511,6 +18070,16 @@ dependencies = [ "staging-xcm-builder", ] +[[package]] +name = "westend-system-emulated-network" +version = "0.0.0" +dependencies = [ + "asset-hub-westend-emulated-chain", + "emulated-integration-tests-common", + "frequency-emulated-chain", + "westend-emulated-chain", +] + [[package]] name = "wide" version = "0.7.32" @@ -16955,10 +18524,43 @@ dependencies = [ "time", ] +[[package]] +name = "xcm-emulator" +version = "0.19.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" +dependencies = [ + "array-bytes", + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-balances", + "pallet-message-queue", + "pallet-timestamp", + "parachains-common", + "parity-scale-codec", + "paste", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-parachains", + "sp-arithmetic", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2503)", + "sp-io", + "sp-runtime", + "sp-tracing", + "staging-xcm", + "staging-xcm-executor", +] + [[package]] name = "xcm-procedural" version = "11.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "Inflector", "proc-macro2", @@ -16969,7 +18571,7 @@ dependencies = [ [[package]] name = "xcm-runtime-apis" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#b7c7686ec66c9fe6dcfcd89d79f7e3607cd2e193" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2503#0bc730c5f59b194ceb11cd993aaa577a811ba32f" dependencies = [ "frame-support", "parity-scale-codec", @@ -17221,3 +18823,8 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "cid" +version = "0.10.1" +source = "git+https://github.com/multiformats/rust-cid?tag=v0.10.1#1df4e3fe0f6bcb8845655d2ccefd9da5ef81a1cd" diff --git a/Cargo.toml b/Cargo.toml index ff89085d68..1b63da9a0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,10 @@ members = [ "node", "node/cli", + "emulated-test/networks/westend", + "emulated-test/chains/frequency-westend", + "emulated-test*", + "emulated-test/test/frequency-westend", "node/service", "pallets/*", "runtime/*", @@ -124,6 +128,21 @@ xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/par cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false } + +# xcm-test emulator +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } + +emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +asset-hub-westend-emulated-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +westend-emulated-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +asset-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } + # client derive_more = "0.99.17" futures = "0.3.25" diff --git a/emulated-test/Cargo.toml b/emulated-test/Cargo.toml new file mode 100644 index 0000000000..d9df772d04 --- /dev/null +++ b/emulated-test/Cargo.toml @@ -0,0 +1,29 @@ +[package] +authors = ["Frequency"] +edition = '2021' +homepage = "https://frequency.xyz" +license = "Apache-2.0" +name = 'runtime-integration-tests' +publish = false +version = "0.0.0" + +[dependencies] +xcm-emulator = { workspace = true } +westend-runtime = { workspace = true } +westend-runtime-constants = { workspace = true } +sc-consensus-grandpa = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-consensus-beefy = { workspace = true } +sp-authority-discovery = { workspace = true } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +parachains-common = { workspace = true } +polkadot-primitives = { workspace = true } + +emulated-integration-tests-common = { workspace = true } +asset-hub-westend-emulated-chain = { workspace = true } +westend-emulated-chain = { workspace = true } + + +frequency-runtime = { path = "../runtime/frequency", features = ["frequency-westend", "frequency-bridging"] } + diff --git a/emulated-test/chains/frequency-westend/Cargo.toml b/emulated-test/chains/frequency-westend/Cargo.toml new file mode 100644 index 0000000000..26b640d5ed --- /dev/null +++ b/emulated-test/chains/frequency-westend/Cargo.toml @@ -0,0 +1,23 @@ +[package] +authors = ["Frequency"] +edition = '2021' +homepage = "https://frequency.xyz" +license = "Apache-2.0" +name = 'frequency-emulated-chain' +publish = false +version = "0.0.0" + +[dependencies] +xcm-emulator = { workspace = true } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +parachains-common = { workspace = true } +polkadot-primitives = { workspace = true } + +emulated-integration-tests-common = { workspace = true } +frequency-runtime = { path = "../../../runtime/frequency", features = ["frequency-westend", "frequency-bridging"] } +cumulus-primitives-core = { workspace = true } +sp-keyring = { workspace = true } +frame-support = { workspace = true } +staging-xcm = { workspace = true } + diff --git a/emulated-test/chains/frequency-westend/src/genesis.rs b/emulated-test/chains/frequency-westend/src/genesis.rs new file mode 100644 index 0000000000..bc44c07400 --- /dev/null +++ b/emulated-test/chains/frequency-westend/src/genesis.rs @@ -0,0 +1,69 @@ +use frame_support::parameter_types; +use sp_core::storage::Storage; +use sp_keyring::Sr25519Keyring as Keyring; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, +}; +use parachains_common::{AccountId, Balance}; +// use frequency_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub}; +use frequency_runtime::xcm_config::RelayLocation; +// Penpal +pub const PARA_ID: u32 = 2000; +pub const ED: Balance = frequency_runtime::EXISTENTIAL_DEPOSIT; + +parameter_types! { + pub FrequencySudoAccount: AccountId = Keyring::Alice.to_account_id(); + pub FrequencyAssetOwner: AccountId = FrequencySudoAccount::get(); +} + +pub fn genesis(para_id: u32) -> Storage { + let genesis_config = frequency_runtime::RuntimeGenesisConfig { + system: frequency_runtime::SystemConfig::default(), + balances: frequency_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + ..Default::default() + }, + parachain_info: frequency_runtime::ParachainInfoConfig { + parachain_id: para_id.into(), + ..Default::default() + }, + collator_selection: frequency_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: frequency_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + frequency_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + ..Default::default() + }, + // polkadot_xcm: frequency_runtime::PolkadotXcmConfig { + // safe_xcm_version: Some(SAFE_XCM_VERSION), + // ..Default::default() + // }, + sudo: frequency_runtime::SudoConfig { key: Some(FrequencySudoAccount::get()) }, + // foreign_assets: frequency_runtime::ForeignAssetsConfig { + // assets: vec![ + // // Relay Native asset representation + // (RelayLocation::get(), FrequencyAssetOwner::get(), true, ED), + // ], + // ..Default::default() + // }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + frequency_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + ) +} diff --git a/emulated-test/chains/frequency-westend/src/lib.rs b/emulated-test/chains/frequency-westend/src/lib.rs new file mode 100644 index 0000000000..30c6b3f4e8 --- /dev/null +++ b/emulated-test/chains/frequency-westend/src/lib.rs @@ -0,0 +1,52 @@ +pub use frequency_runtime::{self, xcm_config::RelayNetwork as FrequencyRelayNetworkId}; + +mod genesis; +pub use genesis::{genesis, FrequencySudoAccount, ED, PARA_ID}; + +// Substrate +use frame_support::traits::OnInitialize; +use sp_core::Encode; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, + impl_xcm_helpers_for_parachain, + impls::{NetworkId, Parachain}, + xcm_emulator::decl_test_parachains, +}; + +// Polkadot +use staging_xcm::latest::WESTEND_GENESIS_HASH; + +// Penpal Parachain declaration +decl_test_parachains! { + pub struct FrequencyWestend { + genesis = genesis(PARA_ID), + on_init = { + frequency_runtime::AuraExt::on_initialize(1); + // frame_support::assert_ok!(frequency_runtime::System::set_storage( + // frequency_runtime::RuntimeOrigin::root(), + // vec![(FrequencyRelayNetworkId::get().unwrap(), NetworkId::ByGenesis(WESTEND_GENESIS_HASH).encode())], + // )); + }, + runtime = frequency_runtime, + core = { + XcmpMessageHandler: frequency_runtime::XcmpQueue, + LocationToAccountId: frequency_runtime::xcm_config::LocationToAccountId, + ParachainInfo: frequency_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: frequency_runtime::PolkadotXcm, + ForeignAssets: frequency_runtime::ForeignAssets, + Balances: frequency_runtime::Balances, + } + }, +} + +impl_accounts_helpers_for_parachain!(FrequencyWestend); +impl_assert_events_helpers_for_parachain!(FrequencyWestend); +// impl_assets_helpers_for_parachain!(Frequency); +// impl_foreign_assets_helpers_for_parachain!(Frequency, staging_xcm::latest::Location); +impl_xcm_helpers_for_parachain!(FrequencyWestend); diff --git a/emulated-test/networks/westend/Cargo.toml b/emulated-test/networks/westend/Cargo.toml new file mode 100644 index 0000000000..0007f704e0 --- /dev/null +++ b/emulated-test/networks/westend/Cargo.toml @@ -0,0 +1,14 @@ +[package] +authors = ["Frequency"] +edition = '2021' +homepage = "https://frequency.xyz" +license = "Apache-2.0" +name = 'westend-system-emulated-network' +publish = false +version = "0.0.0" + +[dependencies] +asset-hub-westend-emulated-chain = { workspace = true } +emulated-integration-tests-common = { workspace = true } +frequency-emulated-chain = { path = "../../chains/frequency-westend"} +westend-emulated-chain = { workspace = true } diff --git a/emulated-test/networks/westend/src/lib.rs b/emulated-test/networks/westend/src/lib.rs new file mode 100644 index 0000000000..4104b81580 --- /dev/null +++ b/emulated-test/networks/westend/src/lib.rs @@ -0,0 +1,30 @@ +pub use asset_hub_westend_emulated_chain; +pub use frequency_emulated_chain; +pub use westend_emulated_chain; + +use asset_hub_westend_emulated_chain::AssetHubWestend; +use frequency_emulated_chain::FrequencyWestend; +use westend_emulated_chain::Westend; + +// Cumulus +use emulated_integration_tests_common::{ + accounts::{ALICE, BOB}, + xcm_emulator::{decl_test_networks, decl_test_sender_receiver_accounts_parameter_types}, +}; + +decl_test_networks! { + pub struct WestendMockNet { + relay_chain = Westend, + parachains = vec![ + AssetHubWestend, + FrequencyWestend, + ], + bridge = () + }, +} + +decl_test_sender_receiver_accounts_parameter_types! { + WestendRelay { sender: ALICE, receiver: BOB }, + AssetHubWestendPara { sender: ALICE, receiver: BOB }, + FrequencyWestendPara { sender: ALICE, receiver: BOB } +} diff --git a/emulated-test/src/genesis.rs b/emulated-test/src/genesis.rs new file mode 100644 index 0000000000..2ef82ed418 --- /dev/null +++ b/emulated-test/src/genesis.rs @@ -0,0 +1,78 @@ +// Substrate +use sc_consensus_grandpa::AuthorityId as GrandpaId; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_babe::AuthorityId as BabeId; +use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; +use sp_core::storage::Storage; +use sp_runtime::Perbill; + +// Polkadot +use polkadot_primitives::{AssignmentId, ValidatorId}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, get_host_config, validators, +}; +use parachains_common::Balance; +use westend_runtime_constants::currency::UNITS as WND; + +pub const ED: Balance = westend_runtime_constants::currency::EXISTENTIAL_DEPOSIT; +const ENDOWMENT: u128 = 1_000_000 * WND; +const STASH: u128 = 100 * WND; + +fn session_keys( + babe: BabeId, + grandpa: GrandpaId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, +) -> westend_runtime::SessionKeys { + westend_runtime::SessionKeys { + babe, + grandpa, + para_validator, + para_assignment, + authority_discovery, + beefy, + } +} + +pub fn genesis() -> Storage { + let genesis_config = westend_runtime::RuntimeGenesisConfig { + system: westend_runtime::SystemConfig::default(), + balances: westend_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ENDOWMENT)).collect(), + ..Default::default() + }, + session: westend_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + ), + ) + }) + .collect::>(), + ..Default::default() + }, + babe: westend_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: westend_runtime::BABE_GENESIS_EPOCH_CONFIG, + ..Default::default() + }, + configuration: westend_runtime::ConfigurationConfig { config: get_host_config() }, + ..Default::default() + }; + + build_genesis_storage(&genesis_config, westend_runtime::WASM_BINARY.unwrap()) +} diff --git a/emulated-test/src/lib.rs b/emulated-test/src/lib.rs new file mode 100644 index 0000000000..db08b0e6c9 --- /dev/null +++ b/emulated-test/src/lib.rs @@ -0,0 +1,46 @@ +use asset_hub_westend_emulated_chain::AssetHubWestend; +use emulated_integration_tests_common::{ + accounts::{ALICE, BOB}, + xcm_emulator::{decl_test_networks, decl_test_sender_receiver_accounts_parameter_types}, +}; +use westend_emulated_chain::Westend; + +decl_test_networks! { + pub struct WestendMockNet { + relay_chain = Westend, + parachains = vec![ + AssetHubWestend, + ], + bridge = () + }, +} + +// use xcm_emulator::{decl_test_relay_chains}; +// use sp_core::storage::Storage; +// use sp_runtime::{traits::AccountIdConversion, BuildStorage}; +// use emulated_integration_tests_common::{accounts, build_genesis_storage, get_host_config, validators}; + +// pub use westend_runtime; + +// pub mod genesis; + +// decl_test_relay_chains! { +// #[api_version(11)] +// pub struct Westend { +// on_init = (), +// runtime = westend_runtime, +// core = { +// SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, +// }, +// pallets = { +// XcmPallet: westend_runtime::XcmPallet, +// Sudo: westend_runtime::Sudo, +// Balances: westend_runtime::Balances, +// Treasury: westend_runtime::Treasury, +// AssetRate: westend_runtime::AssetRate, +// Hrmp: westend_runtime::Hrmp, +// Identity: westend_runtime::Identity, +// IdentityMigrator: westend_runtime::IdentityMigrator, +// } +// }, +// } diff --git a/emulated-test/test/frequency-westend/Cargo.toml b/emulated-test/test/frequency-westend/Cargo.toml new file mode 100644 index 0000000000..72376e681b --- /dev/null +++ b/emulated-test/test/frequency-westend/Cargo.toml @@ -0,0 +1,23 @@ +[package] +authors = ["Frequency"] +edition = '2021' +homepage = "https://frequency.xyz" +license = "Apache-2.0" +name = "frequency-westend-integration-tests" +publish = false +version = "0.0.0" + +[dependencies] +# codec = { workspace = true } +asset-test-utils = { workspace = true } +emulated-integration-tests-common = { workspace = true } +frame-support = { workspace = true } +pallet-balances = { workspace = true } +pallet-message-queue = { workspace = true } +pallet-xcm = { workspace = true } +parachains-common = { workspace = true, default-features = true } +sp-runtime = { workspace = true } +westend-runtime = { workspace = true } +westend-system-emulated-network = { path = "../../networks/westend"} +xcm-executor = { workspace = true } +staging-xcm = { workspace = true } diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs new file mode 100644 index 0000000000..e76389dc7f --- /dev/null +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -0,0 +1,40 @@ +#[cfg(test)] +mod imports { + // Substrate + pub use frame_support::{assert_ok, sp_runtime::DispatchResult, traits::fungibles::Inspect}; + + // Polkadot + pub use staging_xcm::{latest::WESTEND_GENESIS_HASH, prelude::*}; + + // Cumulus + pub use asset_test_utils::xcm_helpers; + pub use emulated_integration_tests_common::xcm_emulator::{ + assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, + TestContext, TestExt, + }; + pub use parachains_common::Balance; + pub use westend_system_emulated_network::{ + self, + asset_hub_westend_emulated_chain::AssetHubWestendParaPallet as AssetHubWestendPallet, + frequency_emulated_chain::{ + frequency_runtime::{ + self, xcm_config::XcmConfig as FrequencyWestendXcmConfig, + ExistentialDeposit as FrequencyExistentialDeposit, + }, + FrequencyWestendParaPallet as FrequencyWestendPallet, + }, + westend_emulated_chain::{ + genesis::ED as WESTEND_ED, westend_runtime::xcm_config::XcmConfig as WestendXcmConfig, + WestendRelayPallet as WestendPallet, + }, + AssetHubWestendPara as AssetHubWestend, FrequencyWestendPara as FrequencyWestend, + FrequencyWestendParaReceiver as FrequencyWestendReceiver, + FrequencyWestendParaSender as FrequencyWestendSender, WestendRelay as Westend, + WestendRelayReceiver as WestendReceiver, WestendRelaySender as WestendSender, + }; + + pub type SystemParaToRelayTest = Test; +} + +#[cfg(test)] +mod tests; diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs new file mode 100644 index 0000000000..ad106cfb1a --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -0,0 +1 @@ +mod teleport; diff --git a/emulated-test/test/frequency-westend/src/tests/teleport.rs b/emulated-test/test/frequency-westend/src/tests/teleport.rs new file mode 100644 index 0000000000..c76cd4fa73 --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/teleport.rs @@ -0,0 +1,24 @@ +use crate::imports::*; +use emulated_integration_tests_common::{ + test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter, +}; + +#[test] +fn teleport_from_and_to_relay() { + let amount = WESTEND_ED * 100; + let native_asset: Assets = (Here, amount).into(); + + test_relay_is_trusted_teleporter!( + Westend, + WestendXcmConfig, + vec![FrequencyWestend], + (native_asset, amount) + ); + + test_parachain_is_trusted_teleporter_for_relay!( + FrequencyWestend, + FrequencyWestendXcmConfig, + Westend, + amount + ); +} diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index d4bfc7dbe8..c841815838 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -18,13 +18,13 @@ pub fn wasm_binary_unwrap() -> &'static [u8] { } #[cfg(feature = "frequency-bridging")] -mod xcm_config; +pub mod xcm_config; // use pallet_assets::BenchmarkHelper; #[cfg(feature = "frequency-bridging")] use xcm_config::ForeignAssetsAssetId; #[cfg(feature = "frequency-bridging")] -mod xcm_queue; +pub mod xcm_queue; #[cfg(feature = "frequency-bridging")] pub mod xcm_commons; @@ -783,6 +783,10 @@ impl pallet_authorship::Config for Runtime { type EventHandler = (CollatorSelection,); } +parameter_types! { + pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT; +} + impl pallet_balances::Config for Runtime { type MaxLocks = BalancesMaxLocks; /// The type for recording an account's balance. @@ -790,7 +794,7 @@ impl pallet_balances::Config for Runtime { /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; type DustRemoval = (); - type ExistentialDeposit = ConstU128; + type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = weights::pallet_balances::SubstrateWeight; type MaxReserves = BalancesMaxReserves; @@ -1504,7 +1508,7 @@ construct_runtime!( XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 71, #[cfg(feature = "frequency-bridging")] - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin} = 72, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin } = 72, #[cfg(feature = "frequency-bridging")] CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 73, diff --git a/runtime/frequency/src/xcm_config.rs b/runtime/frequency/src/xcm_config.rs index 164be52a10..b35c2e5366 100644 --- a/runtime/frequency/src/xcm_config.rs +++ b/runtime/frequency/src/xcm_config.rs @@ -11,7 +11,9 @@ use staging_xcm_builder::{ TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic, }; -use crate::xcm_commons::{LocationToAccountId, RelayNetwork, XcmOriginToTransactDispatchOrigin}; +pub use crate::xcm_commons::{ + LocationToAccountId, RelayNetwork, XcmOriginToTransactDispatchOrigin, +}; use frame_support::{ pallet_prelude::Get, From af15e6555afa6e47c1269aa3346896d5c3a4f38c Mon Sep 17 00:00:00 2001 From: eNDdy Date: Fri, 2 May 2025 19:03:47 -0600 Subject: [PATCH 02/15] change --- .../test/frequency-westend/src/tests/teleport.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/emulated-test/test/frequency-westend/src/tests/teleport.rs b/emulated-test/test/frequency-westend/src/tests/teleport.rs index c76cd4fa73..ad2b7b457d 100644 --- a/emulated-test/test/frequency-westend/src/tests/teleport.rs +++ b/emulated-test/test/frequency-westend/src/tests/teleport.rs @@ -8,17 +8,10 @@ fn teleport_from_and_to_relay() { let amount = WESTEND_ED * 100; let native_asset: Assets = (Here, amount).into(); - test_relay_is_trusted_teleporter!( - Westend, - WestendXcmConfig, - vec![FrequencyWestend], - (native_asset, amount) - ); - - test_parachain_is_trusted_teleporter_for_relay!( + test_parachain_is_trusted_teleporter!( FrequencyWestend, FrequencyWestendXcmConfig, - Westend, - amount + vec![AssetHubWestend], + (native_asset, amount) ); } From 1abda0ee90e191a0d9031ef071581cc4da9e36d6 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Mon, 5 May 2025 10:36:45 -0600 Subject: [PATCH 03/15] change --- emulated-test/networks/westend/src/lib.rs | 2 +- emulated-test/test/frequency-westend/src/lib.rs | 5 ++++- emulated-test/test/frequency-westend/src/tests/teleport.rs | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/emulated-test/networks/westend/src/lib.rs b/emulated-test/networks/westend/src/lib.rs index 4104b81580..45a83a2fcc 100644 --- a/emulated-test/networks/westend/src/lib.rs +++ b/emulated-test/networks/westend/src/lib.rs @@ -2,7 +2,7 @@ pub use asset_hub_westend_emulated_chain; pub use frequency_emulated_chain; pub use westend_emulated_chain; -use asset_hub_westend_emulated_chain::AssetHubWestend; +pub use asset_hub_westend_emulated_chain::AssetHubWestend; use frequency_emulated_chain::FrequencyWestend; use westend_emulated_chain::Westend; diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index e76389dc7f..f0a99edfb9 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -27,7 +27,10 @@ mod imports { genesis::ED as WESTEND_ED, westend_runtime::xcm_config::XcmConfig as WestendXcmConfig, WestendRelayPallet as WestendPallet, }, - AssetHubWestendPara as AssetHubWestend, FrequencyWestendPara as FrequencyWestend, + AssetHubWestendPara as AssetHubWestend, + AssetHubWestendParaReceiver as AssetHubWestendReceiver, + AssetHubWestendParaSender as AssetHubWestendSender, + FrequencyWestendPara as FrequencyWestend, FrequencyWestendParaReceiver as FrequencyWestendReceiver, FrequencyWestendParaSender as FrequencyWestendSender, WestendRelay as Westend, WestendRelayReceiver as WestendReceiver, WestendRelaySender as WestendSender, diff --git a/emulated-test/test/frequency-westend/src/tests/teleport.rs b/emulated-test/test/frequency-westend/src/tests/teleport.rs index ad2b7b457d..2041a8fd75 100644 --- a/emulated-test/test/frequency-westend/src/tests/teleport.rs +++ b/emulated-test/test/frequency-westend/src/tests/teleport.rs @@ -1,10 +1,10 @@ use crate::imports::*; use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter, + test_parachain_is_trusted_teleporter_for_relay, test_parachain_is_trusted_teleporter, test_relay_is_trusted_teleporter, }; #[test] -fn teleport_from_and_to_relay() { +fn teleport_from_and_to_asset_hub() { let amount = WESTEND_ED * 100; let native_asset: Assets = (Here, amount).into(); From a069633fa121b012688f36600534555c505c1cb8 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Tue, 6 May 2025 13:58:51 -0600 Subject: [PATCH 04/15] change --- Cargo.lock | 22 +- Cargo.toml | 1 - emulated-test/Cargo.toml | 29 -- .../test/frequency-westend/.cargo/config.toml | 2 + .../test/frequency-westend/Cargo.toml | 2 + .../test/frequency-westend/src/lib.rs | 24 +- .../test/frequency-westend/src/tests/mod.rs | 3 +- .../frequency-westend/src/tests/reserve.rs | 261 ++++++++++++++++++ 8 files changed, 284 insertions(+), 60 deletions(-) delete mode 100644 emulated-test/Cargo.toml create mode 100644 emulated-test/test/frequency-westend/.cargo/config.toml create mode 100644 emulated-test/test/frequency-westend/src/tests/reserve.rs diff --git a/Cargo.lock b/Cargo.lock index 8fdeae0170..efabd5dd30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4906,6 +4906,7 @@ dependencies = [ "asset-test-utils", "emulated-integration-tests-common", "frame-support", + "pallet-assets", "pallet-balances", "pallet-message-queue", "pallet-xcm", @@ -12534,27 +12535,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" -[[package]] -name = "runtime-integration-tests" -version = "0.0.0" -dependencies = [ - "asset-hub-westend-emulated-chain", - "emulated-integration-tests-common", - "frequency-runtime", - "parachains-common", - "polkadot-primitives", - "sc-consensus-grandpa", - "sp-authority-discovery", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-core", - "sp-runtime", - "westend-emulated-chain", - "westend-runtime", - "westend-runtime-constants", - "xcm-emulator", -] - [[package]] name = "rustc-demangle" version = "0.1.24" diff --git a/Cargo.toml b/Cargo.toml index 1b63da9a0b..d8b92a289b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ members = [ "node/cli", "emulated-test/networks/westend", "emulated-test/chains/frequency-westend", - "emulated-test*", "emulated-test/test/frequency-westend", "node/service", "pallets/*", diff --git a/emulated-test/Cargo.toml b/emulated-test/Cargo.toml deleted file mode 100644 index d9df772d04..0000000000 --- a/emulated-test/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -authors = ["Frequency"] -edition = '2021' -homepage = "https://frequency.xyz" -license = "Apache-2.0" -name = 'runtime-integration-tests' -publish = false -version = "0.0.0" - -[dependencies] -xcm-emulator = { workspace = true } -westend-runtime = { workspace = true } -westend-runtime-constants = { workspace = true } -sc-consensus-grandpa = { workspace = true } -sp-consensus-babe = { workspace = true } -sp-consensus-beefy = { workspace = true } -sp-authority-discovery = { workspace = true } -sp-core = { workspace = true } -sp-runtime = { workspace = true } -parachains-common = { workspace = true } -polkadot-primitives = { workspace = true } - -emulated-integration-tests-common = { workspace = true } -asset-hub-westend-emulated-chain = { workspace = true } -westend-emulated-chain = { workspace = true } - - -frequency-runtime = { path = "../runtime/frequency", features = ["frequency-westend", "frequency-bridging"] } - diff --git a/emulated-test/test/frequency-westend/.cargo/config.toml b/emulated-test/test/frequency-westend/.cargo/config.toml new file mode 100644 index 0000000000..6cc1b4ec44 --- /dev/null +++ b/emulated-test/test/frequency-westend/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +target-dir = "target/tests" \ No newline at end of file diff --git a/emulated-test/test/frequency-westend/Cargo.toml b/emulated-test/test/frequency-westend/Cargo.toml index 72376e681b..b9f3745068 100644 --- a/emulated-test/test/frequency-westend/Cargo.toml +++ b/emulated-test/test/frequency-westend/Cargo.toml @@ -7,6 +7,7 @@ name = "frequency-westend-integration-tests" publish = false version = "0.0.0" + [dependencies] # codec = { workspace = true } asset-test-utils = { workspace = true } @@ -21,3 +22,4 @@ westend-runtime = { workspace = true } westend-system-emulated-network = { path = "../../networks/westend"} xcm-executor = { workspace = true } staging-xcm = { workspace = true } +pallet-assets = { workspace = true } diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index f0a99edfb9..263655d877 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -1,7 +1,10 @@ #[cfg(test)] mod imports { - // Substrate - pub use frame_support::{assert_ok, sp_runtime::DispatchResult, traits::fungibles::Inspect}; + pub use frame_support::{ + assert_ok, + sp_runtime::DispatchResult, + traits::fungibles::{Create as FungiblesCreate, Inspect}, + }; // Polkadot pub use staging_xcm::{latest::WESTEND_GENESIS_HASH, prelude::*}; @@ -15,7 +18,12 @@ mod imports { pub use parachains_common::Balance; pub use westend_system_emulated_network::{ self, - asset_hub_westend_emulated_chain::AssetHubWestendParaPallet as AssetHubWestendPallet, + asset_hub_westend_emulated_chain::{ + asset_hub_westend_runtime::{ + xcm_config::WestendLocation, ExistentialDeposit as AssetHubExistentialDeposit, + }, + AssetHubWestendParaPallet as AssetHubWestendPallet, + }, frequency_emulated_chain::{ frequency_runtime::{ self, xcm_config::XcmConfig as FrequencyWestendXcmConfig, @@ -27,16 +35,16 @@ mod imports { genesis::ED as WESTEND_ED, westend_runtime::xcm_config::XcmConfig as WestendXcmConfig, WestendRelayPallet as WestendPallet, }, - AssetHubWestendPara as AssetHubWestend, - AssetHubWestendParaReceiver as AssetHubWestendReceiver, - AssetHubWestendParaSender as AssetHubWestendSender, - FrequencyWestendPara as FrequencyWestend, + AssetHubWestendPara as AssetHubWestend, + AssetHubWestendParaReceiver as AssetHubWestendReceiver, + AssetHubWestendParaSender as AssetHubWestendSender, + FrequencyWestendPara as FrequencyWestend, FrequencyWestendParaReceiver as FrequencyWestendReceiver, FrequencyWestendParaSender as FrequencyWestendSender, WestendRelay as Westend, WestendRelayReceiver as WestendReceiver, WestendRelaySender as WestendSender, }; - pub type SystemParaToRelayTest = Test; + pub type AssetHubToFrequencyTest = Test; } #[cfg(test)] diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index ad106cfb1a..033222f746 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -1 +1,2 @@ -mod teleport; +// mod teleport; +mod reserve; diff --git a/emulated-test/test/frequency-westend/src/tests/reserve.rs b/emulated-test/test/frequency-westend/src/tests/reserve.rs new file mode 100644 index 0000000000..8216b044a5 --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/reserve.rs @@ -0,0 +1,261 @@ +use crate::imports::*; + +#[macro_export] +macro_rules! foreign_balance_on { + ( $chain:ident, $id:expr, $who:expr ) => { + emulated_integration_tests_common::impls::paste::paste! { + <$chain>::execute_with(|| { + type ForeignAssets = <$chain as [<$chain Pallet>]>::ForeignAssets; + >::balance($id, $who) + }) + } + }; +} + +fn system_para_to_para_reserve_transfer_assets(t: AssetHubToFrequencyTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +pub fn system_para_to_para_receiver_assertions(t: AssetHubToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + + FrequencyWestend::assert_xcmp_queue_success(None); + for asset in t.args.assets.into_inner().into_iter() { + let expected_id = asset.id.0.try_into().unwrap(); + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { + asset_id: *asset_id == expected_id, + owner: *owner == t.receiver.account_id, + }, + ] + ); + } +} + +pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + AssetHubWestend::assert_xcm_pallet_attempted_complete(None); + + let sov_acc_of_dest = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); + for asset in t.args.assets.into_inner().into_iter() { + let expected_id = asset.id.0.clone().try_into().unwrap(); + let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); + if asset.id == AssetId(Location::new(1, [])) { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of native asset is transferred to Parachain's Sovereign account + RuntimeEvent::Balances( + pallet_balances::Event::Transfer { from, to, amount } + ) => { + from: *from == t.sender.account_id, + to: *to == sov_acc_of_dest, + amount: *amount == asset_amount, + }, + ] + ); + } else if matches!( + asset.id.0.unpack(), + (0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(_)]) + ) { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of trust-backed asset is transferred to Parachain's Sovereign account + RuntimeEvent::Assets( + pallet_assets::Event::Transferred { from, to, amount, .. }, + ) => { + from: *from == t.sender.account_id, + to: *to == sov_acc_of_dest, + amount: *amount == asset_amount, + }, + ] + ); + } else { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of foreign asset is transferred to Parachain's Sovereign account + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Transferred { asset_id, from, to, amount }, + ) => { + asset_id: *asset_id == expected_id, + from: *from == t.sender.account_id, + to: *to == sov_acc_of_dest, + amount: *amount == asset_amount, + }, + ] + ); + } + } + assert_expected_events!( + AssetHubWestend, + vec![ + // Delivery fees are paid + RuntimeEvent::PolkadotXcm(pallet_xcm::Event::FeesPaid { .. }) => {}, + ] + ); + AssetHubWestend::assert_xcm_pallet_sent(); +} + +// ========================================================================= +// ======= Reserve Transfers - Native Asset - AssetHub<>Parachain ========== +// ========================================================================= +/// Reserve Transfers of native asset from Asset Hub to Parachain should work +#[test] +fn reserve_transfer_native_asset_from_asset_hub_to_para() { + // Init values for Asset Hub + let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); + let sender = AssetHubWestendSender::get(); + println!("destination: {:?}", destination); + println!("sender: {:?}", sender); + let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 2000; + let assets: Assets = (Parent, amount_to_send).into(); + println!("asserts {:?}", assets); + + // // Init values for Parachain + let system_para_native_asset_location = WestendLocation::get(); + let receiver = FrequencyWestendReceiver::get(); + println!("receiver------------- {:?}", receiver); + + // // Init Test + let test_args = TestContext { + sender, + receiver: receiver.clone(), + args: TestArgs::new_para( + destination.clone(), + receiver.clone(), + amount_to_send, + assets.clone(), + None, + 0, + ), + }; + let mut test = AssetHubToFrequencyTest::new(test_args); + + // Create dot on frequency + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + >::create( + Parent.into(), + FrequencyWestendSender::get(), + false, + 1u32.into(), + ); + // assert!(>::asset_exists( + // ParentThen([Parachain(1000), Parachain(3), PalletInstance(5)].into()).into())); + assert!(>::asset_exists(Parent.into())); + }); + + // Query initial balances + let sender_balance_before = test.sender.balance; + let receiver_assets_before = + foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); + + println!("sender_balance_before {:?}", sender_balance_before); + // println!("receiver_assets_before {:?}", receiver_assets_before); + // test.set_assertion::(system_para_to_para_sender_assertions); + test.set_assertion::(system_para_to_para_receiver_assertions); + test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); + test.assert(); + + // // Query final balances + let sender_balance_after = test.sender.balance; + println!("sender_balance_after {:?}", sender_balance_after); + let receiver_assets_after = + foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); + + // let taco = FrequencyWestend::execute_with(|| { + // type ForeignAssets = ::ForeignAssets; + // >::balance(system_para_native_asset_location.clone(), &receiver) + // }); + + // println!("taco: {:?}------", taco); + + // Sender's balance is reduced by amount sent plus delivery fees + assert!(sender_balance_after < sender_balance_before - amount_to_send); + // Receiver's assets is increased + // assert!(receiver_assets_after > receiver_assets_before); + // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; + // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but + // should be non-zero + // assert!(receiver_assets_after < receiver_assets_before + amount_to_send); +} + +// Reserve Transfers of native asset from Parachain to Asset Hub should work +// #[test] +// fn reserve_transfer_native_asset_from_para_to_asset_hub() { +// // Init values for Parachain +// let destination = PenpalA::sibling_location_of(AssetHubWestend::para_id()); +// let sender = PenpalASender::get(); +// let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 1000; +// let assets: Assets = (Parent, amount_to_send).into(); +// let system_para_native_asset_location = RelayLocation::get(); +// let asset_owner = PenpalAssetOwner::get(); + +// // fund Parachain's sender account +// PenpalA::mint_foreign_asset( +// ::RuntimeOrigin::signed(asset_owner), +// system_para_native_asset_location.clone(), +// sender.clone(), +// amount_to_send * 2, +// ); + +// // Init values for Asset Hub +// let receiver = AssetHubWestendReceiver::get(); +// let penpal_location_as_seen_by_ahr = AssetHubWestend::sibling_location_of(PenpalA::para_id()); +// let sov_penpal_on_ahr = +// AssetHubWestend::sovereign_account_id_of(penpal_location_as_seen_by_ahr); + +// // fund Parachain's SA on Asset Hub with the native tokens held in reserve +// AssetHubWestend::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]); + +// // Init Test +// let test_args = TestContext { +// sender: sender.clone(), +// receiver: receiver.clone(), +// args: TestArgs::new_para( +// destination.clone(), +// receiver.clone(), +// amount_to_send, +// assets.clone(), +// None, +// 0, +// ), +// }; +// let mut test = ParaToSystemParaTest::new(test_args); + +// // Query initial balances +// let sender_assets_before = +// foreign_balance_on!(PenpalA, system_para_native_asset_location.clone(), &sender); +// let receiver_balance_before = test.receiver.balance; + +// // Set assertions and dispatchables +// test.set_assertion::(para_to_system_para_sender_assertions); +// test.set_assertion::(para_to_system_para_receiver_assertions); +// test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); +// test.assert(); + +// // Query final balances +// let sender_assets_after = +// foreign_balance_on!(PenpalA, system_para_native_asset_location, &sender); +// let receiver_balance_after = test.receiver.balance; + +// // Sender's balance is reduced by amount sent plus delivery fees +// assert!(sender_assets_after < sender_assets_before - amount_to_send); +// // Receiver's balance is increased +// assert!(receiver_balance_after > receiver_balance_before); +// // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; +// // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but +// // should be non-zero +// assert!(receiver_balance_after < receiver_balance_before + amount_to_send); +// } From d7cf44903b1c1667be620a9da278c99171d5411f Mon Sep 17 00:00:00 2001 From: eNDdy Date: Tue, 6 May 2025 16:26:34 -0600 Subject: [PATCH 05/15] change --- .../chains/frequency-westend/src/lib.rs | 3 +- .../test/frequency-westend/src/lib.rs | 3 +- .../test/frequency-westend/src/tests/mod.rs | 12 ++ .../frequency-westend/src/tests/reserve.rs | 134 ++++-------------- 4 files changed, 45 insertions(+), 107 deletions(-) diff --git a/emulated-test/chains/frequency-westend/src/lib.rs b/emulated-test/chains/frequency-westend/src/lib.rs index 30c6b3f4e8..21a32589ca 100644 --- a/emulated-test/chains/frequency-westend/src/lib.rs +++ b/emulated-test/chains/frequency-westend/src/lib.rs @@ -47,6 +47,5 @@ decl_test_parachains! { impl_accounts_helpers_for_parachain!(FrequencyWestend); impl_assert_events_helpers_for_parachain!(FrequencyWestend); -// impl_assets_helpers_for_parachain!(Frequency); -// impl_foreign_assets_helpers_for_parachain!(Frequency, staging_xcm::latest::Location); impl_xcm_helpers_for_parachain!(FrequencyWestend); +// impl_foreign_assets_helpers_for_parachain!(FrequencyWestend, staging_xcm::latest::Location); diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index 263655d877..c415f3d43b 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -3,7 +3,8 @@ mod imports { pub use frame_support::{ assert_ok, sp_runtime::DispatchResult, - traits::fungibles::{Create as FungiblesCreate, Inspect}, + traits::fungibles::{Create as FungiblesCreate, Inspect as FungiblesInspect}, + traits::fungible::Inspect, }; // Polkadot diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index 033222f746..b9fc2f5021 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -1,2 +1,14 @@ // mod teleport; mod reserve; + +#[macro_export] +macro_rules! foreign_balance_on { + ( $chain:ident, $id:expr, $who:expr ) => { + emulated_integration_tests_common::impls::paste::paste! { + <$chain>::execute_with(|| { + type ForeignAssets = <$chain as [<$chain Pallet>]>::ForeignAssets; + >::balance($id, $who) + }) + } + }; +} \ No newline at end of file diff --git a/emulated-test/test/frequency-westend/src/tests/reserve.rs b/emulated-test/test/frequency-westend/src/tests/reserve.rs index 8216b044a5..4ab0c4ab5d 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve.rs @@ -1,17 +1,6 @@ +use crate::foreign_balance_on; use crate::imports::*; -#[macro_export] -macro_rules! foreign_balance_on { - ( $chain:ident, $id:expr, $who:expr ) => { - emulated_integration_tests_common::impls::paste::paste! { - <$chain>::execute_with(|| { - type ForeignAssets = <$chain as [<$chain Pallet>]>::ForeignAssets; - >::balance($id, $who) - }) - } - }; -} - fn system_para_to_para_reserve_transfer_assets(t: AssetHubToFrequencyTest) -> DispatchResult { ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, @@ -108,24 +97,26 @@ pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { } // ========================================================================= -// ======= Reserve Transfers - Native Asset - AssetHub<>Parachain ========== +// ======= Reserve Transfers - WSND Native Asset - AssetHub<>Frequency========== // ========================================================================= -/// Reserve Transfers of native asset from Asset Hub to Parachain should work +/// Reserve Transfers of native asset from Asset Hub to Frequency should work #[test] fn reserve_transfer_native_asset_from_asset_hub_to_para() { - // Init values for Asset Hub let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); let sender = AssetHubWestendSender::get(); - println!("destination: {:?}", destination); - println!("sender: {:?}", sender); let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 2000; let assets: Assets = (Parent, amount_to_send).into(); - println!("asserts {:?}", assets); // // Init values for Parachain let system_para_native_asset_location = WestendLocation::get(); let receiver = FrequencyWestendReceiver::get(); - println!("receiver------------- {:?}", receiver); + println!("receiver {:?}", receiver); + + let receiver_XRQCY_assets_before = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&receiver) + }); + assert_eq!(receiver_XRQCY_assets_before, 4096000000u128); // // Init Test let test_args = TestContext { @@ -151,111 +142,46 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { false, 1u32.into(), ); - // assert!(>::asset_exists( - // ParentThen([Parachain(1000), Parachain(3), PalletInstance(5)].into()).into())); - assert!(>::asset_exists(Parent.into())); + + assert!(>::asset_exists(Parent.into())); }); // Query initial balances let sender_balance_before = test.sender.balance; + let receiver_assets_before = foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); + assert!(receiver_assets_before == 0u128); - println!("sender_balance_before {:?}", sender_balance_before); // println!("receiver_assets_before {:?}", receiver_assets_before); - // test.set_assertion::(system_para_to_para_sender_assertions); + test.set_assertion::(system_para_to_para_sender_assertions); test.set_assertion::(system_para_to_para_receiver_assertions); test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); + let receiver_XRQCY_assets_after = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&receiver) + }); + assert_eq!(receiver_XRQCY_assets_after, 4096000000u128); + // // Query final balances let sender_balance_after = test.sender.balance; - println!("sender_balance_after {:?}", sender_balance_after); + let receiver_assets_after = foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); - // let taco = FrequencyWestend::execute_with(|| { - // type ForeignAssets = ::ForeignAssets; - // >::balance(system_para_native_asset_location.clone(), &receiver) - // }); + assert!( + sender_balance_after < sender_balance_before - amount_to_send, + "Sender's balance was NOT reduced by amount sent plus delivery fees" + ); + + assert!(receiver_assets_after > receiver_assets_before, "Receiver's assets did NOT increased"); - // println!("taco: {:?}------", taco); + println!("amount_to_send amount sent {:?}", amount_to_send); - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_balance_after < sender_balance_before - amount_to_send); - // Receiver's assets is increased - // assert!(receiver_assets_after > receiver_assets_before); // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but // should be non-zero - // assert!(receiver_assets_after < receiver_assets_before + amount_to_send); + assert!(receiver_assets_after < receiver_assets_before + amount_to_send); } - -// Reserve Transfers of native asset from Parachain to Asset Hub should work -// #[test] -// fn reserve_transfer_native_asset_from_para_to_asset_hub() { -// // Init values for Parachain -// let destination = PenpalA::sibling_location_of(AssetHubWestend::para_id()); -// let sender = PenpalASender::get(); -// let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 1000; -// let assets: Assets = (Parent, amount_to_send).into(); -// let system_para_native_asset_location = RelayLocation::get(); -// let asset_owner = PenpalAssetOwner::get(); - -// // fund Parachain's sender account -// PenpalA::mint_foreign_asset( -// ::RuntimeOrigin::signed(asset_owner), -// system_para_native_asset_location.clone(), -// sender.clone(), -// amount_to_send * 2, -// ); - -// // Init values for Asset Hub -// let receiver = AssetHubWestendReceiver::get(); -// let penpal_location_as_seen_by_ahr = AssetHubWestend::sibling_location_of(PenpalA::para_id()); -// let sov_penpal_on_ahr = -// AssetHubWestend::sovereign_account_id_of(penpal_location_as_seen_by_ahr); - -// // fund Parachain's SA on Asset Hub with the native tokens held in reserve -// AssetHubWestend::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]); - -// // Init Test -// let test_args = TestContext { -// sender: sender.clone(), -// receiver: receiver.clone(), -// args: TestArgs::new_para( -// destination.clone(), -// receiver.clone(), -// amount_to_send, -// assets.clone(), -// None, -// 0, -// ), -// }; -// let mut test = ParaToSystemParaTest::new(test_args); - -// // Query initial balances -// let sender_assets_before = -// foreign_balance_on!(PenpalA, system_para_native_asset_location.clone(), &sender); -// let receiver_balance_before = test.receiver.balance; - -// // Set assertions and dispatchables -// test.set_assertion::(para_to_system_para_sender_assertions); -// test.set_assertion::(para_to_system_para_receiver_assertions); -// test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); -// test.assert(); - -// // Query final balances -// let sender_assets_after = -// foreign_balance_on!(PenpalA, system_para_native_asset_location, &sender); -// let receiver_balance_after = test.receiver.balance; - -// // Sender's balance is reduced by amount sent plus delivery fees -// assert!(sender_assets_after < sender_assets_before - amount_to_send); -// // Receiver's balance is increased -// assert!(receiver_balance_after > receiver_balance_before); -// // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; -// // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but -// // should be non-zero -// assert!(receiver_balance_after < receiver_balance_before + amount_to_send); -// } From 0f321e1c13827282865a3df7f67afc074631abb9 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Thu, 8 May 2025 14:14:23 -0600 Subject: [PATCH 06/15] change --- Cargo.lock | 4 + Cargo.toml | 3 + .../chains/frequency-westend/src/genesis.rs | 5 +- .../chains/frequency-westend/src/lib.rs | 16 +- .../test/frequency-westend/Cargo.toml | 10 + .../test/frequency-westend/src/lib.rs | 5 +- .../test/frequency-westend/src/tests/mod.rs | 2 +- .../frequency-westend/src/tests/reserve.rs | 192 +++++++++++++++++- 8 files changed, 211 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efabd5dd30..73de00ed04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4911,9 +4911,13 @@ dependencies = [ "pallet-message-queue", "pallet-xcm", "parachains-common", + "sp-io", "sp-runtime", + "sp-tracing", "staging-xcm", "staging-xcm-executor", + "tracing", + "tracing-subscriber", "westend-runtime", "westend-system-emulated-network", ] diff --git a/Cargo.toml b/Cargo.toml index d8b92a289b..b30a618975 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,6 +136,9 @@ sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", bra sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false } +tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false } +tracing-subscriber = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false } emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } asset-hub-westend-emulated-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503" } diff --git a/emulated-test/chains/frequency-westend/src/genesis.rs b/emulated-test/chains/frequency-westend/src/genesis.rs index bc44c07400..a929fe8cd5 100644 --- a/emulated-test/chains/frequency-westend/src/genesis.rs +++ b/emulated-test/chains/frequency-westend/src/genesis.rs @@ -4,12 +4,11 @@ use sp_keyring::Sr25519Keyring as Keyring; // Cumulus use emulated_integration_tests_common::{ - accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, + accounts, build_genesis_storage, collators, }; use parachains_common::{AccountId, Balance}; // use frequency_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub}; -use frequency_runtime::xcm_config::RelayLocation; -// Penpal + pub const PARA_ID: u32 = 2000; pub const ED: Balance = frequency_runtime::EXISTENTIAL_DEPOSIT; diff --git a/emulated-test/chains/frequency-westend/src/lib.rs b/emulated-test/chains/frequency-westend/src/lib.rs index 21a32589ca..8bfcd58110 100644 --- a/emulated-test/chains/frequency-westend/src/lib.rs +++ b/emulated-test/chains/frequency-westend/src/lib.rs @@ -3,32 +3,18 @@ pub use frequency_runtime::{self, xcm_config::RelayNetwork as FrequencyRelayNetw mod genesis; pub use genesis::{genesis, FrequencySudoAccount, ED, PARA_ID}; -// Substrate use frame_support::traits::OnInitialize; -use sp_core::Encode; -// Cumulus use emulated_integration_tests_common::{ impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, - impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, - impl_xcm_helpers_for_parachain, - impls::{NetworkId, Parachain}, - xcm_emulator::decl_test_parachains, + impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, }; -// Polkadot -use staging_xcm::latest::WESTEND_GENESIS_HASH; - -// Penpal Parachain declaration decl_test_parachains! { pub struct FrequencyWestend { genesis = genesis(PARA_ID), on_init = { frequency_runtime::AuraExt::on_initialize(1); - // frame_support::assert_ok!(frequency_runtime::System::set_storage( - // frequency_runtime::RuntimeOrigin::root(), - // vec![(FrequencyRelayNetworkId::get().unwrap(), NetworkId::ByGenesis(WESTEND_GENESIS_HASH).encode())], - // )); }, runtime = frequency_runtime, core = { diff --git a/emulated-test/test/frequency-westend/Cargo.toml b/emulated-test/test/frequency-westend/Cargo.toml index b9f3745068..8d2fbeb256 100644 --- a/emulated-test/test/frequency-westend/Cargo.toml +++ b/emulated-test/test/frequency-westend/Cargo.toml @@ -23,3 +23,13 @@ westend-system-emulated-network = { path = "../../networks/westend"} xcm-executor = { workspace = true } staging-xcm = { workspace = true } pallet-assets = { workspace = true } +sp-io = { workspace = true } +sp-tracing = { workspace = true } +tracing = { version = "0.1.37" } +tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } + + +[features] +default = ["std"] +with-tracing = ["sp-tracing/with-tracing"] +std = ["sp-tracing/std"] \ No newline at end of file diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index c415f3d43b..74aced259d 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -3,8 +3,10 @@ mod imports { pub use frame_support::{ assert_ok, sp_runtime::DispatchResult, - traits::fungibles::{Create as FungiblesCreate, Inspect as FungiblesInspect}, traits::fungible::Inspect, + traits::fungibles::{ + Create as FungiblesCreate, Inspect as FungiblesInspect, Mutate as FungiblesMutate, + }, }; // Polkadot @@ -46,6 +48,7 @@ mod imports { }; pub type AssetHubToFrequencyTest = Test; + pub type FrequencyToAssetHubTest = Test; } #[cfg(test)] diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index b9fc2f5021..0c0f3f02d7 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -11,4 +11,4 @@ macro_rules! foreign_balance_on { }) } }; -} \ No newline at end of file +} diff --git a/emulated-test/test/frequency-westend/src/tests/reserve.rs b/emulated-test/test/frequency-westend/src/tests/reserve.rs index 4ab0c4ab5d..a960297f18 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve.rs @@ -1,6 +1,96 @@ use crate::foreign_balance_on; use crate::imports::*; +fn para_to_system_para_reserve_transfer_assets(t: FrequencyToAssetHubTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +pub fn para_to_system_para_sender_assertions(t: FrequencyToAssetHubTest) { + type RuntimeEvent = ::RuntimeEvent; + FrequencyWestend::assert_xcm_pallet_attempted_complete(None); + for asset in t.args.assets.into_inner().into_iter() { + let expected_id = asset.id.0; + let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, balance } + ) => { + asset_id: *asset_id == expected_id, + owner: *owner == t.sender.account_id, + balance: *balance == asset_amount, + }, + ] + ); + } +} + +pub fn para_to_system_para_receiver_assertions(t: FrequencyToAssetHubTest) { + type RuntimeEvent = ::RuntimeEvent; + AssetHubWestend::assert_xcmp_queue_success(None); + + let sov_acc_of_frequency = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); + for (idx, asset) in t.args.assets.into_inner().into_iter().enumerate() { + let expected_id = asset.id.0.clone().try_into().unwrap(); + let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); + if idx == t.args.fee_asset_item as usize { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of native is withdrawn from Parachain's Sovereign account + RuntimeEvent::Balances( + pallet_balances::Event::Burned { who, amount } + ) => { + who: *who == sov_acc_of_frequency.clone().into(), + amount: *amount == asset_amount, + }, + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { + who: *who == t.receiver.account_id, + }, + ] + ); + } else { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of foreign asset is transferred from Parachain's Sovereign account + // to Receiver's account + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, balance }, + ) => { + asset_id: *asset_id == expected_id, + owner: *owner == sov_acc_of_frequency, + balance: *balance == asset_amount, + }, + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Issued { asset_id, owner, amount }, + ) => { + asset_id: *asset_id == expected_id, + owner: *owner == t.receiver.account_id, + amount: *amount == asset_amount, + }, + ] + ); + } + } + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); +} + fn system_para_to_para_reserve_transfer_assets(t: AssetHubToFrequencyTest) -> DispatchResult { ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, @@ -102,12 +192,14 @@ pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { /// Reserve Transfers of native asset from Asset Hub to Frequency should work #[test] fn reserve_transfer_native_asset_from_asset_hub_to_para() { + // RUST_LOG="xcm=trace,system::events=trace" cargo test -p frequency-westend-integration-tests -- --nocapture + // sp_tracing::try_init_simple(); let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); let sender = AssetHubWestendSender::get(); let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 2000; let assets: Assets = (Parent, amount_to_send).into(); - // // Init values for Parachain + // Init values for Parachain let system_para_native_asset_location = WestendLocation::get(); let receiver = FrequencyWestendReceiver::get(); println!("receiver {:?}", receiver); @@ -118,7 +210,6 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { }); assert_eq!(receiver_XRQCY_assets_before, 4096000000u128); - // // Init Test let test_args = TestContext { sender, receiver: receiver.clone(), @@ -142,7 +233,6 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { false, 1u32.into(), ); - assert!(>::asset_exists(Parent.into())); }); @@ -165,7 +255,6 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { }); assert_eq!(receiver_XRQCY_assets_after, 4096000000u128); - // // Query final balances let sender_balance_after = test.sender.balance; let receiver_assets_after = @@ -178,10 +267,101 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { assert!(receiver_assets_after > receiver_assets_before, "Receiver's assets did NOT increased"); - println!("amount_to_send amount sent {:?}", amount_to_send); - // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but // should be non-zero assert!(receiver_assets_after < receiver_assets_before + amount_to_send); } + +#[test] +fn reserve_transfer_native_asset_from_para_to_asset_hub() { + sp_tracing::try_init_simple(); + let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); + let sender = FrequencyWestendSender::get(); + let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; + let assets: Assets = (Parent, amount_to_send).into(); + let system_para_native_asset_location = WestendLocation::get(); + + let frequency_sender_native_before = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&FrequencyWestendSender::get()) + }); + + assert_eq!(frequency_sender_native_before, 4096000000u128); + + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + >::create( + Parent.into(), + FrequencyWestendSender::get(), + false, + 1u32.into(), + ); + + >::mint_into( + Parent.into(), + &FrequencyWestendSender::get(), + amount_to_send * 2, + ); + + assert!(>::asset_exists(Parent.into())); + }); + + // Init values for Asset Hub + let receiver = AssetHubWestendReceiver::get(); + let frequency_location_as_seen_by_ahr = + AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); + let sov_frequency_on_ahr = + AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_ahr); + + // fund Parachain's SA on Asset Hub with the native tokens held in reserve + AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); + + // Init Test + let test_args = TestContext { + sender: sender.clone(), + receiver: receiver.clone(), + args: TestArgs::new_para( + destination.clone(), + receiver.clone(), + amount_to_send, + assets.clone(), + None, + 0, + ), + }; + let mut test = FrequencyToAssetHubTest::new(test_args); + + // Query initial balances + let sender_assets_before = + foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &sender); + let receiver_balance_before = test.receiver.balance; + + assert_eq!(sender_assets_before, 2000000000000u128); + + // Set assertions and dispatchables + test.set_assertion::(para_to_system_para_sender_assertions); + // test.set_assertion::(para_to_system_para_receiver_assertions); + test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); + test.assert(); + + // Query final balances + let sender_assets_after = + foreign_balance_on!(FrequencyWestend, system_para_native_asset_location, &sender); + let receiver_balance_after = test.receiver.balance; + + let frequency_sender_native_after = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&FrequencyWestendSender::get()) + }); + + + // // Sender's balance is reduced by amount sent plus delivery fees + assert!(sender_assets_after < sender_assets_before - amount_to_send); + // // Receiver's balance is increased + // assert!(receiver_balance_after > receiver_balance_before); + // // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; + // // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but + // // should be non-zero + // assert!(receiver_balance_after < receiver_balance_before + amount_to_send); +} From f0e1305a762da66b6ebe6395494d7f4786bbd21f Mon Sep 17 00:00:00 2001 From: eNDdy Date: Thu, 8 May 2025 14:17:22 -0600 Subject: [PATCH 07/15] rm excess --- emulated-test/src/genesis.rs | 78 ------------------------------------ emulated-test/src/lib.rs | 46 --------------------- 2 files changed, 124 deletions(-) delete mode 100644 emulated-test/src/genesis.rs delete mode 100644 emulated-test/src/lib.rs diff --git a/emulated-test/src/genesis.rs b/emulated-test/src/genesis.rs deleted file mode 100644 index 2ef82ed418..0000000000 --- a/emulated-test/src/genesis.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Substrate -use sc_consensus_grandpa::AuthorityId as GrandpaId; -use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; -use sp_consensus_babe::AuthorityId as BabeId; -use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; -use sp_core::storage::Storage; -use sp_runtime::Perbill; - -// Polkadot -use polkadot_primitives::{AssignmentId, ValidatorId}; - -// Cumulus -use emulated_integration_tests_common::{ - accounts, build_genesis_storage, get_host_config, validators, -}; -use parachains_common::Balance; -use westend_runtime_constants::currency::UNITS as WND; - -pub const ED: Balance = westend_runtime_constants::currency::EXISTENTIAL_DEPOSIT; -const ENDOWMENT: u128 = 1_000_000 * WND; -const STASH: u128 = 100 * WND; - -fn session_keys( - babe: BabeId, - grandpa: GrandpaId, - para_validator: ValidatorId, - para_assignment: AssignmentId, - authority_discovery: AuthorityDiscoveryId, - beefy: BeefyId, -) -> westend_runtime::SessionKeys { - westend_runtime::SessionKeys { - babe, - grandpa, - para_validator, - para_assignment, - authority_discovery, - beefy, - } -} - -pub fn genesis() -> Storage { - let genesis_config = westend_runtime::RuntimeGenesisConfig { - system: westend_runtime::SystemConfig::default(), - balances: westend_runtime::BalancesConfig { - balances: accounts::init_balances().iter().cloned().map(|k| (k, ENDOWMENT)).collect(), - ..Default::default() - }, - session: westend_runtime::SessionConfig { - keys: validators::initial_authorities() - .iter() - .map(|x| { - ( - x.0.clone(), - x.0.clone(), - session_keys( - x.2.clone(), - x.3.clone(), - x.4.clone(), - x.5.clone(), - x.6.clone(), - x.7.clone(), - ), - ) - }) - .collect::>(), - ..Default::default() - }, - babe: westend_runtime::BabeConfig { - authorities: Default::default(), - epoch_config: westend_runtime::BABE_GENESIS_EPOCH_CONFIG, - ..Default::default() - }, - configuration: westend_runtime::ConfigurationConfig { config: get_host_config() }, - ..Default::default() - }; - - build_genesis_storage(&genesis_config, westend_runtime::WASM_BINARY.unwrap()) -} diff --git a/emulated-test/src/lib.rs b/emulated-test/src/lib.rs deleted file mode 100644 index db08b0e6c9..0000000000 --- a/emulated-test/src/lib.rs +++ /dev/null @@ -1,46 +0,0 @@ -use asset_hub_westend_emulated_chain::AssetHubWestend; -use emulated_integration_tests_common::{ - accounts::{ALICE, BOB}, - xcm_emulator::{decl_test_networks, decl_test_sender_receiver_accounts_parameter_types}, -}; -use westend_emulated_chain::Westend; - -decl_test_networks! { - pub struct WestendMockNet { - relay_chain = Westend, - parachains = vec![ - AssetHubWestend, - ], - bridge = () - }, -} - -// use xcm_emulator::{decl_test_relay_chains}; -// use sp_core::storage::Storage; -// use sp_runtime::{traits::AccountIdConversion, BuildStorage}; -// use emulated_integration_tests_common::{accounts, build_genesis_storage, get_host_config, validators}; - -// pub use westend_runtime; - -// pub mod genesis; - -// decl_test_relay_chains! { -// #[api_version(11)] -// pub struct Westend { -// on_init = (), -// runtime = westend_runtime, -// core = { -// SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, -// }, -// pallets = { -// XcmPallet: westend_runtime::XcmPallet, -// Sudo: westend_runtime::Sudo, -// Balances: westend_runtime::Balances, -// Treasury: westend_runtime::Treasury, -// AssetRate: westend_runtime::AssetRate, -// Hrmp: westend_runtime::Hrmp, -// Identity: westend_runtime::Identity, -// IdentityMigrator: westend_runtime::IdentityMigrator, -// } -// }, -// } From 99a8a10accbf5d5197b20fdc611b82581c226d6d Mon Sep 17 00:00:00 2001 From: eNDdy Date: Thu, 8 May 2025 15:27:48 -0600 Subject: [PATCH 08/15] change --- Cargo.lock | 3 - .../test/frequency-westend/Cargo.toml | 11 +- .../test/frequency-westend/src/tests/mod.rs | 7 ++ .../frequency-westend/src/tests/reserve.rs | 116 ++++++++++-------- 4 files changed, 74 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73de00ed04..f46b6f54c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4913,11 +4913,8 @@ dependencies = [ "parachains-common", "sp-io", "sp-runtime", - "sp-tracing", "staging-xcm", "staging-xcm-executor", - "tracing", - "tracing-subscriber", "westend-runtime", "westend-system-emulated-network", ] diff --git a/emulated-test/test/frequency-westend/Cargo.toml b/emulated-test/test/frequency-westend/Cargo.toml index 8d2fbeb256..ae7aa5c13e 100644 --- a/emulated-test/test/frequency-westend/Cargo.toml +++ b/emulated-test/test/frequency-westend/Cargo.toml @@ -23,13 +23,4 @@ westend-system-emulated-network = { path = "../../networks/westend"} xcm-executor = { workspace = true } staging-xcm = { workspace = true } pallet-assets = { workspace = true } -sp-io = { workspace = true } -sp-tracing = { workspace = true } -tracing = { version = "0.1.37" } -tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } - - -[features] -default = ["std"] -with-tracing = ["sp-tracing/with-tracing"] -std = ["sp-tracing/std"] \ No newline at end of file +sp-io = { workspace = true } \ No newline at end of file diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index 0c0f3f02d7..855b16e024 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -12,3 +12,10 @@ macro_rules! foreign_balance_on { } }; } + +// fn foreign_balance_on_frequency_westend(id: v5::Location, who: &AccountId) -> u128 { +// FrequencyWestend::execute_with(|| { +// type ForeignAssets = ::ForeignAssets; +// >::balance($id, $who) +// }) +// } diff --git a/emulated-test/test/frequency-westend/src/tests/reserve.rs b/emulated-test/test/frequency-westend/src/tests/reserve.rs index a960297f18..a613a81486 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve.rs @@ -1,6 +1,13 @@ use crate::foreign_balance_on; use crate::imports::*; +fn get_native_balance_of_frequency_sender() -> u128 { + FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&FrequencyWestendSender::get()) + }) +} + fn para_to_system_para_reserve_transfer_assets(t: FrequencyToAssetHubTest) -> DispatchResult { ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, @@ -123,12 +130,14 @@ pub fn system_para_to_para_receiver_assertions(t: AssetHubToFrequencyTest) { pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { type RuntimeEvent = ::RuntimeEvent; AssetHubWestend::assert_xcm_pallet_attempted_complete(None); + println!("------------here----------------------------"); let sov_acc_of_dest = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); for asset in t.args.assets.into_inner().into_iter() { let expected_id = asset.id.0.clone().try_into().unwrap(); let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); if asset.id == AssetId(Location::new(1, [])) { + println!("------------here----------------------------"); assert_expected_events!( AssetHubWestend, vec![ @@ -146,6 +155,7 @@ pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { asset.id.0.unpack(), (0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(_)]) ) { + println!("------------here----------------------------"); assert_expected_events!( AssetHubWestend, vec![ @@ -160,6 +170,7 @@ pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { ] ); } else { + println!("------------here----------------------------"); assert_expected_events!( AssetHubWestend, vec![ @@ -186,14 +197,28 @@ pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { AssetHubWestend::assert_xcm_pallet_sent(); } +fn setup_foreign_asset_on_frequency() { + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + >::create( + Parent.into(), + FrequencyWestendSender::get(), + false, + 1u32.into(), + ); + assert!(>::asset_exists(Parent.into())); + }); +} + // ========================================================================= // ======= Reserve Transfers - WSND Native Asset - AssetHub<>Frequency========== // ========================================================================= /// Reserve Transfers of native asset from Asset Hub to Frequency should work +// RUST_LOG="xcm=trace,system::events=trace" cargo test -p frequency-westend-integration-tests -- --nocapture #[test] fn reserve_transfer_native_asset_from_asset_hub_to_para() { - // RUST_LOG="xcm=trace,system::events=trace" cargo test -p frequency-westend-integration-tests -- --nocapture - // sp_tracing::try_init_simple(); + setup_foreign_asset_on_frequency(); + let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); let sender = AssetHubWestendSender::get(); let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 2000; @@ -202,13 +227,12 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { // Init values for Parachain let system_para_native_asset_location = WestendLocation::get(); let receiver = FrequencyWestendReceiver::get(); - println!("receiver {:?}", receiver); - let receiver_XRQCY_assets_before = FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&receiver) - }); - assert_eq!(receiver_XRQCY_assets_before, 4096000000u128); + // let receiver_xrqcy_assets_before = FrequencyWestend::execute_with(|| { + // type Balances = ::Balances; + // >::balance(&receiver) + // }); + // assert_eq!(receiver_xrqcy_assets_before, 4096000000u128); let test_args = TestContext { sender, @@ -224,17 +248,6 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { }; let mut test = AssetHubToFrequencyTest::new(test_args); - // Create dot on frequency - FrequencyWestend::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::create( - Parent.into(), - FrequencyWestendSender::get(), - false, - 1u32.into(), - ); - assert!(>::asset_exists(Parent.into())); - }); // Query initial balances let sender_balance_before = test.sender.balance; @@ -243,17 +256,16 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); assert!(receiver_assets_before == 0u128); - // println!("receiver_assets_before {:?}", receiver_assets_before); test.set_assertion::(system_para_to_para_sender_assertions); - test.set_assertion::(system_para_to_para_receiver_assertions); + // test.set_assertion::(system_para_to_para_receiver_assertions); test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); - let receiver_XRQCY_assets_after = FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&receiver) - }); - assert_eq!(receiver_XRQCY_assets_after, 4096000000u128); + // let receiver_xrqcy_assets_after = FrequencyWestend::execute_with(|| { + // type Balances = ::Balances; + // >::balance(&receiver) + // }); + // assert_eq!(receiver_xrqcy_assets_after, 4096000000u128); let sender_balance_after = test.sender.balance; @@ -273,51 +285,55 @@ fn reserve_transfer_native_asset_from_asset_hub_to_para() { assert!(receiver_assets_after < receiver_assets_before + amount_to_send); } -#[test] -fn reserve_transfer_native_asset_from_para_to_asset_hub() { - sp_tracing::try_init_simple(); - let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); - let sender = FrequencyWestendSender::get(); - let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; - let assets: Assets = (Parent, amount_to_send).into(); - let system_para_native_asset_location = WestendLocation::get(); - - let frequency_sender_native_before = FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&FrequencyWestendSender::get()) - }); - - assert_eq!(frequency_sender_native_before, 4096000000u128); - +fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { + // Create and mint DOT-derived asset on Frequency FrequencyWestend::execute_with(|| { type ForeignAssets = ::ForeignAssets; - >::create( + let sender = FrequencyWestendSender::get(); + + let _ = >::create( Parent.into(), - FrequencyWestendSender::get(), + sender.clone(), false, 1u32.into(), ); - >::mint_into( + let _ = >::mint_into( Parent.into(), - &FrequencyWestendSender::get(), + &sender, amount_to_send * 2, ); assert!(>::asset_exists(Parent.into())); }); - // Init values for Asset Hub - let receiver = AssetHubWestendReceiver::get(); + // Fund Frequency sovereign account on AssetHub let frequency_location_as_seen_by_ahr = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); let sov_frequency_on_ahr = AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_ahr); - // fund Parachain's SA on Asset Hub with the native tokens held in reserve AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); +} + +#[test] +fn reserve_transfer_native_asset_from_para_to_asset_hub() { + let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; + setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send); + + let sender = FrequencyWestendSender::get(); + let receiver = AssetHubWestendReceiver::get(); + let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); + let assets: Assets = (Parent, amount_to_send).into(); + let system_para_native_asset_location = WestendLocation::get(); + + let frequency_sender_native_before = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&FrequencyWestendSender::get()) + }); + + assert_eq!(frequency_sender_native_before, 4096000000u128); - // Init Test let test_args = TestContext { sender: sender.clone(), receiver: receiver.clone(), From a2cd5560ae355e289de7b122edabc61f7fbbea34 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Thu, 8 May 2025 18:28:09 -0600 Subject: [PATCH 09/15] chanage --- .../test/frequency-westend/src/tests/mod.rs | 4 +- .../frequency-westend/src/tests/reserve.rs | 383 ------------------ 2 files changed, 3 insertions(+), 384 deletions(-) delete mode 100644 emulated-test/test/frequency-westend/src/tests/reserve.rs diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index 855b16e024..320c9f5c22 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -1,5 +1,7 @@ // mod teleport; -mod reserve; + +mod reserve_transfer_dot_from_asset_hub_to_frequency; +mod reserve_transfer_dot_from_frequency_to_asset_hub; #[macro_export] macro_rules! foreign_balance_on { diff --git a/emulated-test/test/frequency-westend/src/tests/reserve.rs b/emulated-test/test/frequency-westend/src/tests/reserve.rs deleted file mode 100644 index a613a81486..0000000000 --- a/emulated-test/test/frequency-westend/src/tests/reserve.rs +++ /dev/null @@ -1,383 +0,0 @@ -use crate::foreign_balance_on; -use crate::imports::*; - -fn get_native_balance_of_frequency_sender() -> u128 { - FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&FrequencyWestendSender::get()) - }) -} - -fn para_to_system_para_reserve_transfer_assets(t: FrequencyToAssetHubTest) -> DispatchResult { - ::PolkadotXcm::limited_reserve_transfer_assets( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.beneficiary.into()), - bx!(t.args.assets.into()), - t.args.fee_asset_item, - t.args.weight_limit, - ) -} - -pub fn para_to_system_para_sender_assertions(t: FrequencyToAssetHubTest) { - type RuntimeEvent = ::RuntimeEvent; - FrequencyWestend::assert_xcm_pallet_attempted_complete(None); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0; - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - assert_expected_events!( - FrequencyWestend, - vec![ - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance } - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.sender.account_id, - balance: *balance == asset_amount, - }, - ] - ); - } -} - -pub fn para_to_system_para_receiver_assertions(t: FrequencyToAssetHubTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubWestend::assert_xcmp_queue_success(None); - - let sov_acc_of_frequency = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); - for (idx, asset) in t.args.assets.into_inner().into_iter().enumerate() { - let expected_id = asset.id.0.clone().try_into().unwrap(); - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - if idx == t.args.fee_asset_item as usize { - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of native is withdrawn from Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_acc_of_frequency.clone().into(), - amount: *amount == asset_amount, - }, - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == t.receiver.account_id, - }, - ] - ); - } else { - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of foreign asset is transferred from Parachain's Sovereign account - // to Receiver's account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == sov_acc_of_frequency, - balance: *balance == asset_amount, - }, - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Issued { asset_id, owner, amount }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - amount: *amount == asset_amount, - }, - ] - ); - } - } - assert_expected_events!( - AssetHubWestend, - vec![ - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -fn system_para_to_para_reserve_transfer_assets(t: AssetHubToFrequencyTest) -> DispatchResult { - ::PolkadotXcm::limited_reserve_transfer_assets( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.beneficiary.into()), - bx!(t.args.assets.into()), - t.args.fee_asset_item, - t.args.weight_limit, - ) -} - -pub fn system_para_to_para_receiver_assertions(t: AssetHubToFrequencyTest) { - type RuntimeEvent = ::RuntimeEvent; - - FrequencyWestend::assert_xcmp_queue_success(None); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0.try_into().unwrap(); - assert_expected_events!( - FrequencyWestend, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - }, - ] - ); - } -} - -pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubWestend::assert_xcm_pallet_attempted_complete(None); - println!("------------here----------------------------"); - - let sov_acc_of_dest = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0.clone().try_into().unwrap(); - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - if asset.id == AssetId(Location::new(1, [])) { - println!("------------here----------------------------"); - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of native asset is transferred to Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Transfer { from, to, amount } - ) => { - from: *from == t.sender.account_id, - to: *to == sov_acc_of_dest, - amount: *amount == asset_amount, - }, - ] - ); - } else if matches!( - asset.id.0.unpack(), - (0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(_)]) - ) { - println!("------------here----------------------------"); - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of trust-backed asset is transferred to Parachain's Sovereign account - RuntimeEvent::Assets( - pallet_assets::Event::Transferred { from, to, amount, .. }, - ) => { - from: *from == t.sender.account_id, - to: *to == sov_acc_of_dest, - amount: *amount == asset_amount, - }, - ] - ); - } else { - println!("------------here----------------------------"); - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of foreign asset is transferred to Parachain's Sovereign account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Transferred { asset_id, from, to, amount }, - ) => { - asset_id: *asset_id == expected_id, - from: *from == t.sender.account_id, - to: *to == sov_acc_of_dest, - amount: *amount == asset_amount, - }, - ] - ); - } - } - assert_expected_events!( - AssetHubWestend, - vec![ - // Delivery fees are paid - RuntimeEvent::PolkadotXcm(pallet_xcm::Event::FeesPaid { .. }) => {}, - ] - ); - AssetHubWestend::assert_xcm_pallet_sent(); -} - -fn setup_foreign_asset_on_frequency() { - FrequencyWestend::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::create( - Parent.into(), - FrequencyWestendSender::get(), - false, - 1u32.into(), - ); - assert!(>::asset_exists(Parent.into())); - }); -} - -// ========================================================================= -// ======= Reserve Transfers - WSND Native Asset - AssetHub<>Frequency========== -// ========================================================================= -/// Reserve Transfers of native asset from Asset Hub to Frequency should work -// RUST_LOG="xcm=trace,system::events=trace" cargo test -p frequency-westend-integration-tests -- --nocapture -#[test] -fn reserve_transfer_native_asset_from_asset_hub_to_para() { - setup_foreign_asset_on_frequency(); - - let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); - let sender = AssetHubWestendSender::get(); - let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 2000; - let assets: Assets = (Parent, amount_to_send).into(); - - // Init values for Parachain - let system_para_native_asset_location = WestendLocation::get(); - let receiver = FrequencyWestendReceiver::get(); - - // let receiver_xrqcy_assets_before = FrequencyWestend::execute_with(|| { - // type Balances = ::Balances; - // >::balance(&receiver) - // }); - // assert_eq!(receiver_xrqcy_assets_before, 4096000000u128); - - let test_args = TestContext { - sender, - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - amount_to_send, - assets.clone(), - None, - 0, - ), - }; - let mut test = AssetHubToFrequencyTest::new(test_args); - - - // Query initial balances - let sender_balance_before = test.sender.balance; - - let receiver_assets_before = - foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); - assert!(receiver_assets_before == 0u128); - - test.set_assertion::(system_para_to_para_sender_assertions); - // test.set_assertion::(system_para_to_para_receiver_assertions); - test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); - test.assert(); - - // let receiver_xrqcy_assets_after = FrequencyWestend::execute_with(|| { - // type Balances = ::Balances; - // >::balance(&receiver) - // }); - // assert_eq!(receiver_xrqcy_assets_after, 4096000000u128); - - let sender_balance_after = test.sender.balance; - - let receiver_assets_after = - foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); - - assert!( - sender_balance_after < sender_balance_before - amount_to_send, - "Sender's balance was NOT reduced by amount sent plus delivery fees" - ); - - assert!(receiver_assets_after > receiver_assets_before, "Receiver's assets did NOT increased"); - - // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_assets_after < receiver_assets_before + amount_to_send); -} - -fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { - // Create and mint DOT-derived asset on Frequency - FrequencyWestend::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - let sender = FrequencyWestendSender::get(); - - let _ = >::create( - Parent.into(), - sender.clone(), - false, - 1u32.into(), - ); - - let _ = >::mint_into( - Parent.into(), - &sender, - amount_to_send * 2, - ); - - assert!(>::asset_exists(Parent.into())); - }); - - // Fund Frequency sovereign account on AssetHub - let frequency_location_as_seen_by_ahr = - AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); - let sov_frequency_on_ahr = - AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_ahr); - - AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); -} - -#[test] -fn reserve_transfer_native_asset_from_para_to_asset_hub() { - let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; - setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send); - - let sender = FrequencyWestendSender::get(); - let receiver = AssetHubWestendReceiver::get(); - let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); - let assets: Assets = (Parent, amount_to_send).into(); - let system_para_native_asset_location = WestendLocation::get(); - - let frequency_sender_native_before = FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&FrequencyWestendSender::get()) - }); - - assert_eq!(frequency_sender_native_before, 4096000000u128); - - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - amount_to_send, - assets.clone(), - None, - 0, - ), - }; - let mut test = FrequencyToAssetHubTest::new(test_args); - - // Query initial balances - let sender_assets_before = - foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &sender); - let receiver_balance_before = test.receiver.balance; - - assert_eq!(sender_assets_before, 2000000000000u128); - - // Set assertions and dispatchables - test.set_assertion::(para_to_system_para_sender_assertions); - // test.set_assertion::(para_to_system_para_receiver_assertions); - test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_assets_after = - foreign_balance_on!(FrequencyWestend, system_para_native_asset_location, &sender); - let receiver_balance_after = test.receiver.balance; - - let frequency_sender_native_after = FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&FrequencyWestendSender::get()) - }); - - - // // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_assets_after < sender_assets_before - amount_to_send); - // // Receiver's balance is increased - // assert!(receiver_balance_after > receiver_balance_before); - // // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; - // // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // // should be non-zero - // assert!(receiver_balance_after < receiver_balance_before + amount_to_send); -} From f6be245bed4e1f49be50818500f7fe00d07504e0 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Thu, 8 May 2025 18:28:24 -0600 Subject: [PATCH 10/15] change --- ...ransfer_dot_from_asset_hub_to_frequency.rs | 170 +++++++++++++++ ...ransfer_dot_from_frequency_to_asset_hub.rs | 204 ++++++++++++++++++ 2 files changed, 374 insertions(+) create mode 100644 emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs create mode 100644 emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs new file mode 100644 index 0000000000..da7cfc1888 --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs @@ -0,0 +1,170 @@ +use crate::foreign_balance_on; +use crate::imports::*; + +fn system_para_to_para_reserve_transfer_assets(t: AssetHubToFrequencyTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +pub fn system_para_to_para_receiver_assertions(t: AssetHubToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + + FrequencyWestend::assert_xcmp_queue_success(None); + for asset in t.args.assets.into_inner().into_iter() { + let expected_id = asset.id.0.try_into().unwrap(); + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { + asset_id: *asset_id == expected_id, + owner: *owner == t.receiver.account_id, + }, + ] + ); + } +} + +pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { + use pallet_assets::Event as AssetsEvent; + use pallet_assets::Event as ForeignAssetsEvent; + use pallet_balances::Event as BalancesEvent; + use pallet_xcm::Event as XcmEvent; + use AssetId as AID; + + type RuntimeEvent = ::RuntimeEvent; + + AssetHubWestend::assert_xcm_pallet_attempted_complete(None); + + let sov_acc_of_dest = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); + + for asset in t.args.assets.into_inner() { + let expected_id = asset.id.0.clone().try_into().unwrap(); + let asset_amount = match asset.fun { + Fungible(amount) => amount, + _ => panic!("Non-fungible assets are not supported in this test."), + }; + + match asset.id.0.unpack() { + // Native asset (e.g., DOT) + (1, []) => { + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::Balances(BalancesEvent::Transfer { from, to, amount }) => { + from: *from == t.sender.account_id, + to: *to == sov_acc_of_dest, + amount: *amount == asset_amount, + }, + ] + ); + }, + + // Foreign asset from pallet-foreign-assets + _ => { + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::ForeignAssets(ForeignAssetsEvent::Transferred { asset_id, from, to, amount }) => { + asset_id: *asset_id == expected_id, + from: *from == t.sender.account_id, + to: *to == sov_acc_of_dest, + amount: *amount == asset_amount, + }, + ] + ); + }, + } + } + + // Assert delivery fees were paid + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::PolkadotXcm(XcmEvent::FeesPaid { .. }) => {}, + ] + ); + + AssetHubWestend::assert_xcm_pallet_sent(); +} + +fn setup_foreign_asset_on_frequency() { + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + >::create( + Parent.into(), + FrequencyWestendSender::get(), + false, + 1u32.into(), + ); + assert!(>::asset_exists(Parent.into())); + }); +} + +// ========================================================================= +// ======= Reserve Transfers - WSND Native Asset - AssetHub<>Frequency========== +// ========================================================================= +/// Reserve Transfers of Frequency Native from Asset Hub to Frequency should work +// RUST_BACKTRACE=1 RUST_LOG="runtime::system=trace,xcm=trace" cargo test tests::reserve::reserve_transfer_native_asset_from_asset_hub_to_para -p frequency-westend-integration-tests -- --nocapture +#[test] +fn reserve_transfer_dot_from_asset_hub_to_frequency() { + setup_foreign_asset_on_frequency(); + + let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); + let sender = AssetHubWestendSender::get(); + let amount_to_send: Balance = AssetHubExistentialDeposit::get() * 2000; + let assets: Assets = (Parent, amount_to_send).into(); + + // Init values for Parachain + let system_para_native_asset_location = WestendLocation::get(); + let receiver = FrequencyWestendReceiver::get(); + + let test_args = TestContext { + sender, + receiver: receiver.clone(), + args: TestArgs::new_para( + destination.clone(), + receiver.clone(), + amount_to_send, + assets.clone(), + None, + 0, + ), + }; + let mut test = AssetHubToFrequencyTest::new(test_args); + + // Query initial balances + let sender_balance_before = test.sender.balance; + + let receiver_assets_before = + foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); + + assert!(receiver_assets_before == 0u128); + + test.set_assertion::(system_para_to_para_sender_assertions); + test.set_assertion::(system_para_to_para_receiver_assertions); + test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); + test.assert(); + + let sender_balance_after = test.sender.balance; + + let receiver_assets_after = + foreign_balance_on!(FrequencyWestend, system_para_native_asset_location.clone(), &receiver); + + assert!( + sender_balance_after < sender_balance_before - amount_to_send, + "Sender's balance was NOT reduced by amount sent plus delivery fees" + ); + + assert!(receiver_assets_after > receiver_assets_before, "Receiver's assets did NOT increased"); + + // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; + // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but + // should be non-zero + assert!(receiver_assets_after < receiver_assets_before + amount_to_send); +} diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs new file mode 100644 index 0000000000..664be282e1 --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs @@ -0,0 +1,204 @@ +use crate::foreign_balance_on; +use crate::imports::*; + +fn frequency_to_asset_hub_reserve_transfer_assets(t: FrequencyToAssetHubTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +pub fn frequency_to_asset_hub_sender_assertions(t: FrequencyToAssetHubTest) { + type RuntimeEvent = ::RuntimeEvent; + FrequencyWestend::assert_xcm_pallet_attempted_complete(None); + for asset in t.args.assets.into_inner().into_iter() { + let expected_id = asset.clone().id.0; + let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, balance } + ) => { + asset_id: *asset_id == expected_id, + owner: *owner == t.sender.account_id, + balance: *balance == asset_amount, + }, + ] + ); + } +} + +pub fn frequency_to_asset_hub_receiver_assertions(t: FrequencyToAssetHubTest) { + type RuntimeEvent = ::RuntimeEvent; + AssetHubWestend::assert_xcmp_queue_success(None); + + let sov_acc_of_frequency = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); + for (idx, asset) in t.args.assets.into_inner().into_iter().enumerate() { + let expected_id = asset.id.0.clone().try_into().unwrap(); + let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); + if idx == t.args.fee_asset_item as usize { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of native is withdrawn from Parachain's Sovereign account + RuntimeEvent::Balances( + pallet_balances::Event::Burned { who, amount } + ) => { + who: *who == sov_acc_of_frequency.clone().into(), + amount: *amount == asset_amount, + }, + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { + who: *who == t.receiver.account_id, + }, + ] + ); + } else { + assert_expected_events!( + AssetHubWestend, + vec![ + // Amount of foreign asset is transferred from Parachain's Sovereign account + // to Receiver's account + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, balance }, + ) => { + asset_id: *asset_id == expected_id, + owner: *owner == sov_acc_of_frequency, + balance: *balance == asset_amount, + }, + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Issued { asset_id, owner, amount }, + ) => { + asset_id: *asset_id == expected_id, + owner: *owner == t.receiver.account_id, + amount: *amount == asset_amount, + }, + ] + ); + } + } + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); +} + +fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { + // Create and mint DOT-derived asset on Frequency + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + let sender = FrequencyWestendSender::get(); + + let _ = >::create( + Parent.into(), + sender.clone(), + false, + 1u32.into(), + ); + + let _ = >::mint_into( + Parent.into(), + &sender.clone(), + amount_to_send * 2, + ); + + assert!(>::asset_exists(Parent.into())); + }); + + // Fund Frequency sovereign account on AssetHub + let frequency_location_as_seen_by_ahr = + AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); + let sov_frequency_on_ahr = + AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_ahr); + + AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); +} + +const DOT_DOLLAR: u128 = 1_000_000_000_000; +const DOT_CENT: u128 = DOT_DOLLAR / 100; + +// ========================================================================= +// ======= Reserve Transfers - WSND Native Asset - Frequency<>AssetHub========== +// ========================================================================= +/// Reserve Transfers of Frequency Native from Asset Hub to Frequency should work +// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_frequency_to_asset_hub -p frequency-westend-integration-tests -- --nocapture +#[test] +fn reserve_transfer_dot_from_frequency_to_asset_hub() { + let amount_dot_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; + // assert_eq!(amount_to_send, 10_000 * DOLLAR); + setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_dot_to_send); + + /// 20K dollars + let sender = FrequencyWestendSender::get(); + let receiver = AssetHubWestendReceiver::get(); + let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); + let assets: Assets = (Parent, amount_dot_to_send).into(); + let asset_hub_native_asset_location = WestendLocation::get(); + + let sender_dot_assets_before = foreign_balance_on!(FrequencyWestend, Parent.into(), &sender); + + assert_eq!(sender_dot_assets_before, 2_000_000_000_000u128); + + let frequency_sender_native_before = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&FrequencyWestendSender::get()) + }); + + assert_eq!(frequency_sender_native_before, 4_096_000_000u128); + + let test_args = TestContext { + sender: sender.clone(), + receiver: receiver.clone(), + args: TestArgs::new_para( + destination.clone(), + receiver.clone(), + amount_dot_to_send, + assets.clone(), + None, + 0, + ), + }; + + let mut test = FrequencyToAssetHubTest::new(test_args); + + // Query initial balances + + let receiver_balance_before = test.receiver.balance; + + // Set assertions and dispatchables + test.set_assertion::(frequency_to_asset_hub_sender_assertions); + // test.set_assertion::(frequency_to_asset_hub_receiver_assertions); + test.set_dispatchable::(frequency_to_asset_hub_reserve_transfer_assets); + test.assert(); + + // Query final balances + let sender_dot_assets_after = + foreign_balance_on!(FrequencyWestend, asset_hub_native_asset_location, &sender); + + let receiver_balance_after = test.receiver.balance; + + let frequency_sender_native_after = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&FrequencyWestendSender::get()) + }); + + println!("--------frequency_sender_native_before: {:?}", frequency_sender_native_before); + println!("---------frequency_sender_native_after: {:?}", frequency_sender_native_after); + + // Sender's balance is reduced by amount sent + assert_eq!(sender_dot_assets_after, sender_dot_assets_before - amount_dot_to_send); + // // Receiver's balance is increased + // assert!(receiver_balance_after > receiver_balance_before); + // // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; + // // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but + // // should be non-zero + // assert!(receiver_balance_after < receiver_balance_before + amount_to_send); +} From 64cf58f64bc446531f605153aac345c885c68cca Mon Sep 17 00:00:00 2001 From: eNDdy Date: Mon, 12 May 2025 17:36:33 -0600 Subject: [PATCH 11/15] test --- .../test/frequency-westend/src/lib.rs | 4 +- ...ransfer_dot_from_asset_hub_to_frequency.rs | 2 +- ...ransfer_dot_from_frequency_to_asset_hub.rs | 85 +++++++------------ runtime/frequency/src/lib.rs | 64 +++++++++----- runtime/frequency/src/xcm_commons.rs | 3 +- runtime/frequency/src/xcm_config.rs | 18 ++-- runtime/frequency/src/xcm_queue.rs | 29 ++++++- 7 files changed, 114 insertions(+), 91 deletions(-) diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index 74aced259d..7c5f0c82d3 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -14,9 +14,9 @@ mod imports { // Cumulus pub use asset_test_utils::xcm_helpers; - pub use emulated_integration_tests_common::xcm_emulator::{ + pub use emulated_integration_tests_common::{xcm_emulator::{ assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, + TestContext, TestExt,}, RESERVABLE_ASSET_ID, }; pub use parachains_common::Balance; pub use westend_system_emulated_network::{ diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs index da7cfc1888..e929a3a18c 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs @@ -110,7 +110,7 @@ fn setup_foreign_asset_on_frequency() { // ======= Reserve Transfers - WSND Native Asset - AssetHub<>Frequency========== // ========================================================================= /// Reserve Transfers of Frequency Native from Asset Hub to Frequency should work -// RUST_BACKTRACE=1 RUST_LOG="runtime::system=trace,xcm=trace" cargo test tests::reserve::reserve_transfer_native_asset_from_asset_hub_to_para -p frequency-westend-integration-tests -- --nocapture +//RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_asset_hub_to_frequency -p frequency-westend-integration-tests -- --nocapture #[test] fn reserve_transfer_dot_from_asset_hub_to_frequency() { setup_foreign_asset_on_frequency(); diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs index 664be282e1..f186dac468 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs @@ -33,60 +33,35 @@ pub fn frequency_to_asset_hub_sender_assertions(t: FrequencyToAssetHubTest) { } } -pub fn frequency_to_asset_hub_receiver_assertions(t: FrequencyToAssetHubTest) { +fn frequency_to_asset_hub_receiver_assertions(t: FrequencyToAssetHubTest) { type RuntimeEvent = ::RuntimeEvent; + let sov_frequency_on_ahr = AssetHubWestend::sovereign_account_id_of( + AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()), + ); AssetHubWestend::assert_xcmp_queue_success(None); - - let sov_acc_of_frequency = AssetHubWestend::sovereign_account_id_of(t.args.dest.clone()); - for (idx, asset) in t.args.assets.into_inner().into_iter().enumerate() { - let expected_id = asset.id.0.clone().try_into().unwrap(); - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - if idx == t.args.fee_asset_item as usize { - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of native is withdrawn from Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_acc_of_frequency.clone().into(), - amount: *amount == asset_amount, - }, - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == t.receiver.account_id, - }, - ] - ); - } else { - assert_expected_events!( - AssetHubWestend, - vec![ - // Amount of foreign asset is transferred from Parachain's Sovereign account - // to Receiver's account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == sov_acc_of_frequency, - balance: *balance == asset_amount, - }, - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Issued { asset_id, owner, amount }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - amount: *amount == asset_amount, - }, - ] - ); - } - } assert_expected_events!( AssetHubWestend, vec![ - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, + // Amount to reserve transfer is burned from Parachain's Sovereign account + RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { + asset_id: *asset_id == RESERVABLE_ASSET_ID, + owner: *owner == sov_frequency_on_ahr, + balance: *balance == t.args.amount, + }, + // Fee amount is burned from Parachain's Sovereign account + RuntimeEvent::Balances(pallet_balances::Event::Burned { who, .. }) => { + who: *who == sov_frequency_on_ahr, + }, + // Amount to reserve transfer is issued for beneficiary + RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, owner, amount }) => { + asset_id: *asset_id == RESERVABLE_ASSET_ID, + owner: *owner == t.receiver.account_id, + amount: *amount == t.args.amount, + }, + // Remaining fee amount is minted for for beneficiary + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { + who: *who == t.receiver.account_id, + }, ] ); } @@ -130,6 +105,7 @@ const DOT_CENT: u128 = DOT_DOLLAR / 100; // ========================================================================= /// Reserve Transfers of Frequency Native from Asset Hub to Frequency should work // RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_frequency_to_asset_hub -p frequency-westend-integration-tests -- --nocapture +// transfer_type=DestinationReserve #[test] fn reserve_transfer_dot_from_frequency_to_asset_hub() { let amount_dot_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; @@ -175,7 +151,7 @@ fn reserve_transfer_dot_from_frequency_to_asset_hub() { // Set assertions and dispatchables test.set_assertion::(frequency_to_asset_hub_sender_assertions); - // test.set_assertion::(frequency_to_asset_hub_receiver_assertions); + test.set_assertion::(frequency_to_asset_hub_receiver_assertions); test.set_dispatchable::(frequency_to_asset_hub_reserve_transfer_assets); test.assert(); @@ -190,15 +166,12 @@ fn reserve_transfer_dot_from_frequency_to_asset_hub() { >::balance(&FrequencyWestendSender::get()) }); - println!("--------frequency_sender_native_before: {:?}", frequency_sender_native_before); - println!("---------frequency_sender_native_after: {:?}", frequency_sender_native_after); - // Sender's balance is reduced by amount sent - assert_eq!(sender_dot_assets_after, sender_dot_assets_before - amount_dot_to_send); + assert!(sender_dot_assets_after < sender_dot_assets_before - amount_dot_to_send); // // Receiver's balance is increased - // assert!(receiver_balance_after > receiver_balance_before); + assert!(receiver_balance_after > receiver_balance_before); // // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; // // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but // // should be non-zero - // assert!(receiver_balance_after < receiver_balance_before + amount_to_send); + assert!(receiver_balance_after < receiver_balance_before + amount_dot_to_send); } diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index c841815838..7de4e6f7d7 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -107,7 +107,7 @@ use frame_support::{ EqualPrivilegeOnly, GetStorageVersion, InstanceFilter, LinearStoragePrice, OnRuntimeUpgrade, }, - weights::{ConstantMultiplier, Weight}, + weights::{ConstantMultiplier, Weight, constants::WEIGHT_REF_TIME_PER_SECOND}, Twox128, }; @@ -151,6 +151,22 @@ use sp_runtime::traits::transaction_extension::AsTransactionExtension; mod ethereum; mod genesis; +pub mod polkadot_xcm_fee { + use crate::{Balance, WEIGHT_REF_TIME_PER_SECOND, ExtrinsicBaseWeight}; + pub const MICRO_DOT: Balance = 10_000; + pub const MILLI_DOT: Balance = 1_000 * MICRO_DOT; + + pub fn default_fee_per_second() -> u128 { + let base_weight = Balance::from(ExtrinsicBaseWeight::get().ref_time()); + let base_tx_per_second = (WEIGHT_REF_TIME_PER_SECOND as u128) / base_weight; + base_tx_per_second * base_relay_tx_fee() + } + + pub fn base_relay_tx_fee() -> Balance { + MILLI_DOT + } +} + pub struct SchedulerProvider; impl SchedulerProviderTrait for SchedulerProvider { @@ -216,16 +232,18 @@ impl Contains for BaseCallFilter { #[cfg(not(feature = "frequency"))] { match call { - RuntimeCall::Utility(pallet_utility_call) => - Self::is_utility_call_allowed(pallet_utility_call), + RuntimeCall::Utility(pallet_utility_call) => { + Self::is_utility_call_allowed(pallet_utility_call) + }, _ => true, } } #[cfg(feature = "frequency")] { match call { - RuntimeCall::Utility(pallet_utility_call) => - Self::is_utility_call_allowed(pallet_utility_call), + RuntimeCall::Utility(pallet_utility_call) => { + Self::is_utility_call_allowed(pallet_utility_call) + }, // Create provider and create schema are not allowed in mainnet for now. See propose functions. RuntimeCall::Msa(pallet_msa::Call::create_provider { .. }) => false, RuntimeCall::Schemas(pallet_schemas::Call::create_schema_v3 { .. }) => false, @@ -239,9 +257,11 @@ impl Contains for BaseCallFilter { impl BaseCallFilter { fn is_utility_call_allowed(call: &pallet_utility::Call) -> bool { match call { - pallet_utility::Call::batch { calls, .. } | - pallet_utility::Call::batch_all { calls, .. } | - pallet_utility::Call::force_batch { calls, .. } => calls.iter().any(Self::is_batch_call_allowed), + pallet_utility::Call::batch { calls, .. } + | pallet_utility::Call::batch_all { calls, .. } + | pallet_utility::Call::force_batch { calls, .. } => { + calls.iter().any(Self::is_batch_call_allowed) + }, _ => true, } } @@ -249,16 +269,16 @@ impl BaseCallFilter { fn is_batch_call_allowed(call: &RuntimeCall) -> bool { match call { // Block all nested `batch` calls from utility batch - RuntimeCall::Utility(pallet_utility::Call::batch { .. }) | - RuntimeCall::Utility(pallet_utility::Call::batch_all { .. }) | - RuntimeCall::Utility(pallet_utility::Call::force_batch { .. }) => false, + RuntimeCall::Utility(pallet_utility::Call::batch { .. }) + | RuntimeCall::Utility(pallet_utility::Call::batch_all { .. }) + | RuntimeCall::Utility(pallet_utility::Call::force_batch { .. }) => false, // Block all `FrequencyTxPayment` calls from utility batch RuntimeCall::FrequencyTxPayment(..) => false, // Block `create_provider` and `create_schema` calls from utility batch - RuntimeCall::Msa(pallet_msa::Call::create_provider { .. }) | - RuntimeCall::Schemas(pallet_schemas::Call::create_schema_v3 { .. }) => false, + RuntimeCall::Msa(pallet_msa::Call::create_provider { .. }) + | RuntimeCall::Schemas(pallet_schemas::Call::create_schema_v3 { .. }) => false, // Block `Pays::No` calls from utility batch _ if Self::is_pays_no_call(call) => false, @@ -309,17 +329,17 @@ impl InstanceFilter for ProxyType { ), ProxyType::Governance => matches!( c, - RuntimeCall::Treasury(..) | - RuntimeCall::Democracy(..) | - RuntimeCall::TechnicalCommittee(..) | - RuntimeCall::Council(..) | - RuntimeCall::Utility(..) // Calls inside a batch are also run through filters + RuntimeCall::Treasury(..) + | RuntimeCall::Democracy(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::Council(..) + | RuntimeCall::Utility(..) // Calls inside a batch are also run through filters ), ProxyType::Staking => { matches!( c, - RuntimeCall::Capacity(pallet_capacity::Call::stake { .. }) | - RuntimeCall::CollatorSelection( + RuntimeCall::Capacity(pallet_capacity::Call::stake { .. }) + | RuntimeCall::CollatorSelection( pallet_collator_selection::Call::set_candidacy_bond { .. } ) ) @@ -408,8 +428,8 @@ impl OnRuntimeUpgrade for MigratePalletsCu fn on_runtime_upgrade() -> Weight { use sp_core::Get; - if pallet_collator_selection::Pallet::::on_chain_storage_version() != - pallet_collator_selection::Pallet::::in_code_storage_version() + if pallet_collator_selection::Pallet::::on_chain_storage_version() + != pallet_collator_selection::Pallet::::in_code_storage_version() { pallet_collator_selection::Pallet::::in_code_storage_version() .put::>(); diff --git a/runtime/frequency/src/xcm_commons.rs b/runtime/frequency/src/xcm_commons.rs index 6dfbd33539..891ee4047e 100644 --- a/runtime/frequency/src/xcm_commons.rs +++ b/runtime/frequency/src/xcm_commons.rs @@ -5,10 +5,11 @@ use cumulus_primitives_core::AggregateMessageOrigin; use frame_support::parameter_types; use pallet_xcm::XcmPassthrough; use polkadot_parachain_primitives::primitives::Sibling; -use staging_xcm::latest::{prelude::*, WESTEND_GENESIS_HASH}; +pub use staging_xcm::latest::{prelude::{*, AssetId as AssetLocationId}, WESTEND_GENESIS_HASH}; use staging_xcm_builder::{ AccountId32Aliases, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SovereignSignedViaLocation, + // ParentRelayOrSiblingParachains, }; /// Shared Relay Network diff --git a/runtime/frequency/src/xcm_config.rs b/runtime/frequency/src/xcm_config.rs index b35c2e5366..00fedd3450 100644 --- a/runtime/frequency/src/xcm_config.rs +++ b/runtime/frequency/src/xcm_config.rs @@ -1,19 +1,21 @@ use crate::{ AccountId, AllPalletsWithSystem, Balances, ForeignAssets, ParachainInfo, ParachainSystem, - PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, XcmpQueue, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, XcmpQueue, polkadot_xcm_fee::default_fee_per_second, }; use staging_xcm_builder::{ - AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, DenyRecursively, + AllowExplicitUnpaidExecutionFrom, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, IsConcrete, IsParentsOnly, MatchedConvertedConcreteId, NativeAsset, NoChecking, SignedToAccountId32, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic, + TrailingSetTopicAsId, UsingComponents, FixedRateOfFungible, WithComputedOrigin, WithUniqueTopic, }; pub use crate::xcm_commons::{ LocationToAccountId, RelayNetwork, XcmOriginToTransactDispatchOrigin, }; +use parachains_common::xcm_config::ConcreteAssetFromSystem; +// ParentRelayOrSiblingParachains use frame_support::{ pallet_prelude::Get, @@ -46,7 +48,10 @@ parameter_types! { pub const MaxAssetsIntoHolding: u32 = 64; } + + parameter_types! { + pub RelayPerSecondAndByte: (AssetId, u128,u128) = (Location::new(1,Here).into(), default_fee_per_second(), 1024); pub const RelayLocation: Location = Location::parent(); pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())].into(); pub HereLocation: Location = Location::here(); @@ -120,6 +125,8 @@ pub type Barrier = TrailingSetTopicAsId< AllowTopLevelPaidExecutionFrom, AllowExplicitUnpaidExecutionFrom, // ^^^ Parent and its exec plurality get free execution + // Subscriptions for version tracking are OK. + // AllowSubscriptionsFrom, ), UniversalLocation, ConstU32<8>, @@ -145,7 +152,7 @@ impl xcm_executor::Config for XcmConfig { // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = (NativeAsset, AssetFrom); + type IsReserve = (NativeAsset, ConcreteAssetFromSystem, AssetFrom); // in order to register our asset in asset hub // once the asset is registered we can teleport our native asset to asset hub type IsTeleporter = TrustedTeleporter; @@ -153,7 +160,7 @@ impl xcm_executor::Config for XcmConfig { type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = - UsingComponents>; + (FixedRateOfFungible, UsingComponents>,); type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; @@ -200,6 +207,7 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; // update to only allow to teleport native type XcmTeleportFilter = Everything; + // Lets only allow reserve transfers of DOT type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; diff --git a/runtime/frequency/src/xcm_queue.rs b/runtime/frequency/src/xcm_queue.rs index 5339786f3d..71c5ba9fc3 100644 --- a/runtime/frequency/src/xcm_queue.rs +++ b/runtime/frequency/src/xcm_queue.rs @@ -1,5 +1,5 @@ use crate::{ - AccountId, MessageQueue, ParachainSystem, Runtime, RuntimeBlockWeights, RuntimeEvent, XcmpQueue, + Balance, AccountId, MessageQueue, ParachainSystem, Runtime, RuntimeBlockWeights, RuntimeEvent, XcmpQueue, }; #[cfg(not(feature = "runtime-benchmarks"))] @@ -11,7 +11,7 @@ use frame_support::{ weights::Weight, }; -use crate::xcm_commons::XcmOriginToTransactDispatchOrigin; +use crate::xcm_commons::{XcmOriginToTransactDispatchOrigin, AssetLocationId}; use frame_system::EnsureRoot; @@ -25,11 +25,32 @@ use crate::xcm_config; use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; -pub use sp_runtime::Perbill; +pub use sp_runtime::{Perbill, Saturating}; #[cfg(not(feature = "runtime-benchmarks"))] use xcm_executor; +parameter_types! { + /// The asset ID for the asset that we use to pay for message delivery fees. + pub FeeAssetId: AssetLocationId = AssetLocationId(xcm_config::RelayLocation::get()); + /// The base fee for the message delivery fees (3 CENTS). + pub const BaseDeliveryFee: u128 = (1_000_000_000_000u128 / 100).saturating_mul(3); +} + +pub const MICROUNIT: Balance = 1_000_000; + +parameter_types! { + /// Relay Chain `TransactionByteFee` / 10 + pub const TransactionByteFee: Balance = 10 * MICROUNIT; +} + +pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< + FeeAssetId, + BaseDeliveryFee, + TransactionByteFee, + XcmpQueue, +>; + parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } @@ -46,7 +67,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = (); - type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; } impl pallet_message_queue::Config for Runtime { From 44bdb504c4bc6cb1214b97b7c0e1cb823bb2827b Mon Sep 17 00:00:00 2001 From: eNDdy Date: Tue, 13 May 2025 19:25:50 -0600 Subject: [PATCH 12/15] changes --- .../test/frequency-westend/src/lib.rs | 1 + .../test/frequency-westend/src/tests/mod.rs | 1 + ...ve_transfer_dot_from_relay_to_frequency.rs | 123 ++++++++++++++++++ runtime/frequency/src/xcm_config.rs | 2 + 4 files changed, 127 insertions(+) create mode 100644 emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index 7c5f0c82d3..0a69feedfc 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -49,6 +49,7 @@ mod imports { pub type AssetHubToFrequencyTest = Test; pub type FrequencyToAssetHubTest = Test; + pub type RelayToFrequencyTest = Test; } #[cfg(test)] diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index 320c9f5c22..4dea04d2cc 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -2,6 +2,7 @@ mod reserve_transfer_dot_from_asset_hub_to_frequency; mod reserve_transfer_dot_from_frequency_to_asset_hub; +mod reserve_transfer_dot_from_relay_to_frequency; #[macro_export] macro_rules! foreign_balance_on { diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs new file mode 100644 index 0000000000..ce698b0d0a --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs @@ -0,0 +1,123 @@ +use crate::foreign_balance_on; +use crate::imports::*; +use westend_system_emulated_network::westend_emulated_chain::westend_runtime::Dmp; + +fn relay_to_frequency_receiver_assertions(t: RelayToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { + asset_id: *asset_id == WestendLocation::get(), + owner: *owner == t.receiver.account_id, + }, + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); +} + +fn relay_to_frequency_reserve_transfer_assets(t: RelayToFrequencyTest) -> DispatchResult { + let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else { + unimplemented!("Destination is not a parachain?") + }; + + Dmp::make_parachain_reachable(para_id); + ::XcmPallet::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +fn relay_to_frequency_sender_assertions(t: RelayToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + + Westend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(297_174_000, 6_196))); + + assert_expected_events!( + Westend, + vec![ + // Amount to reserve transfer is transferred to Parachain's Sovereign account + RuntimeEvent::Balances( + pallet_balances::Event::Transfer { from, to, amount } + ) => { + from: *from == t.sender.account_id, + to: *to == Westend::sovereign_account_id_of( + t.args.dest.clone() + ), + amount: *amount == t.args.amount, + }, + ] + ); +} + +fn setup_foreign_asset_on_frequency() { + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + let sender = FrequencyWestendSender::get(); + + let _ = >::create( + Parent.into(), + sender.clone(), + false, + 1u32.into(), + ); + + assert!(>::asset_exists(Parent.into())); + }); +} + + +// ========================================================================= +// ========= Reserve Transfers - DOT Asset - Relay<>Frequency =========== +// ========================================================================= +/// Reserve Transfers of DOT from Relay to Parachain should work +// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_relay_to_frequency -p frequency-westend-integration-tests -- --nocapture +// transfer_type=DestinationReserve +#[test] +fn reserve_transfer_dot_asset_from_relay_to_frequency() { + setup_foreign_asset_on_frequency(); + let destination = Westend::child_location_of(FrequencyWestend::para_id()); + let sender = WestendSender::get(); + let amount_to_send: Balance = WESTEND_ED * 1000; + + let relay_native_asset_location = WestendLocation::get(); + let receiver = FrequencyWestendReceiver::get(); + + let test_args = TestContext { + sender, + receiver: receiver.clone(), + args: TestArgs::new_relay(destination.clone(), receiver.clone(), amount_to_send), + + }; + + let mut test = RelayToFrequencyTest::new(test_args); + + let sender_balance_before = test.sender.balance; + let receiver_assets_before = foreign_balance_on!(FrequencyWestend, relay_native_asset_location.clone(), &receiver); + + test.set_assertion::(relay_to_frequency_sender_assertions); + test.set_assertion::(relay_to_frequency_receiver_assertions); + test.set_dispatchable::(relay_to_frequency_reserve_transfer_assets); + test.assert(); + + let sender_balance_after = test.sender.balance; + let receiver_assets_after = + foreign_balance_on!(FrequencyWestend, relay_native_asset_location, &receiver); + + // Sender's balance is reduced by amount sent plus delivery fees + assert!(sender_balance_after < sender_balance_before - amount_to_send); + // Receiver's asset balance is increased + assert!(receiver_assets_after > receiver_assets_before); + // Receiver's asset balance increased by `amount_to_send - delivery_fees - bought_execution`; + // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but + // should be non-zero + assert!(receiver_assets_after < receiver_assets_before + amount_to_send); + +} diff --git a/runtime/frequency/src/xcm_config.rs b/runtime/frequency/src/xcm_config.rs index 00fedd3450..239ed4c685 100644 --- a/runtime/frequency/src/xcm_config.rs +++ b/runtime/frequency/src/xcm_config.rs @@ -220,7 +220,9 @@ impl pallet_xcm::Config for Runtime { type Currency = Balances; type CurrencyMatcher = (); type TrustedLockers = (); + // I do not thingk we need this type SovereignAccountOf = LocationToAccountId; + /// Not sure what this is for? type MaxLockers = ConstU32<8>; type WeightInfo = pallet_xcm::TestWeightInfo; type AdminOrigin = EnsureRoot; From 2dd6dd26675eebef6e501c0e523a8482b8b79fd2 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Wed, 14 May 2025 09:12:27 -0600 Subject: [PATCH 13/15] change --- .../test/frequency-westend/src/lib.rs | 1 + .../test/frequency-westend/src/tests/mod.rs | 1 + ...ve_transfer_dot_from_frequency_to_relay.rs | 156 ++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index 0a69feedfc..b024cf8192 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -50,6 +50,7 @@ mod imports { pub type AssetHubToFrequencyTest = Test; pub type FrequencyToAssetHubTest = Test; pub type RelayToFrequencyTest = Test; + pub type FrequencyToRelayTest = Test; } #[cfg(test)] diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index 4dea04d2cc..59b2e131b5 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -3,6 +3,7 @@ mod reserve_transfer_dot_from_asset_hub_to_frequency; mod reserve_transfer_dot_from_frequency_to_asset_hub; mod reserve_transfer_dot_from_relay_to_frequency; +mod reserve_transfer_dot_from_frequency_to_relay; #[macro_export] macro_rules! foreign_balance_on { diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs new file mode 100644 index 0000000000..f76bf055f7 --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs @@ -0,0 +1,156 @@ +use crate::foreign_balance_on; +use crate::imports::*; +use westend_system_emulated_network::westend_emulated_chain::westend_runtime::Dmp; + +fn frequency_to_relay_reserve_transfer_assets(t: FrequencyToRelayTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +fn frequency_to_relay_receiver_assertions(t: FrequencyToRelayTest) { + type RuntimeEvent = ::RuntimeEvent; + let sov_penpal_on_relay = + Westend::sovereign_account_id_of(Westend::child_location_of(FrequencyWestend::para_id())); + + Westend::assert_ump_queue_processed( + true, + Some(FrequencyWestend::para_id()), + Some(Weight::from_parts(306305000, 7_186)), + ); + + assert_expected_events!( + Westend, + vec![ + // Amount to reserve transfer is withdrawn from Parachain's Sovereign account + RuntimeEvent::Balances( + pallet_balances::Event::Burned { who, amount } + ) => { + who: *who == sov_penpal_on_relay.clone().into(), + amount: *amount == t.args.amount, + }, + RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); +} + +fn frequency_to_relay_sender_assertions(t: FrequencyToRelayTest) { + type RuntimeEvent = ::RuntimeEvent; + FrequencyWestend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + 864_610_000, + 8_799, + ))); + assert_expected_events!( + FrequencyWestend, + vec![ + // Amount to reserve transfer is transferred to Parachain's Sovereign account + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, balance, .. } + ) => { + asset_id: *asset_id == WestendLocation::get(), + owner: *owner == t.sender.account_id, + balance: *balance == t.args.amount, + }, + ] + ); +} + +fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { + // Create and mint DOT-derived asset on Frequency + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + let sender = FrequencyWestendSender::get(); + + let _ = >::create( + Parent.into(), + sender.clone(), + false, + 1u32.into(), + ); + + let _ = >::mint_into( + Parent.into(), + &sender.clone(), + amount_to_send * 2, + ); + + assert!(>::asset_exists(Parent.into())); + }); + + // Fund Frequency sovereign account on AssetHub + let frequency_location_as_seen_by_ahr = + AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); + let sov_frequency_on_ahr = + AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_ahr); + + AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); +} + +// ========================================================================= +// ========= Reserve Transfers - DOT Asset - Frequency<>Relay =========== +// ========================================================================= +/// Reserve Transfers of DOT from Relay to Parachain should work +// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_relay_to_frequency -p frequency-westend-integration-tests -- --nocapture +#[test] +fn reserve_transfer_dot_from_frequency_to_relay() { + let destination = FrequencyWestend::parent_location(); + let sender = FrequencyWestendSender::get(); + let amount_to_send: Balance = WESTEND_ED * 1000; + let assets: Assets = (Parent, amount_to_send).into(); + // let asset_owner = FrequencyAssetOwner::get(); + let relay_native_asset_location = WestendLocation::get(); + + setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send); + + let receiver = WestendReceiver::get(); + let frequency_location_as_seen_by_relay = + Westend::child_location_of(FrequencyWestend::para_id()); + let sov_frequency_on_relay = + Westend::sovereign_account_id_of(frequency_location_as_seen_by_relay); + + let test_args = TestContext { + sender: sender.clone(), + receiver: receiver.clone(), + args: TestArgs::new_para( + destination.clone(), + receiver, + amount_to_send, + assets.clone(), + None, + 0, + ), + }; + + let mut test = FrequencyToRelayTest::new(test_args); + + let sender_assets_before = + foreign_balance_on!(FrequencyWestend, relay_native_asset_location.clone(), &sender); + let receiver_balance_before = test.receiver.balance; + + test.set_assertion::(frequency_to_relay_sender_assertions); + test.set_assertion::(frequency_to_relay_receiver_assertions); + test.set_dispatchable::(frequency_to_relay_reserve_transfer_assets); + test.assert(); + + let sender_assets_after = + foreign_balance_on!(FrequencyWestend, relay_native_asset_location, &sender); + let receiver_balance_after = test.receiver.balance; + + // Sender's balance is reduced by amount sent plus delivery fees + assert!(sender_assets_after < sender_assets_before - amount_to_send); + + assert!(receiver_balance_after > receiver_balance_before); + + // Receiver's asset balance increased by `amount_to_send - delivery_fees - bought_execution`; + // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but + // should be non-zero + assert!(receiver_balance_after < receiver_balance_before + amount_to_send); +} From cf19ade6fdba524f776c3c1aa4ee1f42b77370fe Mon Sep 17 00:00:00 2001 From: eNDdy Date: Wed, 14 May 2025 13:59:19 -0600 Subject: [PATCH 14/15] vs code stuff --- .vscode/launch.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 86546c6b19..b81bafe817 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -49,6 +49,33 @@ "name": "Attach to Frequency", "program": "${workspaceFolder}/target/debug/frequency", }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'Emulated test'", + "cargo": { + "args": [ + "test", + "--no-run", + "--package=frequency-westend-integration-tests" + ], + // "filter": { + // "name": "frequency-westend-integration-tests", + // "kind": "test" + // } + }, + // "program": "${workspaceFolder}/emulated-test/test/frequency-westend/target/tests/debug/deps/frequency_westend_integration_tests-b4edad4aeb26ecb5", + "args": [ + "--", + "--nocapture" + ], + "env": { + "RUST_BACKTRACE": "1", + "RUST_LOG": "events,runtime::system=trace,xcm=trace" + }, + "cwd": "${workspaceFolder}", + "stopOnEntry": true + }, { "type": "lldb", "request": "launch", From fe662b872ebd8a07b822aa5bf4426bc11a231347 Mon Sep 17 00:00:00 2001 From: eNDdy Date: Wed, 14 May 2025 19:30:53 -0600 Subject: [PATCH 15/15] change --- .vscode/settings.json | 6 +- .../chains/frequency-westend/Cargo.toml | 9 +- .../chains/frequency-westend/src/genesis.rs | 16 +- .../chains/frequency-westend/src/lib.rs | 9 +- emulated-test/networks/westend/Cargo.toml | 4 +- .../test/frequency-westend/.cargo/config.toml | 5 +- .../test/frequency-westend/src/lib.rs | 45 ++- .../test/frequency-westend/src/tests/mod.rs | 19 +- ...=> reserve_transfer_dot_from_asset_hub.rs} | 29 +- ....rs => reserve_transfer_dot_from_relay.rs} | 71 ++-- ...rs => reserve_transfer_dot_to_assethub.rs} | 63 ++-- ...ay.rs => reserve_transfer_dot_to_relay.rs} | 30 +- .../frequency-westend/src/tests/teleport.rs | 17 - ...eleport_xfrqcy_to_assethub_with_dot_fee.rs | 328 ++++++++++++++++++ ...eport_xfrqcy_with_dot_fee_from_assethub.rs | 303 ++++++++++++++++ runtime/frequency/src/lib.rs | 19 +- runtime/frequency/src/xcm/asset_transactor.rs | 58 ++++ runtime/frequency/src/xcm/barrier.rs | 38 ++ .../location_converter.rs} | 27 +- runtime/frequency/src/xcm/mod.rs | 30 ++ runtime/frequency/src/xcm/parameters.rs | 42 +++ .../src/{xcm_queue.rs => xcm/queue.rs} | 48 +-- runtime/frequency/src/xcm/reserve.rs | 22 ++ runtime/frequency/src/xcm/teleporter.rs | 27 ++ runtime/frequency/src/xcm/trader.rs | 12 + runtime/frequency/src/xcm/weigher.rs | 14 + runtime/frequency/src/xcm/xcm_config.rs | 116 +++++++ runtime/frequency/src/xcm_config.rs | 248 ------------- 28 files changed, 1200 insertions(+), 455 deletions(-) rename emulated-test/test/frequency-westend/src/tests/{reserve_transfer_dot_from_asset_hub_to_frequency.rs => reserve_transfer_dot_from_asset_hub.rs} (90%) rename emulated-test/test/frequency-westend/src/tests/{reserve_transfer_dot_from_relay_to_frequency.rs => reserve_transfer_dot_from_relay.rs} (67%) rename emulated-test/test/frequency-westend/src/tests/{reserve_transfer_dot_from_frequency_to_asset_hub.rs => reserve_transfer_dot_to_assethub.rs} (81%) rename emulated-test/test/frequency-westend/src/tests/{reserve_transfer_dot_from_frequency_to_relay.rs => reserve_transfer_dot_to_relay.rs} (87%) delete mode 100644 emulated-test/test/frequency-westend/src/tests/teleport.rs create mode 100644 emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_to_assethub_with_dot_fee.rs create mode 100644 emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_with_dot_fee_from_assethub.rs create mode 100644 runtime/frequency/src/xcm/asset_transactor.rs create mode 100644 runtime/frequency/src/xcm/barrier.rs rename runtime/frequency/src/{xcm_commons.rs => xcm/location_converter.rs} (75%) create mode 100644 runtime/frequency/src/xcm/mod.rs create mode 100644 runtime/frequency/src/xcm/parameters.rs rename runtime/frequency/src/{xcm_queue.rs => xcm/queue.rs} (66%) create mode 100644 runtime/frequency/src/xcm/reserve.rs create mode 100644 runtime/frequency/src/xcm/teleporter.rs create mode 100644 runtime/frequency/src/xcm/trader.rs create mode 100644 runtime/frequency/src/xcm/weigher.rs create mode 100644 runtime/frequency/src/xcm/xcm_config.rs delete mode 100644 runtime/frequency/src/xcm_config.rs diff --git a/.vscode/settings.json b/.vscode/settings.json index d3f00d87e7..ac2cbe6712 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,9 +15,11 @@ ], // Set the features to use for cargo commands "rust-analyzer.cargo.features": [ - "runtime-benchmarks", + // "runtime-benchmarks", "frequency-bridging", - "frequency-lint-check" + "frequency-lint-check", + "frequency", + "frequency-westend" ], "lldb.launch.preRunCommands": [ "script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))" diff --git a/emulated-test/chains/frequency-westend/Cargo.toml b/emulated-test/chains/frequency-westend/Cargo.toml index 26b640d5ed..a0f93cda47 100644 --- a/emulated-test/chains/frequency-westend/Cargo.toml +++ b/emulated-test/chains/frequency-westend/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Frequency"] -edition = '2021' +edition = '2021' homepage = "https://frequency.xyz" license = "Apache-2.0" name = 'frequency-emulated-chain' @@ -15,9 +15,12 @@ parachains-common = { workspace = true } polkadot-primitives = { workspace = true } emulated-integration-tests-common = { workspace = true } -frequency-runtime = { path = "../../../runtime/frequency", features = ["frequency-westend", "frequency-bridging"] } +frequency-runtime = { path = "../../../runtime/frequency", features = [ + "frequency-westend", + "frequency-bridging", + "frequency-local", +] } cumulus-primitives-core = { workspace = true } sp-keyring = { workspace = true } frame-support = { workspace = true } staging-xcm = { workspace = true } - diff --git a/emulated-test/chains/frequency-westend/src/genesis.rs b/emulated-test/chains/frequency-westend/src/genesis.rs index a929fe8cd5..9edcd19b5b 100644 --- a/emulated-test/chains/frequency-westend/src/genesis.rs +++ b/emulated-test/chains/frequency-westend/src/genesis.rs @@ -3,11 +3,8 @@ use sp_core::storage::Storage; use sp_keyring::Sr25519Keyring as Keyring; // Cumulus -use emulated_integration_tests_common::{ - accounts, build_genesis_storage, collators, -}; +use emulated_integration_tests_common::{accounts, build_genesis_storage, collators}; use parachains_common::{AccountId, Balance}; -// use frequency_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub}; pub const PARA_ID: u32 = 2000; pub const ED: Balance = frequency_runtime::EXISTENTIAL_DEPOSIT; @@ -46,18 +43,7 @@ pub fn genesis(para_id: u32) -> Storage { .collect(), ..Default::default() }, - // polkadot_xcm: frequency_runtime::PolkadotXcmConfig { - // safe_xcm_version: Some(SAFE_XCM_VERSION), - // ..Default::default() - // }, sudo: frequency_runtime::SudoConfig { key: Some(FrequencySudoAccount::get()) }, - // foreign_assets: frequency_runtime::ForeignAssetsConfig { - // assets: vec![ - // // Relay Native asset representation - // (RelayLocation::get(), FrequencyAssetOwner::get(), true, ED), - // ], - // ..Default::default() - // }, ..Default::default() }; diff --git a/emulated-test/chains/frequency-westend/src/lib.rs b/emulated-test/chains/frequency-westend/src/lib.rs index 8bfcd58110..13f44606b7 100644 --- a/emulated-test/chains/frequency-westend/src/lib.rs +++ b/emulated-test/chains/frequency-westend/src/lib.rs @@ -1,7 +1,7 @@ -pub use frequency_runtime::{self, xcm_config::RelayNetwork as FrequencyRelayNetworkId}; +pub use frequency_runtime::{self, xcm::RelayNetwork as FrequencyRelayNetworkId}; mod genesis; -pub use genesis::{genesis, FrequencySudoAccount, ED, PARA_ID}; +pub use genesis::{genesis, FrequencyAssetOwner, FrequencySudoAccount, ED, PARA_ID}; use frame_support::traits::OnInitialize; @@ -19,7 +19,7 @@ decl_test_parachains! { runtime = frequency_runtime, core = { XcmpMessageHandler: frequency_runtime::XcmpQueue, - LocationToAccountId: frequency_runtime::xcm_config::LocationToAccountId, + LocationToAccountId: frequency_runtime::xcm::LocationToAccountId, ParachainInfo: frequency_runtime::ParachainInfo, MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, }, @@ -32,6 +32,5 @@ decl_test_parachains! { } impl_accounts_helpers_for_parachain!(FrequencyWestend); -impl_assert_events_helpers_for_parachain!(FrequencyWestend); impl_xcm_helpers_for_parachain!(FrequencyWestend); -// impl_foreign_assets_helpers_for_parachain!(FrequencyWestend, staging_xcm::latest::Location); +impl_assert_events_helpers_for_parachain!(FrequencyWestend); diff --git a/emulated-test/networks/westend/Cargo.toml b/emulated-test/networks/westend/Cargo.toml index 0007f704e0..760173c0b7 100644 --- a/emulated-test/networks/westend/Cargo.toml +++ b/emulated-test/networks/westend/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Frequency"] -edition = '2021' +edition = '2021' homepage = "https://frequency.xyz" license = "Apache-2.0" name = 'westend-system-emulated-network' @@ -10,5 +10,5 @@ version = "0.0.0" [dependencies] asset-hub-westend-emulated-chain = { workspace = true } emulated-integration-tests-common = { workspace = true } -frequency-emulated-chain = { path = "../../chains/frequency-westend"} +frequency-emulated-chain = { path = "../../chains/frequency-westend" } westend-emulated-chain = { workspace = true } diff --git a/emulated-test/test/frequency-westend/.cargo/config.toml b/emulated-test/test/frequency-westend/.cargo/config.toml index 6cc1b4ec44..439b9586f2 100644 --- a/emulated-test/test/frequency-westend/.cargo/config.toml +++ b/emulated-test/test/frequency-westend/.cargo/config.toml @@ -1,2 +1,5 @@ [build] -target-dir = "target/tests" \ No newline at end of file +target-dir = "target/tests" + +[profile.dev] +debug = true diff --git a/emulated-test/test/frequency-westend/src/lib.rs b/emulated-test/test/frequency-westend/src/lib.rs index b024cf8192..d299bb3a91 100644 --- a/emulated-test/test/frequency-westend/src/lib.rs +++ b/emulated-test/test/frequency-westend/src/lib.rs @@ -7,16 +7,23 @@ mod imports { traits::fungibles::{ Create as FungiblesCreate, Inspect as FungiblesInspect, Mutate as FungiblesMutate, }, + BoundedVec, }; // Polkadot - pub use staging_xcm::{latest::WESTEND_GENESIS_HASH, prelude::*}; + pub use staging_xcm::{ + latest::{AssetTransferFilter, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH}, + prelude::{AccountId32 as AccountId32Junction, *}, + }; // Cumulus - pub use asset_test_utils::xcm_helpers; - pub use emulated_integration_tests_common::{xcm_emulator::{ - assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt,}, RESERVABLE_ASSET_ID, + pub use emulated_integration_tests_common::{ + xcm_emulator::{ + assert_expected_events, bx, AccountIdOf, Chain, Parachain as Para, RelayChain as Relay, + Test, TestArgs, TestContext, TestExt, + }, + xcm_helpers::{fee_asset, non_fee_asset}, + RESERVABLE_ASSET_ID, }; pub use parachains_common::Balance; pub use westend_system_emulated_network::{ @@ -28,16 +35,10 @@ mod imports { AssetHubWestendParaPallet as AssetHubWestendPallet, }, frequency_emulated_chain::{ - frequency_runtime::{ - self, xcm_config::XcmConfig as FrequencyWestendXcmConfig, - ExistentialDeposit as FrequencyExistentialDeposit, - }, - FrequencyWestendParaPallet as FrequencyWestendPallet, - }, - westend_emulated_chain::{ - genesis::ED as WESTEND_ED, westend_runtime::xcm_config::XcmConfig as WestendXcmConfig, - WestendRelayPallet as WestendPallet, + frequency_runtime::ExistentialDeposit as FrequencyExistentialDeposit, + FrequencyAssetOwner, FrequencyWestendParaPallet as FrequencyWestendPallet, }, + westend_emulated_chain::{genesis::ED as WESTEND_ED, WestendRelayPallet as WestendPallet}, AssetHubWestendPara as AssetHubWestend, AssetHubWestendParaReceiver as AssetHubWestendReceiver, AssetHubWestendParaSender as AssetHubWestendSender, @@ -51,6 +52,22 @@ mod imports { pub type FrequencyToAssetHubTest = Test; pub type RelayToFrequencyTest = Test; pub type FrequencyToRelayTest = Test; + + pub fn frequency_balance_of( + who: &AccountIdOf<::Runtime>, + ) -> Balance { + FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(who) + }) + } + + pub fn assethub_balance_of(who: &AccountIdOf<::Runtime>) -> Balance { + AssetHubWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(who) + }) + } } #[cfg(test)] diff --git a/emulated-test/test/frequency-westend/src/tests/mod.rs b/emulated-test/test/frequency-westend/src/tests/mod.rs index 59b2e131b5..577e04dbc3 100644 --- a/emulated-test/test/frequency-westend/src/tests/mod.rs +++ b/emulated-test/test/frequency-westend/src/tests/mod.rs @@ -1,9 +1,13 @@ // mod teleport; -mod reserve_transfer_dot_from_asset_hub_to_frequency; -mod reserve_transfer_dot_from_frequency_to_asset_hub; -mod reserve_transfer_dot_from_relay_to_frequency; -mod reserve_transfer_dot_from_frequency_to_relay; +mod reserve_transfer_dot_from_asset_hub; +mod reserve_transfer_dot_from_relay; +mod reserve_transfer_dot_to_assethub; +mod reserve_transfer_dot_to_relay; + +mod teleport_xfrqcy_to_assethub_with_dot_fee; + +mod teleport_xfrqcy_with_dot_fee_from_assethub; #[macro_export] macro_rules! foreign_balance_on { @@ -16,10 +20,3 @@ macro_rules! foreign_balance_on { } }; } - -// fn foreign_balance_on_frequency_westend(id: v5::Location, who: &AccountId) -> u128 { -// FrequencyWestend::execute_with(|| { -// type ForeignAssets = ::ForeignAssets; -// >::balance($id, $who) -// }) -// } diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub.rs similarity index 90% rename from emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs rename to emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub.rs index e929a3a18c..b9145c2fd7 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub_to_frequency.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_asset_hub.rs @@ -31,11 +31,9 @@ pub fn system_para_to_para_receiver_assertions(t: AssetHubToFrequencyTest) { } pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { - use pallet_assets::Event as AssetsEvent; use pallet_assets::Event as ForeignAssetsEvent; use pallet_balances::Event as BalancesEvent; use pallet_xcm::Event as XcmEvent; - use AssetId as AID; type RuntimeEvent = ::RuntimeEvent; @@ -93,15 +91,32 @@ pub fn system_para_to_para_sender_assertions(t: AssetHubToFrequencyTest) { AssetHubWestend::assert_xcm_pallet_sent(); } -fn setup_foreign_asset_on_frequency() { + +fn create_dot_asset_on_frequency() { FrequencyWestend::execute_with(|| { type ForeignAssets = ::ForeignAssets; - >::create( + type RuntimeEvent = ::RuntimeEvent; + let sudo_origin = ::RuntimeOrigin::root(); + + let _ = ForeignAssets::force_create( + sudo_origin, Parent.into(), - FrequencyWestendSender::get(), + FrequencyAssetOwner::get().into(), false, - 1u32.into(), + 1u128.into(), + ); + + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::ForceCreated { asset_id, .. } + ) => { + asset_id: *asset_id == Parent.into(), + }, + ] ); + assert!(>::asset_exists(Parent.into())); }); } @@ -113,7 +128,7 @@ fn setup_foreign_asset_on_frequency() { //RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_asset_hub_to_frequency -p frequency-westend-integration-tests -- --nocapture #[test] fn reserve_transfer_dot_from_asset_hub_to_frequency() { - setup_foreign_asset_on_frequency(); + create_dot_asset_on_frequency(); let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); let sender = AssetHubWestendSender::get(); diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay.rs similarity index 67% rename from emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs rename to emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay.rs index ce698b0d0a..df7434a691 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay_to_frequency.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_relay.rs @@ -57,23 +57,35 @@ fn relay_to_frequency_sender_assertions(t: RelayToFrequencyTest) { ); } -fn setup_foreign_asset_on_frequency() { +fn create_dot_asset_on_frequency() { FrequencyWestend::execute_with(|| { type ForeignAssets = ::ForeignAssets; - let sender = FrequencyWestendSender::get(); + type RuntimeEvent = ::RuntimeEvent; + let sudo_origin = ::RuntimeOrigin::root(); - let _ = >::create( + let _ = ForeignAssets::force_create( + sudo_origin, Parent.into(), - sender.clone(), + FrequencyAssetOwner::get().into(), false, - 1u32.into(), + 1u128.into(), + ); + + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::ForceCreated { asset_id, .. } + ) => { + asset_id: *asset_id == Parent.into(), + }, + ] ); assert!(>::asset_exists(Parent.into())); }); } - // ========================================================================= // ========= Reserve Transfers - DOT Asset - Relay<>Frequency =========== // ========================================================================= @@ -81,33 +93,33 @@ fn setup_foreign_asset_on_frequency() { // RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_relay_to_frequency -p frequency-westend-integration-tests -- --nocapture // transfer_type=DestinationReserve #[test] -fn reserve_transfer_dot_asset_from_relay_to_frequency() { - setup_foreign_asset_on_frequency(); - let destination = Westend::child_location_of(FrequencyWestend::para_id()); - let sender = WestendSender::get(); - let amount_to_send: Balance = WESTEND_ED * 1000; - - let relay_native_asset_location = WestendLocation::get(); - let receiver = FrequencyWestendReceiver::get(); - - let test_args = TestContext { - sender, - receiver: receiver.clone(), - args: TestArgs::new_relay(destination.clone(), receiver.clone(), amount_to_send), - - }; +fn reserve_transfer_dot_from_relay_to_frequency() { + create_dot_asset_on_frequency(); + let destination = Westend::child_location_of(FrequencyWestend::para_id()); + let sender = WestendSender::get(); + let amount_to_send: Balance = WESTEND_ED * 1000; + + let relay_native_asset_location = WestendLocation::get(); + let receiver = FrequencyWestendReceiver::get(); + + let test_args = TestContext { + sender, + receiver: receiver.clone(), + args: TestArgs::new_relay(destination.clone(), receiver.clone(), amount_to_send), + }; - let mut test = RelayToFrequencyTest::new(test_args); + let mut test = RelayToFrequencyTest::new(test_args); - let sender_balance_before = test.sender.balance; - let receiver_assets_before = foreign_balance_on!(FrequencyWestend, relay_native_asset_location.clone(), &receiver); + let sender_balance_before = test.sender.balance; + let receiver_assets_before = + foreign_balance_on!(FrequencyWestend, relay_native_asset_location.clone(), &receiver); - test.set_assertion::(relay_to_frequency_sender_assertions); - test.set_assertion::(relay_to_frequency_receiver_assertions); - test.set_dispatchable::(relay_to_frequency_reserve_transfer_assets); - test.assert(); + test.set_assertion::(relay_to_frequency_sender_assertions); + test.set_assertion::(relay_to_frequency_receiver_assertions); + test.set_dispatchable::(relay_to_frequency_reserve_transfer_assets); + test.assert(); - let sender_balance_after = test.sender.balance; + let sender_balance_after = test.sender.balance; let receiver_assets_after = foreign_balance_on!(FrequencyWestend, relay_native_asset_location, &receiver); @@ -119,5 +131,4 @@ fn reserve_transfer_dot_asset_from_relay_to_frequency() { // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but // should be non-zero assert!(receiver_assets_after < receiver_assets_before + amount_to_send); - } diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_to_assethub.rs similarity index 81% rename from emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs rename to emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_to_assethub.rs index f186dac468..3f84244498 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_asset_hub.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_to_assethub.rs @@ -1,7 +1,7 @@ use crate::foreign_balance_on; use crate::imports::*; -fn frequency_to_asset_hub_reserve_transfer_assets(t: FrequencyToAssetHubTest) -> DispatchResult { +fn dispatch_reserve_transfer_dot(t: FrequencyToAssetHubTest) -> DispatchResult { ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, bx!(t.args.dest.into()), @@ -12,7 +12,7 @@ fn frequency_to_asset_hub_reserve_transfer_assets(t: FrequencyToAssetHubTest) -> ) } -pub fn frequency_to_asset_hub_sender_assertions(t: FrequencyToAssetHubTest) { +pub fn assert_sender_burns_dot_correctly(t: FrequencyToAssetHubTest) { type RuntimeEvent = ::RuntimeEvent; FrequencyWestend::assert_xcm_pallet_attempted_complete(None); for asset in t.args.assets.into_inner().into_iter() { @@ -33,7 +33,7 @@ pub fn frequency_to_asset_hub_sender_assertions(t: FrequencyToAssetHubTest) { } } -fn frequency_to_asset_hub_receiver_assertions(t: FrequencyToAssetHubTest) { +fn assert_receiver_receives_dot_correctly(t: FrequencyToAssetHubTest) { type RuntimeEvent = ::RuntimeEvent; let sov_frequency_on_ahr = AssetHubWestend::sovereign_account_id_of( AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()), @@ -66,6 +66,21 @@ fn frequency_to_asset_hub_receiver_assertions(t: FrequencyToAssetHubTest) { ); } +fn build_reserve_transfer_test( + sender: AccountIdOf<::Runtime>, + receiver: AccountIdOf<::Runtime>, + destination: Location, + amount: Balance, + assets: Assets, +) -> FrequencyToAssetHubTest { + let test_args = TestContext { + sender: sender.clone(), + receiver: receiver.clone(), + args: TestArgs::new_para(destination, receiver.clone(), amount, assets, None, 0), + }; + FrequencyToAssetHubTest::new(test_args) +} + fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { // Create and mint DOT-derived asset on Frequency FrequencyWestend::execute_with(|| { @@ -97,22 +112,16 @@ fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); } -const DOT_DOLLAR: u128 = 1_000_000_000_000; -const DOT_CENT: u128 = DOT_DOLLAR / 100; - // ========================================================================= // ======= Reserve Transfers - WSND Native Asset - Frequency<>AssetHub========== // ========================================================================= /// Reserve Transfers of Frequency Native from Asset Hub to Frequency should work // RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_frequency_to_asset_hub -p frequency-westend-integration-tests -- --nocapture -// transfer_type=DestinationReserve #[test] -fn reserve_transfer_dot_from_frequency_to_asset_hub() { +fn reserve_transfer_dot_from_frequency_to_assethub() { let amount_dot_to_send: Balance = AssetHubExistentialDeposit::get() * 1000; - // assert_eq!(amount_to_send, 10_000 * DOLLAR); setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_dot_to_send); - /// 20K dollars let sender = FrequencyWestendSender::get(); let receiver = AssetHubWestendReceiver::get(); let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); @@ -130,29 +139,22 @@ fn reserve_transfer_dot_from_frequency_to_asset_hub() { assert_eq!(frequency_sender_native_before, 4_096_000_000u128); - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - amount_dot_to_send, - assets.clone(), - None, - 0, - ), - }; - - let mut test = FrequencyToAssetHubTest::new(test_args); + let mut test = build_reserve_transfer_test( + sender.clone(), + receiver.clone(), + destination.clone(), + amount_dot_to_send, + assets.clone(), + ); // Query initial balances let receiver_balance_before = test.receiver.balance; // Set assertions and dispatchables - test.set_assertion::(frequency_to_asset_hub_sender_assertions); - test.set_assertion::(frequency_to_asset_hub_receiver_assertions); - test.set_dispatchable::(frequency_to_asset_hub_reserve_transfer_assets); + test.set_assertion::(assert_sender_burns_dot_correctly); + test.set_assertion::(assert_receiver_receives_dot_correctly); + test.set_dispatchable::(dispatch_reserve_transfer_dot); test.assert(); // Query final balances @@ -161,12 +163,7 @@ fn reserve_transfer_dot_from_frequency_to_asset_hub() { let receiver_balance_after = test.receiver.balance; - let frequency_sender_native_after = FrequencyWestend::execute_with(|| { - type Balances = ::Balances; - >::balance(&FrequencyWestendSender::get()) - }); - - // Sender's balance is reduced by amount sent + // Sender's balance is reduced by amount sent assert!(sender_dot_assets_after < sender_dot_assets_before - amount_dot_to_send); // // Receiver's balance is increased assert!(receiver_balance_after > receiver_balance_before); diff --git a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_to_relay.rs similarity index 87% rename from emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs rename to emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_to_relay.rs index f76bf055f7..ec1dbcee51 100644 --- a/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_from_frequency_to_relay.rs +++ b/emulated-test/test/frequency-westend/src/tests/reserve_transfer_dot_to_relay.rs @@ -1,6 +1,5 @@ use crate::foreign_balance_on; use crate::imports::*; -use westend_system_emulated_network::westend_emulated_chain::westend_runtime::Dmp; fn frequency_to_relay_reserve_transfer_assets(t: FrequencyToRelayTest) -> DispatchResult { ::PolkadotXcm::limited_reserve_transfer_assets( @@ -44,10 +43,10 @@ fn frequency_to_relay_receiver_assertions(t: FrequencyToRelayTest) { fn frequency_to_relay_sender_assertions(t: FrequencyToRelayTest) { type RuntimeEvent = ::RuntimeEvent; - FrequencyWestend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 864_610_000, - 8_799, - ))); + // FrequencyWestend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + // 864_610_000, + // 8_799, + // ))); assert_expected_events!( FrequencyWestend, vec![ @@ -67,11 +66,12 @@ fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { // Create and mint DOT-derived asset on Frequency FrequencyWestend::execute_with(|| { type ForeignAssets = ::ForeignAssets; + let owner = FrequencyAssetOwner::get(); let sender = FrequencyWestendSender::get(); let _ = >::create( Parent.into(), - sender.clone(), + owner.clone(), false, 1u32.into(), ); @@ -86,19 +86,19 @@ fn setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send: Balance) { }); // Fund Frequency sovereign account on AssetHub - let frequency_location_as_seen_by_ahr = - AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); - let sov_frequency_on_ahr = - AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_ahr); + let frequency_location_as_seen_by_relay = + Westend::child_location_of(FrequencyWestend::para_id()); + let sov_frequency_on_westend = + Westend::sovereign_account_id_of(frequency_location_as_seen_by_relay); - AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); + Westend::fund_accounts(vec![(sov_frequency_on_westend.into(), amount_to_send * 2)]); } // ========================================================================= // ========= Reserve Transfers - DOT Asset - Frequency<>Relay =========== // ========================================================================= /// Reserve Transfers of DOT from Relay to Parachain should work -// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_relay_to_frequency -p frequency-westend-integration-tests -- --nocapture +// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::reserve_transfer_dot_from_frequency_to_relay -p frequency-westend-integration-tests -- --nocapture #[test] fn reserve_transfer_dot_from_frequency_to_relay() { let destination = FrequencyWestend::parent_location(); @@ -111,10 +111,6 @@ fn reserve_transfer_dot_from_frequency_to_relay() { setup_foreign_asset_on_frequency_and_fund_ah_sov(amount_to_send); let receiver = WestendReceiver::get(); - let frequency_location_as_seen_by_relay = - Westend::child_location_of(FrequencyWestend::para_id()); - let sov_frequency_on_relay = - Westend::sovereign_account_id_of(frequency_location_as_seen_by_relay); let test_args = TestContext { sender: sender.clone(), @@ -133,6 +129,7 @@ fn reserve_transfer_dot_from_frequency_to_relay() { let sender_assets_before = foreign_balance_on!(FrequencyWestend, relay_native_asset_location.clone(), &sender); + let receiver_balance_before = test.receiver.balance; test.set_assertion::(frequency_to_relay_sender_assertions); @@ -142,6 +139,7 @@ fn reserve_transfer_dot_from_frequency_to_relay() { let sender_assets_after = foreign_balance_on!(FrequencyWestend, relay_native_asset_location, &sender); + let receiver_balance_after = test.receiver.balance; // Sender's balance is reduced by amount sent plus delivery fees diff --git a/emulated-test/test/frequency-westend/src/tests/teleport.rs b/emulated-test/test/frequency-westend/src/tests/teleport.rs deleted file mode 100644 index 2041a8fd75..0000000000 --- a/emulated-test/test/frequency-westend/src/tests/teleport.rs +++ /dev/null @@ -1,17 +0,0 @@ -use crate::imports::*; -use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter_for_relay, test_parachain_is_trusted_teleporter, test_relay_is_trusted_teleporter, -}; - -#[test] -fn teleport_from_and_to_asset_hub() { - let amount = WESTEND_ED * 100; - let native_asset: Assets = (Here, amount).into(); - - test_parachain_is_trusted_teleporter!( - FrequencyWestend, - FrequencyWestendXcmConfig, - vec![AssetHubWestend], - (native_asset, amount) - ); -} diff --git a/emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_to_assethub_with_dot_fee.rs b/emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_to_assethub_with_dot_fee.rs new file mode 100644 index 0000000000..a3bf2e68fe --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_to_assethub_with_dot_fee.rs @@ -0,0 +1,328 @@ +use crate::foreign_balance_on; +use crate::imports::*; + +pub const ASSET_MIN_BALANCE: u128 = 1; + + + +fn frequency_location_as_seen_by_asset_hub() -> Location { + AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()) +} + +fn find_fee_asset_item(assets: Assets, fee_asset_id: AssetId) -> u32 { + assets + .into_inner() + .iter() + .position(|a| a.id == fee_asset_id) + .expect("Fee asset not found in asset list") as u32 +} + +fn setup_frequency_to_asset_hub_test_env(dot_to_send: Balance) { + setup_foreign_dot_on_frequency_and_fund_sov_on_ah(dot_to_send); + create_frequency_asset_on_ah(); +} + +fn build_fee_and_value_assets(fee_dot: Balance, native_token: Balance) -> Vec { + vec![ + (Parent, fee_dot).into(), // DOT - used as fee + (Here, native_token).into(), // XRQCY used as main transfer asset + ] +} + +fn build_frequency_to_asset_hub_test( + sender: AccountIdOf<::Runtime>, + receiver: AccountIdOf<::Runtime>, + destination: Location, + frqcy_amount: Balance, + assets: Assets, + fee_asset_item: u32, +) -> FrequencyToAssetHubTest { + let test_args = TestContext { + sender: sender.clone(), + receiver: receiver.clone(), + args: TestArgs::new_para(destination, receiver, frqcy_amount, assets, None, fee_asset_item), + }; + + FrequencyToAssetHubTest::new(test_args) +} + +fn mint_dot_on_frequency( + beneficiary: AccountIdOf<::Runtime>, + amount_to_mint: Balance, +) { + type ForeignAssets = ::ForeignAssets; + type RuntimeEvent = ::RuntimeEvent; + + FrequencyWestend::execute_with(|| { + let signed_origin = + ::RuntimeOrigin::signed(FrequencyAssetOwner::get()); + + assert_ok!(ForeignAssets::mint( + signed_origin, + Parent.into(), + beneficiary.clone().into(), + amount_to_mint + )); + + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Issued { asset_id, owner, amount } + ) => { + asset_id: *asset_id == Parent.into(), + owner: *owner == beneficiary.clone().into(), + amount: *amount == amount_to_mint, + }, + ] + ); + }); +} + +fn setup_foreign_dot_on_frequency_and_fund_sov_on_ah(amount_to_send: Balance) { + // Create and mint DOT-derived asset on Frequency + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + let sender = FrequencyWestendSender::get(); + + let _ = >::create( + Parent.into(), + sender.clone(), + false, + 1u32.into(), + ); + + let _ = >::mint_into( + Parent.into(), + &sender.clone(), + amount_to_send * 2, + ); + + assert!(>::asset_exists(Parent.into())); + }); + + // Fund Frequency sovereign account on AssetHub + let frequency_location_on_ah = frequency_location_as_seen_by_asset_hub(); + let sov_frequency_on_ahr = AssetHubWestend::sovereign_account_id_of(frequency_location_on_ah); + + AssetHubWestend::fund_accounts(vec![(sov_frequency_on_ahr.into(), amount_to_send * 2)]); +} + +fn create_frequency_asset_on_ah() { + let frequency_location_on_ah = frequency_location_as_seen_by_asset_hub(); + + AssetHubWestend::force_create_foreign_asset( + frequency_location_on_ah.clone().try_into().unwrap(), + FrequencyAssetOwner::get(), + false, + ASSET_MIN_BALANCE, + vec![], + ); + + AssetHubWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + + assert!(>::asset_exists(frequency_location_on_ah)); + }); +} + +fn execute_xcm_frequency_to_asset_hub(t: FrequencyToAssetHubTest) -> DispatchResult { + let assets: Assets = t.args.assets.clone(); + + let local_teleportable_asset: Asset = + non_fee_asset(&assets, t.args.fee_asset_item as usize).unwrap().into(); + // TODO(https://github.com/paritytech/polkadot-sdk/issues/6197): dry-run to get exact fees. + // For now )just use half the fees locally, half on dest + + // Use half of the fees to cover remote execution and the + // remainding to cover delivery fees + let mut remote_execution_fee_asset: Asset = + fee_asset(&assets, t.args.fee_asset_item as usize).unwrap().into(); + if let Fungible(fees_amount) = remote_execution_fee_asset.fun { + remote_execution_fee_asset.fun = Fungible(fees_amount / 2); + } + + let xcm_on_dest = Xcm(vec![ + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: t.args.beneficiary }, + ]); + + let xcm = Xcm::<()>(vec![ + WithdrawAsset(assets), + // PayFees { asset: remote_fees.clone() }, + InitiateTransfer { + destination: t.args.dest, + remote_fees: Some(AssetTransferFilter::ReserveWithdraw( + remote_execution_fee_asset.into(), + )), + preserve_origin: false, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::Teleport( + local_teleportable_asset.into(), + )]), + remote_xcm: xcm_on_dest, + }, + RefundSurplus, + DepositAsset { + assets: Wild(All), + beneficiary: AccountId32Junction { + network: None, + id: FrequencyWestendSender::get().into(), + } + .into(), + }, + ]); + + ::PolkadotXcm::execute( + t.signed_origin, + bx!(staging_xcm::VersionedXcm::from(xcm.into())), + Weight::MAX, + ) + .unwrap(); + Ok(()) +} + +fn assert_sender_assets_burned_correctly(t: FrequencyToAssetHubTest) { + type RuntimeEvent = ::RuntimeEvent; + let system_para_native_asset_location = WestendLocation::get(); + let (_, xrqcy_teleport_amount) = + non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + + FrequencyWestend::assert_xcm_pallet_attempted_complete(None); + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, .. } + ) => { + asset_id: *asset_id == system_para_native_asset_location, + owner: *owner == t.sender.account_id, + }, + RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { + who: *who == t.sender.account_id, + amount: *amount == xrqcy_teleport_amount, + }, + ] + ); +} + +fn assert_receiver_fee_burned_and_asset_minted(t: FrequencyToAssetHubTest) { + type RuntimeEvent = ::RuntimeEvent; + AssetHubWestend::assert_xcmp_queue_success(None); + let sovereign_account_of_frequency = + AssetHubWestend::sovereign_account_id_of(frequency_location_as_seen_by_asset_hub()); + + let frequency_location = frequency_location_as_seen_by_asset_hub(); + + let (_, total_fee) = fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + let remote_execution_fee: u128 = total_fee / 2; + + let (_, xrqcy_teleport_amount) = + non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + + assert_expected_events!( + AssetHubWestend, + vec![ + // Withdraw the fee amount from sov account and burn it + RuntimeEvent::Balances( + pallet_balances::Event::Burned { who, amount } + ) => { + who: *who == sovereign_account_of_frequency, + amount: *amount == remote_execution_fee, + }, + // Issue the xFRQCY amount + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Issued { asset_id, owner, amount } + ) => { + asset_id: *asset_id == frequency_location, + owner: *owner == AssetHubWestendReceiver::get(), + amount: *amount == xrqcy_teleport_amount, + }, + // Mint remaining fees and deposit them into receiver otherwise + RuntimeEvent::Balances( + pallet_balances::Event::Minted { who, .. } + ) => { + who: *who == AssetHubWestendReceiver::get(), + }, + ] + ); +} + +// =========================================================================== +// ======= DOT (fee) + xFRQCY (value) Transfer: Frequency → AssetHub ========= +// =========================================================================== +/// This test transfers xFRQCY from the Frequency parachain to AssetHub, +/// using DOT as the fee asset for both delivery and remote execution. +// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::teleport_xfrqcy_to_assethub_with_dot_fee -p frequency-westend-integration-tests -- --nocapture +#[test] +fn teleport_xfrqcy_to_assethub_with_dot_fee() { + // ──────────────── + // Test Setup + // ──────────────── + let dot_fee_amount: Balance = AssetHubExistentialDeposit::get() * 1000; + let xrqcy_transfer_amount = FrequencyExistentialDeposit::get() * 1000; + + setup_frequency_to_asset_hub_test_env(dot_fee_amount); + + let sender = FrequencyWestendSender::get(); + let receiver = AssetHubWestendReceiver::get(); + let destination = FrequencyWestend::sibling_location_of(AssetHubWestend::para_id()); + let frequency_location_on_ah = frequency_location_as_seen_by_asset_hub(); + + // Local fee amount(in DOT) should cover + // 1. delivery cost to AH + // 2. execution cost on AH + let assets: Assets = build_fee_and_value_assets(dot_fee_amount, xrqcy_transfer_amount).into(); + let fee_asset_item = find_fee_asset_item(assets.clone(), AssetId(Parent.into())); + + // ──────────────────────────────── + // Pre-dispatch State Snapshot + // ──────────────────────────────── + let sender_balance_of_dot_on_frequency_before = + foreign_balance_on!(FrequencyWestend, Parent.into(), &sender); + assert_eq!(sender_balance_of_dot_on_frequency_before, 2_000_000_000_000u128); + + + let frequency_sender_native_before = frequency_balance_of(&sender); + assert_eq!(frequency_sender_native_before, 4_096_000_000u128); + + let receiver_frequency_before = + foreign_balance_on!(AssetHubWestend, frequency_location_on_ah.clone(), &sender); + + assert_eq!(receiver_frequency_before, 0u128); + + // ───────────────────────────── + // Build Test Context + // ───────────────────────────── + let mut test = build_frequency_to_asset_hub_test( + sender.clone(), + receiver.clone(), + destination.clone(), + xrqcy_transfer_amount, + assets, + fee_asset_item, + ); + + // ───────────────────────────── + // Execute + Assert + // ───────────────────────────── + test.set_assertion::(assert_sender_assets_burned_correctly); + test.set_assertion::(assert_receiver_fee_burned_and_asset_minted); + test.set_dispatchable::(execute_xcm_frequency_to_asset_hub); + test.assert(); + + let sender_balance_of_dot_on_frequency_after = + foreign_balance_on!(FrequencyWestend, Parent.into(), &sender); + + let receiver_balance_of_xfrqcy_on_ah_after = + foreign_balance_on!(AssetHubWestend, frequency_location_on_ah.clone(), &receiver); + + assert!( + sender_balance_of_dot_on_frequency_after + < sender_balance_of_dot_on_frequency_before + dot_fee_amount + ); + + assert_eq!( + receiver_balance_of_xfrqcy_on_ah_after, xrqcy_transfer_amount, + "Sender's balance on AH does not equal the transfer amount" + ); +} diff --git a/emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_with_dot_fee_from_assethub.rs b/emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_with_dot_fee_from_assethub.rs new file mode 100644 index 0000000000..aed6636f55 --- /dev/null +++ b/emulated-test/test/frequency-westend/src/tests/teleport_xfrqcy_with_dot_fee_from_assethub.rs @@ -0,0 +1,303 @@ +use crate::foreign_balance_on; +use crate::imports::*; + +pub const ASSET_MIN_BALANCE: u128 = 1; + +fn frequency_location_as_seen_by_asset_hub() -> Location { + AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()) +} + +fn find_fee_asset_item(assets: Assets, fee_asset_id: AssetId) -> u32 { + assets + .into_inner() + .iter() + .position(|a| a.id == fee_asset_id) + .expect("Fee asset not found in asset list") as u32 +} + +fn build_fee_and_value_assets(fee_dot: Balance, xrqcy_teleport_amount: Balance) -> Vec { + vec![ + (Parent, fee_dot).into(), // DOT - used as fee + (frequency_location_as_seen_by_asset_hub(), xrqcy_teleport_amount).into(), // XRQCY used as main transfer asset + ] +} + +fn build_asset_hub_to_frequency_test( + sender: AccountIdOf<::Runtime>, + receiver: AccountIdOf<::Runtime>, + destination: Location, + frqcy_amount: Balance, + assets: Assets, + fee_asset_item: u32, +) -> AssetHubToFrequencyTest { + let test_args = TestContext { + sender: sender.clone(), + receiver: receiver.clone(), + args: TestArgs::new_para( + destination, + receiver, + frqcy_amount, + assets.clone(), + None, + fee_asset_item, + ), + }; + + AssetHubToFrequencyTest::new(test_args) +} + +fn assert_sender_assets_burned_correctly(t: AssetHubToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + let frequency_location = frequency_location_as_seen_by_asset_hub(); + let (_, xrqcy_teleport_amount) = + non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + + let frequency_sibling_account = + AssetHubWestend::sovereign_account_id_of(frequency_location.clone()); + + let (_, total_fee) = fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + let remote_execution_fee: u128 = total_fee / 2; + + AssetHubWestend::assert_xcm_pallet_attempted_complete(None); + assert_expected_events!( + AssetHubWestend, + vec![ + // Frequency burned for teleportation + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Burned { asset_id, owner, balance } + ) => { + asset_id: *asset_id == frequency_location, + owner: *owner == t.sender.account_id, + balance: *balance == xrqcy_teleport_amount, + }, + // Remote fee burned + RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { + who: *who == t.sender.account_id, + amount: *amount == total_fee, + }, + // Sovereign account funded for remote fee + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => { + who: *who == frequency_sibling_account, + amount: *amount == remote_execution_fee, + }, + ] + ); +} + +fn assert_receiver_fee_burned_and_asset_minted(t: AssetHubToFrequencyTest) { + type RuntimeEvent = ::RuntimeEvent; + FrequencyWestend::assert_xcmp_queue_success(None); + + let (_, total_fee) = fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + let remote_execution_fee: u128 = total_fee / 2; + + let (_, xrqcy_teleport_amount) = + non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); + + assert_expected_events!( + AssetHubWestend, + vec![ + // Mint remaining fees and deposit them into receiver otherwise + RuntimeEvent::Balances( + pallet_balances::Event::Minted { who, amount } + ) => { + who: *who == FrequencyWestendReceiver::get(), + amount: *amount == xrqcy_teleport_amount, + }, + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Issued { asset_id, owner, amount }, + ) => { + asset_id: *asset_id == Parent.into(), + owner: *owner == t.receiver.account_id, + amount: *amount < remote_execution_fee, + }, + ] + ); +} + +fn mint_xrqcy_on_asset_hub( + beneficiary: AccountIdOf<::Runtime>, + amount_to_mint: Balance, +) { + type ForeignAssets = ::ForeignAssets; + type RuntimeEvent = ::RuntimeEvent; + + AssetHubWestend::execute_with(|| { + let signed_origin = + ::RuntimeOrigin::signed(FrequencyAssetOwner::get()); + + assert_ok!(ForeignAssets::mint( + signed_origin, + frequency_location_as_seen_by_asset_hub().into(), + beneficiary.clone().into(), + amount_to_mint + )); + + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::Issued { asset_id, owner, amount } + ) => { + asset_id: *asset_id == frequency_location_as_seen_by_asset_hub().into(), + owner: *owner == beneficiary.clone().into(), + amount: *amount == amount_to_mint, + }, + ] + ); + }); +} + +fn create_dot_asset_on_frequency() { + FrequencyWestend::execute_with(|| { + type ForeignAssets = ::ForeignAssets; + type RuntimeEvent = ::RuntimeEvent; + let sudo_origin = ::RuntimeOrigin::root(); + + let _ = ForeignAssets::force_create( + sudo_origin, + Parent.into(), + FrequencyAssetOwner::get().into(), + false, + 1u128.into(), + ); + + assert_expected_events!( + FrequencyWestend, + vec![ + RuntimeEvent::ForeignAssets( + pallet_assets::Event::ForceCreated { asset_id, .. } + ) => { + asset_id: *asset_id == Parent.into(), + }, + ] + ); + + assert!(>::asset_exists(Parent.into())); + }); +} + +fn create_frequency_asset_on_ah() { + let frequency_location_on_asset_hub = frequency_location_as_seen_by_asset_hub(); + + AssetHubWestend::force_create_foreign_asset( + frequency_location_on_asset_hub.clone().try_into().unwrap(), + FrequencyAssetOwner::get(), + false, + ASSET_MIN_BALANCE, + vec![], + ); +} + +fn execute_xcm_asset_hub_to_frequency(t: AssetHubToFrequencyTest) -> DispatchResult { + let all_assets = t.args.assets.clone().into_inner(); + let mut assets = all_assets.clone(); + + let mut fees = assets.remove(t.args.fee_asset_item as usize); + + if let Fungible(fees_amount) = fees.fun { + fees.fun = Fungible(fees_amount / 2); + } + // xcm to be executed at dest + let xcm_on_dest = Xcm(vec![ + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: t.args.beneficiary }, + ]); + let xcm = Xcm::<()>(vec![ + WithdrawAsset(all_assets.into()), + PayFees { asset: fees.clone() }, + InitiateTransfer { + destination: t.args.dest, + remote_fees: Some(AssetTransferFilter::ReserveDeposit(fees.into())), + preserve_origin: false, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::Teleport(assets.into())]), + remote_xcm: xcm_on_dest, + }, + ]); + + ::PolkadotXcm::execute( + t.signed_origin, + bx!(staging_xcm::VersionedXcm::from(xcm.into())), + Weight::MAX, + ) + .unwrap(); + Ok(()) +} + +// =========================================================================== +// ======= DOT (fee) + xFRQCY (value) Transfer: AssetHub → Frequency ========= +// =========================================================================== +// RUST_BACKTRACE=1 RUST_LOG="events,runtime::system=trace,xcm=trace" cargo test tests::teleport_xfrqcy_with_dot_fee_from_assethub -p frequency-westend-integration-tests -- --nocapture +#[test] +fn teleport_xfrqcy_with_dot_fee_from_assethub() { + // ──────────────── + // Test Setup + // ──────────────── + let dot_fee_amount: Balance = AssetHubExistentialDeposit::get() * 1000; // ONE_DOT = 1_000_000_000_000 + let xrqcy_teleport_amount = FrequencyExistentialDeposit::get() * 100; // ONE_XRQCY = 100_000_000 + let frequency_location_on_asset_hub = frequency_location_as_seen_by_asset_hub(); + + AssetHubWestend::fund_accounts(vec![( + AssetHubWestendSender::get(), + AssetHubExistentialDeposit::get() * 100, + )]); + + create_dot_asset_on_frequency(); + create_frequency_asset_on_ah(); + mint_xrqcy_on_asset_hub( + AssetHubWestendSender::get().clone(), + (xrqcy_teleport_amount * 2).clone(), + ); + + let sender = AssetHubWestendSender::get(); + let receiver = FrequencyWestendReceiver::get(); + let destination = AssetHubWestend::sibling_location_of(FrequencyWestend::para_id()); + + let assets: Assets = build_fee_and_value_assets(dot_fee_amount, xrqcy_teleport_amount).into(); + let fee_asset_item = find_fee_asset_item(assets.clone(), AssetId(Parent.into())); + + // ──────────────────────────────── + // Pre-dispatch State Snapshot + // ──────────────────────────────── + let sender_dot_on_frequency_before = + foreign_balance_on!(FrequencyWestend, Parent.into(), &sender); + assert_eq!(sender_dot_on_frequency_before, 0u128); + + let sender_xrqcy_on_assethub_before = foreign_balance_on!( + AssetHubWestend, + frequency_location_on_asset_hub.clone(), + &sender.clone() + ); + + assert_eq!(sender_xrqcy_on_assethub_before, 200_000_000u128); + + let sender_dot_on_assethub_before = AssetHubWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&sender) + }); + assert_eq!(sender_dot_on_assethub_before, 4_196_000_000_000u128); + + let receiver_xrqcy_on_frequency_before = FrequencyWestend::execute_with(|| { + type Balances = ::Balances; + >::balance(&receiver) + }); + + assert_eq!(receiver_xrqcy_on_frequency_before, 4_096_000_000u128); + + // ───────────────────────────── + // Build Test Context + // ───────────────────────────── + let mut test = build_asset_hub_to_frequency_test( + sender.clone(), + receiver.clone(), + destination.clone(), + xrqcy_teleport_amount, + assets, + fee_asset_item, + ); + + test.set_assertion::(assert_sender_assets_burned_correctly); + test.set_assertion::(assert_receiver_fee_burned_and_asset_minted); + test.set_dispatchable::(execute_xcm_asset_hub_to_frequency); + test.assert(); +} diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index 7de4e6f7d7..d53582a924 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -18,18 +18,13 @@ pub fn wasm_binary_unwrap() -> &'static [u8] { } #[cfg(feature = "frequency-bridging")] -pub mod xcm_config; +pub mod xcm; // use pallet_assets::BenchmarkHelper; #[cfg(feature = "frequency-bridging")] -use xcm_config::ForeignAssetsAssetId; - -#[cfg(feature = "frequency-bridging")] -pub mod xcm_queue; - -#[cfg(feature = "frequency-bridging")] -pub mod xcm_commons; -#[cfg(feature = "frequency-bridging")] -use xcm_commons::{RelayOrigin, ReservedDmpWeight, ReservedXcmpWeight}; +use xcm::{ + parameters::{RelayOrigin, ReservedDmpWeight, ReservedXcmpWeight, ForeignAssetsAssetId}, + queue as xcm_queue, +}; use alloc::borrow::Cow; use common_runtime::constants::currency::UNITS; @@ -107,7 +102,7 @@ use frame_support::{ EqualPrivilegeOnly, GetStorageVersion, InstanceFilter, LinearStoragePrice, OnRuntimeUpgrade, }, - weights::{ConstantMultiplier, Weight, constants::WEIGHT_REF_TIME_PER_SECOND}, + weights::{constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight}, Twox128, }; @@ -152,7 +147,7 @@ mod ethereum; mod genesis; pub mod polkadot_xcm_fee { - use crate::{Balance, WEIGHT_REF_TIME_PER_SECOND, ExtrinsicBaseWeight}; + use crate::{Balance, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}; pub const MICRO_DOT: Balance = 10_000; pub const MILLI_DOT: Balance = 1_000 * MICRO_DOT; diff --git a/runtime/frequency/src/xcm/asset_transactor.rs b/runtime/frequency/src/xcm/asset_transactor.rs new file mode 100644 index 0000000000..35774ab27e --- /dev/null +++ b/runtime/frequency/src/xcm/asset_transactor.rs @@ -0,0 +1,58 @@ +use crate::{AccountId, Balances, ForeignAssets, PolkadotXcm}; +use staging_xcm::latest::prelude::*; +use staging_xcm_builder::{ + FungibleAdapter, FungiblesAdapter, IsConcrete, IsParentsOnly, MatchedConvertedConcreteId, + NoChecking, +}; + +use crate::xcm::{location_converter::LocationToAccountId, }; + +use frame_support::{parameter_types, traits::ConstU8}; + +parameter_types! { + /// A placeholder account used to hold reserved balances temporarily during checking. + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); + pub HereLocation: Location = Location::here(); +} + +/// Adapter for transacting native assets (like balances) +/// Means for transacting assets on this chain. +/// How xcm deals with assets on this chain +pub type LocalAssetTransactor = FungibleAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // Do a simple punn to convert an AccountId32 Location into a native chain account ID: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports. + (), +>; + +/// Adapter for transacting foreign assets (like DOT) +/// Type for specifying how a `Location` can be converted into an `AccountId`. +///// Transactors /////// +pub type ForeignAssetsAdapter = FungiblesAdapter< + ForeignAssets, + // Use this currency when it is a fungible asset matching the given location or name: + MatchedConvertedConcreteId< + Location, + u128, + IsParentsOnly>, + xcm_executor::traits::JustTry, + xcm_executor::traits::JustTry, + >, + // Convert an XCM Location into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We do not allow teleportation of foreign assets. We only allow the reserve-based + // transfer of USDT, USDC and DOT. + NoChecking, + CheckingAccount, +>; + +/// The complete set of transactors +pub type AssetTransactors = (LocalAssetTransactor, ForeignAssetsAdapter); diff --git a/runtime/frequency/src/xcm/barrier.rs b/runtime/frequency/src/xcm/barrier.rs new file mode 100644 index 0000000000..6549faa798 --- /dev/null +++ b/runtime/frequency/src/xcm/barrier.rs @@ -0,0 +1,38 @@ +use frame_support::traits::{ConstU32, Contains, Everything}; + +use staging_xcm::latest::prelude::*; +use staging_xcm_builder::{ + AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, DenyRecursively, + DenyReserveTransferToRelayChain, DenyThenTry, TakeWeightCredit, TrailingSetTopicAsId, + WithComputedOrigin, +}; + +use crate::xcm::parameters::UniversalLocation; + +pub struct ParentOrParentsExecutivePlurality; +impl Contains for ParentOrParentsExecutivePlurality { + fn contains(location: &Location) -> bool { + matches!(location.unpack(), (1, []) | (1, [Plurality { id: BodyId::Executive, .. }])) + } +} + +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyRecursively, + ( + TakeWeightCredit, + WithComputedOrigin< + ( + // we constraint this one so that we limit who can execute instructions + AllowTopLevelPaidExecutionFrom, + AllowExplicitUnpaidExecutionFrom, + // ^^^ Parent and its exec plurality get free execution + // Subscriptions for version tracking are OK. + // AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, +>; diff --git a/runtime/frequency/src/xcm_commons.rs b/runtime/frequency/src/xcm/location_converter.rs similarity index 75% rename from runtime/frequency/src/xcm_commons.rs rename to runtime/frequency/src/xcm/location_converter.rs index 891ee4047e..73068f69c9 100644 --- a/runtime/frequency/src/xcm_commons.rs +++ b/runtime/frequency/src/xcm/location_converter.rs @@ -1,30 +1,12 @@ use crate::{AccountId, RuntimeOrigin}; - -use crate::MAXIMUM_BLOCK_WEIGHT; -use cumulus_primitives_core::AggregateMessageOrigin; -use frame_support::parameter_types; use pallet_xcm::XcmPassthrough; use polkadot_parachain_primitives::primitives::Sibling; -pub use staging_xcm::latest::{prelude::{*, AssetId as AssetLocationId}, WESTEND_GENESIS_HASH}; use staging_xcm_builder::{ AccountId32Aliases, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SovereignSignedViaLocation, - // ParentRelayOrSiblingParachains, }; -/// Shared Relay Network -pub const RELAY_GENESIS: [u8; 32] = WESTEND_GENESIS_HASH; - -parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; -} - -parameter_types! { - pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(RELAY_GENESIS)); - pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); -} +use super::parameters::{RelayChainOrigin, RelayNetwork}; /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM @@ -43,6 +25,7 @@ pub type LocationToAccountId = ( /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, /// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can /// biases the kind of local `Origin` it will become. +/// Converts an incoming XCM origin into a local `RuntimeOrigin` for `Transact` dispatch. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for @@ -60,3 +43,9 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. XcmPassthrough, ); + +/// Converts a local signed origin into an XCM location. Forms the basis for local origins +/// sending/executing XCMs. +/// Converts a local signed origin into a `MultiLocation` for outbound XCMs. +pub type LocalOriginToLocation = + staging_xcm_builder::SignedToAccountId32; diff --git a/runtime/frequency/src/xcm/mod.rs b/runtime/frequency/src/xcm/mod.rs new file mode 100644 index 0000000000..2c904697cb --- /dev/null +++ b/runtime/frequency/src/xcm/mod.rs @@ -0,0 +1,30 @@ +// pub mod xcm_commons; +pub mod queue; +pub mod xcm_config; + +pub mod asset_transactor; +pub mod barrier; +pub mod location_converter; +pub mod parameters; +pub mod reserve; +pub mod teleporter; +pub mod trader; +pub mod weigher; + +pub use xcm_config::*; + +pub use asset_transactor::AssetTransactors; +pub use barrier::Barrier; +pub use location_converter::{ + LocalOriginToLocation, LocationToAccountId, XcmOriginToTransactDispatchOrigin, +}; +pub use parameters::{ + BaseDeliveryFee, FeeAssetId, ForeignAssetsAssetId, MaxAssetsIntoHolding, RelayNetwork, + TransactionByteFee, UniversalLocation, +}; +pub use queue::XcmRouter; +pub use reserve::TrustedReserves; +pub use teleporter::TrustedTeleporters; +pub use trader::Trader; +pub use weigher::Weigher; + diff --git a/runtime/frequency/src/xcm/parameters.rs b/runtime/frequency/src/xcm/parameters.rs new file mode 100644 index 0000000000..07c580f4ec --- /dev/null +++ b/runtime/frequency/src/xcm/parameters.rs @@ -0,0 +1,42 @@ +use crate::{ + polkadot_xcm_fee::default_fee_per_second, Balance, ParachainInfo, RuntimeOrigin, + MAXIMUM_BLOCK_WEIGHT, +}; +use cumulus_primitives_core::AggregateMessageOrigin; +use frame_support::parameter_types; +use staging_xcm::latest::{prelude::*, WESTEND_GENESIS_HASH}; + +pub const MICROUNIT: Balance = 1_000_000; +pub const RELAY_GENESIS: [u8; 32] = WESTEND_GENESIS_HASH; +const ASSET_HUB_ID: u32 = 1000; + +pub type ForeignAssetsAssetId = Location; + +parameter_types! { + pub const RelayLocation: Location = Location::parent(); + pub FeeAssetId: AssetId = AssetId(RelayLocation::get()); + pub const BaseDeliveryFee: u128 = (1_000_000_000_000u128 / 100).saturating_mul(3); + pub const TransactionByteFee: Balance = 10 * MICROUNIT; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; + pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(RELAY_GENESIS)); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())].into(); + + pub RelayPerSecondAndByte: (AssetId, u128,u128) = (Location::new(1,Here).into(), default_fee_per_second(), 1024); + pub HereLocation: Location = Location::here(); + + pub NativeToken: AssetId = AssetId(Location::here()); + pub NativeTokenFilter: AssetFilter = Wild(AllOf { fun: WildFungible, id: NativeToken::get() }); + pub AssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]); + pub NativeForAssetHub: (AssetFilter, Location) = (NativeTokenFilter::get(), AssetHubLocation::get()); +} + +parameter_types! { + // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. + // XCM instruction weight cost + // pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024); + // pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; +} diff --git a/runtime/frequency/src/xcm_queue.rs b/runtime/frequency/src/xcm/queue.rs similarity index 66% rename from runtime/frequency/src/xcm_queue.rs rename to runtime/frequency/src/xcm/queue.rs index 71c5ba9fc3..0cb8a2f89f 100644 --- a/runtime/frequency/src/xcm_queue.rs +++ b/runtime/frequency/src/xcm/queue.rs @@ -1,5 +1,5 @@ use crate::{ - Balance, AccountId, MessageQueue, ParachainSystem, Runtime, RuntimeBlockWeights, RuntimeEvent, XcmpQueue, + AccountId, MessageQueue, ParachainSystem, Runtime, RuntimeBlockWeights, RuntimeEvent, XcmpQueue, }; #[cfg(not(feature = "runtime-benchmarks"))] @@ -11,9 +11,12 @@ use frame_support::{ weights::Weight, }; -use crate::xcm_commons::{XcmOriginToTransactDispatchOrigin, AssetLocationId}; +use crate::xcm::location_converter::XcmOriginToTransactDispatchOrigin; +use crate::xcm::parameters::{BaseDeliveryFee, FeeAssetId, TransactionByteFee}; +use crate::xcm::XcmConfig; use frame_system::EnsureRoot; +use staging_xcm_builder::WithUniqueTopic; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; @@ -21,29 +24,14 @@ use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; // use xcm_config; #[cfg(not(feature = "runtime-benchmarks"))] -use crate::xcm_config; - -use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; +use super::xcm_config; pub use sp_runtime::{Perbill, Saturating}; #[cfg(not(feature = "runtime-benchmarks"))] use xcm_executor; -parameter_types! { - /// The asset ID for the asset that we use to pay for message delivery fees. - pub FeeAssetId: AssetLocationId = AssetLocationId(xcm_config::RelayLocation::get()); - /// The base fee for the message delivery fees (3 CENTS). - pub const BaseDeliveryFee: u128 = (1_000_000_000_000u128 / 100).saturating_mul(3); -} - -pub const MICROUNIT: Balance = 1_000_000; - -parameter_types! { - /// Relay Chain `TransactionByteFee` / 10 - pub const TransactionByteFee: Balance = 10 * MICROUNIT; -} - +/// Pricing logic for sibling parachain message delivery pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< FeeAssetId, BaseDeliveryFee, @@ -51,10 +39,29 @@ pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender: XcmpQueue, >; +/// Pricing logic for relay message delivery +pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< + FeeAssetId, + BaseDeliveryFee, + TransactionByteFee, + ParachainSystem, +>; + parameter_types! { + /// How much weight to allocate to the background message queue service pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = WithUniqueTopic<( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +)>; + +/// Configures the queue that handles incoming XCMP messages impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ChannelInfo = ParachainSystem; @@ -70,6 +77,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; } +/// Configures the local message queue service impl pallet_message_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); @@ -80,7 +88,7 @@ impl pallet_message_queue::Config for Runtime { #[cfg(not(feature = "runtime-benchmarks"))] type MessageProcessor = staging_xcm_builder::ProcessXcmMessage< AggregateMessageOrigin, - xcm_executor::XcmExecutor, + xcm_executor::XcmExecutor, RuntimeCall, >; type Size = u32; diff --git a/runtime/frequency/src/xcm/reserve.rs b/runtime/frequency/src/xcm/reserve.rs new file mode 100644 index 0000000000..fd43c2d404 --- /dev/null +++ b/runtime/frequency/src/xcm/reserve.rs @@ -0,0 +1,22 @@ +use crate::xcm::parameters::{AssetHubLocation, RelayLocation}; + +use frame_support::traits::ContainsPair; +use parachains_common::xcm_config::ConcreteAssetFromSystem; +use staging_xcm::latest::prelude::*; +use staging_xcm_builder::NativeAsset; + +/// Checks whether the asset originates from a given prefix location +pub struct AssetFrom(core::marker::PhantomData); + +impl> ContainsPair + for AssetFrom +{ + fn contains(_asset: &Asset, location: &Location) -> bool { + let prefix = T::get(); + location == &prefix + } +} + +/// Assets considered as reserve-based (e.g. DOT, native, system-registered) +pub type TrustedReserves = + (NativeAsset, ConcreteAssetFromSystem, AssetFrom); diff --git a/runtime/frequency/src/xcm/teleporter.rs b/runtime/frequency/src/xcm/teleporter.rs new file mode 100644 index 0000000000..4eea624e25 --- /dev/null +++ b/runtime/frequency/src/xcm/teleporter.rs @@ -0,0 +1,27 @@ +use frame_support::parameter_types; +use staging_xcm::latest::prelude::*; +use staging_xcm_builder::Case; + +/// The location of AssetHub on the relay network. +pub const ASSET_HUB_ID: u32 = 1000; + +parameter_types! { + /// The location we use to represent native assets (e.g. XRQCY). + pub NativeTokenLocation: Location = Location::here(); + /// A filter matching the native token only. + pub NativeTokenFilter: AssetFilter = Wild(AllOf { + fun: WildFungible, + id: AssetId(NativeTokenLocation::get()), + }); + + pub AssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]); + + /// The specific (asset, destination) combination allowed for teleport. + pub NativeForAssetHub: (AssetFilter, Location) = ( + NativeTokenFilter::get(), + AssetHubLocation::get(), + ); +} + +/// Assets allowed to teleport (e.g. native token to AssetHub) +pub type TrustedTeleporters = Case; diff --git a/runtime/frequency/src/xcm/trader.rs b/runtime/frequency/src/xcm/trader.rs new file mode 100644 index 0000000000..daa9129c99 --- /dev/null +++ b/runtime/frequency/src/xcm/trader.rs @@ -0,0 +1,12 @@ +use crate::{AccountId, Balances, Runtime}; +use polkadot_runtime_common::impls::ToAuthor; +use staging_xcm_builder::{FixedRateOfFungible, UsingComponents}; + +use crate::xcm::parameters::{HereLocation, RelayPerSecondAndByte}; +use common_runtime::fee::WeightToFee; + +/// The full Trader used for pricing XCM execution and delivery +pub type Trader = ( + FixedRateOfFungible, + UsingComponents>, +); diff --git a/runtime/frequency/src/xcm/weigher.rs b/runtime/frequency/src/xcm/weigher.rs new file mode 100644 index 0000000000..64dae479e7 --- /dev/null +++ b/runtime/frequency/src/xcm/weigher.rs @@ -0,0 +1,14 @@ +use frame_support::parameter_types; +use staging_xcm::latest::prelude::*; +use staging_xcm_builder::FixedWeightBounds; + +use crate::RuntimeCall; + +parameter_types! { + /// The cost of executing a single XCM instruction + pub const UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024); + pub const MaxInstructions: u32 = 100; +} + +/// The XCM weigher used to estimate total weight for execution +pub type Weigher = FixedWeightBounds; diff --git a/runtime/frequency/src/xcm/xcm_config.rs b/runtime/frequency/src/xcm/xcm_config.rs new file mode 100644 index 0000000000..a8864f6ff2 --- /dev/null +++ b/runtime/frequency/src/xcm/xcm_config.rs @@ -0,0 +1,116 @@ +use crate::{ + AccountId, AllPalletsWithSystem, Balances, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, + RuntimeOrigin, +}; + +use staging_xcm_builder::{EnsureXcmOrigin, FrameTransactionalProcessor}; + +use crate::xcm::{ + AssetTransactors, Barrier, LocalOriginToLocation, LocationToAccountId, MaxAssetsIntoHolding, + Trader, TrustedReserves, TrustedTeleporters, UniversalLocation, Weigher, + XcmOriginToTransactDispatchOrigin, XcmRouter, +}; + +use frame_support::{ + parameter_types, + traits::{ConstU32, Disabled, Everything, Nothing}, +}; + +pub use common_runtime::fee::WeightToFee; + +use frame_system::EnsureRoot; + +use xcm_executor::XcmExecutor; + +parameter_types! { + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = XcmRouter; + type XcmEventEmitter = PolkadotXcm; + // How to withdraw and deposit an asset. + type AssetTransactor = AssetTransactors; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = TrustedReserves; + // in order to register our asset in asset hub + // once the asset is registered we can teleport our native asset to asset hub + type IsTeleporter = TrustedTeleporters; + type UniversalLocation = UniversalLocation; + type Barrier = Barrier; + type Weigher = Weigher; + type Trader = Trader; + type ResponseHandler = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; + type SubscriptionService = PolkadotXcm; + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; + type Aliasers = Nothing; + type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = PolkadotXcm; +} + +impl pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + // update to Nothing and create extrinsic + type XcmExecuteFilter = Everything; + // ^ Disable dispatchable execute on the XCM pallet. + // Needs to be `Everything` for local testing. + type XcmExecutor = XcmExecutor; + // update to only allow to teleport native + type XcmTeleportFilter = Everything; + // Lets only allow reserve transfers of DOT + type XcmReserveTransferFilter = Everything; + type Weigher = Weigher; + type UniversalLocation = UniversalLocation; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + // ^ Override for AdvertisedXcmVersion default + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + // I do not thingk we need this + type SovereignAccountOf = LocationToAccountId; + /// Not sure what this is for? + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; + type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); + // Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`. + type AuthorizedAliasConsideration = Disabled; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; +} + +/// Simple conversion of `u32` into an `AssetId` for use in benchmarking. +#[cfg(feature = "runtime-benchmarks")] +pub struct XcmBenchmarkHelper; +#[cfg(feature = "runtime-benchmarks")] +impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { + fn create_asset_id_parameter(id: u32) -> ForeignAssetsAssetId { + Location::new(1, [Parachain(id)]) + } +} diff --git a/runtime/frequency/src/xcm_config.rs b/runtime/frequency/src/xcm_config.rs deleted file mode 100644 index 239ed4c685..0000000000 --- a/runtime/frequency/src/xcm_config.rs +++ /dev/null @@ -1,248 +0,0 @@ -use crate::{ - AccountId, AllPalletsWithSystem, Balances, ForeignAssets, ParachainInfo, ParachainSystem, - PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, XcmpQueue, polkadot_xcm_fee::default_fee_per_second, -}; - -use staging_xcm_builder::{ - AllowExplicitUnpaidExecutionFrom, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyRecursively, - DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, - FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, IsConcrete, IsParentsOnly, - MatchedConvertedConcreteId, NativeAsset, NoChecking, SignedToAccountId32, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, FixedRateOfFungible, WithComputedOrigin, WithUniqueTopic, -}; - -pub use crate::xcm_commons::{ - LocationToAccountId, RelayNetwork, XcmOriginToTransactDispatchOrigin, -}; -use parachains_common::xcm_config::ConcreteAssetFromSystem; -// ParentRelayOrSiblingParachains - -use frame_support::{ - pallet_prelude::Get, - parameter_types, - traits::{ConstU32, ConstU8, Contains, ContainsPair, Disabled, Everything, Nothing}, - weights::Weight, -}; - -pub use common_runtime::fee::WeightToFee; - -use staging_xcm::latest::prelude::*; - -use frame_system::EnsureRoot; - -use xcm_executor::XcmExecutor; - -use polkadot_runtime_common::impls::ToAuthor; - -pub type ForeignAssetsAssetId = Location; - -parameter_types! { - pub CheckingAccount: AccountId = PolkadotXcm::check_account(); -} - -parameter_types! { - // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - // XCM instruction weight cost - pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024); - pub const MaxInstructions: u32 = 100; - pub const MaxAssetsIntoHolding: u32 = 64; -} - - - -parameter_types! { - pub RelayPerSecondAndByte: (AssetId, u128,u128) = (Location::new(1,Here).into(), default_fee_per_second(), 1024); - pub const RelayLocation: Location = Location::parent(); - pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())].into(); - pub HereLocation: Location = Location::here(); -} - -const ASSET_HUB_ID: u32 = 1000; - -parameter_types! { - pub NativeToken: AssetId = AssetId(Location::here()); - pub NativeTokenFilter: AssetFilter = Wild(AllOf { fun: WildFungible, id: NativeToken::get() }); - pub AssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]); - pub NativeForAssetHub: (AssetFilter, Location) = (NativeTokenFilter::get(), AssetHubLocation::get()); -} - -pub type TrustedTeleporter = staging_xcm_builder::Case; - -pub struct ParentOrParentsExecutivePlurality; -impl Contains for ParentOrParentsExecutivePlurality { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (1, []) | (1, [Plurality { id: BodyId::Executive, .. }])) - } -} - -/// Type for specifying how a `Location` can be converted into an `AccountId`. -///// Transactors /////// -pub type ForeignAssetsAdapter = FungiblesAdapter< - ForeignAssets, - // Use this currency when it is a fungible asset matching the given location or name: - MatchedConvertedConcreteId< - Location, - u128, - IsParentsOnly>, - xcm_executor::traits::JustTry, - xcm_executor::traits::JustTry, - >, - // Convert an XCM Location into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We do not allow teleportation of foreign assets. We only allow the reserve-based - // transfer of USDT, USDC and DOT. - NoChecking, - CheckingAccount, ->; - -/// Means for transacting assets on this chain. -/// How xcm deals with assets on this chain -pub type LocalAssetTransactor = FungibleAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // Do a simple punn to convert an AccountId32 Location into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -pub type AssetTransactors = (LocalAssetTransactor, ForeignAssetsAdapter); - -pub type Barrier = TrailingSetTopicAsId< - DenyThenTry< - DenyRecursively, - ( - TakeWeightCredit, - WithComputedOrigin< - ( - // we constraint this one so that we limit who can execute instructions - AllowTopLevelPaidExecutionFrom, - AllowExplicitUnpaidExecutionFrom, - // ^^^ Parent and its exec plurality get free execution - // Subscriptions for version tracking are OK. - // AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), - >, ->; - -pub struct AssetFrom(core::marker::PhantomData); - -impl> ContainsPair for AssetFrom { - fn contains(_asset: &Asset, location: &Location) -> bool { - let prefix = T::get(); - location == &prefix - } -} - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; - type XcmEventEmitter = PolkadotXcm; - // How to withdraw and deposit an asset. - type AssetTransactor = AssetTransactors; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = (NativeAsset, ConcreteAssetFromSystem, AssetFrom); - // in order to register our asset in asset hub - // once the asset is registered we can teleport our native asset to asset hub - type IsTeleporter = TrustedTeleporter; - type UniversalLocation = UniversalLocation; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = - (FixedRateOfFungible, UsingComponents>,); - type ResponseHandler = PolkadotXcm; - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; - type SubscriptionService = PolkadotXcm; - type PalletInstancesInfo = AllPalletsWithSystem; - type MaxAssetsIntoHolding = MaxAssetsIntoHolding; - type AssetLocker = (); - type AssetExchanger = (); - type FeeManager = (); - type MessageExporter = (); - type UniversalAliases = Nothing; - type CallDispatcher = RuntimeCall; - type SafeCallFilter = Everything; - type Aliasers = Nothing; - type TransactionalProcessor = FrameTransactionalProcessor; - type HrmpNewChannelOpenRequestHandler = (); - type HrmpChannelAcceptedHandler = (); - type HrmpChannelClosingHandler = (); - type XcmRecorder = PolkadotXcm; -} - -/// Converts a local signed origin into an XCM location. Forms the basis for local origins -/// sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = WithUniqueTopic<( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -)>; - -impl pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - // update to Nothing and create extrinsic - type XcmExecuteFilter = Everything; - // ^ Disable dispatchable execute on the XCM pallet. - // Needs to be `Everything` for local testing. - type XcmExecutor = XcmExecutor; - // update to only allow to teleport native - type XcmTeleportFilter = Everything; - // Lets only allow reserve transfers of DOT - type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type UniversalLocation = UniversalLocation; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - // ^ Override for AdvertisedXcmVersion default - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = Balances; - type CurrencyMatcher = (); - type TrustedLockers = (); - // I do not thingk we need this - type SovereignAccountOf = LocationToAccountId; - /// Not sure what this is for? - type MaxLockers = ConstU32<8>; - type WeightInfo = pallet_xcm::TestWeightInfo; - type AdminOrigin = EnsureRoot; - type MaxRemoteLockConsumers = ConstU32<0>; - type RemoteLockConsumerIdentifier = (); - // Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`. - type AuthorizedAliasConsideration = Disabled; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; -} - -/// Simple conversion of `u32` into an `AssetId` for use in benchmarking. -#[cfg(feature = "runtime-benchmarks")] -pub struct XcmBenchmarkHelper; -#[cfg(feature = "runtime-benchmarks")] -impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { - fn create_asset_id_parameter(id: u32) -> ForeignAssetsAssetId { - Location::new(1, [Parachain(id)]) - } -}