diff --git a/Cargo.lock b/Cargo.lock index 48d09f239e1..5fcf9573b1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,6 +166,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.8", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.19" @@ -498,7 +510,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "async-trait", @@ -532,7 +544,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "beefy-gadget", "futures 0.3.25", @@ -551,7 +563,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "sp-api", "sp-beefy", @@ -1320,7 +1332,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", + "memoffset 0.6.5", "scopeguard", ] @@ -1422,7 +1434,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "clap", "parity-scale-codec", @@ -1437,7 +1449,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1460,7 +1472,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -1483,7 +1495,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1506,7 +1518,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1529,7 +1541,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", @@ -1552,7 +1564,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1580,7 +1592,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1597,7 +1609,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1620,12 +1632,13 @@ dependencies = [ "sp-std", "sp-trie", "sp-version", + "xcm", ] [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1636,7 +1649,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1652,15 +1665,17 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "log", "parity-scale-codec", + "polkadot-runtime-common", "rand_chacha 0.3.1", "scale-info", + "sp-io", "sp-runtime", "sp-std", "xcm", @@ -1670,7 +1685,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -1680,12 +1695,13 @@ dependencies = [ "sp-runtime", "sp-std", "sp-trie", + "xcm", ] [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1708,7 +1724,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "futures 0.3.25", @@ -1721,12 +1737,14 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "frame-support", "log", "parity-scale-codec", + "polkadot-runtime-common", + "sp-io", "sp-runtime", "sp-std", "xcm", @@ -1737,7 +1755,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1762,7 +1780,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1782,7 +1800,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "array-bytes 6.0.0", "async-trait", @@ -1790,7 +1808,7 @@ dependencies = [ "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures 0.3.25", - "lru", + "lru 0.9.0", "polkadot-core-primitives", "polkadot-network-bridge", "polkadot-node-network-protocol", @@ -1822,7 +1840,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1830,7 +1848,7 @@ dependencies = [ "futures 0.3.25", "futures-timer", "jsonrpsee", - "lru", + "lru 0.9.0", "parity-scale-codec", "polkadot-service", "sc-client-api", @@ -1851,7 +1869,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2055,6 +2073,17 @@ dependencies = [ "syn", ] +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_builder" version = "0.11.2" @@ -2291,7 +2320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek 3.2.0", - "hashbrown", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "sha2 0.9.9", @@ -2639,13 +2668,12 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "async-trait", "fc-db", "fp-consensus", "fp-rpc", - "sc-client-api", "sc-consensus", "sp-api", "sp-block-builder", @@ -2658,7 +2686,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2677,7 +2705,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fc-db", "fp-consensus", @@ -2694,13 +2722,14 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "ethereum", "ethereum-types", "evm", "fc-db", "fc-rpc-core", + "fc-storage", "fp-ethereum", "fp-rpc", "fp-storage", @@ -2709,7 +2738,7 @@ dependencies = [ "jsonrpsee", "libsecp256k1", "log", - "lru", + "lru 0.8.1", "parity-scale-codec", "prometheus", "rand 0.8.5", @@ -2728,7 +2757,6 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-storage", "substrate-prometheus-endpoint", "tokio", ] @@ -2736,7 +2764,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "ethereum", "ethereum-types", @@ -2746,6 +2774,24 @@ dependencies = [ "serde_json", ] +[[package]] +name = "fc-storage" +version = "1.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" +dependencies = [ + "ethereum", + "ethereum-types", + "fp-rpc", + "fp-storage", + "parity-scale-codec", + "sc-client-api", + "sp-api", + "sp-blockchain", + "sp-io", + "sp-runtime", + "sp-storage", +] + [[package]] name = "fdlimit" version = "0.2.1" @@ -2863,7 +2909,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", ] @@ -2880,7 +2926,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "ethereum", "parity-scale-codec", @@ -2892,7 +2938,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "ethereum", "ethereum-types", @@ -2906,20 +2952,21 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "evm", "frame-support", "parity-scale-codec", "serde", "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "ethereum", "ethereum-types", @@ -2935,7 +2982,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "frame-support", "parity-scale-codec", @@ -2947,7 +2994,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "parity-scale-codec", "serde", @@ -2962,9 +3009,10 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", + "frame-support-procedural", "frame-system", "linregress", "log", @@ -2980,12 +3028,13 @@ dependencies = [ "sp-runtime-interface", "sp-std", "sp-storage", + "static_assertions", ] [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "Inflector", "array-bytes 4.1.0", @@ -3032,7 +3081,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3043,7 +3092,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3060,7 +3109,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -3089,7 +3138,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "log", @@ -3105,7 +3154,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "bitflags", "frame-metadata", @@ -3137,10 +3186,11 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "Inflector", "cfg-expr", + "derive-syn-parse", "frame-support-procedural-tools", "itertools", "proc-macro2", @@ -3151,7 +3201,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -3163,7 +3213,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro2", "quote", @@ -3173,7 +3223,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "log", @@ -3191,7 +3241,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -3206,7 +3256,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "sp-api", @@ -3215,7 +3265,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "parity-scale-codec", @@ -3566,7 +3616,16 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", ] [[package]] @@ -3897,7 +3956,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] @@ -4173,8 +4232,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "frame-benchmarking", @@ -4270,8 +4329,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-support", "polkadot-primitives", @@ -4446,7 +4505,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "lru", + "lru 0.8.1", "prost", "prost-build", "prost-codec", @@ -4903,7 +4962,16 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "lru" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.2", ] [[package]] @@ -4971,6 +5039,7 @@ dependencies = [ "parity-scale-codec", "tokio", "xcm", + "xcm-primitives", ] [[package]] @@ -5051,6 +5120,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.31.0" @@ -5058,7 +5136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -5129,7 +5207,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "log", @@ -5148,7 +5226,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "anyhow", "jsonrpsee", @@ -5543,6 +5621,7 @@ dependencies = [ "fc-consensus", "fc-db", "fc-rpc", + "fc-storage", "fp-rpc", "futures 0.3.25", "hex-literal", @@ -5600,6 +5679,7 @@ dependencies = [ "fc-consensus", "fc-rpc", "fc-rpc-core", + "fc-storage", "fp-rpc", "futures 0.3.25", "jsonrpsee", @@ -6315,7 +6395,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.37#9d2cd21e902f583b47e6710c52f8e65c52bcc46b" +source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.38#63531b7f16300606cbbc0456741f91da68c38905" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -6346,7 +6426,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.37#9d2cd21e902f583b47e6710c52f8e65c52bcc46b" +source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.38#63531b7f16300606cbbc0456741f91da68c38905" dependencies = [ "async-trait", "frame-benchmarking", @@ -6371,7 +6451,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -6383,7 +6463,21 @@ dependencies = [ "bitflags", "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", + "static_assertions", ] [[package]] @@ -6408,6 +6502,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -6539,7 +6642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", - "hashbrown", + "hashbrown 0.12.3", "indexmap", "memchr", ] @@ -6639,7 +6742,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.37#536b291262dbd2c28c7464b24dbb7a83678a4906" +source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.38#fbf6c52dab120b1cbf756fa642d5fb1016378ae4" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -6648,6 +6751,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -6657,7 +6761,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.37#536b291262dbd2c28c7464b24dbb7a83678a4906" +source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.38#fbf6c52dab120b1cbf756fa642d5fb1016378ae4" dependencies = [ "frame-support", "parity-scale-codec", @@ -6671,7 +6775,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.37#536b291262dbd2c28c7464b24dbb7a83678a4906" +source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.38#fbf6c52dab120b1cbf756fa642d5fb1016378ae4" dependencies = [ "frame-support", "orml-traits", @@ -6685,7 +6789,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.37#536b291262dbd2c28c7464b24dbb7a83678a4906" +source = "git+https://github.com/purestake/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.38#fbf6c52dab120b1cbf756fa642d5fb1016378ae4" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6754,7 +6858,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -6769,7 +6873,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.37#9d2cd21e902f583b47e6710c52f8e65c52bcc46b" +source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.38#63531b7f16300606cbbc0456741f91da68c38905" dependencies = [ "frame-benchmarking", "frame-support", @@ -6780,7 +6884,6 @@ dependencies = [ "scale-info", "sp-api", "sp-application-crypto", - "sp-authorship", "sp-inherents", "sp-runtime", "sp-std", @@ -6809,7 +6912,7 @@ dependencies = [ [[package]] name = "pallet-author-slot-filter" version = "0.9.0" -source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.37#9d2cd21e902f583b47e6710c52f8e65c52bcc46b" +source = "git+https://github.com/purestake/nimbus?branch=moonbeam-polkadot-v0.9.38#63531b7f16300606cbbc0456741f91da68c38905" dependencies = [ "frame-benchmarking", "frame-support", @@ -6827,7 +6930,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -6843,14 +6946,13 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-authorship", "sp-runtime", "sp-std", ] @@ -6858,7 +6960,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -6882,7 +6984,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6902,7 +7004,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -6917,7 +7019,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", "frame-support", @@ -6931,7 +7033,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -6947,7 +7049,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "beefy-merkle-tree", @@ -6970,7 +7072,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -6988,7 +7090,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7007,7 +7109,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7024,7 +7126,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7041,7 +7143,7 @@ dependencies = [ [[package]] name = "pallet-crowdloan-rewards" version = "0.6.0" -source = "git+https://github.com/purestake/crowdloan-rewards?branch=moonbeam-polkadot-v0.9.37#24b1051b9e75c64a03b2472e272a479a1759d58a" +source = "git+https://github.com/purestake/crowdloan-rewards?branch=moonbeam-polkadot-v0.9.38#ef020ac94552977fe4e4f407dd9da045afd36b10" dependencies = [ "ed25519-dalek", "frame-benchmarking", @@ -7063,7 +7165,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7081,7 +7183,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7104,7 +7206,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7117,7 +7219,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7155,7 +7257,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "environmental", "ethereum", @@ -7200,6 +7302,7 @@ dependencies = [ "fp-evm", "fp-rpc", "fp-self-contained", + "frame-benchmarking", "frame-support", "frame-system", "hex", @@ -7224,7 +7327,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "environmental", "evm", @@ -7233,6 +7336,7 @@ dependencies = [ "frame-support", "frame-system", "hex", + "impl-trait-for-tuples", "log", "pallet-timestamp", "parity-scale-codec", @@ -7330,7 +7434,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", ] @@ -7338,7 +7442,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", "sp-core", @@ -7403,6 +7507,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "xcm-primitives", ] [[package]] @@ -7493,7 +7598,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", "frame-support", @@ -7503,7 +7608,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", "num", @@ -7682,7 +7787,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", "tiny-keccak", @@ -7691,7 +7796,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.37#8e2ad9637e03c9150b419a9abe21ce5ffc0a92f5" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.38#a78776b80b553c0734704f556e652602a62b9a85" dependencies = [ "fp-evm", "ripemd", @@ -7827,7 +7932,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7845,7 +7950,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7868,7 +7973,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7884,7 +7989,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7904,7 +8009,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7938,7 +8043,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7978,7 +8083,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8013,7 +8118,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8029,7 +8134,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8045,7 +8150,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8062,7 +8167,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8082,7 +8187,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "sp-api", @@ -8092,7 +8197,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8109,12 +8214,13 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", + "log", "pallet-babe", "pallet-balances", "pallet-grandpa", @@ -8153,7 +8259,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8170,7 +8276,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8227,7 +8333,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8245,7 +8351,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8260,7 +8366,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8279,7 +8385,7 @@ dependencies = [ [[package]] name = "pallet-root-testing" version = "1.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8294,7 +8400,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8311,7 +8417,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8332,7 +8438,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8348,7 +8454,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8362,7 +8468,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8385,7 +8491,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8396,7 +8502,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "log", "sp-arithmetic", @@ -8405,7 +8511,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8422,7 +8528,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8436,7 +8542,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8454,7 +8560,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8473,7 +8579,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-support", "frame-system", @@ -8489,7 +8595,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8505,7 +8611,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8517,7 +8623,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8534,7 +8640,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8550,7 +8656,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8565,7 +8671,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8579,9 +8685,10 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "log", @@ -8589,6 +8696,7 @@ dependencies = [ "scale-info", "serde", "sp-core", + "sp-io", "sp-runtime", "sp-std", "xcm", @@ -8597,8 +8705,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -8606,9 +8714,11 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", + "sp-io", "sp-runtime", "sp-std", "xcm", + "xcm-builder", "xcm-executor", ] @@ -8641,7 +8751,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.37#5f977c2a76ee969f3cbe4f531b64b75c2e92bf2b" +source = "git+https://github.com/purestake/cumulus?branch=moonbeam-polkadot-v0.9.38#27cbefe132ca7866f61afb54f360457102cee1b8" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -8652,9 +8762,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a7511a0bec4a336b5929999d02b560d2439c993cccf98c26481484e811adc43" +checksum = "dd684a725651d9588ef21f140a328b6b4f64e646b2e931f3e6f14f75eedf9980" dependencies = [ "blake2", "crc32fast", @@ -8671,9 +8781,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.2.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" +checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -8686,9 +8796,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.3" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8941,8 +9051,8 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "polkadot-node-metrics", @@ -8956,8 +9066,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -8970,13 +9080,13 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "derive_more", "fatality", "futures 0.3.25", - "lru", + "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -8993,12 +9103,12 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "fatality", "futures 0.3.25", - "lru", + "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -9014,8 +9124,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "clap", "frame-benchmarking-cli", @@ -9029,6 +9139,7 @@ dependencies = [ "sc-cli", "sc-executor", "sc-service", + "sc-storage-monitor", "sc-sysinfo", "sc-tracing", "sp-core", @@ -9041,8 +9152,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "frame-benchmarking", @@ -9086,8 +9197,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "always-assert", "bitvec", @@ -9108,8 +9219,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "parity-scale-codec", "scale-info", @@ -9120,15 +9231,15 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "derive_more", "fatality", "futures 0.3.25", "futures-timer", "indexmap", - "lru", + "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -9145,8 +9256,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9159,8 +9270,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "futures-timer", @@ -9179,8 +9290,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "always-assert", "async-trait", @@ -9203,8 +9314,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "parity-scale-codec", @@ -9221,15 +9332,15 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "derive_more", "futures 0.3.25", "futures-timer", "kvdb", - "lru", + "lru 0.9.0", "merlin", "parity-scale-codec", "polkadot-node-jaeger", @@ -9250,8 +9361,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "futures 0.3.25", @@ -9270,8 +9381,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "fatality", @@ -9289,8 +9400,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -9304,8 +9415,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "futures 0.3.25", @@ -9323,8 +9434,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "polkadot-node-metrics", @@ -9338,8 +9449,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "futures-timer", @@ -9355,13 +9466,13 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "fatality", "futures 0.3.25", "kvdb", - "lru", + "lru 0.9.0", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -9374,8 +9485,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "futures 0.3.25", @@ -9391,8 +9502,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "fatality", @@ -9409,8 +9520,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "always-assert", "assert_matches", @@ -9441,8 +9552,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", "polkadot-node-primitives", @@ -9457,11 +9568,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "futures 0.3.25", - "lru", + "lru 0.9.0", "polkadot-node-metrics", "polkadot-node-subsystem", "polkadot-node-subsystem-types", @@ -9472,8 +9583,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "lazy_static", "log", @@ -9490,8 +9601,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bs58", "futures 0.3.25", @@ -9509,8 +9620,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "derive_more", @@ -9532,8 +9643,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bounded-vec", "futures 0.3.25", @@ -9554,8 +9665,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9564,8 +9675,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "derive_more", @@ -9587,8 +9698,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "derive_more", @@ -9597,7 +9708,7 @@ dependencies = [ "futures-channel", "itertools", "kvdb", - "lru", + "lru 0.9.0", "parity-db", "parity-scale-codec", "parking_lot 0.11.2", @@ -9620,13 +9731,13 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "futures 0.3.25", "futures-timer", - "lru", + "lru 0.9.0", "orchestra", "parking_lot 0.12.1", "polkadot-node-metrics", @@ -9643,8 +9754,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "derive_more", "frame-support", @@ -9659,8 +9770,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "env_logger", "kusama-runtime", @@ -9674,8 +9785,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "hex-literal", @@ -9700,8 +9811,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -9732,8 +9843,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "frame-benchmarking", @@ -9821,8 +9932,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "frame-benchmarking", @@ -9838,6 +9949,7 @@ dependencies = [ "pallet-balances", "pallet-beefy-mmr", "pallet-election-provider-multi-phase", + "pallet-fast-unstake", "pallet-session", "pallet-staking", "pallet-staking-reward-fn", @@ -9869,8 +9981,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-support", "polkadot-primitives", @@ -9883,8 +9995,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bs58", "parity-scale-codec", @@ -9895,8 +10007,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitflags", "bitvec", @@ -9938,11 +10050,12 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "async-trait", "beefy-gadget", + "frame-benchmarking-cli", "frame-support", "frame-system-rpc-runtime-api", "futures 0.3.25", @@ -9951,7 +10064,8 @@ dependencies = [ "kusama-runtime-constants", "kvdb", "kvdb-rocksdb", - "lru", + "log", + "lru 0.9.0", "mmr-gadget", "pallet-babe", "pallet-im-online", @@ -10047,8 +10161,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -10068,8 +10182,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10286,13 +10400,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] @@ -10814,8 +10927,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "beefy-merkle-tree", "frame-benchmarking", @@ -10900,8 +11013,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-support", "polkadot-primitives", @@ -11107,7 +11220,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "log", "sp-core", @@ -11118,7 +11231,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -11145,7 +11258,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "futures-timer", @@ -11168,7 +11281,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -11184,7 +11297,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -11199,7 +11312,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11210,7 +11323,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "chrono", @@ -11250,7 +11363,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "fnv", "futures 0.3.25", @@ -11276,7 +11389,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "hash-db", "kvdb", @@ -11289,6 +11402,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-state-db", + "schnellru", "sp-arithmetic", "sp-blockchain", "sp-core", @@ -11301,7 +11415,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -11326,7 +11440,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -11355,7 +11469,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "fork-tree", @@ -11393,7 +11507,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -11415,7 +11529,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11428,7 +11542,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "assert_matches", "async-trait", @@ -11462,7 +11576,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -11485,9 +11599,9 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ - "lru", + "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor-common", @@ -11509,7 +11623,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -11522,7 +11636,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "log", "sc-allocator", @@ -11535,7 +11649,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "cfg-if", "libc", @@ -11552,9 +11666,9 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ - "ahash", + "ahash 0.8.3", "array-bytes 4.1.0", "async-trait", "dyn-clone", @@ -11592,7 +11706,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "finality-grandpa", "futures 0.3.25", @@ -11612,7 +11726,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "ansi_term", "futures 0.3.25", @@ -11627,7 +11741,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "async-trait", @@ -11642,7 +11756,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "async-trait", @@ -11656,7 +11770,7 @@ dependencies = [ "ip_network", "libp2p", "log", - "lru", + "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", @@ -11684,7 +11798,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "cid", "futures 0.3.25", @@ -11703,7 +11817,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "bitflags", @@ -11729,14 +11843,14 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ - "ahash", + "ahash 0.8.3", "futures 0.3.25", "futures-timer", "libp2p", "log", - "lru", + "lru 0.8.1", "sc-network-common", "sc-peerset", "sp-runtime", @@ -11747,7 +11861,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "futures 0.3.25", @@ -11768,7 +11882,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "async-trait", @@ -11776,7 +11890,7 @@ dependencies = [ "futures 0.3.25", "libp2p", "log", - "lru", + "lru 0.8.1", "mockall", "parity-scale-codec", "prost", @@ -11800,7 +11914,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "futures 0.3.25", @@ -11819,7 +11933,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "bytes", @@ -11849,7 +11963,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "libp2p", @@ -11862,7 +11976,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -11871,7 +11985,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -11895,12 +12009,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-version", + "tokio", ] [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11919,7 +12034,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "http", "jsonrpsee", @@ -11934,7 +12049,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "futures 0.3.25", @@ -11960,7 +12075,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "directories", @@ -11991,6 +12106,7 @@ dependencies = [ "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", + "sc-storage-monitor", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -12025,7 +12141,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "log", "parity-scale-codec", @@ -12033,10 +12149,26 @@ dependencies = [ "sp-core", ] +[[package]] +name = "sc-storage-monitor" +version = "0.1.0" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" +dependencies = [ + "clap", + "futures 0.3.25", + "log", + "nix 0.26.2", + "sc-client-db", + "sc-utils", + "sp-core", + "thiserror", + "tokio", +] + [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12055,7 +12187,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "libc", @@ -12074,7 +12206,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "chrono", "futures 0.3.25", @@ -12093,7 +12225,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "ansi_term", "atty", @@ -12124,7 +12256,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12135,13 +12267,14 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", "futures-timer", "linked-hash-map", "log", + "num-traits", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", @@ -12161,7 +12294,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -12175,7 +12308,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "backtrace", "futures 0.3.25", @@ -12222,6 +12355,17 @@ dependencies = [ "windows-sys 0.36.1", ] +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.3", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -12588,8 +12732,8 @@ dependencies = [ [[package]] name = "slot-range-helper" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "enumn", "parity-scale-codec", @@ -12666,7 +12810,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "hash-db", "log", @@ -12684,7 +12828,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "blake2", "proc-macro-crate", @@ -12696,7 +12840,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -12709,7 +12853,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "integer-sqrt", "num-traits", @@ -12723,7 +12867,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -12733,22 +12877,10 @@ dependencies = [ "sp-std", ] -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-beefy" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -12765,7 +12897,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "sp-api", @@ -12777,11 +12909,11 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "log", - "lru", + "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", "sp-api", @@ -12795,7 +12927,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -12813,7 +12945,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "parity-scale-codec", @@ -12831,7 +12963,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "merlin", @@ -12854,7 +12986,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -12866,7 +12998,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -12879,7 +13011,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "base58", @@ -12921,7 +13053,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "blake2", "byteorder", @@ -12935,7 +13067,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro2", "quote", @@ -12946,7 +13078,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -12955,7 +13087,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "proc-macro2", "quote", @@ -12965,7 +13097,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "environmental", "parity-scale-codec", @@ -12976,7 +13108,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "finality-grandpa", "log", @@ -12994,7 +13126,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13008,7 +13140,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "bytes", "ed25519", @@ -13033,7 +13165,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "lazy_static", "sp-core", @@ -13044,7 +13176,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures 0.3.25", @@ -13061,7 +13193,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "thiserror", "zstd", @@ -13070,7 +13202,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13088,7 +13220,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -13102,7 +13234,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "sp-api", "sp-core", @@ -13112,7 +13244,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "backtrace", "lazy_static", @@ -13122,7 +13254,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "rustc-hash", "serde", @@ -13132,7 +13264,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "either", "hash256-std-hasher", @@ -13154,7 +13286,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13172,7 +13304,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "Inflector", "proc-macro-crate", @@ -13184,7 +13316,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -13198,7 +13330,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -13210,7 +13342,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "hash-db", "log", @@ -13230,12 +13362,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -13248,7 +13380,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "futures-timer", @@ -13263,7 +13395,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "sp-std", @@ -13275,7 +13407,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "sp-api", "sp-runtime", @@ -13284,7 +13416,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "log", @@ -13300,18 +13432,18 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ - "ahash", + "ahash 0.8.3", "hash-db", - "hashbrown", + "hashbrown 0.12.3", "lazy_static", - "lru", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", "scale-info", + "schnellru", "sp-core", "sp-std", "thiserror", @@ -13323,7 +13455,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -13340,7 +13472,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -13351,7 +13483,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "impl-trait-for-tuples", "log", @@ -13364,7 +13496,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "parity-scale-codec", "scale-info", @@ -13570,7 +13702,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "platforms", ] @@ -13588,7 +13720,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.25", @@ -13607,7 +13739,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "hyper", "log", @@ -13619,7 +13751,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "async-trait", "jsonrpsee", @@ -13632,7 +13764,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "jsonrpsee", "log", @@ -13651,7 +13783,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "array-bytes 4.1.0", "async-trait", @@ -13677,7 +13809,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "beefy-merkle-tree", "cfg-if", @@ -13720,7 +13852,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "futures 0.3.25", "parity-scale-codec", @@ -13739,7 +13871,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "ansi_term", "build-helper", @@ -14142,6 +14274,23 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" + +[[package]] +name = "toml_edit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" +dependencies = [ + "indexmap", + "nom8", + "toml_datetime", +] + [[package]] name = "tower" version = "0.4.13" @@ -14229,8 +14378,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -14240,8 +14389,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -14301,7 +14450,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", "log", "rustc-hex", "smallvec", @@ -14390,7 +14539,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.37#946507ba9ef13e263534176b7b74e26fc56efbd4" +source = "git+https://github.com/purestake/substrate?branch=moonbeam-polkadot-v0.9.38#7c3cf43a55a25988516f39823de8ff3e8e89b1bb" dependencies = [ "clap", "frame-remote-externalities", @@ -14754,9 +14903,9 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.110.2" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68e8037b4daf711393f4be2056246d12d975651b14d581520ad5d1f19219cec" +checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" dependencies = [ "anyhow", "libc", @@ -14770,9 +14919,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.110.2" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91adbad477e97bba3fbd21dd7bfb594e7ad5ceb9169ab1c93ab9cb0ada636b6f" +checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" dependencies = [ "anyhow", "cxx", @@ -14782,9 +14931,9 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.110.2" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4fa5a322a4e6ac22fd141f498d56afbdbf9df5debeac32380d2dcaa3e06941" +checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" dependencies = [ "anyhow", "cc", @@ -14997,7 +15146,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset", + "memoffset 0.6.5", "paste", "rand 0.8.5", "rustix 0.35.13", @@ -15282,8 +15431,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "bitvec", "frame-benchmarking", @@ -15327,6 +15476,7 @@ dependencies = [ "pallet-society", "pallet-staking", "pallet-staking-reward-curve", + "pallet-state-trie-migration", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", @@ -15372,8 +15522,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-support", "polkadot-primitives", @@ -15654,25 +15804,28 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "derivative", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-runtime", + "serde", + "sp-core", + "sp-weights", "xcm-procedural", ] [[package]] name = "xcm-builder" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "pallet-transaction-payment", "parity-scale-codec", @@ -15688,9 +15841,10 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ + "environmental", "frame-benchmarking", "frame-support", "impl-trait-for-tuples", @@ -15701,6 +15855,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-weights", "xcm", ] @@ -15711,6 +15866,7 @@ dependencies = [ "cumulus-primitives-core", "ethereum", "ethereum-types", + "frame-benchmarking", "frame-support", "frame-system", "hex", @@ -15731,8 +15887,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "Inflector", "proc-macro2", @@ -15742,8 +15898,8 @@ dependencies = [ [[package]] name = "xcm-simulator" -version = "0.9.37" -source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.37#b4b818d89bf62fa552e7eb0c3aa7aa015ffbb20c" +version = "0.9.38" +source = "git+https://github.com/purestake/polkadot?branch=moonbeam-polkadot-v0.9.38#3628ce602a2d386afde9383d620eb5a5106db5ae" dependencies = [ "frame-support", "parity-scale-codec", diff --git a/Cargo.toml b/Cargo.toml index 8a9a99c0288..659a2f50a21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,7 @@ precompile-utils = { path = "precompiles/utils", default-features = false } session-keys-primitives = { path = "primitives/session-keys", default-features = false } xcm-primitives = { path = "primitives/xcm", default-features = false } -pallet-crowdloan-rewards = { git = "https://github.com/purestake/crowdloan-rewards", branch = "moonbeam-polkadot-v0.9.37", default-features = false } +pallet-crowdloan-rewards = { git = "https://github.com/purestake/crowdloan-rewards", branch = "moonbeam-polkadot-v0.9.38", default-features = false } # Moonbeam (client) moonbeam-cli = { path = "node/cli", default-features = false } @@ -121,94 +121,94 @@ moonbeam-runtime = { path = "runtime/moonbeam" } moonriver-runtime = { path = "runtime/moonriver" } # Substrate (wasm) -frame-benchmarking = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -frame-executive = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -frame-support = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -frame-system = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -frame-system-benchmarking = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -frame-try-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-assets = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-balances = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-collective = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-conviction-voting = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-democracy = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-identity = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-preimage = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-proxy = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-referenda = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-root-testing = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-scheduler = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-society = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-staking = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-sudo = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-timestamp = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-transaction-payment = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-treasury = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-utility = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-whitelist = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] } +frame-benchmarking = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +frame-executive = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +frame-support = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +frame-system = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +frame-system-benchmarking = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +frame-try-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-assets = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-balances = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-collective = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-conviction-voting = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-democracy = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-identity = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-preimage = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-proxy = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-referenda = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-root-testing = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-scheduler = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-society = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-staking = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-sudo = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-timestamp = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-transaction-payment = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-treasury = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-utility = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-whitelist = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +parity-scale-codec = { version = "3.2.2", default-features = false, features = [ "derive" ] } scale-info = { version = "2.0", default-features = false, features = [ "derive" ] } -sp-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-application-crypto = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-block-builder = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-consensus-babe = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-consensus-vrf = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-core = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-debug-derive = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-externalities = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-inherents = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-io = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-keystore = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-offchain = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-runtime-interface = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-session = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-std = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-transaction-pool = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -sp-version = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false } +sp-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-application-crypto = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-block-builder = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-consensus-babe = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-consensus-vrf = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-core = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-debug-derive = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-externalities = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-inherents = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-io = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-keystore = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-offchain = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-runtime-interface = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-session = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-std = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-transaction-pool = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +sp-version = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38", default-features = false } substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } # Substrate (client) -frame-benchmarking-cli = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -pallet-transaction-payment-rpc = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-basic-authorship = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-block-builder = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-chain-spec = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-cli = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-client-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-client-db = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-consensus = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-consensus-manual-seal = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-executor = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-finality-grandpa = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-informant = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-network = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-network-common = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-rpc = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-rpc-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-service = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-sysinfo = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-telemetry = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-tracing = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-transaction-pool = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-transaction-pool-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sc-utils = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-blockchain = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-consensus = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-storage = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-timestamp = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-trie = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-wasm-interface = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-build-script-utils = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-frame-rpc-system = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-prometheus-endpoint = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-test-client = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-test-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-test-runtime-client = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -substrate-wasm-builder = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -try-runtime-cli = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } +frame-benchmarking-cli = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +pallet-transaction-payment-rpc = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-basic-authorship = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-block-builder = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-chain-spec = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-cli = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-client-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-client-db = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-consensus = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-consensus-manual-seal = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-executor = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-finality-grandpa = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-informant = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-network = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-network-common = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-rpc = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-rpc-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-service = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-sysinfo = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-telemetry = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-tracing = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-transaction-pool = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-transaction-pool-api = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sc-utils = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sp-blockchain = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sp-consensus = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sp-storage = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sp-timestamp = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sp-trie = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +sp-wasm-interface = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-build-script-utils = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-frame-rpc-system = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-prometheus-endpoint = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-test-client = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-test-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-test-runtime-client = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +substrate-wasm-builder = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } +try-runtime-cli = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.38" } # Frontier (wasm) ethereum = { version = "0.14.0", default-features = false, features = [ "with-codec" ] } @@ -216,80 +216,81 @@ ethereum-types = { version = "0.14", default-features = false } evm = { version = "0.37.0", default-features = false, features = [ "with-codec" ] } evm-gasometer = { version = "0.37.0", default-features = false } evm-runtime = { version = "0.37.0", default-features = false } -fp-ethereum = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -fp-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -fp-self-contained = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-base-fee = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-ethereum = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false, features = [ "forbid-evm-reentrancy" ] } -pallet-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false, features = [ "forbid-evm-reentrancy" ] } -pallet-evm-precompile-blake2 = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false } +fp-ethereum = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +fp-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +fp-self-contained = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-base-fee = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-ethereum = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false, features = [ "forbid-evm-reentrancy" ] } +pallet-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false, features = [ "forbid-evm-reentrancy" ] } +pallet-evm-precompile-blake2 = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", default-features = false } # Frontier (client) -fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } -fc-db = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } -fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", features = [ "rpc-binary-search-estimate" ] } -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } -fp-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } -fp-storage = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } +fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } +fc-db = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } +fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38", features = [ "rpc-binary-search-estimate" ] } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } +fc-storage = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } +fp-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } +fp-storage = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.38" } # Cumulus / Nimbus (wasm) -cumulus-pallet-dmp-queue = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-primitives-core = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-primitives-parachain-inherent = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-primitives-timestamp = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-primitives-utility = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -cumulus-test-relay-sproof-builder = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -nimbus-primitives = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-author-inherent = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-author-slot-filter = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -parachain-info = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-primitives-core = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +cumulus-test-relay-sproof-builder = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +nimbus-primitives = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-author-inherent = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-author-slot-filter = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +parachain-info = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38", default-features = false } # Cumulus / Nimbus (client) -cumulus-client-cli = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-client-collator = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-client-consensus-common = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-client-consensus-relay-chain = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-client-network = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-client-service = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-relay-chain-inprocess-interface = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-relay-chain-interface = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-relay-chain-minimal-node = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -cumulus-relay-chain-rpc-interface = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.37" } -nimbus-consensus = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.37" } +cumulus-client-cli = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-client-collator = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-client-consensus-common = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-client-consensus-relay-chain = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-client-network = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-client-service = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-relay-chain-interface = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-relay-chain-minimal-node = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +cumulus-relay-chain-rpc-interface = { git = "https://github.com/purestake/cumulus", branch = "moonbeam-polkadot-v0.9.38" } +nimbus-consensus = { git = "https://github.com/purestake/nimbus", branch = "moonbeam-polkadot-v0.9.38" } # Polkadot / XCM (wasm) -orml-traits = { git = "https://github.com/purestake/open-runtime-module-library", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -orml-xcm-support = { git = "https://github.com/purestake/open-runtime-module-library", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -orml-xtokens = { git = "https://github.com/purestake/open-runtime-module-library", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-xcm = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -pallet-xcm-benchmarks = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -polkadot-core-primitives = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -polkadot-parachain = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -xcm = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -xcm-builder = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } -xcm-executor = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false } +orml-traits = { git = "https://github.com/purestake/open-runtime-module-library", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +orml-xcm-support = { git = "https://github.com/purestake/open-runtime-module-library", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +orml-xtokens = { git = "https://github.com/purestake/open-runtime-module-library", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-xcm = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +polkadot-core-primitives = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +polkadot-parachain = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +xcm = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +xcm-builder = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } +xcm-executor = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38", default-features = false } # Polkadot / XCM (client) -kusama-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -polkadot-cli = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -polkadot-primitives = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -polkadot-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -polkadot-runtime-common = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -polkadot-runtime-parachains = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -polkadot-service = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -rococo-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -westend-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } -xcm-simulator = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37" } +kusama-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +polkadot-cli = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +polkadot-primitives = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +polkadot-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +polkadot-runtime-common = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +polkadot-runtime-parachains = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +polkadot-service = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +rococo-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +westend-runtime = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } +xcm-simulator = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.38" } # Other (wasm) affix = "0.1.2" diff --git a/client/rpc-core/debug/Cargo.toml b/client/rpc-core/debug/Cargo.toml index 6ecffd7309b..c693d636d41 100644 --- a/client/rpc-core/debug/Cargo.toml +++ b/client/rpc-core/debug/Cargo.toml @@ -16,4 +16,4 @@ moonbeam-rpc-core-types = { workspace = true } serde = { workspace = true, features = [ "derive" ] } serde_json = { workspace = true } -sp-core = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } +sp-core = { workspace = true, features = [ "std" ] } diff --git a/client/rpc/debug/Cargo.toml b/client/rpc/debug/Cargo.toml index 7728d512962..19578062895 100644 --- a/client/rpc/debug/Cargo.toml +++ b/client/rpc/debug/Cargo.toml @@ -35,4 +35,5 @@ ethereum-types = { workspace = true, features = [ "std" ] } fc-consensus = { workspace = true } fc-db = { workspace = true } fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] } +fc-storage = { workspace = true } fp-rpc = { workspace = true, features = [ "std" ] } diff --git a/client/rpc/debug/src/lib.rs b/client/rpc/debug/src/lib.rs index 5598caaaa51..ca836ebe86e 100644 --- a/client/rpc/debug/src/lib.rs +++ b/client/rpc/debug/src/lib.rs @@ -308,7 +308,7 @@ where frontier_backend.as_ref(), eth_hash, ) { - Ok(Some(id)) => Ok(id), + Ok(Some(hash)) => Ok(BlockId::Hash(hash)), Ok(_) => Err(internal_err("Block hash not found".to_string())), Err(e) => Err(e), } @@ -331,16 +331,13 @@ where // Get parent blockid. let parent_block_id = BlockId::Hash(*header.parent_hash()); - let schema = frontier_backend_client::onchain_storage_schema::( - client.as_ref(), - reference_id, - ); + let schema = fc_storage::onchain_storage_schema::(client.as_ref(), hash); // Using storage overrides we align with `:ethereum_schema` which will result in proper // SCALE decoding in case of migration. let statuses = match overrides.schemas.get(&schema) { Some(schema) => schema - .current_transaction_statuses(&reference_id) + .current_transaction_statuses(hash) .unwrap_or_default(), _ => { return Err(internal_err(format!( @@ -446,7 +443,7 @@ where frontier_backend.as_ref(), hash, ) { - Ok(Some(hash)) => hash, + Ok(Some(hash)) => BlockId::Hash(hash), Ok(_) => return Err(internal_err("Block hash not found".to_string())), Err(e) => return Err(e), }; @@ -482,19 +479,17 @@ where )); }; - let schema = frontier_backend_client::onchain_storage_schema::( - client.as_ref(), - reference_id, - ); + let schema = + fc_storage::onchain_storage_schema::(client.as_ref(), reference_hash); // Get the block that contains the requested transaction. Using storage overrides we align // with `:ethereum_schema` which will result in proper SCALE decoding in case of migration. let reference_block = match overrides.schemas.get(&schema) { - Some(schema) => schema.current_block(&reference_id), + Some(schema) => schema.current_block(reference_hash), _ => { return Err(internal_err(format!( "No storage override at {:?}", - reference_id + reference_hash ))) } }; diff --git a/client/rpc/finality/src/lib.rs b/client/rpc/finality/src/lib.rs index 870ec8a3e1e..ee00c6876f7 100644 --- a/client/rpc/finality/src/lib.rs +++ b/client/rpc/finality/src/lib.rs @@ -20,7 +20,6 @@ use std::{marker::PhantomData, sync::Arc}; //TODO ideally we wouldn't depend on BlockId here. Can we change frontier // so it's load_hash helper returns an H256 instead of wrapping it in a BlockId? use fc_db::Backend as FrontierBackend; -use sp_api::BlockId; use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block; @@ -90,8 +89,7 @@ fn is_block_finalized_inner, C: HeaderBackend + 'static let substrate_hash = match frontier_backend_client::load_hash::(client, backend, raw_hash)? { // If we find this hash in the frontier data base, we know it is an eth hash - Some(BlockId::Hash(hash)) => hash, - Some(BlockId::Number(_)) => panic!("is_canon test only works with hashes."), + Some(hash) => hash, // Otherwise, we assume this is a Substrate hash. None => raw_hash, }; diff --git a/client/rpc/manual-xcm/Cargo.toml b/client/rpc/manual-xcm/Cargo.toml index b41c3b59372..010bdd1669b 100644 --- a/client/rpc/manual-xcm/Cargo.toml +++ b/client/rpc/manual-xcm/Cargo.toml @@ -17,3 +17,4 @@ tokio = { workspace = true, features = [ "sync", "time" ] } xcm = { workspace = true } cumulus-primitives-core = { workspace = true, features = [ "std" ] } +xcm-primitives = { workspace = true, features = [ "std" ] } diff --git a/client/rpc/manual-xcm/src/lib.rs b/client/rpc/manual-xcm/src/lib.rs index 66dc9ebc7cd..cd3899b473e 100644 --- a/client/rpc/manual-xcm/src/lib.rs +++ b/client/rpc/manual-xcm/src/lib.rs @@ -18,6 +18,8 @@ use cumulus_primitives_core::XcmpMessageFormat; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use parity_scale_codec::Encode; use xcm::latest::prelude::*; +use xcm::opaque::lts::Weight; +use xcm_primitives::DEFAULT_PROOF_SIZE; /// This RPC interface is used to manually submit XCM messages that will be injected into a /// parachain-enabled runtime. This allows testing XCM logic in a controlled way in integration @@ -57,20 +59,19 @@ impl ManualXcmApiServer for ManualXcm { let downward_message_channel = self.downward_message_channel.clone(); // If no message is supplied, inject a default one. let msg = if msg.is_empty() { - xcm::VersionedXcm::<()>::V2(Xcm(vec![ - ReserveAssetDeposited((Parent, 10000000000000).into()), + xcm::VersionedXcm::<()>::V3(Xcm(vec![ + ReserveAssetDeposited((Parent, 10000000000000u128).into()), ClearOrigin, BuyExecution { - fees: (Parent, 10000000000000).into(), - weight_limit: Limited(4_000_000_000), + fees: (Parent, 10000000000000u128).into(), + weight_limit: Limited(Weight::from_parts(4_000_000_000u64, DEFAULT_PROOF_SIZE)), }, DepositAsset { - assets: All.into(), - max_assets: 1, + assets: AllCounted(1).into(), beneficiary: MultiLocation::new( 0, X1(AccountKey20 { - network: Any, + network: None, key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"), }), ), @@ -98,22 +99,24 @@ impl ManualXcmApiServer for ManualXcm { let msg = if msg.is_empty() { let mut mes = XcmpMessageFormat::ConcatenatedVersionedXcm.encode(); mes.append( - &mut (xcm::VersionedXcm::<()>::V2(Xcm(vec![ + &mut (xcm::VersionedXcm::<()>::V3(Xcm(vec![ ReserveAssetDeposited( - ((Parent, Parachain(sender.into())), 10000000000000).into(), + ((Parent, Parachain(sender.into())), 10000000000000u128).into(), ), ClearOrigin, BuyExecution { - fees: ((Parent, Parachain(sender.into())), 10000000000000).into(), - weight_limit: Limited(4_000_000_000), + fees: ((Parent, Parachain(sender.into())), 10000000000000u128).into(), + weight_limit: Limited(Weight::from_parts( + 4_000_000_000u64, + DEFAULT_PROOF_SIZE, + )), }, DepositAsset { - assets: All.into(), - max_assets: 1, + assets: AllCounted(1).into(), beneficiary: MultiLocation::new( 0, X1(AccountKey20 { - network: Any, + network: None, key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"), }), ), diff --git a/client/rpc/trace/Cargo.toml b/client/rpc/trace/Cargo.toml index 6d381b31b1b..ee846f7da5c 100644 --- a/client/rpc/trace/Cargo.toml +++ b/client/rpc/trace/Cargo.toml @@ -39,4 +39,5 @@ sp-transaction-pool = { workspace = true } fc-consensus = { workspace = true } fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] } fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } fp-rpc = { workspace = true } diff --git a/client/rpc/trace/src/lib.rs b/client/rpc/trace/src/lib.rs index 57d8ffedd42..e0f80d08e00 100644 --- a/client/rpc/trace/src/lib.rs +++ b/client/rpc/trace/src/lib.rs @@ -42,7 +42,7 @@ use sp_blockchain::{ use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; use ethereum_types::H256; -use fc_rpc::{frontier_backend_client, OverrideHandle}; +use fc_rpc::OverrideHandle; use fp_rpc::EthereumRuntimeRPCApi; use moonbeam_client_evm_tracing::{ @@ -774,8 +774,6 @@ where substrate_hash: H256, overrides: Arc>, ) -> TxsTraceRes { - let substrate_block_id = BlockId::Hash(substrate_hash); - // Get Subtrate block data. let api = client.runtime_api(); let block_header = client @@ -786,31 +784,29 @@ where substrate_hash, e ) })? - .ok_or_else(|| format!("Subtrate block {} don't exist", substrate_block_id))?; + .ok_or_else(|| format!("Subtrate block {} don't exist", substrate_hash))?; let height = *block_header.number(); let substrate_parent_id = BlockId::::Hash(*block_header.parent_hash()); - let schema = frontier_backend_client::onchain_storage_schema::( - client.as_ref(), - substrate_block_id, - ); + let schema = + fc_storage::onchain_storage_schema::(client.as_ref(), substrate_hash); // Get Ethereum block data. let (eth_block, eth_transactions) = match overrides.schemas.get(&schema) { Some(schema) => match ( - schema.current_block(&substrate_block_id), - schema.current_transaction_statuses(&substrate_block_id), + schema.current_block(substrate_hash), + schema.current_transaction_statuses(substrate_hash), ) { (Some(a), Some(b)) => (a, b), _ => { return Err(format!( "Failed to get Ethereum block data for Substrate block {}", - substrate_block_id + substrate_hash )) } }, - _ => return Err(format!("No storage override at {:?}", substrate_block_id)), + _ => return Err(format!("No storage override at {:?}", substrate_hash)), }; let eth_block_hash = eth_block.header.hash(); diff --git a/node/service/src/client.rs b/node/service/src/client.rs index d5e7e3cdcb7..ff138e5aaef 100644 --- a/node/service/src/client.rs +++ b/node/service/src/client.rs @@ -320,7 +320,7 @@ impl sc_client_api::StorageProvider for Client { prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< - KeyIterator<'a, >::State, Block>, + KeyIterator<>::State, Block>, > { match_client!(self, storage_keys_iter(hash, prefix, start_key)) } @@ -350,7 +350,7 @@ impl sc_client_api::StorageProvider for Client { prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< - KeyIterator<'a, >::State, Block>, + KeyIterator<>::State, Block>, > { match_client!( self, diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 96807fdad0f..834692128e8 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -30,7 +30,7 @@ use cumulus_client_network::BlockAnnounceValidator; use cumulus_client_service::{ prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams, }; -use cumulus_primitives_core::relay_chain::v2::CollatorPair; +use cumulus_primitives_core::relay_chain::CollatorPair; use cumulus_primitives_core::ParaId; use cumulus_primitives_parachain_inherent::{ MockValidationDataInherentDataProvider, MockXcmConfig, diff --git a/node/service/src/rpc.rs b/node/service/src/rpc.rs index 2eb0295a580..4aaeb9c60fb 100644 --- a/node/service/src/rpc.rs +++ b/node/service/src/rpc.rs @@ -121,30 +121,26 @@ pub struct TracingConfig { pub trace_filter_max_count: u32, } -pub fn overrides_handle(client: Arc) -> Arc> +pub fn overrides_handle(client: Arc) -> Arc> where - C: ProvideRuntimeApi + StorageProvider + AuxStore, - C: HeaderBackend + HeaderMetadata, - C: Send + Sync + 'static, - C::Api: fp_rpc::EthereumRuntimeRPCApi, - BE: Backend + 'static, - BE::State: StateBackend, + B: BlockT, + C: ProvideRuntimeApi, + C::Api: EthereumRuntimeRPCApi, + C: HeaderBackend + StorageProvider + 'static, + BE: Backend + 'static, { let mut overrides_map = BTreeMap::new(); overrides_map.insert( EthereumStorageSchema::V1, - Box::new(SchemaV1Override::new(client.clone())) - as Box + Send + Sync>, + Box::new(SchemaV1Override::new(client.clone())) as Box>, ); overrides_map.insert( EthereumStorageSchema::V2, - Box::new(SchemaV2Override::new(client.clone())) - as Box + Send + Sync>, + Box::new(SchemaV2Override::new(client.clone())) as Box>, ); overrides_map.insert( EthereumStorageSchema::V3, - Box::new(SchemaV3Override::new(client.clone())) - as Box + Send + Sync>, + Box::new(SchemaV3Override::new(client.clone())) as Box>, ); Arc::new(OverrideHandle { diff --git a/pallets/asset-manager/src/migrations.rs b/pallets/asset-manager/src/migrations.rs index 22cad203646..71f3e98858c 100644 --- a/pallets/asset-manager/src/migrations.rs +++ b/pallets/asset-manager/src/migrations.rs @@ -15,14 +15,15 @@ // along with Moonbeam. If not, see . use crate::{AssetIdType, AssetTypeId, AssetTypeUnitsPerSecond, Config, SupportedFeePaymentAssets}; +#[cfg(feature = "try-runtime")] +use frame_support::storage::{generator::StorageValue, migration::get_storage_value}; use frame_support::{ pallet_prelude::PhantomData, storage::migration::storage_key_iter, traits::{Get, OnRuntimeUpgrade}, weights::Weight, - Blake2_128Concat, + Blake2_128Concat, StoragePrefixedMap, }; -#[cfg(feature = "try-runtime")] use parity_scale_codec::{Decode, Encode}; //TODO sometimes this is unused, sometimes its necessary use sp_std::vec::Vec; @@ -534,3 +535,375 @@ impl OnRuntimeUpgrade for PopulateSupportedFeePaymentAssets { Ok(()) } } + +#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode)] +pub(crate) enum OldAssetType { + Xcm(xcm::v2::MultiLocation), +} + +impl Into> for OldAssetType { + fn into(self) -> Option { + match self { + Self::Xcm(location) => Some(location), + } + } +} + +#[cfg(feature = "try-runtime")] +#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode)] +enum PreUpgradeState { + AssetIdType(Vec<(T::AssetId, OldAssetType)>), + AssetTypeId(Vec<(OldAssetType, T::AssetId)>), + AssetTypeUnitsPerSecond(Vec<(OldAssetType, u128)>), + SupportedFeePaymentAssets(Vec), +} + +#[cfg(feature = "try-runtime")] +#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode)] +enum PostUpgradeState { + AssetIdType(Vec<(T::AssetId, T::ForeignAssetType)>), + AssetTypeId(Vec<(T::ForeignAssetType, T::AssetId)>), + AssetTypeUnitsPerSecond(Vec<(T::ForeignAssetType, u128)>), + SupportedFeePaymentAssets(Vec), +} + +#[cfg(feature = "try-runtime")] +impl From> for PostUpgradeState +where + T::ForeignAssetType: From, +{ + fn from(pre: PreUpgradeState) -> PostUpgradeState { + match pre { + PreUpgradeState::AssetIdType(items) => { + let mut out: Vec<(T::AssetId, T::ForeignAssetType)> = Vec::new(); + for (key, value) in items.into_iter() { + let old_multilocation: Option = value.into(); + let old_multilocation: xcm::v2::MultiLocation = + old_multilocation.expect("old storage convert to XcmV2 Multilocation"); + let new_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("Multilocation v2 to v3"); + out.push((key, new_multilocation.into())); + } + PostUpgradeState::AssetIdType(out) + } + PreUpgradeState::AssetTypeId(items) => { + let mut out: Vec<(T::ForeignAssetType, T::AssetId)> = Vec::new(); + for (key, value) in items.into_iter() { + let old_multilocation: Option = key.into(); + let old_multilocation: xcm::v2::MultiLocation = + old_multilocation.expect("old storage convert to XcmV2 Multilocation"); + let new_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("Multilocation v2 to v3"); + let new_key: T::ForeignAssetType = new_multilocation.into(); + out.push((new_key, value)); + } + PostUpgradeState::AssetTypeId(out) + } + PreUpgradeState::AssetTypeUnitsPerSecond(items) => { + let mut out: Vec<(T::ForeignAssetType, u128)> = Vec::new(); + for (key, value) in items.into_iter() { + let old_multilocation: Option = key.into(); + let old_multilocation: xcm::v2::MultiLocation = + old_multilocation.expect("old storage convert to XcmV2 Multilocation"); + let new_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("Multilocation v2 to v3"); + out.push((new_multilocation.into(), value)); + } + PostUpgradeState::AssetTypeUnitsPerSecond(out) + } + PreUpgradeState::SupportedFeePaymentAssets(items) => { + let mut out: Vec = Vec::new(); + for value in items.into_iter() { + let old_multilocation: Option = value.into(); + let old_multilocation: xcm::v2::MultiLocation = + old_multilocation.expect("old storage convert to XcmV2 Multilocation"); + let new_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("Multilocation v2 to v3"); + out.push(new_multilocation.into()); + } + PostUpgradeState::SupportedFeePaymentAssets(out) + } + } + } +} + +pub struct XcmV2ToV3AssetManager(PhantomData); +impl OnRuntimeUpgrade for XcmV2ToV3AssetManager +where + T::ForeignAssetType: From, +{ + fn on_runtime_upgrade() -> Weight { + log::trace!( + target: "XcmV2ToV3AssetManager", + "Running XcmV2ToV3AssetManager migration" + ); + // Migrates the pallet's storage from Xcm V2 to V3: + // - AssetIdType -> migrate map's value + // - AssetTypeId -> migrate map's key + // - AssetTypeUnitsPerSecond -> migrate map's key + // - SupportedFeePaymentAssets -> migrate value + + // Shared module prefix + let module_prefix = AssetIdType::::module_prefix(); + // AssetTypeId + let asset_type_id_storage_prefix = AssetTypeId::::storage_prefix(); + // AssetTypeUnitsPerSecond + let units_per_second_storage_prefix = AssetTypeUnitsPerSecond::::storage_prefix(); + + // Db (read, write) count + let mut db_weight_count: (u64, u64) = (0, 0); + + // Migrate `AssetIdType` value + let _ = AssetIdType::::translate::(|_key, value| { + db_weight_count.0 += 1; + db_weight_count.1 += 1; + let old_multilocation: Option = value.into(); + let old_multilocation: xcm::v2::MultiLocation = + old_multilocation.expect("old storage convert to XcmV2 Multilocation"); + let new_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("Multilocation v2 to v3"); + Some(new_multilocation.into()) + }); + + // Migrate `AssetTypeId` key + db_weight_count.0 += 1; + let old_data = storage_key_iter::( + &module_prefix, + asset_type_id_storage_prefix, + ) + .drain() + .collect::>(); + for (old_key, value) in old_data { + db_weight_count.1 += 1; + let old_key: Option = old_key.into(); + let old_key: xcm::v2::MultiLocation = + old_key.expect("old storage convert to XcmV2 Multilocation"); + let v3_multilocation: MultiLocation = + old_key.try_into().expect("Multilocation v2 to v3"); + let new_key: T::ForeignAssetType = v3_multilocation.into(); + AssetTypeId::::insert(new_key, value); + } + + // Migrate `AssetTypeUnitsPerSecond` key + db_weight_count.0 += 1; + let old_data = storage_key_iter::( + &module_prefix, + units_per_second_storage_prefix, + ) + .drain() + .collect::>(); + for (old_key, value) in old_data { + db_weight_count.1 += 1; + let old_key: Option = old_key.into(); + let old_key: xcm::v2::MultiLocation = + old_key.expect("old storage convert to XcmV2 Multilocation"); + let v3_multilocation: MultiLocation = + old_key.try_into().expect("Multilocation v2 to v3"); + let new_key: T::ForeignAssetType = v3_multilocation.into(); + AssetTypeUnitsPerSecond::::insert(new_key, value); + } + + // Migrate `SupportedFeePaymentAssets` value + let _ = SupportedFeePaymentAssets::::translate::, _>(|value| { + db_weight_count.0 += 1; + db_weight_count.1 += 1; + let new_value: Vec = value + .unwrap_or_default() + .into_iter() + .map(|old_value| { + let old_multilocation: Option = old_value.into(); + let old_multilocation: xcm::v2::MultiLocation = + old_multilocation.expect("old storage convert to XcmV2 Multilocation"); + let new_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("Multilocation v2 to v3"); + new_multilocation.into() + }) + .collect(); + Some(new_value) + }); + + T::DbWeight::get().reads_writes(db_weight_count.0, db_weight_count.1) + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + log::trace!( + target: "XcmV2ToV3AssetManager", + "Running XcmV2ToV3AssetManager pre_upgrade hook" + ); + // Shared module prefix + let module_prefix = AssetIdType::::module_prefix(); + // AssetIdType + let asset_id_type_storage_prefix = AssetIdType::::storage_prefix(); + // AssetTypeId + let asset_type_id_storage_prefix = AssetTypeId::::storage_prefix(); + // AssetTypeUnitsPerSecond + let units_per_second_storage_prefix = AssetTypeUnitsPerSecond::::storage_prefix(); + // SupportedFeePaymentAssets + let supported_fee_storage_prefix = SupportedFeePaymentAssets::::storage_prefix(); + + let mut result: Vec> = Vec::new(); + + // AssetIdType pre-upgrade data + let asset_id_type_storage_data: Vec<_> = storage_key_iter::< + T::AssetId, + OldAssetType, + Blake2_128Concat, + >(module_prefix, asset_id_type_storage_prefix) + .collect(); + result.push(PreUpgradeState::::AssetIdType( + asset_id_type_storage_data, + )); + + // AssetTypeId pre-upgrade data + let asset_type_id_storage_data: Vec<_> = storage_key_iter::< + OldAssetType, + T::AssetId, + Blake2_128Concat, + >(module_prefix, asset_type_id_storage_prefix) + .collect(); + result.push(PreUpgradeState::::AssetTypeId( + asset_type_id_storage_data, + )); + + // AssetTypeUnitsPerSecond pre-upgrade data + let units_per_second_storage_data: Vec<_> = + storage_key_iter::( + module_prefix, + units_per_second_storage_prefix, + ) + .collect(); + result.push(PreUpgradeState::::AssetTypeUnitsPerSecond( + units_per_second_storage_data, + )); + + // SupportedFeePaymentAssets pre-upgrade data + let supported_fee_storage_data: Vec<_> = get_storage_value::>( + module_prefix, + supported_fee_storage_prefix, + &[], + ) + .expect("SupportedFeePaymentAssets value"); + result.push(PreUpgradeState::::SupportedFeePaymentAssets( + supported_fee_storage_data, + )); + + Ok(result.encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: Vec) -> Result<(), &'static str> { + log::trace!( + target: "XcmV2ToV3AssetManager", + "Running XcmV2ToV3AssetManager post_upgrade hook" + ); + let pre_upgrade_state: Vec> = + Decode::decode(&mut &state[..]).expect("pre_upgrade provides a valid state; qed"); + + // Shared module prefix + let module_prefix = AssetIdType::::module_prefix(); + // AssetIdType + let asset_id_type_storage_prefix = AssetIdType::::storage_prefix(); + // AssetTypeId + let asset_type_id_storage_prefix = AssetTypeId::::storage_prefix(); + // AssetTypeUnitsPerSecond + let units_per_second_storage_prefix = AssetTypeUnitsPerSecond::::storage_prefix(); + + // First we convert pre-state to post-state. This is equivalent to what the migration + // should do. If this conversion and the result of the migration match, we consider it a + // success. + let to_post_upgrade: Vec> = pre_upgrade_state + .into_iter() + .map(|value| value.into()) + .collect(); + + // Because the order of the storage and the pre-upgrade vector is likely different, + // we encode everything, which is easier to sort and compare. + let mut expected_post_upgrade_state: Vec> = Vec::new(); + for item in to_post_upgrade.iter() { + match item { + // Vec<(T::AssetId, T::ForeignAssetType)> + PostUpgradeState::AssetIdType(items) => { + for inner in items.into_iter() { + expected_post_upgrade_state.push(inner.encode()) + } + } + // Vec<(T::ForeignAssetType, T::AssetId)> + PostUpgradeState::AssetTypeId(items) => { + for inner in items.into_iter() { + expected_post_upgrade_state.push(inner.encode()) + } + } + // Vec<(T::ForeignAssetType, u128)> + PostUpgradeState::AssetTypeUnitsPerSecond(items) => { + for inner in items.into_iter() { + expected_post_upgrade_state.push(inner.encode()) + } + } + // Vec + PostUpgradeState::SupportedFeePaymentAssets(items) => { + for inner in items.into_iter() { + expected_post_upgrade_state.push(inner.encode()) + } + } + } + } + + // Then we retrieve the actual state after migration. + let mut actual_post_upgrade_state: Vec> = Vec::new(); + + // Actual AssetIdType post-upgrade data + let asset_id_type_storage_data: Vec<_> = storage_key_iter::< + T::AssetId, + T::ForeignAssetType, + Blake2_128Concat, + >(module_prefix, asset_id_type_storage_prefix) + .collect(); + for item in asset_id_type_storage_data.iter() { + actual_post_upgrade_state.push(item.encode()) + } + + // Actual AssetTypeId post-upgrade data + let asset_type_id_storage_data: Vec<_> = storage_key_iter::< + T::ForeignAssetType, + T::AssetId, + Blake2_128Concat, + >(module_prefix, asset_type_id_storage_prefix) + .collect(); + for item in asset_type_id_storage_data.iter() { + actual_post_upgrade_state.push(item.encode()) + } + + // Actual AssetTypeUnitsPerSecond post-upgrade data + let units_per_second_storage_data: Vec<_> = + storage_key_iter::( + module_prefix, + units_per_second_storage_prefix, + ) + .collect(); + for item in units_per_second_storage_data.iter() { + actual_post_upgrade_state.push(item.encode()) + } + + // Actual SupportedFeePaymentAssets post-upgrade data + let supported_fee_storage_data: Vec<_> = SupportedFeePaymentAssets::::get(); + for item in supported_fee_storage_data.iter() { + actual_post_upgrade_state.push(item.encode()) + } + + // Both state blobs are sorted. + expected_post_upgrade_state.sort(); + actual_post_upgrade_state.sort(); + + // Assert equality + assert_eq!(expected_post_upgrade_state, actual_post_upgrade_state); + + Ok(()) + } +} diff --git a/pallets/asset-manager/src/mock.rs b/pallets/asset-manager/src/mock.rs index 36d7d75a66a..bc9a895cfdd 100644 --- a/pallets/asset-manager/src/mock.rs +++ b/pallets/asset-manager/src/mock.rs @@ -110,8 +110,8 @@ parameter_types! { pub type AssetId = u32; #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, TypeInfo)] pub enum MockAssetType { - MockAsset(AssetId), Xcm(MultiLocation), + MockAsset(AssetId), } impl Default for MockAssetType { diff --git a/pallets/asset-manager/src/tests.rs b/pallets/asset-manager/src/tests.rs index 69eef27089b..009035d7214 100644 --- a/pallets/asset-manager/src/tests.rs +++ b/pallets/asset-manager/src/tests.rs @@ -843,3 +843,151 @@ fn test_destroy_local_asset_works() { ]); }); } + +#[test] +fn xcm_v2_to_v3_asset_id_type_storage_migration_works() { + ExtBuilder::default().build().execute_with(|| { + use frame_support::StorageHasher; + let pallet_prefix: &[u8] = b"AssetManager"; + let storage_item_prefix: &[u8] = b"AssetIdType"; + use frame_support::traits::OnRuntimeUpgrade; + use parity_scale_codec::Encode; + + let statemine_para_id = mock::StatemineParaIdInfo::get(); + + let old_multilocation = xcm::v2::MultiLocation { + parents: 1, + interior: xcm::v2::Junctions::X2( + xcm::v2::Junction::Parachain(statemine_para_id), + xcm::v2::Junction::GeneralIndex(1), + ), + }; + let old_asset_type = crate::migrations::OldAssetType::Xcm(old_multilocation.clone()); + + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&1u32.encode()), + old_asset_type, + ); + + crate::migrations::XcmV2ToV3AssetManager::::on_runtime_upgrade(); + + let new_expected_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("convert xcm v2 into v3"); + let new_actual_multilocation: MockAssetType = + AssetManager::asset_id_type(1).expect("migrated to xcm v3"); + assert!(new_actual_multilocation == MockAssetType::Xcm(new_expected_multilocation)); + }); +} + +#[test] +fn xcm_v2_to_v3_asset_type_id_storage_migration_works() { + ExtBuilder::default().build().execute_with(|| { + use frame_support::StorageHasher; + let pallet_prefix: &[u8] = b"AssetManager"; + let storage_item_prefix: &[u8] = b"AssetTypeId"; + use frame_support::traits::OnRuntimeUpgrade; + use parity_scale_codec::Encode; + + let statemine_para_id = mock::StatemineParaIdInfo::get(); + + let old_multilocation = xcm::v2::MultiLocation { + parents: 1, + interior: xcm::v2::Junctions::X2( + xcm::v2::Junction::Parachain(statemine_para_id), + xcm::v2::Junction::GeneralIndex(1), + ), + }; + let old_asset_type = crate::migrations::OldAssetType::Xcm(old_multilocation.clone()); + + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&old_asset_type.encode()), + 1u32, + ); + + crate::migrations::XcmV2ToV3AssetManager::::on_runtime_upgrade(); + + let new_expected_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("convert xcm v2 into v3"); + let new_value: u32 = + AssetManager::asset_type_id(MockAssetType::Xcm(new_expected_multilocation)) + .expect("migrated to xcm v3"); + assert!(new_value == 1); + }); +} + +#[test] +fn xcm_v2_to_v3_units_per_second_storage_migration_works() { + ExtBuilder::default().build().execute_with(|| { + use frame_support::StorageHasher; + let pallet_prefix: &[u8] = b"AssetManager"; + let storage_item_prefix: &[u8] = b"AssetTypeUnitsPerSecond"; + use frame_support::traits::OnRuntimeUpgrade; + use parity_scale_codec::Encode; + + let statemine_para_id = mock::StatemineParaIdInfo::get(); + + let old_multilocation = xcm::v2::MultiLocation { + parents: 1, + interior: xcm::v2::Junctions::X2( + xcm::v2::Junction::Parachain(statemine_para_id), + xcm::v2::Junction::GeneralIndex(1), + ), + }; + let old_asset_type = crate::migrations::OldAssetType::Xcm(old_multilocation.clone()); + + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&old_asset_type.encode()), + 1u128, + ); + + crate::migrations::XcmV2ToV3AssetManager::::on_runtime_upgrade(); + + let new_expected_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("convert xcm v2 into v3"); + let new_value: u128 = AssetManager::asset_type_units_per_second(MockAssetType::Xcm( + new_expected_multilocation, + )) + .expect("migrated to xcm v3"); + assert!(new_value == 1); + }); +} + +#[test] +fn xcm_v2_to_v3_supported_assets_storage_migration_works() { + ExtBuilder::default().build().execute_with(|| { + let pallet_prefix: &[u8] = b"AssetManager"; + let storage_item_prefix: &[u8] = b"SupportedFeePaymentAssets"; + use frame_support::traits::OnRuntimeUpgrade; + + let statemine_para_id = mock::StatemineParaIdInfo::get(); + + let old_multilocation = xcm::v2::MultiLocation { + parents: 1, + interior: xcm::v2::Junctions::X2( + xcm::v2::Junction::Parachain(statemine_para_id), + xcm::v2::Junction::GeneralIndex(1), + ), + }; + let old_asset_types = vec![crate::migrations::OldAssetType::Xcm( + old_multilocation.clone(), + )]; + + put_storage_value(pallet_prefix, storage_item_prefix, &[], old_asset_types); + crate::migrations::XcmV2ToV3AssetManager::::on_runtime_upgrade(); + + let new_expected_value: MultiLocation = old_multilocation + .try_into() + .expect("convert xcm v2 into v3"); + let new_value = AssetManager::supported_fee_payment_assets(); + assert!(new_value == vec![MockAssetType::Xcm(new_expected_value)]); + }); +} diff --git a/pallets/erc20-xcm-bridge/src/erc20_matcher.rs b/pallets/erc20-xcm-bridge/src/erc20_matcher.rs index 30d70875cea..56ed7362828 100644 --- a/pallets/erc20-xcm-bridge/src/erc20_matcher.rs +++ b/pallets/erc20-xcm-bridge/src/erc20_matcher.rs @@ -101,7 +101,7 @@ mod tests { PalletInstance(42u8), AccountKey20 { key: [0; 20], - network: NetworkId::Any, + network: None, }, ), }; diff --git a/pallets/erc20-xcm-bridge/src/erc20_trap.rs b/pallets/erc20-xcm-bridge/src/erc20_trap.rs index b1bf0be3988..93359ec4596 100644 --- a/pallets/erc20-xcm-bridge/src/erc20_trap.rs +++ b/pallets/erc20-xcm-bridge/src/erc20_trap.rs @@ -26,6 +26,7 @@ impl DropAssets for AssetTrapWrapper xcm::latest::Weight { // Remove all erc20 assets let assets_to_remove: Vec<_> = assets @@ -42,6 +43,6 @@ impl DropAssets for AssetTrapWrapper XcmResult { + fn deposit_asset( + what: &MultiAsset, + who: &MultiLocation, + _context: &XcmContext, + ) -> XcmResult { let (contract_address, amount) = Erc20Matcher::::matches_fungibles(what)?; @@ -164,6 +167,7 @@ pub mod pallet { asset: &MultiAsset, from: &MultiLocation, to: &MultiLocation, + _context: &XcmContext, ) -> Result { let (contract_address, amount) = Erc20Matcher::::matches_fungibles(asset)?; @@ -190,7 +194,11 @@ pub mod pallet { // one (1 to withdraw the asset and a second one to deposit it). // In order to perform only one evm call, we just trace the origin of the asset, // and then the transfer will only really be performed in the deposit instruction. - fn withdraw_asset(what: &MultiAsset, who: &MultiLocation) -> Result { + fn withdraw_asset( + what: &MultiAsset, + who: &MultiLocation, + _context: Option<&XcmContext>, + ) -> Result { let (contract_address, amount) = Erc20Matcher::::matches_fungibles(what)?; let who = T::AccountIdConverter::convert_ref(who) diff --git a/pallets/erc20-xcm-bridge/src/xcm_exec_filter.rs b/pallets/erc20-xcm-bridge/src/xcm_exec_filter.rs deleted file mode 100644 index 445d2015d73..00000000000 --- a/pallets/erc20-xcm-bridge/src/xcm_exec_filter.rs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. - -// Moonbeam is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Moonbeam is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . - -use frame_support::traits::Contains; -use xcm::latest::prelude::*; - -type RuntimeCallOf = ::RuntimeCall; - -/// Morph a given "xcm execution" filter implementation into one which filter out -/// some XCM instructions if they could manipulate erc20 assets. -/// If your runtime allows arbitrary xcm messages to be executed locally you should use this -// wrapper. -pub struct XcmExecuteFilterWrapper( - core::marker::PhantomData<(Runtime, InnerFilter)>, -); - -impl Contains<(MultiLocation, Xcm>)> - for XcmExecuteFilterWrapper -where - T: crate::Config, - InnerFilter: Contains<(MultiLocation, Xcm>)>, -{ - fn contains(tuple: &(MultiLocation, Xcm>)) -> bool { - Self::inner_contains(tuple) && InnerFilter::contains(tuple) - } -} - -impl XcmExecuteFilterWrapper -where - T: crate::Config, - InnerFilter: Contains<(MultiLocation, Xcm>)>, -{ - // To be sure that the execution of this message will not lead to instructions incompatible - // with the erc20 assets to manipulate them, we must "quickly simulate" the execution of the - // message to know what will be in the xcm holding when we wait for the problematic - // instructions. - fn inner_contains((_location, message): &(MultiLocation, Xcm>)) -> bool { - // Track erc20 assets in the "simulated xcm holding" - let mut erc20_assets = sp_std::collections::btree_set::BTreeSet::new(); - for instruction in &message.0 { - match instruction { - // Fill in the "simulated xcm holding" - Instruction::WithdrawAsset(assets) => { - for asset in assets.inner() { - if crate::Pallet::::is_erc20_asset(asset) { - erc20_assets.insert(&asset.id); - } - } - } - // Take erc20 assets from the "simulated xcm holding" - Instruction::DepositAsset { assets, .. } - | Instruction::DepositReserveAsset { assets, .. } => match assets { - MultiAssetFilter::Wild(All) => { - erc20_assets = Default::default(); - } - MultiAssetFilter::Wild(AllOf { - fun: WildFungible, - id, - }) => { - erc20_assets.remove(id); - } - MultiAssetFilter::Wild(AllOf { - fun: WildNonFungible, - .. - }) => {} - MultiAssetFilter::Definite(_assets) => { - // If we wanted a perfect simulation, we would have to remove the assets - // defined according to their amounts, but this would involve calculations - // on the balances. - // To keep the simulation fast, we voluntarily choose to do nothing here, - // This implies to refuse some messages that are not problematic but that - // would take too long to check properly. - } - }, - // Theses instructions should never handle erc20 assets - // So, if the "simulated xcm holding" contains erc20 assets compatibles with - // the `MultiAssetFilter` the message should be forbid. - Instruction::InitiateReserveWithdraw { assets, .. } - | Instruction::InitiateTeleport { assets, .. } => match assets { - MultiAssetFilter::Wild(All) => { - if !erc20_assets.is_empty() { - return false; - } - } - MultiAssetFilter::Wild(AllOf { - fun: WildFungible, - id, - }) => { - if erc20_assets.contains(id) { - return false; - } - } - MultiAssetFilter::Wild(AllOf { - fun: WildNonFungible, - .. - }) => {} - MultiAssetFilter::Definite(assets) => { - for asset in assets.inner() { - if erc20_assets.contains(&asset.id) { - return false; - } - } - } - }, - // We don't care of any other XCM instructions - _ => {} - } - } - true - } -} diff --git a/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs b/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs index 4bff4277a3d..942f3f9a7e2 100644 --- a/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs +++ b/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs @@ -16,7 +16,6 @@ //! Module that provides types to extend xcm holding. -use core::marker::PhantomData; use sp_core::{H160, U256}; use sp_std::collections::btree_map::BTreeMap; use sp_std::vec::Vec; @@ -94,28 +93,6 @@ impl XcmHoldingErc20sOrigins { } } -/// Xcm executor wrapper that inject xcm holding extension "XcmHoldingErc20sOrigins" -pub struct XcmExecutorWrapper( - PhantomData<(RuntimeCall, InnerXcmExecutor)>, -); -impl xcm::latest::ExecuteXcm - for XcmExecutorWrapper -where - InnerXcmExecutor: xcm::latest::ExecuteXcm, -{ - fn execute_xcm_in_credit( - origin: impl Into, - message: xcm::latest::Xcm, - weight_limit: xcm::latest::Weight, - weight_credit: xcm::latest::Weight, - ) -> xcm::latest::Outcome { - let mut erc20s_origins = Default::default(); - XCM_HOLDING_ERC20_ORIGINS::using(&mut erc20s_origins, || { - InnerXcmExecutor::execute_xcm_in_credit(origin, message, weight_limit, weight_credit) - }) - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/pallets/ethereum-xcm/Cargo.toml b/pallets/ethereum-xcm/Cargo.toml index d31acd89ee8..6cba6c8f8f9 100644 --- a/pallets/ethereum-xcm/Cargo.toml +++ b/pallets/ethereum-xcm/Cargo.toml @@ -36,6 +36,9 @@ fp-self-contained = { workspace = true } pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } xcm-primitives = { workspace = true } +# Benchmarks +frame-benchmarking = { workspace = true, optional = true } + [dev-dependencies] pallet-evm-precompile-proxy = { workspace = true } @@ -77,10 +80,5 @@ std = [ "sp-std/std", "xcm-primitives/std", ] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-evm/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", -] +runtime-benchmarks = [ "frame-benchmarking", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-evm/runtime-benchmarks", "xcm-primitives/runtime-benchmarks" ] try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/ethereum-xcm/src/lib.rs b/pallets/ethereum-xcm/src/lib.rs index 7cfd3891080..358e317a410 100644 --- a/pallets/ethereum-xcm/src/lib.rs +++ b/pallets/ethereum-xcm/src/lib.rs @@ -76,8 +76,10 @@ impl> + From> EnsureOrigin } #[cfg(feature = "runtime-benchmarks")] - fn successful_origin() -> O { - O::from(RawOrigin::XcmEthereumTransaction(Default::default())) + fn try_successful_origin() -> Result { + Ok(O::from(RawOrigin::XcmEthereumTransaction( + Default::default(), + ))) } } diff --git a/pallets/ethereum-xcm/src/mock.rs b/pallets/ethereum-xcm/src/mock.rs index 8d72ee03584..1330ab79bf1 100644 --- a/pallets/ethereum-xcm/src/mock.rs +++ b/pallets/ethereum-xcm/src/mock.rs @@ -176,6 +176,7 @@ impl pallet_evm::Config for Test { type OnChargeTransaction = (); type FindAuthor = FindAuthorTruncated; type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; + type OnCreate = (); } impl pallet_ethereum::Config for Test { diff --git a/pallets/moonbeam-xcm-benchmarks/Cargo.toml b/pallets/moonbeam-xcm-benchmarks/Cargo.toml index efc5178bc7d..cd6d4a52801 100644 --- a/pallets/moonbeam-xcm-benchmarks/Cargo.toml +++ b/pallets/moonbeam-xcm-benchmarks/Cargo.toml @@ -57,5 +57,4 @@ runtime-benchmarks = [ "parity-scale-codec", "scale-info", "xcm-executor/runtime-benchmarks", - "xcm/runtime-benchmarks", ] diff --git a/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs b/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs index 86295a90d4c..20313c63f98 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs @@ -16,6 +16,7 @@ use super::*; use frame_benchmarking::benchmarks; +use frame_support::dispatch::Weight; use pallet_xcm_benchmarks::{new_executor, XcmCallOf}; use sp_std::vec; use sp_std::vec::Vec; @@ -23,22 +24,23 @@ use xcm::latest::prelude::*; benchmarks! { buy_execution { - let holding = T::worst_case_holding().into(); + // TODO setting it to zero by now + let holding = T::worst_case_holding(0).into(); let mut executor = new_executor::(Default::default()); - executor.holding = holding; + executor.set_holding(holding); let fee_asset = Concrete(MultiLocation::parent()); let instruction = Instruction::>::BuyExecution { - fees: (fee_asset, 100_000_000).into(), // should be something inside of holding - weight_limit: WeightLimit::Limited(1u64), + fees: (fee_asset, 100_000_000u128).into(), // should be something inside of holding + weight_limit: WeightLimit::Limited(Weight::from_parts(1u64, xcm_primitives::DEFAULT_PROOF_SIZE)), }; let xcm = Xcm(vec![instruction]); } : { - executor.execute(xcm)?; + executor.bench_process(xcm)?; } verify { } diff --git a/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs b/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs index 015988af580..1e3ef4a169e 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs @@ -140,8 +140,19 @@ impl pallet_xcm_benchmarks::generic::Config for Test { (0, Response::Assets(assets)) } - fn transact_origin() -> Result { - Ok(Default::default()) + fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn universal_alias() -> Result { + Err(BenchmarkError::Skip) + } + + fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { + Ok(( + Default::default(), + frame_system::Call::remark_with_event { remark: vec![] }.into(), + )) } fn subscribe_origin() -> Result { @@ -156,6 +167,10 @@ impl pallet_xcm_benchmarks::generic::Config for Test { }; Ok((Default::default(), ticket, assets)) } + + fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + Err(BenchmarkError::Skip) + } } impl generic::Config for Test {} diff --git a/pallets/moonbeam-xcm-benchmarks/src/mock.rs b/pallets/moonbeam-xcm-benchmarks/src/mock.rs index 6380bee3552..3f111fea17e 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/mock.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/mock.rs @@ -14,25 +14,39 @@ // You should have received a copy of the GNU General Public License // along with Moonbeam. If not, see . -use frame_support::parameter_types; +use frame_support::{dispatch::Weight, parameter_types, traits::ContainsPair}; use xcm::latest::prelude::*; -use xcm::latest::Weight as XCMWeight; -use xcm_executor::traits::FilterAssetLocation; // An xcm sender/receiver akin to > /dev/null pub struct DevNull; -impl xcm::opaque::latest::SendXcm for DevNull { - fn send_xcm(_: impl Into, _: Xcm<()>) -> SendResult { - Ok(()) +impl SendXcm for DevNull { + type Ticket = (); + + fn validate( + _destination: &mut Option, + _message: &mut Option, + ) -> SendResult { + Ok(((), MultiAssets::new())) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(XcmHash::default()) } } impl xcm_executor::traits::OnResponse for DevNull { - fn expecting_response(_: &MultiLocation, _: u64) -> bool { + fn expecting_response(_: &MultiLocation, _: u64, _: Option<&MultiLocation>) -> bool { false } - fn on_response(_: &MultiLocation, _: u64, _: Response, _: XCMWeight) -> XCMWeight { - 0 + fn on_response( + _: &MultiLocation, + _: u64, + _: Option<&MultiLocation>, + _: Response, + _: Weight, + _: &XcmContext, + ) -> Weight { + Weight::zero() } } @@ -60,8 +74,8 @@ parameter_types! { } pub struct AllAssetLocationsPass; -impl FilterAssetLocation for AllAssetLocationsPass { - fn filter_asset_location(_: &MultiAsset, _: &MultiLocation) -> bool { +impl ContainsPair for AllAssetLocationsPass { + fn contains(_: &MultiAsset, _: &MultiLocation) -> bool { true } } diff --git a/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs b/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs index debcd47e06c..a0fc14dae81 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs @@ -27,31 +27,32 @@ use xcm::{ DoubleEncoded, }; +const MAX_ASSETS: u32 = 100; + trait WeighMultiAssets { fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight; } trait WeighMultiAssetsFilter { - fn weigh_multi_assets_filter(&self, max_assests: u32, weight: Weight) -> XCMWeight; + fn weigh_multi_assets_filter(&self, weight: Weight) -> XCMWeight; } impl WeighMultiAssetsFilter for MultiAssetFilter { - fn weigh_multi_assets_filter(&self, max_assests: u32, weight: Weight) -> XCMWeight { - let weight = match self { + fn weigh_multi_assets_filter(&self, weight: Weight) -> XCMWeight { + match self { Self::Definite(assets) => { weight.saturating_mul(assets.inner().into_iter().count() as u64) } - Self::Wild(_) => weight.saturating_mul(max_assests as u64), - }; - weight.ref_time() + Self::Wild(AllOf { .. } | AllOfCounted { .. }) => weight, + Self::Wild(AllCounted(count)) => weight.saturating_mul(*count as u64), + Self::Wild(All) => weight.saturating_mul(MAX_ASSETS as u64), + } } } impl WeighMultiAssets for MultiAssets { fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { - weight - .saturating_mul(self.inner().into_iter().count() as u64) - .ref_time() + weight.saturating_mul(self.inner().into_iter().count() as u64) } } @@ -61,23 +62,28 @@ where Runtime: frame_system::Config + pallet_erc20_xcm_bridge::Config, { fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { - assets.inner().iter().fold(0, |acc, asset| { - acc.saturating_add(XcmFungibleWeight::::withdraw_asset(&asset).ref_time()) + assets.inner().iter().fold(Weight::zero(), |acc, asset| { + acc.saturating_add(XcmFungibleWeight::::withdraw_asset(&asset)) }) } // Currently there is no trusted reserve fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { - XcmFungibleWeight::::reserve_asset_deposited().ref_time() + XcmFungibleWeight::::reserve_asset_deposited() } fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) } - fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight { - XcmGeneric::::query_response().ref_time() + fn query_response( + _query_id: &u64, + _response: &Response, + _max_weight: &Weight, + _querier: &Option, + ) -> XCMWeight { + XcmGeneric::::query_response() } fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { - assets.inner().iter().fold(0, |acc, asset| { - acc.saturating_add(XcmFungibleWeight::::transfer_asset(&asset).ref_time()) + assets.inner().iter().fold(Weight::zero(), |acc, asset| { + acc.saturating_add(XcmFungibleWeight::::transfer_asset(&asset)) }) } fn transfer_reserve_asset( @@ -85,18 +91,16 @@ where _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> XCMWeight { - assets.inner().iter().fold(0, |acc, asset| { - acc.saturating_add( - XcmFungibleWeight::::transfer_reserve_asset(&asset).ref_time(), - ) + assets.inner().iter().fold(Weight::zero(), |acc, asset| { + acc.saturating_add(XcmFungibleWeight::::transfer_reserve_asset(&asset)) }) } fn transact( _origin_type: &OriginKind, - _require_weight_at_most: &u64, + _require_weight_at_most: &Weight, _call: &DoubleEncoded, ) -> XCMWeight { - XcmGeneric::::transact().ref_time() + XcmGeneric::::transact() } fn hrmp_new_channel_open_request( _sender: &u32, @@ -104,50 +108,41 @@ where _max_capacity: &u32, ) -> XCMWeight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } fn hrmp_channel_accepted(_recipient: &u32) -> XCMWeight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> XCMWeight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } fn clear_origin() -> XCMWeight { - XcmGeneric::::clear_origin().ref_time() + XcmGeneric::::clear_origin() } fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { - XcmGeneric::::descend_origin().ref_time() + XcmGeneric::::descend_origin() } - fn report_error( - _query_id: &QueryId, - _dest: &MultiLocation, - _max_response_weight: &u64, - ) -> XCMWeight { - XcmGeneric::::report_error().ref_time() + fn report_error(_query_response_info: &QueryResponseInfo) -> XCMWeight { + XcmGeneric::::report_error() } - - fn deposit_asset( - assets: &MultiAssetFilter, - max_assets: &u32, - _dest: &MultiLocation, - ) -> XCMWeight { - assets.weigh_multi_assets_filter(*max_assets, XcmFungibleWeight::::deposit_asset()) + fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> XCMWeight { + assets.weigh_multi_assets_filter(XcmFungibleWeight::::deposit_asset()) } fn deposit_reserve_asset( assets: &MultiAssetFilter, - max_assets: &u32, _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> XCMWeight { - assets.weigh_multi_assets_filter( - *max_assets, - XcmFungibleWeight::::deposit_reserve_asset(), - ) + assets.weigh_multi_assets_filter(XcmFungibleWeight::::deposit_reserve_asset()) } - fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight { - Weight::MAX.ref_time() + fn exchange_asset( + _give: &MultiAssetFilter, + _receive: &MultiAssets, + _maximal: &bool, + ) -> XCMWeight { + Weight::MAX } fn initiate_reserve_withdraw( _assets: &MultiAssetFilter, @@ -157,48 +152,110 @@ where // This is not correct. initiate reserve withdraw does not to that many db reads // the only thing it does based on number of assets is a take from a local variable //assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) - XcmGeneric::::initiate_reserve_withdraw().ref_time() + XcmGeneric::::initiate_reserve_withdraw() } fn initiate_teleport( _assets: &MultiAssetFilter, _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> XCMWeight { - XcmFungibleWeight::::initiate_teleport().ref_time() + XcmFungibleWeight::::initiate_teleport() } - fn query_holding( - _query_id: &u64, - _dest: &MultiLocation, - _assets: &MultiAssetFilter, - _max_response_weight: &u64, - ) -> XCMWeight { - XcmGeneric::::query_holding().ref_time() + fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { + XcmGeneric::::report_holding() } fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { - XcmGeneric::::buy_execution().ref_time() + XcmGeneric::::buy_execution() } fn refund_surplus() -> XCMWeight { - XcmGeneric::::refund_surplus().ref_time() + XcmGeneric::::refund_surplus() } fn set_error_handler(_xcm: &Xcm) -> XCMWeight { - XcmGeneric::::set_error_handler().ref_time() + XcmGeneric::::set_error_handler() } fn set_appendix(_xcm: &Xcm) -> XCMWeight { - XcmGeneric::::set_appendix().ref_time() + XcmGeneric::::set_appendix() } fn clear_error() -> XCMWeight { - XcmGeneric::::clear_error().ref_time() + XcmGeneric::::clear_error() } fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { - XcmGeneric::::claim_asset().ref_time() + XcmGeneric::::claim_asset() } fn trap(_code: &u64) -> XCMWeight { - XcmGeneric::::trap().ref_time() + XcmGeneric::::trap() } - fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> XCMWeight { - XcmGeneric::::subscribe_version().ref_time() + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &Weight) -> XCMWeight { + XcmGeneric::::subscribe_version() } fn unsubscribe_version() -> XCMWeight { - XcmGeneric::::unsubscribe_version().ref_time() + XcmGeneric::::unsubscribe_version() + } + fn burn_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::burn_asset()) + } + fn expect_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::expect_asset()) + } + fn expect_origin(_origin: &Option) -> Weight { + XcmGeneric::::expect_origin() + } + fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight { + XcmGeneric::::expect_error() + } + fn expect_transact_status(_transact_status: &MaybeErrorCode) -> Weight { + XcmGeneric::::expect_transact_status() + } + fn query_pallet(_module_name: &Vec, _response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::query_pallet() + } + fn expect_pallet( + _index: &u32, + _name: &Vec, + _module_name: &Vec, + _crate_major: &u32, + _min_crate_minor: &u32, + ) -> Weight { + XcmGeneric::::expect_pallet() + } + fn report_transact_status(_response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::report_transact_status() + } + fn clear_transact_status() -> Weight { + XcmGeneric::::clear_transact_status() + } + fn universal_origin(_: &Junction) -> Weight { + Weight::MAX + } + fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { + Weight::MAX + } + fn lock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX + } + fn unlock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX + } + fn note_unlockable(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX + } + fn request_unlock(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX + } + fn set_fees_mode(_: &bool) -> Weight { + XcmGeneric::::set_fees_mode() + } + fn set_topic(_topic: &[u8; 32]) -> Weight { + XcmGeneric::::set_topic() + } + fn clear_topic() -> Weight { + XcmGeneric::::clear_topic() + } + fn alias_origin(_: &MultiLocation) -> Weight { + // XCM Executor does not currently support alias origin operations + Weight::MAX + } + fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { + XcmGeneric::::unpaid_execution() } } diff --git a/pallets/moonbeam-xcm-benchmarks/src/weights/moonbeam_xcm_benchmarks_generic.rs b/pallets/moonbeam-xcm-benchmarks/src/weights/moonbeam_xcm_benchmarks_generic.rs index 4076a60e9eb..f56ad4aa116 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/weights/moonbeam_xcm_benchmarks_generic.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/weights/moonbeam_xcm_benchmarks_generic.rs @@ -51,8 +51,6 @@ use sp_std::marker::PhantomData; /// Weight functions needed for moonbeam_xcm_benchmarks_generic. pub trait WeightInfo { - #[rustfmt::skip] - fn query_holding() -> Weight; #[rustfmt::skip] fn buy_execution() -> Weight; #[rustfmt::skip] @@ -83,22 +81,53 @@ pub trait WeightInfo { fn unsubscribe_version() -> Weight; #[rustfmt::skip] fn initiate_reserve_withdraw() -> Weight; + #[rustfmt::skip] + fn report_holding() -> Weight; + #[rustfmt::skip] + fn burn_asset() -> Weight; + #[rustfmt::skip] + fn expect_asset() -> Weight; + #[rustfmt::skip] + fn expect_origin() -> Weight; + #[rustfmt::skip] + fn expect_error() -> Weight; + #[rustfmt::skip] + fn expect_transact_status() -> Weight; + #[rustfmt::skip] + fn query_pallet() -> Weight; + #[rustfmt::skip] + fn expect_pallet() -> Weight; + #[rustfmt::skip] + fn report_transact_status() -> Weight; + #[rustfmt::skip] + fn clear_transact_status() -> Weight; + #[rustfmt::skip] + fn universal_origin() -> Weight; + #[rustfmt::skip] + fn export_message() -> Weight; + #[rustfmt::skip] + fn lock_asset() -> Weight; + #[rustfmt::skip] + fn unlock_asset() -> Weight; + #[rustfmt::skip] + fn note_unlockable() -> Weight; + #[rustfmt::skip] + fn request_unlock() -> Weight; + #[rustfmt::skip] + fn set_fees_mode() -> Weight; + #[rustfmt::skip] + fn set_topic() -> Weight; + #[rustfmt::skip] + fn clear_topic() -> Weight; + #[rustfmt::skip] + fn alias_origin() -> Weight; + #[rustfmt::skip] + fn unpaid_execution() -> Weight; } /// Weights for moonbeam_xcm_benchmarks_generic using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - #[rustfmt::skip] - fn query_holding() -> Weight { - Weight::from_ref_time(494_254_000 as u64) - .saturating_add(T::DbWeight::get().reads(5 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: AssetManager SupportedFeePaymentAssets (r:1 w:0) // Storage: AssetManager AssetTypeUnitsPerSecond (r:1 w:0) // Storage: AssetManager AssetTypeId (r:1 w:0) @@ -195,21 +224,95 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + + #[rustfmt::skip] + fn report_holding() -> Weight { + todo!(); + } + #[rustfmt::skip] + fn burn_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_origin() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_error() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_transact_status() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn query_pallet() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_pallet() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn report_transact_status() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn clear_transact_status() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn universal_origin() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn export_message() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn lock_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn unlock_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn note_unlockable() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn request_unlock() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn set_fees_mode() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn set_topic() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn clear_topic() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn alias_origin() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn unpaid_execution() -> Weight{ + todo!(); + } } // For backwards compatibility and tests impl WeightInfo for () { - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - #[rustfmt::skip] - fn query_holding() -> Weight { - Weight::from_ref_time(494_254_000 as u64) - .saturating_add(RocksDbWeight::get().reads(5 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } // Storage: AssetManager SupportedFeePaymentAssets (r:1 w:0) // Storage: AssetManager AssetTypeUnitsPerSecond (r:1 w:0) // Storage: AssetManager AssetTypeId (r:1 w:0) @@ -306,4 +409,89 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(5 as u64)) .saturating_add(RocksDbWeight::get().writes(2 as u64)) } + + #[rustfmt::skip] + fn report_holding() -> Weight { + todo!(); + } + #[rustfmt::skip] + fn burn_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_origin() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_error() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_transact_status() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn query_pallet() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn expect_pallet() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn report_transact_status() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn clear_transact_status() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn universal_origin() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn export_message() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn lock_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn unlock_asset() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn note_unlockable() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn request_unlock() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn set_fees_mode() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn set_topic() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn clear_topic() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn alias_origin() -> Weight{ + todo!(); + } + #[rustfmt::skip] + fn unpaid_execution() -> Weight{ + todo!(); + } } diff --git a/pallets/xcm-transactor/Cargo.toml b/pallets/xcm-transactor/Cargo.toml index 9024e25a7c5..b88d329d473 100644 --- a/pallets/xcm-transactor/Cargo.toml +++ b/pallets/xcm-transactor/Cargo.toml @@ -58,5 +58,9 @@ std = [ ] runtime-benchmarks = [ "frame-benchmarking", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/xcm-transactor/src/benchmarks.rs b/pallets/xcm-transactor/src/benchmarks.rs index 8566cf877a3..a35019a1745 100644 --- a/pallets/xcm-transactor/src/benchmarks.rs +++ b/pallets/xcm-transactor/src/benchmarks.rs @@ -18,6 +18,7 @@ use crate::{Call, Config, Currency, CurrencyPayment, HrmpOperation, Pallet, TransactWeights}; use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; +use frame_support::dispatch::Weight; use frame_system::RawOrigin; use sp_std::boxed::Box; use sp_std::vec; @@ -44,37 +45,37 @@ benchmarks! { } set_transact_info { - let extra_weight = 300000000u64; + let extra_weight: Weight = Weight::from_ref_time(300000000u64); let fee_per_second = 1; - let max_weight = 20000000000u64; + let max_weight: Weight = Weight::from_ref_time(20000000000u64); let location = MultiLocation::parent(); }: _( RawOrigin::Root, - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), extra_weight, max_weight, None ) verify { assert_eq!(Pallet::::transact_info(&location), Some(crate::RemoteTransactInfoWithMaxWeight { - transact_extra_weight: extra_weight, - max_weight, + transact_extra_weight: extra_weight.into(), + max_weight: max_weight.into(), transact_extra_weight_signed: None })); } remove_transact_info { - let extra_weight = 300000000u64; - let max_weight = 20000000000u64; + let extra_weight: Weight = Weight::from_ref_time(300000000u64); + let max_weight: Weight = Weight::from_ref_time(20000000000u64); let location = MultiLocation::parent(); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), extra_weight, max_weight, None ).unwrap(); - }: _(RawOrigin::Root, Box::new(xcm::VersionedMultiLocation::V1(location.clone()))) + }: _(RawOrigin::Root, Box::new(xcm::VersionedMultiLocation::V3(location.clone()))) verify { assert!(Pallet::::transact_info(&location).is_none()); } @@ -84,7 +85,7 @@ benchmarks! { let location = MultiLocation::parent(); }: _( RawOrigin::Root, - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), fee_per_second ) verify { @@ -95,23 +96,23 @@ benchmarks! { // Worst Case: transacInfo db reads transact_through_derivative { let fee_per_second = 1; - let extra_weight = 300000000u64; - let max_weight = 20000000000u64; + let extra_weight: Weight = Weight::from_ref_time(300000000u64); + let max_weight: Weight = Weight::from_ref_time(20000000000u64); let location = MultiLocation::parent(); let call = vec![1u8]; - let dest_weight = 100u64; + let dest_weight: Weight = Weight::from_ref_time(100u64); let currency: T::CurrencyId = location.clone().into(); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), extra_weight, max_weight, Some(extra_weight) ).unwrap(); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), fee_per_second ).unwrap(); Pallet::::register( @@ -151,30 +152,30 @@ benchmarks! { transact_through_sovereign { let fee_per_second = 1; - let extra_weight = 300000000u64; - let max_weight = 20000000000u64; + let extra_weight: Weight = Weight::from_ref_time(300000000u64); + let max_weight: Weight = Weight::from_ref_time(20000000000u64); let location = MultiLocation::parent(); let currency: T::CurrencyId = location.clone().into(); let call = vec![1u8]; - let dest_weight = 100u64; + let dest_weight: Weight = Weight::from_ref_time(100u64); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), extra_weight, max_weight, Some(extra_weight) ).unwrap(); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), fee_per_second ).unwrap(); }: { let result = Pallet::::transact_through_sovereign( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), user.clone(), CurrencyPayment { // This might involve a db Read when translating, therefore worst case @@ -203,28 +204,28 @@ benchmarks! { transact_through_signed { let fee_per_second = 1; - let extra_weight = 300000000u64; - let max_weight = 20000000000u64; + let extra_weight: Weight = Weight::from_ref_time(300000000u64); + let max_weight: Weight = Weight::from_ref_time(20000000000u64); let location = MultiLocation::parent(); let currency: T::CurrencyId = location.clone().into(); let call = vec![1u8]; - let dest_weight = 100u64; + let dest_weight: Weight = Weight::from_ref_time(100u64); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), extra_weight, max_weight, Some(extra_weight) ).unwrap(); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), fee_per_second ).unwrap(); }: _( RawOrigin::Signed(user.clone()), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), CurrencyPayment { // This might involve a db Read when translating, therefore worst case currency: Currency::AsCurrencyId(currency), @@ -241,23 +242,23 @@ benchmarks! { hrmp_manage { let fee_per_second = 1; - let extra_weight = 300000000u64; - let max_weight = 20000000000u64; + let extra_weight: Weight = Weight::from_ref_time(300000000u64); + let max_weight: Weight = Weight::from_ref_time(20000000000u64); let location = MultiLocation::parent(); let currency: T::CurrencyId = location.clone().into(); let call = vec![1u8]; - let dest_weight = 100u64; + let dest_weight: Weight = Weight::from_ref_time(100u64); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), extra_weight, max_weight, Some(extra_weight) ).unwrap(); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V1(location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(location.clone())), fee_per_second ).unwrap(); }: _( diff --git a/pallets/xcm-transactor/src/lib.rs b/pallets/xcm-transactor/src/lib.rs index 34a57d782a7..950408255e7 100644 --- a/pallets/xcm-transactor/src/lib.rs +++ b/pallets/xcm-transactor/src/lib.rs @@ -89,17 +89,16 @@ pub mod pallet { use crate::weights::WeightInfo; use crate::CurrencyIdOf; - use cumulus_primitives_core::{relay_chain::v2::HrmpChannelId, ParaId}; + use cumulus_primitives_core::{relay_chain::HrmpChannelId, ParaId}; use frame_support::{pallet_prelude::*, weights::constants::WEIGHT_REF_TIME_PER_SECOND}; use frame_system::{ensure_signed, pallet_prelude::*}; use orml_traits::location::{Parse, Reserve}; - use sp_runtime::traits::{AtLeast32BitUnsigned, Convert}; + use sp_runtime::traits::{AtLeast32BitUnsigned, Bounded, Convert}; use sp_std::boxed::Box; use sp_std::convert::TryFrom; use sp_std::prelude::*; use xcm::{latest::prelude::*, VersionedMultiLocation}; - use xcm_executor::traits::{InvertLocation, TransactAsset, WeightBounds}; - pub(crate) use xcm_primitives::XcmV2Weight; + use xcm_executor::traits::{TransactAsset, WeightBounds}; use xcm_primitives::{ FilterMaxAssetFee, HrmpAvailableCalls, HrmpEncodeCall, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, @@ -147,8 +146,8 @@ pub mod pallet { /// Means of measuring the weight consumed by an XCM message locally. type Weigher: WeightBounds; - /// Means of inverting a location. - type LocationInverter: InvertLocation; + /// This chain's Universal Location. + type UniversalLocation: Get; /// Self chain location. #[pallet::constant] @@ -165,7 +164,7 @@ pub mod pallet { /// The actual weight for an XCM message is `T::BaseXcmWeight + /// T::Weigher::weight(&msg)`. #[pallet::constant] - type BaseXcmWeight: Get; + type BaseXcmWeight: Get; /// The way to retrieve the reserve of a MultiAsset. This can be /// configured to accept absolute or relative paths for self tokens @@ -182,21 +181,21 @@ pub mod pallet { /// Stores the information to be able to issue a transact operation in another chain use an /// asset as fee payer. - #[derive(Default, Clone, Encode, Decode, RuntimeDebug, PartialEq, scale_info::TypeInfo)] + #[derive(Default, Clone, Encode, Decode, RuntimeDebug, Eq, PartialEq, scale_info::TypeInfo)] pub struct RemoteTransactInfoWithMaxWeight { /// Extra weight that transacting a call in a destination chain adds /// Extra weight involved when transacting without DescendOrigin /// This should always be possible in a destination chain, since /// it involves going through the sovereign account - pub transact_extra_weight: XcmV2Weight, + pub transact_extra_weight: Weight, /// Max destination weight - pub max_weight: XcmV2Weight, + pub max_weight: Weight, /// Whether we allow transacting through signed origins in another chain, and /// how much extra cost implies /// Extra weight involved when transacting with DescendOrigin /// The reason for it being an option is because the destination chain /// might not support constructing origins based on generic MultiLocations - pub transact_extra_weight_signed: Option, + pub transact_extra_weight_signed: Option, } /// Enum defining the way to express a Currency. @@ -265,11 +264,11 @@ pub mod pallet { /// If None, then this amount will be tried to be derived from storage. If the storage item pub struct TransactWeights { // the amount of weight the Transact instruction should consume at most - pub transact_required_weight_at_most: XcmV2Weight, + pub transact_required_weight_at_most: Weight, // the overall weight to be used for the whole XCM message execution. If None, // then this amount will be tried to be derived from storage. If the storage item // for the chain is not populated, then it fails - pub overall_weight: Option, + pub overall_weight: Option, } /// Since we are using pallet-utility for account derivation (through AsDerivative), @@ -307,7 +306,7 @@ pub mod pallet { NotCrossChainTransfer, AssetIsNotReserveInDestination, DestinationNotInvertible, - ErrorSending, + ErrorDelivering, DispatchWeightBiggerThanTotalWeight, WeightOverflow, AmountOverflow, @@ -322,6 +321,7 @@ pub mod pallet { FailedMultiLocationToJunction, HrmpHandlerNotImplemented, TooMuchFeeUsed, + ErrorValidating, } #[pallet::event] @@ -436,7 +436,7 @@ pub mod pallet { /// to be a reserve asset for the destination transactor::multilocation. #[pallet::call_index(2)] #[pallet::weight( - Weight::from_ref_time(Pallet::::weight_of_initiate_reserve_withdraw()) + Pallet::::weight_of_initiate_reserve_withdraw() .saturating_add(T::WeightInfo::transact_through_derivative()) )] pub fn transact_through_derivative( @@ -474,7 +474,7 @@ pub mod pallet { // Calculate the total weight that the xcm message is going to spend in the // destination chain - let total_weight: u64 = weight_info.overall_weight.map_or_else( + let total_weight = weight_info.overall_weight.map_or_else( || { Self::take_weight_from_transact_info( dest.clone(), @@ -520,7 +520,7 @@ pub mod pallet { /// SovereignAccountDispatcherOrigin callable only #[pallet::call_index(3)] #[pallet::weight( - Weight::from_ref_time(Pallet::::weight_of_initiate_reserve_withdraw()) + Pallet::::weight_of_initiate_reserve_withdraw() .saturating_add(T::WeightInfo::transact_through_sovereign()) )] pub fn transact_through_sovereign( @@ -547,7 +547,7 @@ pub mod pallet { // Calculate the total weight that the xcm message is going to spend in the // destination chain - let total_weight: u64 = weight_info.overall_weight.map_or_else( + let total_weight = weight_info.overall_weight.map_or_else( || { Self::take_weight_from_transact_info( dest.clone(), @@ -593,9 +593,9 @@ pub mod pallet { pub fn set_transact_info( origin: OriginFor, location: Box, - transact_extra_weight: XcmV2Weight, - max_weight: u64, - transact_extra_weight_signed: Option, + transact_extra_weight: Weight, + max_weight: Weight, + transact_extra_weight_signed: Option, ) -> DispatchResult { T::DerivativeAddressRegistrationOrigin::ensure_origin(origin)?; let location = @@ -660,7 +660,7 @@ pub mod pallet { // Calculate the total weight that the xcm message is going to spend in the // destination chain - let total_weight: u64 = weight_info.overall_weight.map_or_else( + let total_weight = weight_info.overall_weight.map_or_else( || { Self::take_weight_from_transact_info_signed( dest.clone(), @@ -782,7 +782,7 @@ pub mod pallet { // Calculate the total weight that the xcm message is going to spend in the // destination chain - let total_weight: u64 = weight_info.overall_weight.map_or_else( + let total_weight = weight_info.overall_weight.map_or_else( || { Self::take_weight_from_transact_info( destination.clone(), @@ -831,8 +831,8 @@ pub mod pallet { fee: MultiAsset, call: Vec, origin_kind: OriginKind, - total_weight: XcmV2Weight, - transact_required_weight_at_most: XcmV2Weight, + total_weight: Weight, + transact_required_weight_at_most: Weight, with_appendix: Option>>, ) -> DispatchResult { if let Some(fee_payer) = fee_payer { @@ -841,7 +841,7 @@ pub mod pallet { // Construct the local withdraw message with the previous calculated amount // This message deducts and burns "amount" from the caller when executed - T::AssetTransactor::withdraw_asset(&fee.clone().into(), &origin_as_mult) + T::AssetTransactor::withdraw_asset(&fee.clone().into(), &origin_as_mult, None) .map_err(|_| Error::::UnableToWithdrawAsset)?; } @@ -862,7 +862,10 @@ pub mod pallet { )?; // Send to sovereign - T::XcmSender::send_xcm(dest, transact_message).map_err(|_| Error::::ErrorSending)?; + let (ticket, _price) = + T::XcmSender::validate(&mut Some(dest), &mut Some(transact_message)) + .map_err(|_| Error::::ErrorValidating)?; + T::XcmSender::deliver(ticket).map_err(|_| Error::::ErrorDelivering)?; Ok(()) } @@ -873,8 +876,8 @@ pub mod pallet { fee: MultiAsset, call: Vec, origin_kind: OriginKind, - total_weight: XcmV2Weight, - transact_required_weight_at_most: XcmV2Weight, + total_weight: Weight, + transact_required_weight_at_most: Weight, _with_appendix: Option>>, ) -> DispatchResult { // Convert origin to multilocation @@ -906,7 +909,10 @@ pub mod pallet { transact_message.0.insert(0, DescendOrigin(interior)); // Send to destination chain - T::XcmSender::send_xcm(dest, transact_message).map_err(|_| Error::::ErrorSending)?; + let (ticket, _price) = + T::XcmSender::validate(&mut Some(dest), &mut Some(transact_message)) + .map_err(|_| Error::::ErrorValidating)?; + T::XcmSender::deliver(ticket).map_err(|_| Error::::ErrorDelivering)?; Ok(()) } @@ -917,7 +923,7 @@ pub mod pallet { fee_location: MultiLocation, fee_amount: Option, destination: MultiLocation, - total_weight: XcmV2Weight, + total_weight: Weight, ) -> Result { // If amount is provided, just use it // Else, multiply weight*destination_units_per_second to see how much we should charge for @@ -944,9 +950,9 @@ pub mod pallet { fn transact_message( dest: MultiLocation, asset: MultiAsset, - dest_weight: XcmV2Weight, + dest_weight: Weight, call: Vec, - dispatch_weight: XcmV2Weight, + dispatch_weight: Weight, origin_kind: OriginKind, with_appendix: Option>>, ) -> Result, DispatchError> { @@ -958,7 +964,7 @@ pub mod pallet { instructions.push(Self::appendix_instruction(appendix)?); } instructions.push(Transact { - origin_type: origin_kind, + origin_kind: origin_kind, require_weight_at_most: dispatch_weight, call: call.into(), }); @@ -969,11 +975,11 @@ pub mod pallet { fn buy_execution( asset: MultiAsset, at: &MultiLocation, - weight: u64, + weight: Weight, ) -> Result, DispatchError> { - let ancestry = T::LocationInverter::ancestry(); + let universal_location = T::UniversalLocation::get(); let fees = asset - .reanchored(at, &ancestry) + .reanchored(at, universal_location) .map_err(|_| Error::::CannotReanchor)?; Ok(BuyExecution { @@ -987,9 +993,9 @@ pub mod pallet { asset: MultiAsset, at: &MultiLocation, ) -> Result, DispatchError> { - let ancestry = T::LocationInverter::ancestry(); + let universal_location = T::UniversalLocation::get(); let fees = asset - .reanchored(at, &ancestry) + .reanchored(at, universal_location) .map_err(|_| Error::::CannotReanchor)?; Ok(WithdrawAsset(fees.into())) @@ -1000,13 +1006,12 @@ pub mod pallet { mut beneficiary: MultiLocation, at: &MultiLocation, ) -> Result, DispatchError> { - let ancestry = T::LocationInverter::ancestry(); + let universal_location = T::UniversalLocation::get(); beneficiary - .reanchor(at, &ancestry) + .reanchor(at, universal_location) .map_err(|_| Error::::CannotReanchor)?; Ok(DepositAsset { assets: Wild(All), - max_assets: 1, beneficiary, }) } @@ -1050,7 +1055,7 @@ pub mod pallet { } /// Returns weight of `weight_of_initiate_reserve_withdraw` call. - fn weight_of_initiate_reserve_withdraw() -> XcmV2Weight { + fn weight_of_initiate_reserve_withdraw() -> Weight { let dest = MultiLocation::parent(); // We can use whatever asset here @@ -1070,20 +1075,20 @@ pub mod pallet { xcm: Xcm(vec![]), }, ]); - T::Weigher::weight(&mut xcm.into()).map_or(XcmV2Weight::max_value(), |w| { + T::Weigher::weight(&mut xcm.into()).map_or(Weight::max_value(), |w| { T::BaseXcmWeight::get().saturating_add(w) }) } /// Returns the fee for a given set of parameters /// We always round up in case of fractional division - pub fn calculate_fee_per_second(weight: XcmV2Weight, fee_per_second: u128) -> u128 { + pub fn calculate_fee_per_second(weight: Weight, fee_per_second: u128) -> u128 { // grab WEIGHT_REF_TIME_PER_SECOND as u128 let weight_per_second_u128 = WEIGHT_REF_TIME_PER_SECOND as u128; // we add WEIGHT_REF_TIME_PER_SECOND -1 after multiplication to make sure that // if there is a fractional part we round up the result - let fee_mul_rounded_up = (fee_per_second.saturating_mul(weight as u128)) + let fee_mul_rounded_up = (fee_per_second.saturating_mul(weight.ref_time() as u128)) .saturating_add(weight_per_second_u128 - 1); fee_mul_rounded_up / weight_per_second_u128 @@ -1093,18 +1098,18 @@ pub mod pallet { /// it returns the weight to be used in non-signed cases pub fn take_weight_from_transact_info( dest: MultiLocation, - dest_weight: XcmV2Weight, - ) -> Result { + dest_weight: Weight, + ) -> Result { // Grab transact info for the destination provided let transactor_info = TransactInfoWithWeightLimit::::get(&dest) .ok_or(Error::::TransactorInfoNotSet)?; let total_weight = dest_weight - .checked_add(transactor_info.transact_extra_weight) + .checked_add(&transactor_info.transact_extra_weight) .ok_or(Error::::WeightOverflow)?; ensure!( - total_weight <= transactor_info.max_weight, + total_weight.all_lte(transactor_info.max_weight), Error::::MaxWeightTransactReached ); Ok(total_weight) @@ -1114,8 +1119,8 @@ pub mod pallet { /// it returns the weight to be used in signed cases pub fn take_weight_from_transact_info_signed( dest: MultiLocation, - dest_weight: XcmV2Weight, - ) -> Result { + dest_weight: Weight, + ) -> Result { // Grab transact info for the destination provided let transactor_info = TransactInfoWithWeightLimit::::get(&dest) .ok_or(Error::::TransactorInfoNotSet)?; @@ -1127,11 +1132,11 @@ pub mod pallet { .ok_or(Error::::SignedTransactNotAllowedForDestination)?; let total_weight = dest_weight - .checked_add(transact_in_dest_as_signed_weight) + .checked_add(&transact_in_dest_as_signed_weight) .ok_or(Error::::WeightOverflow)?; ensure!( - total_weight <= transactor_info.max_weight, + total_weight.all_lte(transactor_info.max_weight), Error::::MaxWeightTransactReached ); Ok(total_weight) @@ -1142,7 +1147,7 @@ pub mod pallet { pub fn take_fee_per_second_from_storage( fee_location: MultiLocation, destination: MultiLocation, - total_weight: XcmV2Weight, + total_weight: Weight, ) -> Result { let fee_per_second = DestinationAssetFeePerSecond::::get(&fee_location) .ok_or(Error::::FeePerSecondNotSet)?; diff --git a/pallets/xcm-transactor/src/migrations.rs b/pallets/xcm-transactor/src/migrations.rs index 2e08649a707..5d9ab7bbfa2 100644 --- a/pallets/xcm-transactor/src/migrations.rs +++ b/pallets/xcm-transactor/src/migrations.rs @@ -13,3 +13,258 @@ // You should have received a copy of the GNU General Public License // along with Moonbeam. If not, see . +use crate::{ + Config, DestinationAssetFeePerSecond, RemoteTransactInfoWithMaxWeight, + TransactInfoWithWeightLimit, +}; +use frame_support::{ + pallet_prelude::PhantomData, + storage::migration::storage_key_iter, + traits::{Get, OnRuntimeUpgrade}, + weights::Weight, + Blake2_128Concat, StoragePrefixedMap, Twox64Concat, +}; +use parity_scale_codec::{Decode, Encode}; +use sp_std::vec::Vec; +use xcm::latest::prelude::*; +use xcm::v2::MultiLocation as OldMultiLocation; +use xcm_primitives::DEFAULT_PROOF_SIZE; + +#[cfg(feature = "try-runtime")] +#[derive(Clone, Eq, Debug, PartialEq, Encode, Decode)] +enum PreUpgradeState { + TransactInfoWithWeightLimit(Vec<(OldMultiLocation, OldRemoteTransactInfoWithMaxWeight)>), + DestinationAssetFeePerSecond(Vec<(OldMultiLocation, u128)>), +} + +#[cfg(feature = "try-runtime")] +#[derive(Clone, Eq, Debug, PartialEq, Encode, Decode)] +enum PostUpgradeState { + TransactInfoWithWeightLimit(Vec<(MultiLocation, RemoteTransactInfoWithMaxWeight)>), + DestinationAssetFeePerSecond(Vec<(MultiLocation, u128)>), +} + +#[cfg(feature = "try-runtime")] +impl From for PostUpgradeState { + fn from(pre: PreUpgradeState) -> PostUpgradeState { + match pre { + PreUpgradeState::TransactInfoWithWeightLimit(items) => { + let mut out: Vec<(MultiLocation, RemoteTransactInfoWithMaxWeight)> = Vec::new(); + for (old_key, old_value) in items.into_iter() { + let new_key: MultiLocation = + old_key.try_into().expect("Multilocation v2 to v3"); + let new_value: RemoteTransactInfoWithMaxWeight = old_value.into(); + out.push((new_key, new_value)); + } + PostUpgradeState::TransactInfoWithWeightLimit(out) + } + PreUpgradeState::DestinationAssetFeePerSecond(items) => { + let mut out: Vec<(MultiLocation, u128)> = Vec::new(); + for (old_key, value) in items.into_iter() { + let new_key: MultiLocation = + old_key.try_into().expect("Multilocation v2 to v3"); + out.push((new_key, value)); + } + PostUpgradeState::DestinationAssetFeePerSecond(out) + } + } + } +} + +#[derive(Default, Debug, Clone, Encode, Decode, Eq, PartialEq)] +pub struct OldRemoteTransactInfoWithMaxWeight { + pub transact_extra_weight: u64, + pub max_weight: u64, + pub transact_extra_weight_signed: Option, +} + +impl From for RemoteTransactInfoWithMaxWeight { + fn from(old: OldRemoteTransactInfoWithMaxWeight) -> RemoteTransactInfoWithMaxWeight { + let transact_extra_weight: Weight = + Weight::from_parts(old.transact_extra_weight, DEFAULT_PROOF_SIZE); + let max_weight: Weight = Weight::from_parts(old.max_weight, DEFAULT_PROOF_SIZE); + let transact_extra_weight_signed: Option = + if let Some(w) = old.transact_extra_weight_signed { + Some(Weight::from_parts(w, DEFAULT_PROOF_SIZE)) + } else { + None + }; + RemoteTransactInfoWithMaxWeight { + transact_extra_weight, + max_weight, + transact_extra_weight_signed, + } + } +} + +pub struct XcmV2ToV3XcmTransactor(PhantomData); +impl OnRuntimeUpgrade for XcmV2ToV3XcmTransactor { + fn on_runtime_upgrade() -> Weight { + log::trace!( + target: "XcmV2ToV3XcmTransactor", + "Running XcmV2ToV3XcmTransactor migration" + ); + // Migrates the pallet's storage from Xcm V2 to V3: + // - TransactInfoWithWeightLimit -> migrate map's key + // - DestinationAssetFeePerSecond -> migrate map's key + + // Shared module prefix + let module_prefix = TransactInfoWithWeightLimit::::module_prefix(); + // TransactInfoWithWeightLimit + let transact_info_with_weight_limit = TransactInfoWithWeightLimit::::storage_prefix(); + // DestinationAssetFeePerSecond + let destination_asset_fee_per_second = DestinationAssetFeePerSecond::::storage_prefix(); + + // Db (read, write) count + let mut db_weight_count: (u64, u64) = (0, 0); + + // Migrate both `TransactInfoWithWeightLimit` key and value + db_weight_count.0 += 1; + let old_data = storage_key_iter::< + OldMultiLocation, + OldRemoteTransactInfoWithMaxWeight, + Blake2_128Concat, + >(&module_prefix, transact_info_with_weight_limit) + .drain() + .collect::>(); + for (old_key, old_value) in old_data { + db_weight_count.1 += 1; + let new_key: MultiLocation = old_key.try_into().expect("Multilocation v2 to v3"); + let new_value: RemoteTransactInfoWithMaxWeight = old_value.into(); + TransactInfoWithWeightLimit::::insert(new_key, new_value); + } + + // Migrate `DestinationAssetFeePerSecond` key + db_weight_count.0 += 1; + let old_data = storage_key_iter::( + &module_prefix, + destination_asset_fee_per_second, + ) + .drain() + .collect::>(); + for (old_key, value) in old_data { + db_weight_count.1 += 1; + let new_key: MultiLocation = old_key.try_into().expect("Multilocation v2 to v3"); + DestinationAssetFeePerSecond::::insert(new_key, value); + } + + T::DbWeight::get().reads_writes(db_weight_count.0, db_weight_count.1) + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + log::trace!( + target: "XcmV2ToV3XcmTransactor", + "Running XcmV2ToV3XcmTransactor pre_upgrade hook" + ); + // Shared module prefix + let module_prefix = TransactInfoWithWeightLimit::::module_prefix(); + // TransactInfoWithWeightLimit + let transact_info_with_weight_limit = TransactInfoWithWeightLimit::::storage_prefix(); + // DestinationAssetFeePerSecond + let destination_asset_fee_per_second = DestinationAssetFeePerSecond::::storage_prefix(); + + let mut result: Vec = Vec::new(); + + // TransactInfoWithWeightLimit pre-upgrade data + let transact_info_with_weight_limit_storage_data: Vec<_> = + storage_key_iter::< + OldMultiLocation, + OldRemoteTransactInfoWithMaxWeight, + Blake2_128Concat, + >(module_prefix, transact_info_with_weight_limit) + .collect(); + result.push(PreUpgradeState::TransactInfoWithWeightLimit( + transact_info_with_weight_limit_storage_data, + )); + + // DestinationAssetFeePerSecond pre-upgrade data + let destination_asset_fee_per_second_storage_data: Vec<_> = + storage_key_iter::( + module_prefix, + destination_asset_fee_per_second, + ) + .collect(); + result.push(PreUpgradeState::DestinationAssetFeePerSecond( + destination_asset_fee_per_second_storage_data, + )); + + Ok(result.encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: Vec) -> Result<(), &'static str> { + log::trace!( + target: "XcmV2ToV3XcmTransactor", + "Running XcmV2ToV3XcmTransactor post_upgrade hook" + ); + let pre_upgrade_state: Vec = + Decode::decode(&mut &state[..]).expect("pre_upgrade provides a valid state; qed"); + + // Shared module prefix + let module_prefix = TransactInfoWithWeightLimit::::module_prefix(); + // TransactInfoWithWeightLimit + let transact_info_with_weight_limit = TransactInfoWithWeightLimit::::storage_prefix(); + // DestinationAssetFeePerSecond + let destination_asset_fee_per_second = DestinationAssetFeePerSecond::::storage_prefix(); + + // First we convert pre-state to post-state. This is equivalent to what the migration + // should do. If this conversion and the result of the migration match, we consider it a + // success. + let to_post_upgrade: Vec = pre_upgrade_state + .into_iter() + .map(|value| value.into()) + .collect(); + + // Because the order of the storage and the pre-upgrade vector is likely different, + // we encode everything, which is easier to sort and compare. + let mut expected_post_upgrade_state: Vec> = Vec::new(); + for item in to_post_upgrade.iter() { + match item { + PostUpgradeState::TransactInfoWithWeightLimit(items) => { + for inner in items.into_iter() { + expected_post_upgrade_state.push(inner.encode()) + } + } + PostUpgradeState::DestinationAssetFeePerSecond(items) => { + for inner in items.into_iter() { + expected_post_upgrade_state.push(inner.encode()) + } + } + } + } + + let mut actual_post_upgrade_state: Vec> = Vec::new(); + + // Actual TransactInfoWithWeightLimit post-upgrade data + let transact_info_with_weight_limit_storage_data: Vec<_> = + storage_key_iter::( + module_prefix, + transact_info_with_weight_limit, + ) + .collect(); + for item in transact_info_with_weight_limit_storage_data.iter() { + actual_post_upgrade_state.push(item.encode()) + } + + // Actual DestinationAssetFeePerSecond post-upgrade data + let destination_asset_fee_per_second_storage_data: Vec<_> = + storage_key_iter::( + module_prefix, + destination_asset_fee_per_second, + ) + .collect(); + for item in destination_asset_fee_per_second_storage_data.iter() { + actual_post_upgrade_state.push(item.encode()) + } + + // Both state blobs are sorted. + expected_post_upgrade_state.sort(); + actual_post_upgrade_state.sort(); + + // Assert + assert_eq!(expected_post_upgrade_state, actual_post_upgrade_state); + + Ok(()) + } +} diff --git a/pallets/xcm-transactor/src/mock.rs b/pallets/xcm-transactor/src/mock.rs index f73ffb80017..0b859325680 100644 --- a/pallets/xcm-transactor/src/mock.rs +++ b/pallets/xcm-transactor/src/mock.rs @@ -18,6 +18,7 @@ use super::*; use crate as pallet_xcm_transactor; +use cumulus_primitives_core::MultiAssets; use frame_support::traits::PalletInfo as PalletInfoTrait; use frame_support::{construct_runtime, parameter_types, weights::Weight}; use frame_system::EnsureRoot; @@ -27,18 +28,18 @@ use sp_core::{H160, H256}; use sp_io; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use xcm::latest::{ - opaque, Error as XcmError, Instruction, + opaque, Error as XcmError, Instruction, InteriorMultiLocation, Junction::{AccountKey20, PalletInstance, Parachain}, - Junctions, MultiAsset, MultiLocation, NetworkId, Result as XcmResult, SendResult, SendXcm, Xcm, + Junctions, MultiAsset, MultiLocation, NetworkId, Result as XcmResult, SendError, SendResult, + SendXcm, Xcm, XcmContext, XcmHash, }; -pub use xcm_primitives::XcmV2Weight; use xcm_primitives::{ HrmpAvailableCalls, HrmpEncodeCall, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, }; use sp_std::cell::RefCell; use xcm_executor::{ - traits::{InvertLocation, TransactAsset, WeightBounds, WeightTrader}, + traits::{TransactAsset, WeightBounds, WeightTrader}, Assets, }; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -124,17 +125,31 @@ impl pallet_timestamp::Config for Test { } pub struct DoNothingRouter; impl SendXcm for DoNothingRouter { - fn send_xcm(_dest: impl Into, _msg: Xcm<()>) -> SendResult { - Ok(()) + type Ticket = (); + + fn validate( + _destination: &mut Option, + _message: &mut Option, + ) -> SendResult { + Ok(((), MultiAssets::new())) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(XcmHash::default()) } } + pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation) -> XcmResult { + fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation, _context: &XcmContext) -> XcmResult { Ok(()) } - fn withdraw_asset(_what: &MultiAsset, _who: &MultiLocation) -> Result { + fn withdraw_asset( + _what: &MultiAsset, + _who: &MultiLocation, + _context: Option<&XcmContext>, + ) -> Result { Ok(Assets::default()) } } @@ -145,30 +160,20 @@ impl WeightTrader for DummyWeightTrader { DummyWeightTrader } - fn buy_weight(&mut self, _weight: XcmV2Weight, _payment: Assets) -> Result { + fn buy_weight(&mut self, _weight: Weight, _payment: Assets) -> Result { Ok(Assets::default()) } } -pub struct InvertNothing; -impl InvertLocation for InvertNothing { - fn invert_location(_: &MultiLocation) -> sp_std::result::Result { - Ok(MultiLocation::here()) - } - - fn ancestry() -> MultiLocation { - MultiLocation::here() - } -} use sp_std::marker::PhantomData; pub struct DummyWeigher(PhantomData); impl WeightBounds for DummyWeigher { - fn weight(_message: &mut Xcm) -> Result { - Ok(0) + fn weight(_message: &mut Xcm) -> Result { + Ok(Weight::zero()) } - fn instr_weight(_instruction: &Instruction) -> Result { - Ok(0) + fn instr_weight(_instruction: &Instruction) -> Result { + Ok(Weight::zero()) } } @@ -179,7 +184,7 @@ impl sp_runtime::traits::Convert for AccountIdToMultiLocatio MultiLocation::new( 0, Junctions::X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: as_h160.as_fixed_bytes().clone(), }), ) @@ -189,18 +194,23 @@ impl sp_runtime::traits::Convert for AccountIdToMultiLocatio parameter_types! { pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); - pub const BaseXcmWeight: XcmV2Weight = 1000; + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = (1, Junctions::X1(Parachain(ParachainId::get().into()))).into(); + pub SelfLocation: MultiLocation = + MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); - pub SelfReserve: MultiLocation = ( + pub SelfReserve: MultiLocation = MultiLocation::new( 1, Junctions::X2( Parachain(ParachainId::get().into()), - PalletInstance(::PalletInfo::index::().unwrap() as u8) - )).into(); + PalletInstance( + ::PalletInfo::index::().unwrap() as u8 + ) + )); pub MaxInstructions: u32 = 100; + + pub UniversalLocation: InteriorMultiLocation = RelayNetwork::get().into(); } #[derive(Encode, Decode)] @@ -331,9 +341,21 @@ pub fn sent_xcm() -> Vec<(MultiLocation, opaque::Xcm)> { } pub struct TestSendXcm; impl SendXcm for TestSendXcm { - fn send_xcm(dest: impl Into, msg: opaque::Xcm) -> SendResult { - SENT_XCM.with(|q| q.borrow_mut().push((dest.into(), msg))); - Ok(()) + type Ticket = (); + + fn validate( + destination: &mut Option, + message: &mut Option, + ) -> SendResult { + SENT_XCM.with(|q| { + q.borrow_mut() + .push((destination.clone().unwrap(), message.clone().unwrap())) + }); + Ok(((), MultiAssets::new())) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(XcmHash::default()) } } @@ -354,7 +376,7 @@ impl Config for Test { type AccountIdToMultiLocation = AccountIdToMultiLocation; type SelfLocation = SelfLocation; type Weigher = DummyWeigher; - type LocationInverter = InvertNothing; + type UniversalLocation = UniversalLocation; type BaseXcmWeight = BaseXcmWeight; type XcmSender = TestSendXcm; type ReserveProvider = orml_traits::location::RelativeReserveProvider; diff --git a/pallets/xcm-transactor/src/tests.rs b/pallets/xcm-transactor/src/tests.rs index 4a2ff060ad2..49957102b90 100644 --- a/pallets/xcm-transactor/src/tests.rs +++ b/pallets/xcm-transactor/src/tests.rs @@ -16,8 +16,8 @@ use crate::mock::*; use crate::*; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; -use frame_support::dispatch::DispatchError; +use cumulus_primitives_core::relay_chain::HrmpChannelId; +use frame_support::dispatch::{DispatchError, Weight}; use frame_support::{assert_noop, assert_ok, weights::constants::WEIGHT_REF_TIME_PER_SECOND}; use sp_std::boxed::Box; use xcm::latest::prelude::*; @@ -61,13 +61,13 @@ fn test_transact_through_derivative_errors() { 1, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -85,13 +85,13 @@ fn test_transact_through_derivative_errors() { 1, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -101,9 +101,9 @@ fn test_transact_through_derivative_errors() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); @@ -115,13 +115,13 @@ fn test_transact_through_derivative_errors() { 1, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -131,7 +131,7 @@ fn test_transact_through_derivative_errors() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::new( + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::new( 1, Junctions::X1(Junction::Parachain(1000)) ))), @@ -146,7 +146,7 @@ fn test_transact_through_derivative_errors() { 1, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::new( + xcm::VersionedMultiLocation::V3(MultiLocation::new( 1, Junctions::X1(Junction::Parachain(1000)) )) @@ -155,7 +155,7 @@ fn test_transact_through_derivative_errors() { }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -165,7 +165,7 @@ fn test_transact_through_derivative_errors() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -177,13 +177,13 @@ fn test_transact_through_derivative_errors() { 1, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 10001u64, + transact_required_weight_at_most: 10001u64.into(), overall_weight: None } ), @@ -202,16 +202,16 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -221,9 +221,9 @@ fn test_transact_through_signed_errors() { // Root can set transact info without extra_signed being None assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); @@ -231,16 +231,16 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -250,26 +250,26 @@ fn test_transact_through_signed_errors() { // Root can set transact info, with extra signed assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 15000, - Some(12000) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 15000.into(), + Some(12000.into()) )); // TransactInfo present, but FeePerSecond not set assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -279,7 +279,7 @@ fn test_transact_through_signed_errors() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::new( + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::new( 1, Junctions::X1(Junction::Parachain(1000)) ))), @@ -290,10 +290,10 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::new( + xcm::VersionedMultiLocation::V3(MultiLocation::new( 1, Junctions::X1(Junction::Parachain(1000)) )) @@ -302,7 +302,7 @@ fn test_transact_through_signed_errors() { }, vec![0u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -323,16 +323,16 @@ fn test_transact_through_derivative_multilocation_success() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -342,14 +342,14 @@ fn test_transact_through_derivative_multilocation_success() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } )); @@ -361,8 +361,8 @@ fn test_transact_through_derivative_multilocation_success() { crate::Event::TransactInfoChanged { location: MultiLocation::parent(), remote_info: RemoteTransactInfoWithMaxWeight { - transact_extra_weight: 0, - max_weight: 10000, + transact_extra_weight: 0.into(), + max_weight: 10000.into(), transact_extra_weight_signed: None, }, }, @@ -394,16 +394,16 @@ fn test_transact_through_derivative_success() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -418,7 +418,7 @@ fn test_transact_through_derivative_success() { }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } )); @@ -430,8 +430,8 @@ fn test_transact_through_derivative_success() { crate::Event::TransactInfoChanged { location: MultiLocation::parent(), remote_info: RemoteTransactInfoWithMaxWeight { - transact_extra_weight: 0, - max_weight: 10000, + transact_extra_weight: 0.into(), + max_weight: 10000.into(), transact_extra_weight_signed: None, }, }, @@ -461,18 +461,18 @@ fn test_root_can_transact_through_sovereign() { assert_noop!( XcmTransactor::transact_through_sovereign( RuntimeOrigin::signed(1), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1u64, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![1u8], OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -482,26 +482,26 @@ fn test_root_can_transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); // fee as destination are the same, this time it should work assert_ok!(XcmTransactor::transact_through_sovereign( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1u64, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -509,7 +509,7 @@ fn test_root_can_transact_through_sovereign() { vec![1u8], OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } )); @@ -518,8 +518,8 @@ fn test_root_can_transact_through_sovereign() { crate::Event::TransactInfoChanged { location: MultiLocation::parent(), remote_info: RemoteTransactInfoWithMaxWeight { - transact_extra_weight: 0, - max_weight: 10000, + transact_extra_weight: 0.into(), + max_weight: 10000.into(), transact_extra_weight_signed: None, }, }, @@ -545,7 +545,7 @@ fn test_fee_calculation_works() { .execute_with(|| { assert_eq!( XcmTransactor::calculate_fee_per_second( - 1000000000, + 1000000000.into(), 8 * WEIGHT_REF_TIME_PER_SECOND as u128 ), 8000000000 @@ -564,7 +564,7 @@ fn test_fee_calculation_works_kusama_0_9_20_case() { // integer arithmetic would round this to 12332587 // we test here that it rounds up to 12332588 instead assert_eq!( - XcmTransactor::calculate_fee_per_second(319324000, 38620923000), + XcmTransactor::calculate_fee_per_second(319324000.into(), 38620923000), 12332588 ); }) @@ -605,16 +605,16 @@ fn removing_transact_info_works() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); // Root can remove transact info assert_ok!(XcmTransactor::remove_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), )); assert!(XcmTransactor::transact_info(MultiLocation::parent()).is_none()); @@ -623,8 +623,8 @@ fn removing_transact_info_works() { crate::Event::TransactInfoChanged { location: MultiLocation::parent(), remote_info: RemoteTransactInfoWithMaxWeight { - transact_extra_weight: 0, - max_weight: 10000, + transact_extra_weight: 0.into(), + max_weight: 10000.into(), transact_extra_weight_signed: None, }, }, @@ -646,14 +646,14 @@ fn test_transact_through_signed_fails_if_transact_info_not_set_at_all() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -671,9 +671,9 @@ fn test_transact_through_signed_fails_if_weight_is_not_set() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), None )); @@ -681,14 +681,14 @@ fn test_transact_through_signed_fails_if_weight_is_not_set() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -706,24 +706,24 @@ fn test_transact_through_signed_fails_if_weight_overflows() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, - Some(u64::MAX) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), + Some(Weight::MAX) )); // weight should overflow assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 10064, + transact_required_weight_at_most: 10064u64.into(), overall_weight: None } ), @@ -741,24 +741,24 @@ fn test_transact_through_signed_fails_if_weight_is_bigger_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, - Some(1) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), + Some(1.into()) )); // 10000 + 1 > 10000 (max weight permitted by dest chain) assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100000u64, + transact_required_weight_at_most: 100000u64.into(), overall_weight: None } ), @@ -776,24 +776,24 @@ fn test_transact_through_signed_fails_if_fee_per_second_not_set() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, - Some(1) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), + Some(1.into()) )); // fee per second not set, fails assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } ), @@ -811,16 +811,16 @@ fn test_transact_through_signed_works() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000, - Some(1) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + 0.into(), + 10000.into(), + Some(1.into()) )); // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -828,14 +828,14 @@ fn test_transact_through_signed_works() { // this time it should work assert_ok!(XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None }, vec![1u8], TransactWeights { - transact_required_weight_at_most: 100u64, + transact_required_weight_at_most: 100u64.into(), overall_weight: None } )); @@ -844,9 +844,9 @@ fn test_transact_through_signed_works() { crate::Event::TransactInfoChanged { location: MultiLocation::parent(), remote_info: RemoteTransactInfoWithMaxWeight { - transact_extra_weight: 0, - max_weight: 10000, - transact_extra_weight_signed: Some(1), + transact_extra_weight: 0.into(), + max_weight: 10000.into(), + transact_extra_weight_signed: Some(1.into()), }, }, crate::Event::DestFeePerSecondChanged { @@ -874,8 +874,8 @@ fn test_send_through_derivative_with_custom_weight_and_fee() { // We are gonna use a total weight of 10_100, a tx weight of 100, // and a total fee of 100 - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 100u128; // By specifying total fee and total weight, we ensure @@ -920,7 +920,7 @@ fn test_send_through_derivative_with_custom_weight_and_fee() { weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { - origin_type: OriginKind::SovereignAccount, + origin_kind: OriginKind::SovereignAccount, require_weight_at_most: tx_weight, call: Transactors::Relay .encode_call(UtilityAvailableCalls::AsDerivative(1, vec![1u8])) @@ -940,8 +940,8 @@ fn test_send_through_sovereign_with_custom_weight_and_fee() { // We are gonna use a total weight of 10_100, a tx weight of 100, // and a total fee of 100 - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 100u128; // By specifying total fee and total weight, we ensure @@ -951,10 +951,10 @@ fn test_send_through_sovereign_with_custom_weight_and_fee() { // fee as destination are the same, this time it should work assert_ok!(XcmTransactor::transact_through_sovereign( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1u64, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) @@ -990,7 +990,7 @@ fn test_send_through_sovereign_with_custom_weight_and_fee() { weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { - origin_type: OriginKind::SovereignAccount, + origin_kind: OriginKind::SovereignAccount, require_weight_at_most: tx_weight, call: vec![1u8].into(), })); @@ -1005,8 +1005,8 @@ fn test_send_through_signed_with_custom_weight_and_fee() { .execute_with(|| { // We are gonna use a total weight of 10_100, a tx weight of 100, // and a total fee of 100 - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 100u128; // By specifying total fee and total weight, we ensure @@ -1016,9 +1016,9 @@ fn test_send_through_signed_with_custom_weight_and_fee() { // fee as destination are the same, this time it should work assert_ok!(XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) @@ -1047,7 +1047,7 @@ fn test_send_through_signed_with_custom_weight_and_fee() { weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { - origin_type: OriginKind::SovereignAccount, + origin_kind: OriginKind::SovereignAccount, require_weight_at_most: tx_weight, call: vec![1u8].into(), })); @@ -1062,8 +1062,8 @@ fn test_hrmp_manipulator_init() { .execute_with(|| { // We are gonna use a total weight of 10_100, a tx weight of 100, // and a total fee of 100 - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 100u128; assert_ok!(XcmTransactor::hrmp_manage( @@ -1074,7 +1074,7 @@ fn test_hrmp_manipulator_init() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) @@ -1096,7 +1096,7 @@ fn test_hrmp_manipulator_init() { weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { - origin_type: OriginKind::Native, + origin_kind: OriginKind::Native, require_weight_at_most: tx_weight, call: vec![1u8, 0u8].into(), })); @@ -1109,8 +1109,8 @@ fn test_hrmp_max_fee_errors() { .with_balances(vec![]) .build() .execute_with(|| { - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 10_000_000_000_000u128; assert_noop!( @@ -1123,7 +1123,7 @@ fn test_hrmp_max_fee_errors() { }), CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: Some(total_fee) }, @@ -1145,8 +1145,8 @@ fn test_hrmp_manipulator_accept() { .execute_with(|| { // We are gonna use a total weight of 10_100, a tx weight of 100, // and a total fee of 100 - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 100u128; assert_ok!(XcmTransactor::hrmp_manage( @@ -1155,7 +1155,7 @@ fn test_hrmp_manipulator_accept() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) @@ -1177,7 +1177,7 @@ fn test_hrmp_manipulator_accept() { weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { - origin_type: OriginKind::Native, + origin_kind: OriginKind::Native, require_weight_at_most: tx_weight, call: vec![1u8, 1u8].into(), })); @@ -1192,8 +1192,8 @@ fn test_hrmp_manipulator_close() { .execute_with(|| { // We are gonna use a total weight of 10_100, a tx weight of 100, // and a total fee of 100 - let total_weight = 10_100u64; - let tx_weight = 100_u64; + let total_weight: Weight = 10_100u64.into(); + let tx_weight: Weight = 100_u64.into(); let total_fee = 100u128; assert_ok!(XcmTransactor::hrmp_manage( @@ -1203,7 +1203,7 @@ fn test_hrmp_manipulator_close() { recipient: 1u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) @@ -1225,9 +1225,91 @@ fn test_hrmp_manipulator_close() { weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { - origin_type: OriginKind::Native, + origin_kind: OriginKind::Native, require_weight_at_most: tx_weight, call: vec![1u8, 2u8].into(), })); }) } + +#[test] +fn xcm_v2_to_v3_transact_info_with_weight_limit_works() { + ExtBuilder::default().build().execute_with(|| { + use frame_support::{migration::put_storage_value, Blake2_128Concat, StorageHasher}; + let pallet_prefix: &[u8] = b"XcmTransactor"; + let storage_item_prefix: &[u8] = b"TransactInfoWithWeightLimit"; + use frame_support::traits::OnRuntimeUpgrade; + use parity_scale_codec::Encode; + + let para_id = mock::ParachainId::get(); + + let old_multilocation = xcm::v2::MultiLocation { + parents: 1, + interior: xcm::v2::Junctions::X2( + xcm::v2::Junction::Parachain(para_id.into()), + xcm::v2::Junction::GeneralIndex(1), + ), + }; + + let old_value = crate::migrations::OldRemoteTransactInfoWithMaxWeight { + transact_extra_weight: 10u64, + max_weight: 10u64, + transact_extra_weight_signed: Some(10u64), + }; + + let expected_value: crate::RemoteTransactInfoWithMaxWeight = old_value.clone().into(); + + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&old_multilocation.encode()), + old_value, + ); + + crate::migrations::XcmV2ToV3XcmTransactor::::on_runtime_upgrade(); + + let new_expected_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("convert xcm v2 into v3"); + let new_value: crate::RemoteTransactInfoWithMaxWeight = + XcmTransactor::transact_info(new_expected_multilocation).expect("migrated to xcm v3"); + assert!(new_value == expected_value); + }); +} + +#[test] +fn xcm_v2_to_v3_destination_asset_fee_per_second_works() { + ExtBuilder::default().build().execute_with(|| { + use frame_support::{migration::put_storage_value, StorageHasher, Twox64Concat}; + let pallet_prefix: &[u8] = b"XcmTransactor"; + let storage_item_prefix: &[u8] = b"DestinationAssetFeePerSecond"; + use frame_support::traits::OnRuntimeUpgrade; + use parity_scale_codec::Encode; + + let para_id = mock::ParachainId::get(); + + let old_multilocation = xcm::v2::MultiLocation { + parents: 1, + interior: xcm::v2::Junctions::X2( + xcm::v2::Junction::Parachain(para_id.into()), + xcm::v2::Junction::GeneralIndex(1), + ), + }; + + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Twox64Concat::hash(&old_multilocation.encode()), + 7u128, + ); + + crate::migrations::XcmV2ToV3XcmTransactor::::on_runtime_upgrade(); + + let new_expected_multilocation: MultiLocation = old_multilocation + .try_into() + .expect("convert xcm v2 into v3"); + let new_value: u128 = XcmTransactor::dest_asset_fee_per_second(new_expected_multilocation) + .expect("migrated to xcm v3"); + assert!(new_value == 7u128); + }); +} diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index d9cf8c47a2e..6189470317b 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -198,6 +198,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } type ForeignAssetInstance = pallet_assets::Instance1; @@ -229,7 +230,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -250,7 +251,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); diff --git a/precompiles/assets-erc20/src/tests.rs b/precompiles/assets-erc20/src/tests.rs index 686b86ca582..38e13710767 100644 --- a/precompiles/assets-erc20/src/tests.rs +++ b/precompiles/assets-erc20/src/tests.rs @@ -267,7 +267,7 @@ fn approve() { value: 500.into(), }, ) - .expect_cost(46005756) + .expect_cost(27666756) .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_APPROVAL, @@ -308,7 +308,7 @@ fn approve_saturating() { value: U256::MAX, }, ) - .expect_cost(46005756) + .expect_cost(27666756) .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_APPROVAL, @@ -437,7 +437,7 @@ fn transfer() { value: 400.into(), }, ) - .expect_cost(59448756) // 1 weight => 1 gas in mock + .expect_cost(43534756) // 1 weight => 1 gas in mock .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -564,7 +564,7 @@ fn transfer_from() { value: 400.into(), }, ) - .expect_cost(71723756) // 1 weight => 1 gas in mock + .expect_cost(56637756) // 1 weight => 1 gas in mock .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -642,7 +642,7 @@ fn transfer_from_non_incremental_approval() { value: 500.into(), }, ) - .expect_cost(46005756) + .expect_cost(27666756) .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_APPROVAL, @@ -665,7 +665,7 @@ fn transfer_from_non_incremental_approval() { value: 300.into(), }, ) - .expect_cost(92915756) + .expect_cost(56991756) .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_APPROVAL, @@ -773,7 +773,7 @@ fn transfer_from_self() { value: 400.into(), }, ) - .expect_cost(59448756) // 1 weight => 1 gas in mock + .expect_cost(43534756) // 1 weight => 1 gas in mock .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -940,7 +940,7 @@ fn mint_local_assets() { value: 400.into(), }, ) - .expect_cost(37341756) // 1 weight => 1 gas in mock + .expect_cost(25785756) // 1 weight => 1 gas in mock .expect_log(log3( LocalAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -1001,7 +1001,7 @@ fn burn_local_assets() { value: 400.into(), }, ) - .expect_cost(45486756) // 1 weight => 1 gas in mock + .expect_cost(31512756) // 1 weight => 1 gas in mock .expect_log(log3( LocalAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -1061,7 +1061,7 @@ fn freeze_local_assets() { account: Address(Bob.into()), }, ) - .expect_cost(27373000) // 1 weight => 1 gas in mock + .expect_cost(17498000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1119,7 +1119,7 @@ fn thaw_local_assets() { account: Address(Bob.into()), }, ) - .expect_cost(27373000) // 1 weight => 1 gas in mock + .expect_cost(17498000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1131,7 +1131,7 @@ fn thaw_local_assets() { account: Address(Bob.into()), }, ) - .expect_cost(26854000) // 1 weight => 1 gas in mock + .expect_cost(17842000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1144,7 +1144,7 @@ fn thaw_local_assets() { value: 400.into(), }, ) - .expect_cost(59448756) // 1 weight => 1 gas in mock + .expect_cost(43534756) // 1 weight => 1 gas in mock .expect_log(log3( LocalAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -1190,7 +1190,7 @@ fn freeze_asset_local_asset() { LocalAssetId(0u128), LocalPCall::freeze_asset {}, ) - .expect_cost(23613000) // 1 weight => 1 gas in mock + .expect_cost(13719000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1246,13 +1246,13 @@ fn thaw_asset_local_assets() { LocalAssetId(0u128), LocalPCall::freeze_asset {}, ) - .expect_cost(23613000) // 1 weight => 1 gas in mock + .expect_cost(13719000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); precompiles() .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::thaw_asset {}) - .expect_cost(24121000) // 1 weight => 1 gas in mock + .expect_cost(13764000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1265,7 +1265,7 @@ fn thaw_asset_local_assets() { value: 400.into(), }, ) - .expect_cost(59448756) // 1 weight => 1 gas in mock + .expect_cost(43534756) // 1 weight => 1 gas in mock .expect_log(log3( LocalAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -1307,7 +1307,7 @@ fn transfer_ownership_local_assets() { owner: Address(Bob.into()), }, ) - .expect_cost(24347000) // 1 weight => 1 gas in mock + .expect_cost(15366000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1335,7 +1335,7 @@ fn transfer_ownership_local_assets() { owner: Address(CryptoAlith.into()), }, ) - .expect_cost(24347000) // 1 weight => 1 gas in mock + .expect_cost(15366000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); }); @@ -1373,7 +1373,7 @@ fn set_team_local_assets() { freezer: Address(Bob.into()), }, ) - .expect_cost(23518000) // 1 weight => 1 gas in mock + .expect_cost(14437000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1403,7 +1403,7 @@ fn set_team_local_assets() { value: 400.into(), }, ) - .expect_cost(37341756) // 1 weight => 1 gas in mock + .expect_cost(25785756) // 1 weight => 1 gas in mock .expect_log(log3( LocalAssetId(0u128), SELECTOR_LOG_TRANSFER, @@ -1459,7 +1459,7 @@ fn set_metadata() { decimals: 12, }, ) - .expect_cost(42853124) // 1 weight => 1 gas in mock + .expect_cost(24489304) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1523,7 +1523,7 @@ fn clear_metadata() { decimals: 12, }, ) - .expect_cost(42853124) // 1 weight => 1 gas in mock + .expect_cost(24489304) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1533,7 +1533,7 @@ fn clear_metadata() { LocalAssetId(0u128), LocalPCall::clear_metadata {}, ) - .expect_cost(42957000) // 1 weight => 1 gas in mock + .expect_cost(24812000) // 1 weight => 1 gas in mock .expect_no_logs() .execute_returns_encoded(true); @@ -1630,7 +1630,7 @@ fn permit_valid() { s: H256::from(rs.s.b32()), }, ) - .expect_cost(46004000) + .expect_cost(27665000) .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_APPROVAL, @@ -1739,7 +1739,7 @@ fn permit_valid_named_asset() { s: H256::from(rs.s.b32()), }, ) - .expect_cost(46004000) + .expect_cost(27665000) .expect_log(log3( ForeignAssetId(0u128), SELECTOR_LOG_APPROVAL, @@ -2217,7 +2217,7 @@ fn permit_valid_with_metamask_signed_data() { s: H256::from(s_real), }, ) - .expect_cost(46004000) + .expect_cost(27665000) .expect_log(log3( ForeignAssetId(1u128), SELECTOR_LOG_APPROVAL, diff --git a/precompiles/author-mapping/src/mock.rs b/precompiles/author-mapping/src/mock.rs index 596a27a937c..b38fe263925 100644 --- a/precompiles/author-mapping/src/mock.rs +++ b/precompiles/author-mapping/src/mock.rs @@ -126,6 +126,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/balances-erc20/src/mock.rs b/precompiles/balances-erc20/src/mock.rs index 864633e17a3..febb60342af 100644 --- a/precompiles/balances-erc20/src/mock.rs +++ b/precompiles/balances-erc20/src/mock.rs @@ -119,6 +119,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } // Configure a mock runtime to test the pallet. diff --git a/precompiles/balances-erc20/src/tests.rs b/precompiles/balances-erc20/src/tests.rs index 541e00e0419..602791dc240 100644 --- a/precompiles/balances-erc20/src/tests.rs +++ b/precompiles/balances-erc20/src/tests.rs @@ -280,7 +280,7 @@ fn transfer() { value: 400.into(), }, ) - .expect_cost(173812756) // 1 weight => 1 gas in mock + .expect_cost(173315756) // 1 weight => 1 gas in mock .expect_log(log3( Precompile1, SELECTOR_LOG_TRANSFER, @@ -367,7 +367,7 @@ fn transfer_from() { value: 400.into(), }, ) - .expect_cost(173812756) // 1 weight => 1 gas in mock + .expect_cost(173315756) // 1 weight => 1 gas in mock .expect_log(log3( Precompile1, SELECTOR_LOG_TRANSFER, @@ -463,7 +463,7 @@ fn transfer_from_self() { value: 400.into(), }, ) - .expect_cost(173812756) // 1 weight => 1 gas in mock + .expect_cost(173315756) // 1 weight => 1 gas in mock .expect_log(log3( Precompile1, SELECTOR_LOG_TRANSFER, diff --git a/precompiles/batch/src/mock.rs b/precompiles/batch/src/mock.rs index 8002c2ed2e9..2a48db7d7ee 100644 --- a/precompiles/batch/src/mock.rs +++ b/precompiles/batch/src/mock.rs @@ -140,6 +140,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/call-permit/src/mock.rs b/precompiles/call-permit/src/mock.rs index c334984b8a7..ab037c580b7 100644 --- a/precompiles/call-permit/src/mock.rs +++ b/precompiles/call-permit/src/mock.rs @@ -131,6 +131,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = (); type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/collective/Cargo.toml b/precompiles/collective/Cargo.toml index 65963f5049e..06804e66f92 100644 --- a/precompiles/collective/Cargo.toml +++ b/precompiles/collective/Cargo.toml @@ -13,6 +13,7 @@ slices = { workspace = true } # Moonbeam precompile-utils = { workspace = true } +xcm-primitives = { workspace = true } # Substrate frame-support = { workspace = true } diff --git a/precompiles/collective/src/lib.rs b/precompiles/collective/src/lib.rs index 7438f53503c..dfc297720e6 100644 --- a/precompiles/collective/src/lib.rs +++ b/precompiles/collective/src/lib.rs @@ -255,7 +255,10 @@ where pallet_collective::Call::::close { proposal_hash: proposal_hash.into(), index: proposal_index, - proposal_weight_bound: Weight::from_ref_time(proposal_weight_bound), + proposal_weight_bound: Weight::from_parts( + proposal_weight_bound, + xcm_primitives::DEFAULT_PROOF_SIZE, + ), length_bound, }, )?; diff --git a/precompiles/collective/src/mock.rs b/precompiles/collective/src/mock.rs index 83623f6a06f..9806cc74a67 100644 --- a/precompiles/collective/src/mock.rs +++ b/precompiles/collective/src/mock.rs @@ -134,6 +134,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/conviction-voting/src/mock.rs b/precompiles/conviction-voting/src/mock.rs index 435a9fa3850..d3775cc696a 100644 --- a/precompiles/conviction-voting/src/mock.rs +++ b/precompiles/conviction-voting/src/mock.rs @@ -129,6 +129,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/crowdloan-rewards/src/mock.rs b/precompiles/crowdloan-rewards/src/mock.rs index e7da84ee52d..bf2850c7db5 100644 --- a/precompiles/crowdloan-rewards/src/mock.rs +++ b/precompiles/crowdloan-rewards/src/mock.rs @@ -151,6 +151,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/pallet-democracy/src/mock.rs b/precompiles/pallet-democracy/src/mock.rs index 2db01ccc55f..fd3f5909870 100644 --- a/precompiles/pallet-democracy/src/mock.rs +++ b/precompiles/pallet-democracy/src/mock.rs @@ -125,6 +125,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/parachain-staking/src/mock.rs b/precompiles/parachain-staking/src/mock.rs index 6055fa551ff..9a5440c9c1d 100644 --- a/precompiles/parachain-staking/src/mock.rs +++ b/precompiles/parachain-staking/src/mock.rs @@ -132,6 +132,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/preimage/src/mock.rs b/precompiles/preimage/src/mock.rs index 59b9977139a..2fd2bd97736 100644 --- a/precompiles/preimage/src/mock.rs +++ b/precompiles/preimage/src/mock.rs @@ -124,6 +124,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/proxy/src/mock.rs b/precompiles/proxy/src/mock.rs index fccc38f7d67..87946c4fa70 100644 --- a/precompiles/proxy/src/mock.rs +++ b/precompiles/proxy/src/mock.rs @@ -161,6 +161,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/randomness/src/mock.rs b/precompiles/randomness/src/mock.rs index 840deab256d..75f7aa9e646 100644 --- a/precompiles/randomness/src/mock.rs +++ b/precompiles/randomness/src/mock.rs @@ -140,6 +140,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = (); type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/referenda/src/mock.rs b/precompiles/referenda/src/mock.rs index b19ed0bace8..9c0114ffd7f 100644 --- a/precompiles/referenda/src/mock.rs +++ b/precompiles/referenda/src/mock.rs @@ -140,6 +140,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/relay-encoder/src/lib.rs b/precompiles/relay-encoder/src/lib.rs index 284934a04a6..db23f470e41 100644 --- a/precompiles/relay-encoder/src/lib.rs +++ b/precompiles/relay-encoder/src/lib.rs @@ -326,7 +326,7 @@ where handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; let encoded = RelayRuntime::hrmp_encode_call(HrmpAvailableCalls::CloseChannel( - relay_chain::v2::HrmpChannelId { + relay_chain::HrmpChannelId { sender: sender.into(), recipient: recipient.into(), }, diff --git a/precompiles/relay-encoder/src/mock.rs b/precompiles/relay-encoder/src/mock.rs index e94d3d38bdb..a8008f3299c 100644 --- a/precompiles/relay-encoder/src/mock.rs +++ b/precompiles/relay-encoder/src/mock.rs @@ -140,6 +140,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/relay-encoder/src/test_relay_runtime.rs b/precompiles/relay-encoder/src/test_relay_runtime.rs index 10a127e2d64..d91d0454a0f 100644 --- a/precompiles/relay-encoder/src/test_relay_runtime.rs +++ b/precompiles/relay-encoder/src/test_relay_runtime.rs @@ -16,7 +16,7 @@ use crate::AvailableStakeCalls; use crate::StakeEncodeCall; -use cumulus_primitives_core::{relay_chain::v2::HrmpChannelId, ParaId}; +use cumulus_primitives_core::{relay_chain::HrmpChannelId, ParaId}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::traits::{AccountIdLookup, StaticLookup}; use sp_runtime::AccountId32; diff --git a/precompiles/utils/macro/Cargo.toml b/precompiles/utils/macro/Cargo.toml index 06e2988e5bd..f27ee05bd84 100644 --- a/precompiles/utils/macro/Cargo.toml +++ b/precompiles/utils/macro/Cargo.toml @@ -27,7 +27,7 @@ trybuild = "1.0" precompile-utils = { path = "../", features = [ "testing" ] } -fp-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37" } +fp-evm = { workspace = true } frame-support = { workspace = true } -sp-core = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } -sp-std = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" } +sp-core = { workspace = true } +sp-std = { workspace = true } diff --git a/precompiles/utils/src/data/xcm.rs b/precompiles/utils/src/data/xcm.rs index 1e7359a5db8..b066904de26 100644 --- a/precompiles/utils/src/data/xcm.rs +++ b/precompiles/utils/src/data/xcm.rs @@ -33,36 +33,82 @@ pub const JUNCTION_SIZE_LIMIT: u32 = 2u32.pow(16); // We don't implement EVMData here as these bytes will be appended only // to certain Junction variants // Each NetworkId variant is represented as bytes -// The first byte represents the enum variant to be used +// The first byte represents the enum variant to be used. +// - Indexes 0,2,3 represent XCM V2 variants +// - Index 1 changes name in V3 (`ByGenesis`), but is compatible with V2 `Named` +// - Indexes 4~10 represent new XCM V3 variants // The rest of the bytes (if any), represent the additional data that such enum variant requires -// In this case, only Named requires additional non-bounded data. // In such a case, since NetworkIds will be appended at the end, we will read the buffer until the // end to recover the name -pub(crate) fn network_id_to_bytes(network_id: NetworkId) -> Vec { + +pub(crate) fn network_id_to_bytes(network_id: Option) -> Vec { let mut encoded: Vec = Vec::new(); match network_id.clone() { - NetworkId::Any => { + None => { encoded.push(0u8); encoded } - NetworkId::Named(name) => { + Some(NetworkId::ByGenesis(id)) => { encoded.push(1u8); - encoded.append(&mut name.into_inner()); + encoded.append(&mut id.into()); encoded } - NetworkId::Polkadot => { + Some(NetworkId::Polkadot) => { + encoded.push(2u8); encoded.push(2u8); encoded } - NetworkId::Kusama => { + Some(NetworkId::Kusama) => { encoded.push(3u8); + encoded.push(3u8); + encoded + } + Some(NetworkId::ByFork { + block_number, + block_hash, + }) => { + encoded.push(4u8); + encoded.push(1u8); + encoded.append(&mut block_number.to_be_bytes().into()); + encoded.append(&mut block_hash.into()); + encoded + } + Some(NetworkId::Westend) => { + encoded.push(5u8); + encoded.push(4u8); + encoded + } + Some(NetworkId::Rococo) => { + encoded.push(6u8); + encoded.push(5u8); + encoded + } + Some(NetworkId::Wococo) => { + encoded.push(7u8); + encoded.push(6u8); + encoded + } + Some(NetworkId::Ethereum { chain_id }) => { + encoded.push(8u8); + encoded.push(7u8); + encoded.append(&mut chain_id.to_be_bytes().into()); + encoded + } + Some(NetworkId::BitcoinCore) => { + encoded.push(9u8); + encoded.push(8u8); + encoded + } + Some(NetworkId::BitcoinCash) => { + encoded.push(10u8); + encoded.push(9u8); encoded } } } // Function to convert bytes to networkId -pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert { +pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert> { ensure!( encoded_bytes.len() > 0, RevertReason::custom("Junctions cannot be empty") @@ -74,17 +120,42 @@ pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert Ok(NetworkId::Any), - 1 => Ok(NetworkId::Named( + 0 => Ok(None), + 1 => Ok(Some(NetworkId::ByGenesis( encoded_network_id .read_till_end() - .in_field("name")? + .in_field("genesis")? .to_vec() .try_into() - .map_err(|_| RevertReason::value_is_too_large("network name").in_field("name"))?, - )), - 2 => Ok(NetworkId::Polkadot), - 3 => Ok(NetworkId::Kusama), + .map_err(|_| { + RevertReason::value_is_too_large("network by genesis").in_field("genesis") + })?, + ))), + 2 => Ok(Some(NetworkId::Polkadot)), + 3 => Ok(Some(NetworkId::Kusama)), + 4 => { + let mut block_number: [u8; 8] = Default::default(); + block_number.copy_from_slice(&encoded_network_id.read_raw_bytes(8)?); + + let mut block_hash: [u8; 32] = Default::default(); + block_hash.copy_from_slice(&encoded_network_id.read_raw_bytes(32)?); + Ok(Some(NetworkId::ByFork { + block_number: u64::from_be_bytes(block_number), + block_hash, + })) + } + 5 => Ok(Some(NetworkId::Westend)), + 6 => Ok(Some(NetworkId::Rococo)), + 7 => Ok(Some(NetworkId::Wococo)), + 8 => { + let mut chain_id: [u8; 8] = Default::default(); + chain_id.copy_from_slice(&encoded_network_id.read_raw_bytes(8)?); + Ok(Some(NetworkId::Ethereum { + chain_id: u64::from_be_bytes(chain_id), + })) + } + 9 => Ok(Some(NetworkId::BitcoinCore)), + 10 => Ok(Some(NetworkId::BitcoinCash)), _ => Err(RevertReason::custom("Non-valid Network Id").into()), } } @@ -158,14 +229,32 @@ impl EvmData for Junction { general_index.copy_from_slice(&encoded_junction.read_raw_bytes(16)?); Ok(Junction::GeneralIndex(u128::from_be_bytes(general_index))) } - 6 => Ok(Junction::GeneralKey( - encoded_junction - .read_till_end()? - .to_vec() - .try_into() - .map_err(|_| RevertReason::custom("junction general key is too long"))?, - )), + 6 => { + let mut length: [u8; 1] = Default::default(); + length.copy_from_slice( + encoded_junction + .read_raw_bytes(1) + .map_err(|_| RevertReason::read_out_of_bounds("General Key length"))?, + ); + + let mut data: [u8; 32] = Default::default(); + data.copy_from_slice(&encoded_junction.read_till_end()?); + + Ok(Junction::GeneralKey { + length: u8::from_be_bytes(length), + data, + }) + } 7 => Ok(Junction::OnlyChild), + 8 => Err(RevertReason::custom("Junction::Plurality not supported yet").into()), + 9 => { + let network = encoded_junction.read_till_end()?.to_vec(); + if let Some(network_id) = network_id_from_bytes(network)? { + Ok(Junction::GlobalConsensus(network_id)) + } else { + Err(RevertReason::custom("Unknown NetworkId").into()) + } + } _ => Err(RevertReason::custom("Unknown Junction variant").into()), } } @@ -206,15 +295,21 @@ impl EvmData for Junction { encoded.append(&mut id.to_be_bytes().to_vec()); encoded.as_slice().into() } - Junction::GeneralKey(key) => { + Junction::GeneralKey { length, data } => { encoded.push(6u8); - encoded.append(&mut key.into_inner()); + encoded.push(length); + encoded.append(&mut data.into()); encoded.as_slice().into() } Junction::OnlyChild => { encoded.push(7u8); encoded.as_slice().into() } + Junction::GlobalConsensus(network_id) => { + encoded.push(9u8); + encoded.append(&mut network_id_to_bytes(Some(network_id))); + encoded.as_slice().into() + } // TODO: The only missing item here is Junciton::Plurality. This is a complex encoded // type that we need to evaluate how to support _ => unreachable!("Junction::Plurality not supported yet"), diff --git a/precompiles/utils/src/tests.rs b/precompiles/utils/src/tests.rs index 92eee98a8e8..7a9aa561571 100644 --- a/precompiles/utils/src/tests.rs +++ b/precompiles/utils/src/tests.rs @@ -822,7 +822,7 @@ fn junction_decoder_works() { let writer_output = EvmDataWriter::new() .write(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }) .build(); @@ -835,14 +835,14 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], } ); let writer_output = EvmDataWriter::new() .write(Junction::AccountIndex64 { - network: NetworkId::Any, + network: None, index: u64::from_be_bytes([1u8; 8]), }) .build(); @@ -855,14 +855,14 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountIndex64 { - network: NetworkId::Any, + network: None, index: u64::from_be_bytes([1u8; 8]), } ); let writer_output = EvmDataWriter::new() .write(Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: H160::repeat_byte(0xAA).as_bytes().try_into().unwrap(), }) .build(); @@ -875,7 +875,7 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: H160::repeat_byte(0xAA).as_bytes().try_into().unwrap(), } ); @@ -883,28 +883,23 @@ fn junction_decoder_works() { #[test] fn network_id_decoder_works() { - assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Any)), - Ok(NetworkId::Any) - ); + assert_eq!(network_id_from_bytes(network_id_to_bytes(None)), Ok(None)); + let mut name = [0u8; 32]; + name[0..6].copy_from_slice(b"myname"); assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Named( - b"myname".to_vec().try_into().expect("name not too long") - ))), - Ok(NetworkId::Named( - b"myname".to_vec().try_into().expect("name not too long") - )) + network_id_from_bytes(network_id_to_bytes(Some(NetworkId::ByGenesis(name)))), + Ok(Some(NetworkId::ByGenesis(name))) ); assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Kusama)), - Ok(NetworkId::Kusama) + network_id_from_bytes(network_id_to_bytes(Some(NetworkId::Kusama))), + Ok(Some(NetworkId::Kusama)) ); assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Polkadot)), - Ok(NetworkId::Polkadot) + network_id_from_bytes(network_id_to_bytes(Some(NetworkId::Polkadot))), + Ok(Some(NetworkId::Polkadot)) ); } diff --git a/precompiles/utils/tests-external/lib.rs b/precompiles/utils/tests-external/lib.rs index e6ef23ae063..f97e7d6cee0 100644 --- a/precompiles/utils/tests-external/lib.rs +++ b/precompiles/utils/tests-external/lib.rs @@ -173,6 +173,7 @@ mod tests { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { diff --git a/precompiles/xcm-transactor/Cargo.toml b/precompiles/xcm-transactor/Cargo.toml index 9bdd33546a2..980d35f1989 100644 --- a/precompiles/xcm-transactor/Cargo.toml +++ b/precompiles/xcm-transactor/Cargo.toml @@ -43,7 +43,7 @@ precompile-utils = { workspace = true, features = [ "testing" ] } xcm-primitives = { workspace = true } # Substrate -pallet-balances = { workspace = true } +pallet-balances = { workspace = true, features = [ "std" ] } pallet-timestamp = { workspace = true } parity-scale-codec = { workspace = true, features = [ "max-encoded-len" ] } scale-info = { workspace = true, features = [ "derive" ] } diff --git a/precompiles/xcm-transactor/src/functions.rs b/precompiles/xcm-transactor/src/functions.rs index 3eb09eda87f..72e97a759e1 100644 --- a/precompiles/xcm-transactor/src/functions.rs +++ b/precompiles/xcm-transactor/src/functions.rs @@ -18,7 +18,7 @@ use fp_evm::PrecompileHandle; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, + dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo, Weight}, traits::ConstU32, }; use pallet_evm::AddressMapping; @@ -34,7 +34,9 @@ use sp_std::{ vec::Vec, }; use xcm::latest::MultiLocation; -use xcm_primitives::{AccountIdToCurrencyId, UtilityAvailableCalls, UtilityEncodeCall}; +use xcm_primitives::{ + AccountIdToCurrencyId, UtilityAvailableCalls, UtilityEncodeCall, DEFAULT_PROOF_SIZE, +}; /// A precompile to wrap the functionality from xcm transactor pub struct XcmTransactorWrapper(PhantomData); @@ -86,9 +88,9 @@ where .ok_or(revert("Fee Per Second not set"))?; Ok(( - remote_transact_info.transact_extra_weight, + remote_transact_info.transact_extra_weight.ref_time(), fee_per_second.into(), - remote_transact_info.max_weight, + remote_transact_info.max_weight.ref_time(), )) } @@ -105,12 +107,12 @@ where let transact_extra_weight_signed = remote_transact_info .transact_extra_weight_signed - .unwrap_or(0); + .unwrap_or(Weight::zero()); Ok(( - remote_transact_info.transact_extra_weight, - transact_extra_weight_signed, - remote_transact_info.max_weight, + remote_transact_info.transact_extra_weight.ref_time(), + transact_extra_weight_signed.ref_time(), + remote_transact_info.max_weight.ref_time(), )) } @@ -148,14 +150,21 @@ where dest: transactor, index, fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( fee_asset, ))), fee_amount: None, }, inner_call, weight_info: TransactWeights { - transact_required_weight_at_most: weight, + // TODO overall weight None means we will retrieve the allowed proof size from storage. + // In the v2 to v3 migration we set this value to DEFAULT_PROOF_SIZE, so setting + // require_weight_at_most to DEFAULT_PROOF_SIZE/2 makes sense. Although we might + // want to revisit this to use whatever storage value there is and divide it by 2. + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), overall_weight: None, }, }; @@ -188,15 +197,18 @@ where dest: transactor, index, fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( fee_asset, ))), fee_amount: Some(fee_amount), }, inner_call, weight_info: TransactWeights { - transact_required_weight_at_most: weight, - overall_weight: Some(overall_weight), + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), + overall_weight: Some(Weight::from_parts(overall_weight, DEFAULT_PROOF_SIZE)), }, }; @@ -238,7 +250,10 @@ where fee_amount: None, }, weight_info: TransactWeights { - transact_required_weight_at_most: weight, + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), overall_weight: None, }, inner_call, @@ -285,8 +300,11 @@ where fee_amount: Some(fee_amount), }, weight_info: TransactWeights { - transact_required_weight_at_most: weight, - overall_weight: Some(overall_weight), + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), + overall_weight: Some(Weight::from_parts(overall_weight, DEFAULT_PROOF_SIZE)), }, inner_call, }; @@ -309,15 +327,18 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(dest)), + dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( fee_asset, ))), fee_amount: None, }, weight_info: TransactWeights { - transact_required_weight_at_most: weight, + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), overall_weight: None, }, call, @@ -343,16 +364,19 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(dest)), + dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( fee_asset, ))), fee_amount: Some(fee_amount), }, weight_info: TransactWeights { - transact_required_weight_at_most: weight, - overall_weight: Some(overall_weight), + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), + overall_weight: Some(Weight::from_parts(overall_weight, DEFAULT_PROOF_SIZE)), }, call, }; @@ -385,13 +409,16 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(dest)), + dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), fee: CurrencyPayment { currency: Currency::AsCurrencyId(currency_id), fee_amount: None, }, weight_info: TransactWeights { - transact_required_weight_at_most: weight, + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), overall_weight: None, }, call, @@ -427,14 +454,17 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(dest)), + dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), fee: CurrencyPayment { currency: Currency::AsCurrencyId(currency_id), fee_amount: Some(fee_amount), }, weight_info: TransactWeights { - transact_required_weight_at_most: weight, - overall_weight: Some(overall_weight), + transact_required_weight_at_most: Weight::from_parts( + weight, + DEFAULT_PROOF_SIZE.saturating_div(2), + ), + overall_weight: Some(Weight::from_parts(overall_weight, DEFAULT_PROOF_SIZE)), }, call, }; diff --git a/precompiles/xcm-transactor/src/mock.rs b/precompiles/xcm-transactor/src/mock.rs index 4c6c6763289..03c5e6b14c4 100644 --- a/precompiles/xcm-transactor/src/mock.rs +++ b/precompiles/xcm-transactor/src/mock.rs @@ -32,17 +32,13 @@ use precompile_utils::{ use scale_info::TypeInfo; use sp_core::{H160, H256, U256}; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; -use xcm::latest::{ - Error as XcmError, - Junction::{AccountKey20, GeneralIndex, PalletInstance, Parachain}, - Junctions, MultiAsset, MultiLocation, NetworkId, Result as XcmResult, SendResult, SendXcm, Xcm, -}; +use xcm::latest::{prelude::*, Error as XcmError}; use xcm_builder::FixedWeightBounds; use xcm_executor::{ - traits::{InvertLocation, TransactAsset, WeightTrader}, + traits::{TransactAsset, WeightTrader}, Assets, }; -use xcm_primitives::{AccountIdToCurrencyId, XcmV2Weight}; +use xcm_primitives::AccountIdToCurrencyId; pub type AccountId = MockAccount; pub type Balance = u128; @@ -73,7 +69,7 @@ impl sp_runtime::traits::Convert for AccountIdToMultiL MultiLocation::new( 0, Junctions::X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: as_h160.as_fixed_bytes().clone(), }), ) @@ -199,6 +195,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { @@ -226,18 +223,31 @@ impl EnsureOrigin for ConvertOriginToLocal { pub struct DoNothingRouter; impl SendXcm for DoNothingRouter { - fn send_xcm(_dest: impl Into, _msg: Xcm<()>) -> SendResult { - Ok(()) + type Ticket = (); + + fn validate( + _destination: &mut Option, + _message: &mut Option>, + ) -> SendResult { + Ok(((), MultiAssets::new())) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(XcmHash::default()) } } pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation) -> XcmResult { + fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation, _context: &XcmContext) -> XcmResult { Ok(()) } - fn withdraw_asset(_what: &MultiAsset, _who: &MultiLocation) -> Result { + fn withdraw_asset( + _what: &MultiAsset, + _who: &MultiLocation, + _maybe_context: Option<&XcmContext>, + ) -> Result { Ok(Assets::default()) } } @@ -248,22 +258,11 @@ impl WeightTrader for DummyWeightTrader { DummyWeightTrader } - fn buy_weight(&mut self, _weight: XcmV2Weight, _payment: Assets) -> Result { + fn buy_weight(&mut self, _weight: Weight, _payment: Assets) -> Result { Ok(Assets::default()) } } -pub struct InvertNothing; -impl InvertLocation for InvertNothing { - fn invert_location(_: &MultiLocation) -> sp_std::result::Result { - Ok(MultiLocation::here()) - } - - fn ancestry() -> MultiLocation { - MultiLocation::here() - } -} - #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, scale_info::TypeInfo)] pub enum CurrencyId { SelfReserve, @@ -273,18 +272,23 @@ pub enum CurrencyId { parameter_types! { pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); - pub const BaseXcmWeight: XcmV2Weight = 1000; + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = (1, Junctions::X1(Parachain(ParachainId::get().into()))).into(); + pub SelfLocation: MultiLocation = + MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); - pub SelfReserve: MultiLocation = ( + pub SelfReserve: MultiLocation = MultiLocation::new( 1, Junctions::X2( Parachain(ParachainId::get().into()), - PalletInstance(::PalletInfo::index::().unwrap() as u8) - )).into(); + PalletInstance( + ::PalletInfo::index::().unwrap() as u8 + ) + )); pub MaxInstructions: u32 = 100; + + pub UniversalLocation: InteriorMultiLocation = Here; } impl pallet_xcm_transactor::Config for Runtime { @@ -298,7 +302,7 @@ impl pallet_xcm_transactor::Config for Runtime { type CurrencyIdToMultiLocation = CurrencyIdToMultiLocation; type SelfLocation = SelfLocation; type Weigher = FixedWeightBounds; - type LocationInverter = InvertNothing; + type UniversalLocation = UniversalLocation; type BaseXcmWeight = BaseXcmWeight; type XcmSender = DoNothingRouter; type AssetTransactor = DummyAssetTransactor; diff --git a/precompiles/xcm-transactor/src/tests.rs b/precompiles/xcm-transactor/src/tests.rs index b0de1863c2e..25c83ebf07d 100644 --- a/precompiles/xcm-transactor/src/tests.rs +++ b/precompiles/xcm-transactor/src/tests.rs @@ -18,11 +18,11 @@ use crate::mock::{ RuntimeOrigin, TransactorV1, TransactorV2, XcmTransactor, }; -use frame_support::assert_ok; +use frame_support::{assert_ok, dispatch::Weight}; use precompile_utils::{prelude::*, testing::*}; use sp_core::H160; use sp_std::boxed::Box; -use xcm::v1::MultiLocation; +use xcm::latest::MultiLocation; fn precompiles() -> Precompiles { PrecompilesValue::get() @@ -146,16 +146,16 @@ fn take_transact_info() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000u64, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Weight::zero(), + 10000u64.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -191,16 +191,16 @@ fn take_transact_info_with_signed() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000u64, - Some(1) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Weight::zero(), + 10000u64.into(), + Some(1.into()) )); // Root can set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -237,7 +237,7 @@ fn take_fee_per_second() { // Root can set fee per secnd assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); precompiles() @@ -304,16 +304,16 @@ fn test_transact_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Weight::zero(), + 10000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -357,16 +357,16 @@ fn test_transact_derivative() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000000, + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Weight::zero(), + 10000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -438,16 +438,16 @@ fn test_transact_signed() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000000, - Some(1) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Weight::zero(), + 10000000.into(), + Some(1.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -516,16 +516,16 @@ fn test_transact_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), - 0, - 10000000, - Some(1) + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Weight::zero(), + 10000000.into(), + Some(1.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); diff --git a/precompiles/xcm-utils/src/lib.rs b/precompiles/xcm-utils/src/lib.rs index 9c918255bef..6e9b74199c4 100644 --- a/precompiles/xcm-utils/src/lib.rs +++ b/precompiles/xcm-utils/src/lib.rs @@ -23,7 +23,7 @@ use fp_evm::PrecompileHandle; use frame_support::codec::Decode; use frame_support::traits::ConstU32; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, + dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo, Weight}, traits::OriginTrait, }; use pallet_evm::AddressMapping; @@ -40,6 +40,8 @@ use xcm_executor::traits::ConvertOrigin; use xcm_executor::traits::WeightBounds; use xcm_executor::traits::WeightTrader; +use xcm_primitives::DEFAULT_PROOF_SIZE; + pub type XcmOriginOf = <::RuntimeCall as Dispatchable>::RuntimeOrigin; pub type XcmAccountIdOf = @@ -144,7 +146,10 @@ where // buy_weight returns unused assets let unused = trader - .buy_weight(weight_per_second, vec![multiasset.clone()].into()) + .buy_weight( + Weight::from_parts(weight_per_second, DEFAULT_PROOF_SIZE), + vec![multiasset.clone()].into(), + ) .map_err(|_| { RevertReason::custom("Asset not supported as fee payment").in_field("multilocation") })?; @@ -187,7 +192,7 @@ where .into()), }; - result + Ok(result?.ref_time()) } #[precompile::public("xcmExecute(bytes,uint64)")] @@ -209,7 +214,7 @@ where let call = pallet_xcm::Call::::execute { message: Box::new(xcm), - max_weight: weight, + max_weight: Weight::from_parts(weight, DEFAULT_PROOF_SIZE), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; diff --git a/precompiles/xcm-utils/src/mock.rs b/precompiles/xcm-utils/src/mock.rs index 304a05c7d61..fa2c7bf3497 100644 --- a/precompiles/xcm-utils/src/mock.rs +++ b/precompiles/xcm-utils/src/mock.rs @@ -18,7 +18,7 @@ use super::*; use frame_support::{ construct_runtime, parameter_types, - traits::{EnsureOrigin, Everything, OriginTrait, PalletInfo as _}, + traits::{ConstU32, EnsureOrigin, Everything, Nothing, OriginTrait, PalletInfo as _}, weights::{RuntimeDbWeight, Weight}, }; use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, GasWeightMapping}; @@ -31,17 +31,14 @@ use sp_core::{H256, U256}; use sp_io; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use sp_std::borrow::Borrow; -use xcm::latest::{ - Error as XcmError, - Junction::{AccountKey20, PalletInstance, Parachain}, - Junctions, MultiAsset, MultiLocation, NetworkId, Result as XcmResult, SendResult, SendXcm, -}; +use xcm::latest::Error as XcmError; use xcm_builder::AllowUnpaidExecutionFrom; use xcm_builder::FixedWeightBounds; +use xcm_builder::IsConcrete; use xcm_builder::SovereignSignedViaLocation; use xcm_executor::traits::Convert; use xcm_executor::{ - traits::{InvertLocation, TransactAsset, WeightTrader}, + traits::{TransactAsset, WeightTrader}, Assets, }; use Junctions::Here; @@ -91,7 +88,7 @@ where Ok(SystemRawOrigin::Signed(who)) => { let account_h160: H160 = who.into(); Ok(Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: account_h160.into(), } .into()) @@ -158,7 +155,7 @@ impl sp_runtime::traits::Convert for AccountIdToMultiL MultiLocation::new( 0, Junctions::X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: as_h160.as_fixed_bytes().clone(), }), ) @@ -167,7 +164,7 @@ impl sp_runtime::traits::Convert for AccountIdToMultiL parameter_types! { pub ParachainId: cumulus_primitives_core::ParaId = 100.into(); - pub LocalNetworkId: NetworkId = NetworkId::Any; + pub LocalNetworkId: Option = None; } parameter_types! { @@ -220,6 +217,9 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); } +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); +} pub type LocalOriginToLocation = MockAccountToAccountKey20; impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -232,12 +232,18 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = xcm_builder::LocationInverter; + type UniversalLocation = Ancestry; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // We use a custom one to test runtime ugprades type AdvertisedXcmVersion = (); + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } pub type Precompiles = PrecompileSetBuilder< R, @@ -287,6 +293,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { @@ -325,19 +332,35 @@ pub fn sent_xcm() -> Vec<(MultiLocation, opaque::Xcm)> { } pub struct TestSendXcm; impl SendXcm for TestSendXcm { - fn send_xcm(dest: impl Into, msg: opaque::Xcm) -> SendResult { - SENT_XCM.with(|q| q.borrow_mut().push((dest.into(), msg))); - Ok(()) + type Ticket = (); + + fn validate( + destination: &mut Option, + message: &mut Option, + ) -> SendResult { + SENT_XCM.with(|q| { + q.borrow_mut() + .push((destination.clone().unwrap(), message.clone().unwrap())) + }); + Ok(((), MultiAssets::new())) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(XcmHash::default()) } } pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation) -> XcmResult { + fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation, _context: &XcmContext) -> XcmResult { Ok(()) } - fn withdraw_asset(_what: &MultiAsset, _who: &MultiLocation) -> Result { + fn withdraw_asset( + _what: &MultiAsset, + _who: &MultiLocation, + _maybe_context: Option<&XcmContext>, + ) -> Result { Ok(Assets::default()) } } @@ -348,8 +371,9 @@ impl WeightTrader for DummyWeightTrader { DummyWeightTrader } - fn buy_weight(&mut self, weight: XcmV2Weight, payment: Assets) -> Result { - let asset_to_charge: MultiAsset = (MultiLocation::parent(), weight as u128).into(); + fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { + let asset_to_charge: MultiAsset = + (MultiLocation::parent(), weight.ref_time() as u128).into(); let unused = payment .checked_sub(asset_to_charge) .map_err(|_| XcmError::TooExpensive)?; @@ -358,35 +382,27 @@ impl WeightTrader for DummyWeightTrader { } } -pub struct InvertNothing; -impl InvertLocation for InvertNothing { - fn invert_location(_: &MultiLocation) -> sp_std::result::Result { - Ok(MultiLocation::here()) - } - - fn ancestry() -> MultiLocation { - MultiLocation::here() - } -} - parameter_types! { - pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); - - pub const BaseXcmWeight: XcmV2Weight = 1000; + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 0u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = (1, Junctions::X1(Parachain(ParachainId::get().into()))).into(); + pub SelfLocation: MultiLocation = + MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); - pub SelfReserve: MultiLocation = ( + pub SelfReserve: MultiLocation = MultiLocation::new( 1, Junctions::X2( Parachain(ParachainId::get().into()), PalletInstance(::PalletInfo::index::().unwrap() as u8) - )).into(); + )); pub MaxInstructions: u32 = 100; -} -use xcm_primitives::XcmV2Weight; + pub UniversalLocation: InteriorMultiLocation = Here; + pub Ancestry: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::get().into()).into()); + + pub const MaxAssetsIntoHolding: u32 = 64; +} pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location @@ -402,7 +418,7 @@ impl xcm_executor::Config for XcmConfig { type OriginConverter = XcmOriginToTransactDispatchOrigin; type IsReserve = (); type IsTeleporter = (); - type LocationInverter = InvertNothing; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = DummyWeightTrader; @@ -411,6 +427,14 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = (); type AssetClaims = (); type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } pub(crate) struct ExtBuilder { diff --git a/precompiles/xcm-utils/src/tests.rs b/precompiles/xcm-utils/src/tests.rs index b7be8e74632..d0ddee30347 100644 --- a/precompiles/xcm-utils/src/tests.rs +++ b/precompiles/xcm-utils/src/tests.rs @@ -18,7 +18,7 @@ use crate::mock::{ sent_xcm, AccountId, Balances, ExtBuilder, PCall, ParentAccount, Precompiles, PrecompilesValue, Runtime, SiblingParachainAccount, System, }; -use frame_support::traits::PalletInfo; +use frame_support::{dispatch::Weight, traits::PalletInfo}; use parity_scale_codec::Encode; use precompile_utils::{prelude::*, testing::*}; use sp_core::{H160, U256}; @@ -94,7 +94,7 @@ fn test_get_account_sibling() { #[test] fn test_weight_message() { ExtBuilder::default().build().execute_with(|| { - let message: Vec = xcm::VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = PCall::weight_message { message: message.into(), @@ -126,7 +126,7 @@ fn test_get_units_per_second() { #[test] fn test_executor_clear_origin() { ExtBuilder::default().build().execute_with(|| { - let xcm_to_execute = VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = PCall::xcm_execute { message: xcm_to_execute.into(), @@ -145,7 +145,7 @@ fn test_executor_clear_origin() { fn test_executor_send() { ExtBuilder::default().build().execute_with(|| { let withdrawn_asset: MultiAsset = (MultiLocation::parent(), 1u128).into(); - let xcm_to_execute = VersionedXcm::<()>::V2(Xcm(vec![ + let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![ WithdrawAsset(vec![withdrawn_asset].into()), InitiateReserveWithdraw { assets: MultiAssetFilter::Wild(All), @@ -192,16 +192,16 @@ fn test_executor_transact() { } .encode(); encoded.append(&mut call_bytes); - let xcm_to_execute = VersionedXcm::<()>::V2(Xcm(vec![Transact { - origin_type: OriginKind::SovereignAccount, - require_weight_at_most: 1_000_000_000u64, + let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most: Weight::from_parts(1_000_000_000u64, 2603u64), call: encoded.into(), }])) .encode(); let input = PCall::xcm_execute { message: xcm_to_execute.into(), - weight: 2000000000u64, + weight: 2_000_000_000u64, }; precompiles() @@ -219,7 +219,7 @@ fn test_executor_transact() { #[test] fn test_send_clear_origin() { ExtBuilder::default().build().execute_with(|| { - let xcm_to_send = VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let xcm_to_send = VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = PCall::xcm_send { dest: MultiLocation::parent(), @@ -228,7 +228,8 @@ fn test_send_clear_origin() { precompiles() .prepare_test(CryptoAlith, Precompile1, input) - .expect_cost(100000000) + // Fixed: TestWeightInfo + (BaseXcmWeight * MessageLen) + .expect_cost(100001000) .expect_no_logs() .execute_returns(EvmDataWriter::new().build()); @@ -251,7 +252,7 @@ fn execute_fails_if_called_by_smart_contract() { // Set code to Alice address as it if was a smart contract. pallet_evm::AccountCodes::::insert(H160::from(Alice), vec![10u8]); - let xcm_to_execute = VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = PCall::xcm_execute { message: xcm_to_execute.into(), diff --git a/precompiles/xtokens/Cargo.toml b/precompiles/xtokens/Cargo.toml index 1650eec6565..f2948a72084 100644 --- a/precompiles/xtokens/Cargo.toml +++ b/precompiles/xtokens/Cargo.toml @@ -38,7 +38,7 @@ sha3 = { workspace = true } precompile-utils = { workspace = true, features = [ "testing" ] } # Substrate -pallet-balances = { workspace = true } +pallet-balances = { workspace = true, features = [ "std" ] } pallet-timestamp = { workspace = true } parity-scale-codec = { workspace = true, features = [ "max-encoded-len" ] } scale-info = { workspace = true, features = [ "derive" ] } diff --git a/precompiles/xtokens/src/lib.rs b/precompiles/xtokens/src/lib.rs index 72174d124ef..629d902b441 100644 --- a/precompiles/xtokens/src/lib.rs +++ b/precompiles/xtokens/src/lib.rs @@ -21,7 +21,7 @@ use fp_evm::PrecompileHandle; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, + dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo, Weight}, traits::Get, }; use pallet_evm::AddressMapping; @@ -37,7 +37,7 @@ use xcm::{ latest::{AssetId, Fungibility, MultiAsset, MultiAssets, MultiLocation, WeightLimit}, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, }; -use xcm_primitives::AccountIdToCurrencyId; +use xcm_primitives::{AccountIdToCurrencyId, DEFAULT_PROOF_SIZE}; #[cfg(test)] mod mock; @@ -98,8 +98,8 @@ where let call = orml_xtokens::Call::::transfer { currency_id, amount, - dest: Box::new(VersionedMultiLocation::V1(destination)), - dest_weight_limit: WeightLimit::Limited(weight), + dest: Box::new(VersionedMultiLocation::V3(destination)), + dest_weight_limit: WeightLimit::Limited(Weight::from_parts(weight, DEFAULT_PROOF_SIZE)), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; @@ -142,8 +142,8 @@ where currency_id, amount, fee, - dest: Box::new(VersionedMultiLocation::V1(destination)), - dest_weight_limit: WeightLimit::Limited(weight), + dest: Box::new(VersionedMultiLocation::V3(destination)), + dest_weight_limit: WeightLimit::Limited(Weight::from_parts(weight, DEFAULT_PROOF_SIZE)), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; @@ -166,12 +166,12 @@ where .map_err(|_| RevertReason::value_is_too_large("balance type").in_field("amount"))?; let call = orml_xtokens::Call::::transfer_multiasset { - asset: Box::new(VersionedMultiAsset::V1(MultiAsset { + asset: Box::new(VersionedMultiAsset::V3(MultiAsset { id: AssetId::Concrete(asset), fun: Fungibility::Fungible(to_balance), })), - dest: Box::new(VersionedMultiLocation::V1(destination)), - dest_weight_limit: WeightLimit::Limited(weight), + dest: Box::new(VersionedMultiLocation::V3(destination)), + dest_weight_limit: WeightLimit::Limited(Weight::from_parts(weight, DEFAULT_PROOF_SIZE)), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; @@ -202,16 +202,16 @@ where .map_err(|_| RevertReason::value_is_too_large("balance type").in_field("fee"))?; let call = orml_xtokens::Call::::transfer_multiasset_with_fee { - asset: Box::new(VersionedMultiAsset::V1(MultiAsset { + asset: Box::new(VersionedMultiAsset::V3(MultiAsset { id: AssetId::Concrete(asset.clone()), fun: Fungibility::Fungible(amount), })), - fee: Box::new(VersionedMultiAsset::V1(MultiAsset { + fee: Box::new(VersionedMultiAsset::V3(MultiAsset { id: AssetId::Concrete(asset), fun: Fungibility::Fungible(fee), })), - dest: Box::new(VersionedMultiLocation::V1(destination)), - dest_weight_limit: WeightLimit::Limited(weight), + dest: Box::new(VersionedMultiLocation::V3(destination)), + dest_weight_limit: WeightLimit::Limited(Weight::from_parts(weight, DEFAULT_PROOF_SIZE)), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; @@ -264,8 +264,8 @@ where let call = orml_xtokens::Call::::transfer_multicurrencies { currencies, fee_item, - dest: Box::new(VersionedMultiLocation::V1(destination)), - dest_weight_limit: WeightLimit::Limited(weight), + dest: Box::new(VersionedMultiLocation::V3(destination)), + dest_weight_limit: WeightLimit::Limited(Weight::from_parts(weight, DEFAULT_PROOF_SIZE)), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; @@ -311,10 +311,10 @@ where })?; let call = orml_xtokens::Call::::transfer_multiassets { - assets: Box::new(VersionedMultiAssets::V1(multiassets)), + assets: Box::new(VersionedMultiAssets::V3(multiassets)), fee_item, - dest: Box::new(VersionedMultiLocation::V1(destination)), - dest_weight_limit: WeightLimit::Limited(weight), + dest: Box::new(VersionedMultiLocation::V3(destination)), + dest_weight_limit: WeightLimit::Limited(Weight::from_parts(weight, DEFAULT_PROOF_SIZE)), }; RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call)?; diff --git a/precompiles/xtokens/src/mock.rs b/precompiles/xtokens/src/mock.rs index 8674549b6fb..21ea6e11c2a 100644 --- a/precompiles/xtokens/src/mock.rs +++ b/precompiles/xtokens/src/mock.rs @@ -16,7 +16,9 @@ //! Test utilities use super::*; -use frame_support::traits::{EnsureOrigin, Everything, OriginTrait, PalletInfo as PalletInfoTrait}; +use frame_support::traits::{ + ConstU32, EnsureOrigin, Everything, Nothing, OriginTrait, PalletInfo as PalletInfoTrait, +}; use frame_support::{construct_runtime, parameter_types, weights::Weight}; use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; use pallet_evm::{EnsureAddressNever, EnsureAddressRoot}; @@ -30,17 +32,12 @@ use scale_info::TypeInfo; use sp_core::H256; use sp_io; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; -use xcm::latest::{ - Error as XcmError, - Junction::{AccountKey20, GeneralIndex, PalletInstance, Parachain}, - Junctions, MultiAsset, MultiLocation, NetworkId, Result as XcmResult, SendResult, SendXcm, Xcm, -}; -use xcm_builder::{AllowUnpaidExecutionFrom, FixedWeightBounds}; +use xcm::latest::{prelude::*, Error as XcmError}; +use xcm_builder::{AllowUnpaidExecutionFrom, FixedWeightBounds, IsConcrete}; use xcm_executor::{ - traits::{InvertLocation, TransactAsset, WeightTrader}, + traits::{TransactAsset, WeightTrader}, Assets, XcmExecutor, }; -use xcm_primitives::XcmV2Weight; pub type AccountId = MockAccount; pub type Balance = u128; @@ -159,6 +156,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } parameter_types! { @@ -186,8 +184,17 @@ impl EnsureOrigin for ConvertOriginToLocal { pub struct DoNothingRouter; impl SendXcm for DoNothingRouter { - fn send_xcm(_dest: impl Into, _msg: Xcm<()>) -> SendResult { - Ok(()) + type Ticket = (); + + fn validate( + _destination: &mut Option, + _message: &mut Option>, + ) -> SendResult { + Ok(((), MultiAssets::new())) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(XcmHash::default()) } } @@ -195,11 +202,15 @@ pub type Barrier = AllowUnpaidExecutionFrom; pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation) -> XcmResult { + fn deposit_asset(_what: &MultiAsset, _who: &MultiLocation, _context: &XcmContext) -> XcmResult { Ok(()) } - fn withdraw_asset(_what: &MultiAsset, _who: &MultiLocation) -> Result { + fn withdraw_asset( + _what: &MultiAsset, + _who: &MultiLocation, + _maybe_context: Option<&XcmContext>, + ) -> Result { Ok(Assets::default()) } } @@ -210,20 +221,16 @@ impl WeightTrader for DummyWeightTrader { DummyWeightTrader } - fn buy_weight(&mut self, _weight: XcmV2Weight, _payment: Assets) -> Result { + fn buy_weight(&mut self, _weight: Weight, _payment: Assets) -> Result { Ok(Assets::default()) } } -pub struct InvertNothing; -impl InvertLocation for InvertNothing { - fn invert_location(_: &MultiLocation) -> sp_std::result::Result { - Ok(MultiLocation::here()) - } - - fn ancestry() -> MultiLocation { - MultiLocation::here() - } +parameter_types! { + pub UniversalLocation: InteriorMultiLocation = Here; + pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub ReachableDest: Option = Some(MultiLocation::here()); + pub const MaxAssetsIntoHolding: u32 = 64; } impl pallet_xcm::Config for Runtime { @@ -231,7 +238,7 @@ impl pallet_xcm::Config for Runtime { // is `XcmExecutor`, which will be used in unit tests located in xcm-executor. type RuntimeEvent = RuntimeEvent; type ExecuteXcmOrigin = ConvertOriginToLocal; - type LocationInverter = InvertNothing; + type UniversalLocation = UniversalLocation; type SendXcmOrigin = ConvertOriginToLocal; type Weigher = xcm_builder::FixedWeightBounds; type XcmRouter = DoNothingRouter; @@ -243,6 +250,12 @@ impl pallet_xcm::Config for Runtime { type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } pub struct XcmConfig; @@ -253,7 +266,7 @@ impl xcm_executor::Config for XcmConfig { type OriginConverter = pallet_xcm::XcmPassthrough; type IsReserve = (); type IsTeleporter = (); - type LocationInverter = InvertNothing; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = DummyWeightTrader; @@ -262,6 +275,14 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = (); type AssetClaims = (); type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] @@ -314,7 +335,7 @@ impl sp_runtime::traits::Convert for AccountIdToMultiL MultiLocation::new( 1, Junctions::X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: as_h160.as_fixed_bytes().clone(), }), ) @@ -324,18 +345,21 @@ impl sp_runtime::traits::Convert for AccountIdToMultiL parameter_types! { pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); - pub const BaseXcmWeight: XcmV2Weight = 1000; + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub const MaxAssetsForTransfer: usize = 2; - pub SelfLocation: MultiLocation = (1, Junctions::X1(Parachain(ParachainId::get().into()))).into(); + pub SelfLocation: MultiLocation = + MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); - pub SelfReserve: MultiLocation = ( + pub SelfReserve: MultiLocation = MultiLocation::new( 1, Junctions::X2( Parachain(ParachainId::get().into()), - PalletInstance(::PalletInfo::index::().unwrap() as u8) - )).into(); + PalletInstance( + ::PalletInfo::index::().unwrap() as u8 + ) + )); pub MaxInstructions: u32 = 100; } @@ -355,7 +379,7 @@ impl orml_xtokens::Config for Runtime { type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = InvertNothing; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; diff --git a/precompiles/xtokens/src/tests.rs b/precompiles/xtokens/src/tests.rs index 5090254b69e..3a73fa0cf72 100644 --- a/precompiles/xtokens/src/tests.rs +++ b/precompiles/xtokens/src/tests.rs @@ -24,7 +24,7 @@ use precompile_utils::{prelude::*, testing::*}; use sp_core::U256; use sp_runtime::traits::Convert; use xcm::latest::{ - AssetId, Fungibility, Junction, Junctions, MultiAsset, MultiAssets, MultiLocation, NetworkId, + AssetId, Fungibility, Junction, Junctions, MultiAsset, MultiAssets, MultiLocation, }; fn precompiles() -> Precompiles { @@ -80,7 +80,7 @@ fn transfer_self_reserve_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -127,7 +127,7 @@ fn transfer_to_reserve_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -174,7 +174,7 @@ fn transfer_to_reserve_with_fee_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -230,7 +230,7 @@ fn transfer_non_reserve_to_non_reserve_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -278,7 +278,7 @@ fn transfer_non_reserve_to_non_reserve_with_fee_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -333,7 +333,7 @@ fn transfer_multi_asset_to_reserve_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -381,7 +381,7 @@ fn transfer_multi_asset_self_reserve_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -428,7 +428,7 @@ fn transfer_multi_asset_self_reserve_with_fee_works() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -480,7 +480,7 @@ fn transfer_multi_asset_non_reserve_to_non_reserve() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -530,7 +530,7 @@ fn transfer_multi_asset_non_reserve_to_non_reserve_with_fee() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -585,7 +585,7 @@ fn transfer_multi_currencies() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -645,7 +645,7 @@ fn transfer_multi_assets() { Junctions::X2( Junction::Parachain(2), Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }, ), @@ -710,7 +710,7 @@ fn transfer_multi_currencies_cannot_insert_more_than_max() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -747,7 +747,7 @@ fn transfer_multi_assets_cannot_insert_more_than_max() { Junctions::X2( Junction::Parachain(2), Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }, ), @@ -800,7 +800,7 @@ fn transfer_multi_assets_is_not_sorted_error() { Junctions::X2( Junction::Parachain(2), Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }, ), diff --git a/primitives/xcm/Cargo.toml b/primitives/xcm/Cargo.toml index 035108a38fa..ceda8275798 100644 --- a/primitives/xcm/Cargo.toml +++ b/primitives/xcm/Cargo.toml @@ -37,6 +37,9 @@ xcm = { workspace = true } xcm-builder = { workspace = true } xcm-executor = { workspace = true } +# Benchmarks +frame-benchmarking = { workspace = true, optional = true } + [features] default = [ "std" ] std = [ @@ -51,4 +54,4 @@ std = [ "xcm-builder/std", "xcm/std", ] -runtime-benchmarks = [] +runtime-benchmarks = [ "frame-benchmarking", "frame-benchmarking/runtime-benchmarks", "xcm-builder/runtime-benchmarks" ] diff --git a/primitives/xcm/src/barriers.rs b/primitives/xcm/src/barriers.rs index e4c7ac7ddba..1059536e83d 100644 --- a/primitives/xcm/src/barriers.rs +++ b/primitives/xcm/src/barriers.rs @@ -14,17 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Moonbeam. If not, see . -use frame_support::{ensure, traits::Contains}; +use frame_support::{ensure, pallet_prelude::Weight, traits::Contains}; /// Allows execution from `origin` if it is contained in `T` (i.e. `T::Contains(origin)`) taking /// payments into account and if it starts with DescendOrigin. /// /// Only allows for `DescendOrigin` + `WithdrawAsset`, + `BuyExecution` use sp_std::marker::PhantomData; use xcm::latest::{ - prelude::{BuyExecution, DescendOrigin, WithdrawAsset}, + prelude::{BuyExecution, DescendOrigin, Instruction, WithdrawAsset}, MultiLocation, WeightLimit::{Limited, Unlimited}, - Xcm, }; use xcm_executor::traits::ShouldExecute; @@ -34,9 +33,9 @@ pub struct AllowTopLevelPaidExecutionDescendOriginFirst(PhantomData); impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { fn should_execute( origin: &MultiLocation, - message: &mut Xcm, - max_weight: u64, - _weight_credit: &mut u64, + message: &mut [Instruction], + max_weight: Weight, + _weight_credit: &mut Weight, ) -> Result<(), ()> { log::trace!( target: "xcm::barriers", @@ -45,7 +44,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes origin, message, max_weight, _weight_credit, ); ensure!(T::contains(origin), ()); - let mut iter = message.0.iter_mut(); + let mut iter = message.iter_mut(); // Make sure the first instruction is DescendOrigin iter.next() .filter(|instruction| matches!(instruction, DescendOrigin(_))) @@ -62,8 +61,9 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes BuyExecution { weight_limit: Limited(ref mut weight), .. - } if *weight >= max_weight => { - *weight = max_weight; + } if weight.all_gte(max_weight) => { + weight.set_ref_time(max_weight.ref_time()); + weight.set_proof_size(max_weight.proof_size()); Ok(()) } BuyExecution { diff --git a/primitives/xcm/src/ethereum_xcm.rs b/primitives/xcm/src/ethereum_xcm.rs index 9bfebc7d4cd..d3477088dac 100644 --- a/primitives/xcm/src/ethereum_xcm.rs +++ b/primitives/xcm/src/ethereum_xcm.rs @@ -24,6 +24,15 @@ use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_std::vec::Vec; +// polkadot/blob/19f6665a6162e68cd2651f5fe3615d6676821f90/xcm/src/v3/mod.rs#L1193 +// Defensively we increase this value to allow UMP fragments through xcm-transactor to prepare our +// runtime for a relay upgrade where the xcm instruction weights are not ZERO hardcoded. If that +// happens stuff will break in our side. +// Rationale behind the value: e.g. staking unbond will go above 32kb and thus +// required_weight_at_most must be below overall weight but still above whatever value we decide to +// set. For this reason we set here a value that makes sense for the overall weight. +pub const DEFAULT_PROOF_SIZE: u64 = 128 * 1024; + /// Max. allowed size of 65_536 bytes. pub const MAX_ETHEREUM_XCM_INPUT_SIZE: u32 = 2u32.pow(16); diff --git a/primitives/xcm/src/fee_handlers.rs b/primitives/xcm/src/fee_handlers.rs index 4b668818fe0..174df2bc306 100644 --- a/primitives/xcm/src/fee_handlers.rs +++ b/primitives/xcm/src/fee_handlers.rs @@ -21,6 +21,7 @@ // UnitsToWeightRatio trait, which needs to be implemented by AssetIdInfoGetter use frame_support::{ + pallet_prelude::Weight, traits::{tokens::fungibles::Mutate, Get}, weights::constants::WEIGHT_REF_TIME_PER_SECOND, }; @@ -38,7 +39,7 @@ pub struct FirstAssetTrader< AssetIdInfoGetter: UnitsToWeightRatio, R: TakeRevenue, >( - u64, + Weight, Option<(MultiLocation, u128, u128)>, // id, amount, units_per_second PhantomData<(AssetType, AssetIdInfoGetter, R)>, ); @@ -49,11 +50,11 @@ impl< > WeightTrader for FirstAssetTrader { fn new() -> Self { - FirstAssetTrader(0, None, PhantomData) + FirstAssetTrader(Weight::zero(), None, PhantomData) } fn buy_weight( &mut self, - weight: u64, + weight: Weight, payment: xcm_executor::Assets, ) -> Result { // can only call one time @@ -62,7 +63,7 @@ impl< return Err(XcmError::NotWithdrawable); } - assert_eq!(self.0, 0); + assert_eq!(self.0, Weight::zero()); let first_asset = payment .clone() .fungible_assets_iter() @@ -82,7 +83,8 @@ impl< } if let Some(units_per_second) = AssetIdInfoGetter::get_units_per_second(asset_type) { - let amount = units_per_second.saturating_mul(weight as u128) + // TODO handle proof size payment + let amount = units_per_second.saturating_mul(weight.ref_time() as u128) / (WEIGHT_REF_TIME_PER_SECOND as u128); // We dont need to proceed if the amount is 0 @@ -113,11 +115,12 @@ impl< } // Refund weight. We will refund in whatever asset is stored in self. - fn refund_weight(&mut self, weight: u64) -> Option { + fn refund_weight(&mut self, weight: Weight) -> Option { if let Some((id, prev_amount, units_per_second)) = self.1.clone() { let weight = weight.min(self.0); self.0 -= weight; - let amount = units_per_second * (weight as u128) / (WEIGHT_REF_TIME_PER_SECOND as u128); + let amount = units_per_second * (weight.ref_time() as u128) + / (WEIGHT_REF_TIME_PER_SECOND as u128); let amount = amount.min(prev_amount); self.1 = Some(( id.clone(), @@ -225,10 +228,10 @@ mod test { let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader - .buy_weight(amount as u64, payment.clone()) + .buy_weight((amount as u64).into(), payment.clone()) .expect("can buy weight once"); assert!(unused.is_empty()); - assert_eq!(trader.0, 1000u64); + assert_eq!(trader.0, 1000u64.into()); } #[test] @@ -245,10 +248,10 @@ mod test { fun: Fungibility::Fungible(100u128), }); let buy_one_results = trader - .buy_weight(100u64, asset_one_payment.clone()) + .buy_weight(100u64.into(), asset_one_payment.clone()) .expect("can buy weight once"); assert_eq!(buy_one_results.fungible.len(), 0); // no unused amount - assert_eq!(trader.0, 100u64); + assert_eq!(trader.0, 100u64.into()); assert_eq!( trader.1, Some(( @@ -271,12 +274,12 @@ mod test { fun: Fungibility::Fungible(10_000u128), }); assert_eq!( - trader.buy_weight(10_000u64, asset_two_payment.clone()), + trader.buy_weight(10_000u64.into(), asset_two_payment.clone()), Err(XcmError::NotWithdrawable), ); // state should be unchanged - assert_eq!(trader.0, 100u64); + assert_eq!(trader.0, 100u64.into()); assert_eq!( trader.1, Some(( @@ -302,13 +305,13 @@ mod test { let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader - .buy_weight(amount as u64, payment.clone()) + .buy_weight((amount as u64).into(), payment.clone()) .expect("can buy weight once"); assert!(unused.is_empty()); - assert_eq!(trader.0, 1000u64); + assert_eq!(trader.0, 1000u64.into()); assert_eq!( - trader.refund_weight(1000u64), + trader.refund_weight(1000u64.into()), Some(MultiAsset { fun: Fungibility::Fungible(1000), id: ARBITRARY_ID, @@ -328,13 +331,13 @@ mod test { let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader - .buy_weight(amount as u64, payment.clone()) + .buy_weight((amount as u64).into(), payment.clone()) .expect("can buy weight once"); assert!(unused.is_empty()); - assert_eq!(trader.0, 1000u64); + assert_eq!(trader.0, 1000u64.into()); assert_eq!( - trader.refund_weight(100u64), + trader.refund_weight(100u64.into()), Some(MultiAsset { fun: Fungibility::Fungible(100), id: ARBITRARY_ID, @@ -342,12 +345,12 @@ mod test { ); // should reflect 100 weight and 100 currency deducted - assert_eq!(trader.0, 900); + assert_eq!(trader.0, 900u64.into()); assert_eq!(trader.1.clone().unwrap().1, 900); // can call again assert_eq!( - trader.refund_weight(200u64), + trader.refund_weight(200u64.into()), Some(MultiAsset { fun: Fungibility::Fungible(200), id: ARBITRARY_ID, @@ -355,7 +358,7 @@ mod test { ); // should reflect another 200 weight and 200 currency deducted - assert_eq!(trader.0, 700); + assert_eq!(trader.0, 700u64.into()); assert_eq!(trader.1.clone().unwrap().1, 700); } @@ -371,20 +374,20 @@ mod test { let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader - .buy_weight(amount as u64, payment.clone()) + .buy_weight((amount as u64).into(), payment.clone()) .expect("can buy weight once"); assert!(unused.is_empty()); - assert_eq!(trader.0, 1000u64); + assert_eq!(trader.0, 1000u64.into()); // can't call with more weight assert_eq!( - trader.refund_weight(9999u64), + trader.refund_weight(9999u64.into()), Some(MultiAsset { fun: Fungibility::Fungible(1000), id: ARBITRARY_ID, }) ); - assert_eq!(trader.0, 0); + assert_eq!(trader.0, Weight::zero()); } #[test] @@ -399,23 +402,23 @@ mod test { let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader - .buy_weight(amount as u64, payment.clone()) + .buy_weight((amount as u64).into(), payment.clone()) .expect("can buy weight once"); assert!(unused.is_empty()); - assert_eq!(trader.0, 1000u64); + assert_eq!(trader.0, 1000u64.into()); // adjust weight so that it will allow a higher amount -- we want to see that the currency // (self.1.1) is capped even when weight is not - trader.0 = trader.0 + 1000; + trader.0 = trader.0.saturating_add(1000u64.into()); // can't call with more weight assert_eq!( - trader.refund_weight(1500u64), + trader.refund_weight(1500u64.into()), Some(MultiAsset { fun: Fungibility::Fungible(1000), id: ARBITRARY_ID, }) ); - assert_eq!(trader.0, 500); // still thinks we have unreturned weight + assert_eq!(trader.0, 500u64.into()); // still thinks we have unreturned weight } } diff --git a/primitives/xcm/src/origin_conversion.rs b/primitives/xcm/src/origin_conversion.rs index 6ccb5ebe7bb..ed04cfa1e84 100644 --- a/primitives/xcm/src/origin_conversion.rs +++ b/primitives/xcm/src/origin_conversion.rs @@ -30,7 +30,7 @@ where MultiLocation { parents: 0, interior: X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: account.into(), }), } @@ -52,7 +52,7 @@ where o.try_with_caller(|caller| match caller.try_into() { Ok(frame_system::RawOrigin::Signed(who)) => Ok(AccountKey20 { key: who.into(), - network: Network::get(), + network: Some(Network::get()), } .into()), Ok(other) => Err(other.into()), diff --git a/primitives/xcm/src/transactor_traits.rs b/primitives/xcm/src/transactor_traits.rs index a5c0b17872a..3ac48df808b 100644 --- a/primitives/xcm/src/transactor_traits.rs +++ b/primitives/xcm/src/transactor_traits.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License -use cumulus_primitives_core::{relay_chain::v2::HrmpChannelId, ParaId}; +use cumulus_primitives_core::{relay_chain::HrmpChannelId, ParaId}; use sp_std::vec::Vec; use xcm::latest::{Error as XcmError, MultiLocation}; diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index cbe325d8f0b..7dff076f0e5 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -74,7 +74,7 @@ std = [ "xcm-executor/std", "xcm/std", ] -runtime-benchmarks = [ "pallet-referenda/runtime-benchmarks" ] +runtime-benchmarks = [ "pallet-ethereum-xcm/runtime-benchmarks", "pallet-referenda/runtime-benchmarks" ] try-runtime = [ "frame-support/try-runtime", "pallet-migrations/try-runtime", diff --git a/runtime/common/src/apis.rs b/runtime/common/src/apis.rs index a451c54cb6f..c13c210af1e 100644 --- a/runtime/common/src/apis.rs +++ b/runtime/common/src/apis.rs @@ -379,6 +379,14 @@ macro_rules! impl_runtime_apis_plus_common { ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_fee_details(uxt, len) } + + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } } impl nimbus_primitives::NimbusApi for Runtime { @@ -514,14 +522,13 @@ macro_rules! impl_runtime_apis_plus_common { impl moonbeam_xcm_benchmarks::generic::Config for Runtime {} use pallet_asset_manager::Config as PalletAssetManagerConfig; - impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmExecutorConfig; type AccountIdConverter = xcm_config::LocationToAccountId; fn valid_destination() -> Result { Ok(MultiLocation::parent()) } - fn worst_case_holding() -> MultiAssets { + fn worst_case_holding(_depositable_count: u32) -> MultiAssets { // 100 fungibles const HOLDING_FUNGIBLES: u32 = 100; let fungibles_amount: u128 = 100; @@ -576,20 +583,39 @@ macro_rules! impl_runtime_apis_plus_common { (0u64, Response::Version(Default::default())) } - fn transact_origin() -> Result { - Ok(MultiLocation::parent()) + fn worst_case_asset_exchange() + -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn universal_alias() -> Result { + Err(BenchmarkError::Skip) + } + + fn transact_origin_and_runtime_call() + -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { + Ok((MultiLocation::parent(), frame_system::Call::remark_with_event { + remark: vec![] + }.into())) } fn subscribe_origin() -> Result { Ok(MultiLocation::parent()) } - fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { + fn claimable_asset() + -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { let origin = MultiLocation::parent(); - let assets: MultiAssets = (Concrete(MultiLocation::parent()), 1_000u128).into(); + let assets: MultiAssets = (Concrete(MultiLocation::parent()), 1_000u128) + .into(); let ticket = MultiLocation { parents: 0, interior: Here }; Ok((origin, ticket, assets)) } + + fn unlockable_asset() + -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + Err(BenchmarkError::Skip) + } } use moonbeam_xcm_benchmarks::generic::benchmarking as MoonbeamXcmBenchmarks; diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index 9ff289bec35..36f06ea7f25 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -101,6 +101,59 @@ where } } +pub struct PalletAssetManagerMigrateXcmV2ToV3(pub PhantomData); +impl Migration for PalletAssetManagerMigrateXcmV2ToV3 +where + T: pallet_asset_manager::Config + frame_system::Config, + T::ForeignAssetType: From, +{ + fn friendly_name(&self) -> &str { + "MM_PalletAssetManagerMigrateXcmV2ToV3" + } + + fn migrate(&self, _available_weight: Weight) -> Weight { + pallet_asset_manager::migrations::XcmV2ToV3AssetManager::::on_runtime_upgrade() + } + + /// Run a standard pre-runtime test. This works the same way as in a normal runtime upgrade. + #[cfg(feature = "try-runtime")] + fn pre_upgrade(&self) -> Result, &'static str> { + pallet_asset_manager::migrations::XcmV2ToV3AssetManager::::pre_upgrade() + } + + /// Run a standard post-runtime test. This works the same way as in a normal runtime upgrade. + #[cfg(feature = "try-runtime")] + fn post_upgrade(&self, state: Vec) -> Result<(), &'static str> { + pallet_asset_manager::migrations::XcmV2ToV3AssetManager::::post_upgrade(state) + } +} + +pub struct PalletXcmTransactorMigrateXcmV2ToV3(pub PhantomData); +impl Migration for PalletXcmTransactorMigrateXcmV2ToV3 +where + T: pallet_xcm_transactor::Config + frame_system::Config, +{ + fn friendly_name(&self) -> &str { + "MM_PalletXcmTransactorMigrateXcmV2ToV3" + } + + fn migrate(&self, _available_weight: Weight) -> Weight { + pallet_xcm_transactor::migrations::XcmV2ToV3XcmTransactor::::on_runtime_upgrade() + } + + /// Run a standard pre-runtime test. This works the same way as in a normal runtime upgrade. + #[cfg(feature = "try-runtime")] + fn pre_upgrade(&self) -> Result, &'static str> { + pallet_xcm_transactor::migrations::XcmV2ToV3XcmTransactor::::pre_upgrade() + } + + /// Run a standard post-runtime test. This works the same way as in a normal runtime upgrade. + #[cfg(feature = "try-runtime")] + fn post_upgrade(&self, state: Vec) -> Result<(), &'static str> { + pallet_xcm_transactor::migrations::XcmV2ToV3XcmTransactor::::post_upgrade(state) + } +} + pub struct CommonMigrations(PhantomData<(Runtime, Council, Tech)>); impl GetMigrations for CommonMigrations @@ -113,6 +166,9 @@ where Tech: GetStorageVersion + PalletInfoAccess + 'static, Runtime: pallet_democracy::Config, Runtime: pallet_preimage::Config, + Runtime: pallet_asset_manager::Config, + ::ForeignAssetType: From, + Runtime: pallet_xcm_transactor::Config, { fn get_migrations() -> Vec> { // let migration_author_mapping_twox_to_blake = AuthorMappingTwoXToBlake:: { @@ -174,6 +230,10 @@ where // DemocracryMigrationHashToBoundedCall::(Default::default()); //let preimage_migration_hash_to_bounded_call = // PreimageMigrationHashToBoundedCall::(Default::default()); + let asset_manager_to_xcm_v3 = + PalletAssetManagerMigrateXcmV2ToV3::(Default::default()); + let xcm_transactor_to_xcm_v3 = + PalletXcmTransactorMigrateXcmV2ToV3::(Default::default()); vec![ // completed in runtime 800 // Box::new(migration_author_mapping_twox_to_blake), @@ -218,6 +278,8 @@ where //Box::new(scheduler_to_v4), //Box::new(democracy_migration_hash_to_bounded_call), //Box::new(preimage_migration_hash_to_bounded_call), + Box::new(asset_manager_to_xcm_v3), + Box::new(xcm_transactor_to_xcm_v3), ] } } diff --git a/runtime/moonbase/Cargo.toml b/runtime/moonbase/Cargo.toml index c017e55fc6e..00224cadad6 100644 --- a/runtime/moonbase/Cargo.toml +++ b/runtime/moonbase/Cargo.toml @@ -345,6 +345,7 @@ try-runtime = [ "pallet-scheduler/try-runtime", "pallet-society/try-runtime", "pallet-timestamp/try-runtime", + "pallet-xcm-transactor/try-runtime", ] moonbase-runtime-benchmarks = [] diff --git a/runtime/moonbase/src/asset_config.rs b/runtime/moonbase/src/asset_config.rs index fb0b66c3dfa..901cec9afd3 100644 --- a/runtime/moonbase/src/asset_config.rs +++ b/runtime/moonbase/src/asset_config.rs @@ -43,6 +43,14 @@ use sp_std::{ prelude::*, }; +// Number of items that can be destroyed with our configured max extrinsic proof size. +// x = (a - b) / c where: +// a: maxExtrinsic proof size +// b: base proof size for destroy_accounts in pallet_assets weights +// c: proof size for each item +// 656.87 = (3_407_872 - 8232) / 5180 +const REMOVE_ITEMS_LIMIT: u32 = 656; + // Not to disrupt the previous asset instance, we assign () to Foreign pub type ForeignAssetInstance = (); pub type LocalAssetInstance = pallet_assets::Instance1; @@ -85,7 +93,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -107,7 +115,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 07f8fb10f1a..ac86d4b30ef 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -145,7 +145,7 @@ pub mod currency { /// Maximum weight per block pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND) .saturating_div(2) - .set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64); + .set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64); pub const MILLISECS_PER_BLOCK: u64 = 12000; pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -479,6 +479,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = OnChargeEVMTransaction>; type BlockGasLimit = BlockGasLimit; type FindAuthor = FindAuthorAdapter; + type OnCreate = (); } parameter_types! { diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index d4bc6f17eb1..339adbb2298 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -30,17 +30,18 @@ use sp_runtime::{ }; use frame_support::{ + dispatch::Weight, parameter_types, traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess}, }; use frame_system::{EnsureRoot, RawOrigin}; -use sp_core::{H160, H256}; +use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, - CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, LocationInverter, + AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, + CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, @@ -53,7 +54,6 @@ use orml_xcm_support::MultiNativeAsset; use xcm_primitives::{ AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToMultiLocation, AsAssetType, FirstAssetTrader, SignedToAccountId20, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, - XcmV2Weight, }; use parity_scale_codec::{Decode, Encode}; @@ -73,8 +73,10 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; // The relay chain Origin type pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - // The ancestry, defines the multilocation describing this consensus system - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + // The universal location within the global consensus system + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); + // Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such @@ -131,7 +133,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< Assets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsAssetType, @@ -143,7 +145,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont allow teleports. - Nothing, + NoChecking, // We dont track any teleports (), >; @@ -170,7 +172,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< LocalAssets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, // This just tells to convert an assetId into a GeneralIndex junction prepended @@ -184,7 +186,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont want to allow teleporting assets - Nothing, + NoChecking, // The account to use for tracking teleports. (), >; @@ -225,7 +227,6 @@ pub type XcmOriginToTransactDispatchOrigin = ( ); parameter_types! { - pub UnitWeightCost: XcmV2Weight = 200_000_000u64; /// Maximum number of instructions in a single XCM fragment. A sanity check against /// weight caculations getting too crazy. pub MaxInstructions: u32 = 100; @@ -259,7 +260,7 @@ parameter_types! { pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< Assets, ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsAssetType, @@ -279,6 +280,19 @@ moonbeam_runtime_common::impl_moonbeam_xcm_call_tracing!(); moonbeam_runtime_common::impl_evm_runner_precompile_or_eth_xcm!(); +pub struct SafeCallFilter; +impl frame_support::traits::Contains for SafeCallFilter { + fn contains(_call: &RuntimeCall) -> bool { + // TODO review + // This needs to be addressed at EVM level + true + } +} + +parameter_types! { + pub const MaxAssetsIntoHolding: u32 = 64; +} + pub struct XcmExecutorConfig; impl xcm_executor::Config for XcmExecutorConfig { type RuntimeCall = RuntimeCall; @@ -291,7 +305,7 @@ impl xcm_executor::Config for XcmExecutorConfig { // of our chain, we always return the relative reserve type IsReserve = MultiNativeAsset>; type IsTeleporter = (); // No teleport - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = XcmBarrier; type Weigher = XcmWeigher; // We use two traders @@ -314,13 +328,16 @@ impl xcm_executor::Config for XcmExecutorConfig { type AssetTrap = pallet_erc20_xcm_bridge::AssetTrapWrapper; type AssetClaims = PolkadotXcm; type CallDispatcher = MoonbeamCall; + type PalletInstancesInfo = crate::AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = SafeCallFilter; } -type XcmExecutor = pallet_erc20_xcm_bridge::XcmExecutorWrapper< - RuntimeCall, - xcm_executor::XcmExecutor, ->; - // Converts a Signed Local Origin into a MultiLocation pub type LocalOriginToLocation = SignedToAccountId20; @@ -328,51 +345,62 @@ pub type LocalOriginToLocation = SignedToAccountId20, + cumulus_primitives_utility::ParentAsUmp, // ..and XCMP to communicate with the sibling chains. XcmpQueue, ); -/// For compatibility with erc20 assets, we need to forbid XCM messages that can manipulate -/// erc20 assets in an unsupported way. -pub type XcmExecuteFilter = pallet_erc20_xcm_bridge::XcmExecuteFilterWrapper; +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parent.into()); +} impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = XcmExecuteFilter; - type XcmExecutor = XcmExecutor; + type XcmExecuteFilter = Everything; + type XcmExecutor = xcm_executor::XcmExecutor; type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = XcmWeigher; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = LocationToAccountId; + type MaxLockers = ConstU32<8>; + // TODO pallet-xcm weights + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; } impl cumulus_pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; + type XcmExecutor = xcm_executor::XcmExecutor; } impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; + type XcmExecutor = xcm_executor::XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; + type PriceForSiblingDelivery = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; + type XcmExecutor = xcm_executor::XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -479,7 +507,7 @@ where location .push_interior(Junction::AccountKey20 { key: contract_address.0, - network: NetworkId::Any, + network: None, }) .ok(); Some(location) @@ -489,7 +517,8 @@ where } parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 200_000_000u64; + pub const BaseXcmWeight: Weight + = Weight::from_parts(200_000_000u64, xcm_primitives::DEFAULT_PROOF_SIZE); pub const MaxAssetsForTransfer: usize = 2; // This is how we are going to detect whether the asset is a Reserve asset // This however is the chain part only @@ -518,11 +547,11 @@ impl orml_xtokens::Config for Runtime { type AccountIdToMultiLocation = AccountIdToMultiLocation; type CurrencyIdConvert = CurrencyIdtoMultiLocation>; - type XcmExecutor = XcmExecutor; + type XcmExecutor = xcm_executor::XcmExecutor; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; @@ -594,7 +623,7 @@ impl pallet_xcm_transactor::Config for Runtime { type XcmSender = XcmRouter; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; type ReserveProvider = AbsoluteAndRelativeReserve; diff --git a/runtime/moonbase/tests/integration_test.rs b/runtime/moonbase/tests/integration_test.rs index c1853e3c05c..d4233d48d8a 100644 --- a/runtime/moonbase/tests/integration_test.rs +++ b/runtime/moonbase/tests/integration_test.rs @@ -1282,7 +1282,7 @@ fn asset_erc20_precompiles_transfer() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(24133) + .expect_cost(23497) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1334,7 +1334,7 @@ fn asset_erc20_precompiles_approve() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(14596) + .expect_cost(13862) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1355,7 +1355,7 @@ fn asset_erc20_precompiles_approve() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(29624) + .expect_cost(29021) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1407,7 +1407,7 @@ fn asset_erc20_precompiles_mint_burn() { value: { 1000 * UNIT }.into(), }, ) - .expect_cost(13249) + .expect_cost(12787) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1434,7 +1434,7 @@ fn asset_erc20_precompiles_mint_burn() { value: { 500 * UNIT }.into(), }, ) - .expect_cost(13575) + .expect_cost(13016) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1479,7 +1479,7 @@ fn asset_erc20_precompiles_freeze_thaw_account() { account: Address(ALICE.into()), }, ) - .expect_cost(7094) + .expect_cost(6699) .expect_no_logs() .execute_returns_encoded(true); @@ -1498,7 +1498,7 @@ fn asset_erc20_precompiles_freeze_thaw_account() { account: Address(ALICE.into()), }, ) - .expect_cost(7074) + .expect_cost(6713) .expect_no_logs() .execute_returns_encoded(true); @@ -1533,7 +1533,7 @@ fn asset_erc20_precompiles_freeze_thaw_asset() { asset_precompile_address, LocalAssetsPCall::freeze_asset {}, ) - .expect_cost(5944) + .expect_cost(5548) .expect_no_logs() .execute_returns_encoded(true); @@ -1550,7 +1550,7 @@ fn asset_erc20_precompiles_freeze_thaw_asset() { asset_precompile_address, LocalAssetsPCall::thaw_asset {}, ) - .expect_cost(5964) + .expect_cost(5550) .expect_no_logs() .execute_returns_encoded(true); }); @@ -1582,7 +1582,7 @@ fn asset_erc20_precompiles_freeze_transfer_ownership() { owner: Address(BOB.into()), }, ) - .expect_cost(6973) + .expect_cost(6614) .expect_no_logs() .execute_returns_encoded(true); }); @@ -1616,7 +1616,7 @@ fn asset_erc20_precompiles_freeze_set_team() { freezer: Address(BOB.into()), }, ) - .expect_cost(5940) + .expect_cost(5577) .expect_no_logs() .execute_returns_encoded(true); @@ -1737,7 +1737,7 @@ fn xcm_asset_erc20_precompiles_transfer() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(24133) + .expect_cost(23497) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1801,7 +1801,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(14596) + .expect_cost(13862) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1822,7 +1822,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(29624) + .expect_cost(29021) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1883,7 +1883,7 @@ fn xtokens_precompiles_transfer() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -1933,7 +1933,7 @@ fn xtokens_precompiles_transfer_multiasset() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -1977,7 +1977,7 @@ fn xtokens_precompiles_transfer_native() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -2025,7 +2025,7 @@ fn xtokens_precompile_transfer_local_asset() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -2370,7 +2370,7 @@ fn root_can_change_default_xcm_vers() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -2382,8 +2382,8 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), moonbase_runtime::xcm_config::CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V1(dest.clone())), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + WeightLimit::Limited(4000000000.into()) ), orml_xtokens::Error::::XcmExecutionFailed ); @@ -2399,8 +2399,8 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), moonbase_runtime::xcm_config::CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(4000000000.into()) )); }) } @@ -2436,16 +2436,16 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1, )); @@ -2456,14 +2456,14 @@ fn transactor_cannot_use_more_than_max_weight() { 0, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![], // 20000 is the max TransactWeights { - transact_required_weight_at_most: 17001, + transact_required_weight_at_most: 17001.into(), overall_weight: None } ), @@ -2483,7 +2483,7 @@ fn transactor_cannot_use_more_than_max_weight() { vec![], // 20000 is the max TransactWeights { - transact_required_weight_at_most: 17001, + transact_required_weight_at_most: 17001.into(), overall_weight: None } ), @@ -2511,17 +2511,17 @@ fn root_can_use_hrmp_manage() { }, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: Some(10000) }, // 20000 is the max TransactWeights { - transact_required_weight_at_most: 17001, - overall_weight: Some(20000) + transact_required_weight_at_most: 17001.into(), + overall_weight: Some(20000.into()) } ), - pallet_xcm_transactor::Error::::ErrorSending + pallet_xcm_transactor::Error::::ErrorValidating ); }) } @@ -2548,16 +2548,16 @@ fn transact_through_signed_precompile_works_v1() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, - Some(4000) + 3000.into(), + Weight::from_parts(200_000, (xcm_primitives::DEFAULT_PROOF_SIZE) + 4000), + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1, )); @@ -2656,7 +2656,7 @@ fn transact_through_signed_cannot_send_to_local_chain() { from_utf8(&output) .unwrap() .contains("Dispatched call failed with error:") - && from_utf8(&output).unwrap().contains("ErrorSending") + && from_utf8(&output).unwrap().contains("ErrorValidating") }); }); } @@ -2873,7 +2873,7 @@ fn test_xcm_utils_ml_tp_account() { X2( Parachain(2000), AccountKey20 { - network: Any, + network: None, key: ALICE, }, ), @@ -2905,10 +2905,10 @@ fn test_xcm_utils_ml_tp_account() { fn test_xcm_utils_weight_message() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); - let expected_weight: xcm_primitives::XcmV2Weight = - XcmWeight::::clear_origin(); + let expected_weight = + XcmWeight::::clear_origin().ref_time(); - let message: Vec = xcm::VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = XcmUtilsPCall::weight_message { message: message.into(), diff --git a/runtime/moonbase/tests/xcm_mock/parachain.rs b/runtime/moonbase/tests/xcm_mock/parachain.rs index 79d8df75385..53fa6eb3cab 100644 --- a/runtime/moonbase/tests/xcm_mock/parachain.rs +++ b/runtime/moonbase/tests/xcm_mock/parachain.rs @@ -38,7 +38,7 @@ use sp_runtime::{ use sp_std::{convert::TryFrom, prelude::*}; use xcm::{latest::prelude::*, Version as XcmVersion, VersionedXcm}; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; +use cumulus_primitives_core::relay_chain::HrmpChannelId; use orml_traits::parameter_type_with_key; use polkadot_core_primitives::BlockNumber as RelayBlockNumber; use polkadot_parachain::primitives::{Id as ParaId, Sibling}; @@ -49,14 +49,13 @@ use xcm::latest::{ }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, + AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, - FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, - SovereignSignedViaLocation, TakeWeightCredit, + FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; use scale_info::TypeInfo; use xcm_simulator::{ @@ -127,7 +126,6 @@ parameter_types! { pub const AssetsStringLimit: u32 = 50; pub const MetadataDepositBase: Balance = 0; pub const MetadataDepositPerByte: Balance = 0; - pub const ExecutiveBody: xcm::v0::BodyId = xcm::v0::BodyId::Executive; pub const AssetAccountDeposit: Balance = 0; } @@ -146,7 +144,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -167,7 +165,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -209,7 +207,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( ); parameter_types! { - pub const UnitWeightCost: XcmV2Weight = 1u64; + pub const UnitWeightCost: Weight = Weight::from_parts(1u64, 1u64); pub MaxInstructions: u32 = 100; } @@ -220,7 +218,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, xcm_primitives::AsAssetType, @@ -232,7 +230,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont allow teleports. - Nothing, + NoChecking, // We dont track any teleports (), >; @@ -243,7 +241,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< Balances, // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations - xcm_builder::IsConcrete, + IsConcrete, // We can convert the MultiLocations with our converter above: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -258,7 +256,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< LocalAssets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsPrefixedGeneralIndex, @@ -270,7 +268,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont want to allow teleporting assets - Nothing, + NoChecking, // The account to use for tracking teleports. (), >; @@ -304,7 +302,7 @@ parameter_types! { pub type XcmFeesToAccount_ = xcm_primitives::XcmFeesToAccount< Assets, ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, xcm_primitives::AsAssetType, @@ -319,16 +317,18 @@ parameter_types! { // We cannot skip the native trader for some specific tests, so we will have to work with // a native trader that charges same number of units as weight // We use both the old and new anchoring logics - pub ParaTokensPerSecond: (XcmAssetId, u128) = ( + pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = ( Concrete(SelfReserve::get()), - 1000000000000 + 1000000000000, + 0, ); } parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(MsgQueue::parachain_id().into()).into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); // New Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such @@ -346,6 +346,7 @@ parameter_types! { PalletInstance(::index() as u8) ) }; + pub const MaxAssetsIntoHolding: u32 = 64; } use frame_system::RawOrigin; @@ -364,7 +365,7 @@ impl Config for XcmConfig { xcm_primitives::AbsoluteAndRelativeReserve, >; type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; // We use three traders @@ -381,6 +382,14 @@ impl Config for XcmConfig { type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; type CallDispatcher = MoonbeamCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } impl cumulus_pallet_xcm::Config for Runtime { @@ -425,7 +434,7 @@ where } parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 100; + pub const BaseXcmWeight: Weight = Weight::from_parts(100u64, 100u64); pub const MaxAssetsForTransfer: usize = 2; pub SelfLocation: MultiLocation = MultiLocation::here(); pub SelfLocationAbsolute: MultiLocation = MultiLocation { @@ -454,7 +463,7 @@ impl orml_xtokens::Config for Runtime { type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; @@ -555,16 +564,14 @@ pub mod mock_msg_queue { let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); - match T::XcmExecutor::execute_xcm(location, xcm, max_weight.ref_time()) { + let mut id = [0u8; 32]; + id.copy_from_slice(hash.as_ref()); + match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => { - (Ok(Weight::from_ref_time(w)), Event::Success(Some(hash))) - } + Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => { - (Ok(Weight::from_ref_time(w)), Event::Fail(Some(hash), e)) - } + Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), } } Err(()) => ( @@ -619,7 +626,7 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time()); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } @@ -686,6 +693,9 @@ impl mock_version_changer::Config for Runtime { pub type LocalOriginToLocation = xcm_primitives::SignedToAccountId20; +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); +} impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -697,12 +707,18 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = xcm_builder::LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // We use a custom one to test runtime ugprades type AdvertisedXcmVersion = XcmVersioner; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } // Our AssetType. For now we only handle Xcm Assets @@ -877,7 +893,7 @@ impl pallet_xcm_transactor::Config for Runtime { CurrencyIdtoMultiLocation>; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type XcmSender = XcmRouter; type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; @@ -925,6 +941,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = (); type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } pub struct NormalFilter; diff --git a/runtime/moonbase/tests/xcm_mock/relay_chain.rs b/runtime/moonbase/tests/xcm_mock/relay_chain.rs index c7d60bcb8a7..9d70b61992f 100644 --- a/runtime/moonbase/tests/xcm_mock/relay_chain.rs +++ b/runtime/moonbase/tests/xcm_mock/relay_chain.rs @@ -22,7 +22,7 @@ use frame_support::{ }; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, ConstU32, IdentityLookup}, AccountId32, }; @@ -36,11 +36,10 @@ use xcm_builder::{ Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, LocationInverter, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; pub type AccountId = AccountId32; pub type Balance = u128; pub type BlockNumber = u32; @@ -73,7 +72,7 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; + type MaxConsumers = ConstU32<16>; } parameter_types! { @@ -108,11 +107,10 @@ impl configuration::Config for Runtime { } parameter_types! { - pub const KsmLocation: MultiLocation = Here.into(); + pub KsmLocation: MultiLocation = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; - pub const AnyNetwork: NetworkId = NetworkId::Any; - pub Ancestry: MultiLocation = Here.into(); - pub UnitWeightCost: XcmV2Weight = 1_000; + pub const AnyNetwork: Option = None; + pub UniversalLocation: InteriorMultiLocation = Here; } pub type SovereignAccountOf = ( @@ -134,9 +132,11 @@ type LocalOriginConverter = ( ); parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 1_000; - pub KsmPerSecond: (AssetId, u128) = (Concrete(KsmLocation::get()), 1); + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); + pub KsmPerSecond: (AssetId, u128, u128) = (Concrete(KsmLocation::get()), 1, 1); pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; + pub MatcherLocation: MultiLocation = MultiLocation::here(); } pub type XcmRouter = super::RelayChainXcmRouter; @@ -158,7 +158,7 @@ impl Config for XcmConfig { type OriginConverter = LocalOriginConverter; type IsReserve = (); type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = FixedRateOfFungible; @@ -167,6 +167,14 @@ impl Config for XcmConfig { type AssetClaims = XcmPallet; type SubscriptionService = XcmPallet; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } pub type LocalOriginToLocation = SignedToAccountId32; @@ -182,11 +190,17 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } parameter_types! { diff --git a/runtime/moonbase/tests/xcm_mock/statemint_like.rs b/runtime/moonbase/tests/xcm_mock/statemint_like.rs index 0ca6c523f36..c0e1f320d74 100644 --- a/runtime/moonbase/tests/xcm_mock/statemint_like.rs +++ b/runtime/moonbase/tests/xcm_mock/statemint_like.rs @@ -39,13 +39,12 @@ use xcm::VersionedXcm; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, - FixedWeightBounds, FungiblesAdapter, IsConcrete, LocationInverter, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; use xcm_simulator::{ DmpMessageHandlerT as DmpMessageHandler, XcmpMessageFormat, XcmpMessageHandlerT as XcmpMessageHandler, @@ -131,7 +130,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = (); - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -141,10 +140,12 @@ parameter_types! { pub const KsmLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(MsgQueue::parachain_id().into()).into(); - pub const Local: MultiLocation = Here.into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); + pub Local: MultiLocation = Here.into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); - pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128) = (Concrete(KsmLocation::get()), 1); + pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128, u128) = + (Concrete(KsmLocation::get()), 1, 1); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -178,7 +179,7 @@ pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: Assets, // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsPrefixedGeneralIndex, @@ -190,7 +191,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AccountId, // We only want to allow teleports of known assets. We use non-zero issuance as an indication // that this asset is known. - Nothing, + NoChecking, // The account to use for tracking teleports. CheckingAccount, >; @@ -223,7 +224,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: XcmV2Weight = 100; + pub UnitWeightCost: Weight = Weight::from_parts(100u64, 100u64); pub const MaxInstructions: u32 = 100; } @@ -251,6 +252,11 @@ pub type Barrier = ( AllowSubscriptionsFrom, ); +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub const MaxAssetsIntoHolding: u32 = 64; +} + pub struct XcmConfig; impl Config for XcmConfig { type RuntimeCall = RuntimeCall; @@ -260,7 +266,7 @@ impl Config for XcmConfig { type IsReserve = orml_xcm_support::MultiNativeAsset; type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = FixedRateOfFungible; @@ -269,6 +275,14 @@ impl Config for XcmConfig { type AssetClaims = PolkadotXcm; type SubscriptionService = PolkadotXcm; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -286,11 +300,17 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } impl cumulus_pallet_xcm::Config for Runtime { @@ -365,16 +385,14 @@ pub mod mock_msg_queue { let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); - match T::XcmExecutor::execute_xcm(location, xcm, max_weight.ref_time()) { + let mut id = [0u8; 32]; + id.copy_from_slice(hash.as_ref()); + match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => { - (Ok(Weight::from_ref_time(w)), Event::Success(Some(hash))) - } + Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => { - (Ok(Weight::from_ref_time(w)), Event::Fail(Some(hash), e)) - } + Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), } } Err(()) => ( @@ -429,7 +447,7 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time()); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } diff --git a/runtime/moonbase/tests/xcm_tests.rs b/runtime/moonbase/tests/xcm_tests.rs index e452dcfc775..f30e01a88f6 100644 --- a/runtime/moonbase/tests/xcm_tests.rs +++ b/runtime/moonbase/tests/xcm_tests.rs @@ -19,6 +19,7 @@ mod xcm_mock; use frame_support::{ assert_ok, + dispatch::Weight, traits::{ConstU32, PalletInfo, PalletInfoAccess}, weights::constants::WEIGHT_REF_TIME_PER_SECOND, BoundedVec, @@ -32,11 +33,11 @@ use xcm::latest::prelude::*; use xcm::{VersionedMultiLocation, WrapVersion}; use xcm_executor::traits::Convert; use xcm_mock::*; -use xcm_primitives::UtilityEncodeCall; +use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE}; use xcm_simulator::TestExt; mod common; use common::ExtBuilder; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; +use cumulus_primitives_core::relay_chain::HrmpChannelId; // Send a relay asset (like DOT) to a parachain A #[test] fn receive_relay_asset_from_relay() { @@ -68,15 +69,15 @@ fn receive_relay_asset_from_relay() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -122,7 +123,7 @@ fn send_relay_asset_to_relay() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -131,8 +132,8 @@ fn send_relay_asset_to_relay() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -153,7 +154,7 @@ fn send_relay_asset_to_relay() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: RELAYALICE.into(), }), }; @@ -164,8 +165,8 @@ fn send_relay_asset_to_relay() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 123, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -230,15 +231,15 @@ fn send_relay_asset_to_para_b() { // First send relay chain asset to Parachain A like in previous test let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -255,7 +256,7 @@ fn send_relay_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -266,8 +267,8 @@ fn send_relay_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -320,7 +321,7 @@ fn send_para_a_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -332,8 +333,8 @@ fn send_para_a_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -406,7 +407,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -417,8 +418,8 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -441,7 +442,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { interior: X2( Parachain(3), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -452,8 +453,8 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -501,7 +502,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -511,8 +512,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -535,7 +536,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { interior: X2( Parachain(1), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -545,8 +546,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -594,7 +595,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -604,8 +605,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -632,20 +633,19 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { let reanchored_para_a_balances = MultiLocation::new(0, X1(PalletInstance(1u8))); - let message = xcm::VersionedXcm::<()>::V2(Xcm(vec![ + let message = xcm::VersionedXcm::<()>::V3(Xcm(vec![ WithdrawAsset((reanchored_para_a_balances.clone(), 100).into()), ClearOrigin, BuyExecution { fees: (reanchored_para_a_balances, 100).into(), - weight_limit: Limited(80), + weight_limit: Limited(80.into()), }, DepositAsset { assets: All.into(), - max_assets: 1, beneficiary: MultiLocation::new( 0, X1(AccountKey20 { - network: Any, + network: None, key: PARAALICE, }), ), @@ -703,7 +703,7 @@ fn receive_relay_asset_with_trader() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -716,8 +716,8 @@ fn receive_relay_asset_with_trader() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 100).into()), 0, )); @@ -766,7 +766,7 @@ fn send_para_a_asset_to_para_b_with_trader() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -779,8 +779,8 @@ fn send_para_a_asset_to_para_b_with_trader() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(10) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(10u64, DEFAULT_PROOF_SIZE)) )); }); ParaA::execute_with(|| { @@ -841,7 +841,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -854,8 +854,8 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { parachain::CurrencyId::SelfReserve, 100, 1, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); ParaA::execute_with(|| { @@ -887,7 +887,7 @@ fn error_when_not_paying_enough() { }; let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -916,8 +916,8 @@ fn error_when_not_paying_enough() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 5).into()), 0, )); @@ -960,16 +960,16 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); @@ -977,7 +977,7 @@ fn transact_through_derivative_multilocation() { // Let's construct the call to know how much weight it is going to require let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -985,9 +985,9 @@ fn transact_through_derivative_multilocation() { // 4000000000 transact + 3000 correspond to 4000003000 tokens. 100 more for the transfer call assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1012,7 +1012,7 @@ fn transact_through_derivative_multilocation() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1023,8 +1023,8 @@ fn transact_through_derivative_multilocation() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1064,7 +1064,7 @@ fn transact_through_derivative_multilocation() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -1072,7 +1072,7 @@ fn transact_through_derivative_multilocation() { // 4000000000 + 3000 we should have taken out 4000003000 tokens from the caller encoded, TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -1128,7 +1128,7 @@ fn transact_through_derivative_with_custom_fee_weight() { // Let's construct the call to know how much weight it is going to require let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1136,9 +1136,9 @@ fn transact_through_derivative_with_custom_fee_weight() { // 4000000000 transact + 3000 correspond to 4000003000 tokens. 100 more for the transfer call assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1163,7 +1163,7 @@ fn transact_through_derivative_with_custom_fee_weight() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1174,8 +1174,8 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1216,7 +1216,7 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), // 1-1 fee weight mapping @@ -1225,8 +1225,8 @@ fn transact_through_derivative_with_custom_fee_weight() { // 4000000000 + 3000 we should have taken out 4000003000 tokens from the caller encoded, TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(overall_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(overall_weight.into()) } )); let event_found: Option = parachain::para_events() @@ -1280,31 +1280,31 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1328,7 +1328,7 @@ fn transact_through_sovereign() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1339,8 +1339,8 @@ fn transact_through_sovereign() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1389,10 +1389,10 @@ fn transact_through_sovereign() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(dest)), + Box::new(xcm::VersionedMultiLocation::V3(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -1400,7 +1400,7 @@ fn transact_through_sovereign() { utility_bytes, OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -1444,16 +1444,16 @@ fn transact_through_sovereign_with_custom_fee_weight() { }); let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1477,7 +1477,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1488,8 +1488,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1539,10 +1539,10 @@ fn transact_through_sovereign_with_custom_fee_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(dest)), + Box::new(xcm::VersionedMultiLocation::V3(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), // 1-1 fee-weight mapping @@ -1551,8 +1551,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { utility_bytes, OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(total_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -1594,19 +1594,21 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { }); let response = Response::Version(2); + let querier: MultiLocation = Here.into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change let mock_message: Xcm<()> = Xcm(vec![QueryResponse { query_id: 0, response, - max_weight: 0, + max_weight: Weight::zero(), + querier: Some(querier), }]); // The router is mocked, and we cannot use WrapVersion in ChildParachainRouter. So we will force // it directly here // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1629,8 +1631,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // Transfer assets. Since it is an unknown destination, it will query for version assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1664,6 +1666,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { interior: Here, }, 2, + vec![].into(), ) .into(); @@ -1711,13 +1714,15 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { decimals: 18, }; let response = Response::Version(2); + let querier: MultiLocation = Here.into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change let mock_message: Xcm<()> = Xcm(vec![QueryResponse { query_id: 0, response, - max_weight: 0, + max_weight: Weight::zero(), + querier: Some(querier), }]); ParaA::execute_with(|| { @@ -1783,7 +1788,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -1794,8 +1799,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); // free execution, full amount received assert_eq!( @@ -1816,6 +1821,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { interior: X1(Parachain(1)), }, 2, + vec![].into(), ) .into(); @@ -1881,15 +1887,15 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: fresh_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1914,8 +1920,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1959,15 +1965,15 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: fresh_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -2019,15 +2025,15 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: sufficient_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -2091,15 +2097,15 @@ fn empty_account_should_not_be_reset() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: sufficient_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -2216,7 +2222,7 @@ fn test_statemint_like() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -2225,7 +2231,7 @@ fn test_statemint_like() { assert_ok!(StatemintChainPalletXcm::reserve_transfer_assets( statemint_like::RuntimeOrigin::signed(RELAYALICE), Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new( ( X2( @@ -2304,7 +2310,7 @@ fn send_para_a_local_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2316,8 +2322,8 @@ fn send_para_a_local_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::LocalAssetReserve(asset_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2409,7 +2415,7 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2424,8 +2430,8 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { (parachain::CurrencyId::SelfReserve, 1000000) ], 0, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2442,7 +2448,7 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { interior: X2( Parachain(1), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2470,8 +2476,8 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { ) ], 0, - Box::new(VersionedMultiLocation::V1(new_dest)), - WeightLimit::Limited(4) + Box::new(VersionedMultiLocation::V3(new_dest)), + WeightLimit::Limited(Weight::from_parts(4u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2496,25 +2502,25 @@ fn transact_through_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2525,7 +2531,7 @@ fn transact_through_signed_multilocation() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), &ancestry) + .reanchor(&MultiLocation::parent(), ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2569,9 +2575,9 @@ fn transact_through_signed_multilocation() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -2579,7 +2585,7 @@ fn transact_through_signed_multilocation() { encoded, // 4000000000 for transfer + 4000 for XCM TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -2598,12 +2604,12 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { let mut ancestry = MultiLocation::parent(); ParaA::execute_with(|| { - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2614,7 +2620,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), &ancestry) + .reanchor(&MultiLocation::parent(), ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2659,9 +2665,9 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_weight as u128) @@ -2669,8 +2675,8 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { encoded, // 4000000000 for transfer + 4000 for XCM TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(total_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -2696,25 +2702,25 @@ fn transact_through_signed_multilocation_para_to_para() { assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V1(para_b_location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 - 3, - 20000000000, + 3.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4) + Some(4.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(para_b_balances.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2725,7 +2731,7 @@ fn transact_through_signed_multilocation_para_to_para() { // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, &ancestry) + .reanchor(¶_b_location, ancestry.interior) .unwrap(); let derived = xcm_primitives::Account20Hash::::convert_ref( @@ -2767,9 +2773,9 @@ fn transact_through_signed_multilocation_para_to_para() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(para_b_location)), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( para_b_balances ))), fee_amount: None @@ -2778,7 +2784,7 @@ fn transact_through_signed_multilocation_para_to_para() { // 4000000000 for transfer + 4000 for XCM // 1-1 to fee TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -2805,25 +2811,25 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V1(para_b_location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 - 3, - 20000000000, + 3.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4) + Some(4.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(para_b_balances.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2834,7 +2840,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, &ancestry) + .reanchor(¶_b_location, ancestry.interior) .unwrap(); let derived = xcm_primitives::Account20Hash::::convert_ref( @@ -2891,9 +2897,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(para_b_location)), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( para_b_balances ))), fee_amount: None @@ -2902,7 +2908,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { // 4000000000 for transfer + 4000 for XCM // 1-1 to fee TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -2931,25 +2937,25 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V1(para_b_location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 - 3, - 20000000000, + 3.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4) + Some(4.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(para_b_balances.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2960,7 +2966,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, &ancestry) + .reanchor(¶_b_location, ancestry.interior) .unwrap(); let derived = xcm_primitives::Account20Hash::::convert_ref( @@ -3018,16 +3024,16 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(para_b_location)), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( para_b_balances ))), fee_amount: None }, encoded, TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -3053,25 +3059,25 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V1(para_b_location.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 - 3, - 20000000000, + 3.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4) + Some(4.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(para_b_balances.clone())), + Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -3082,7 +3088,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, &ancestry) + .reanchor(¶_b_location, ancestry.interior) .unwrap(); let derived = xcm_primitives::Account20Hash::::convert_ref( @@ -3148,16 +3154,16 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(para_b_location)), + Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( para_b_balances ))), fee_amount: None }, encoded, TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -3202,14 +3208,14 @@ fn hrmp_init_accept_through_root() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -3235,14 +3241,14 @@ fn hrmp_init_accept_through_root() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -3290,14 +3296,14 @@ fn hrmp_close_works() { recipient: 2u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); diff --git a/runtime/moonbeam/src/asset_config.rs b/runtime/moonbeam/src/asset_config.rs index facfa0ba09c..ba2a4b6fce2 100644 --- a/runtime/moonbeam/src/asset_config.rs +++ b/runtime/moonbeam/src/asset_config.rs @@ -43,6 +43,14 @@ use sp_std::{ prelude::*, }; +// Number of items that can be destroyed with our configured max extrinsic proof size. +// x = (a - b) / c where: +// a: maxExtrinsic proof size +// b: base proof size for destroy_accounts in pallet_assets weights +// c: proof size for each item +// 656.87 = (3_407_872 - 8232) / 5180 +const REMOVE_ITEMS_LIMIT: u32 = 656; + // Not to disrupt the previous asset instance, we assign () to Foreign pub type ForeignAssetInstance = (); pub type LocalAssetInstance = pallet_assets::Instance1; @@ -82,7 +90,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -104,7 +112,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 6ea2527d89f..802190d7ace 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -136,7 +136,7 @@ pub mod currency { /// Maximum weight per block pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND) .saturating_div(2) - .set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64); + .set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64); pub const MILLISECS_PER_BLOCK: u64 = 12000; pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -451,6 +451,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = OnChargeEVMTransaction>; type BlockGasLimit = BlockGasLimit; type FindAuthor = FindAuthorAdapter; + type OnCreate = (); } parameter_types! { diff --git a/runtime/moonbeam/src/xcm_config.rs b/runtime/moonbeam/src/xcm_config.rs index a4b22504862..2caea037c52 100644 --- a/runtime/moonbeam/src/xcm_config.rs +++ b/runtime/moonbeam/src/xcm_config.rs @@ -27,18 +27,19 @@ use pallet_evm_precompileset_assets_erc20::AccountIdAssetIdConversion; use sp_runtime::traits::Hash as THash; use frame_support::{ + dispatch::Weight, parameter_types, traits::{Everything, Nothing, PalletInfoAccess}, }; use frame_system::EnsureRoot; -use sp_core::{H160, H256}; +use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, + AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, - LocationInverter, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, }; @@ -50,7 +51,7 @@ use orml_xcm_support::MultiNativeAsset; use xcm_primitives::{ AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToMultiLocation, AsAssetType, FirstAssetTrader, SignedToAccountId20, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, - XcmV2Weight, + DEFAULT_PROOF_SIZE, }; use parity_scale_codec::{Decode, Encode}; @@ -68,8 +69,8 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; // The relay chain Origin type pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - // The ancestry, defines the multilocation describing this consensus system - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); // Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such // a MultiLocation: (Self Balances pallet index) @@ -111,7 +112,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< Assets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsAssetType, @@ -123,7 +124,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont allow teleports. - Nothing, + NoChecking, // We dont track any teleports (), >; @@ -149,7 +150,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< LocalAssets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, // This just tells to convert an assetId into a GeneralIndex junction prepended @@ -163,7 +164,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont want to allow teleporting assets - Nothing, + NoChecking, // The account to use for tracking teleports. (), >; @@ -198,7 +199,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( parameter_types! { /// The amount of weight an XCM operation takes. This is safe overestimate. - pub UnitWeightCost: XcmV2Weight = 200_000_000; + pub UnitWeightCost: Weight = Weight::from_parts(200_000_000u64, DEFAULT_PROOF_SIZE); /// Maximum number of instructions in a single XCM fragment. A sanity check against /// weight caculations getting too crazy. pub MaxInstructions: u32 = 100; @@ -228,7 +229,7 @@ parameter_types! { pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< Assets, ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsAssetType, @@ -239,6 +240,19 @@ pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< XcmFeesAccount, >; +pub struct SafeCallFilter; +impl frame_support::traits::Contains for SafeCallFilter { + fn contains(_call: &RuntimeCall) -> bool { + // TODO review + // This needs to be addressed at EVM level + true + } +} + +parameter_types! { + pub const MaxAssetsIntoHolding: u32 = 64; +} + pub struct XcmExecutorConfig; impl xcm_executor::Config for XcmExecutorConfig { type RuntimeCall = RuntimeCall; @@ -251,7 +265,7 @@ impl xcm_executor::Config for XcmExecutorConfig { // of our chain, we always return the relative reserve type IsReserve = MultiNativeAsset>; type IsTeleporter = (); // No teleport - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = XcmBarrier; type Weigher = XcmWeigher; // We use two traders @@ -274,6 +288,14 @@ impl xcm_executor::Config for XcmExecutorConfig { type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; type CallDispatcher = RuntimeCall; + type PalletInstancesInfo = crate::AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = SafeCallFilter; } type XcmExecutor = xcm_executor::XcmExecutor; @@ -285,11 +307,16 @@ pub type LocalOriginToLocation = SignedToAccountId20, + cumulus_primitives_utility::ParentAsUmp, // ..and XCMP to communicate with the sibling chains. XcmpQueue, ); +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parent.into()); +} + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -300,11 +327,20 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = XcmWeigher; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = LocationToAccountId; + type MaxLockers = ConstU32<8>; + // TODO pallet-xcm weights + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; } impl cumulus_pallet_xcm::Config for Runtime { @@ -321,6 +357,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; + type PriceForSiblingDelivery = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -419,7 +456,7 @@ where } parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 200_000_000; + pub const BaseXcmWeight: Weight = Weight::from_parts(200_000_000u64, DEFAULT_PROOF_SIZE); pub const MaxAssetsForTransfer: usize = 2; // This is how we are going to detect whether the asset is a Reserve asset @@ -452,7 +489,7 @@ impl orml_xtokens::Config for Runtime { type SelfLocation = SelfLocation; type Weigher = XcmWeigher; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; @@ -522,7 +559,7 @@ impl pallet_xcm_transactor::Config for Runtime { type XcmSender = XcmRouter; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; type ReserveProvider = AbsoluteAndRelativeReserve; diff --git a/runtime/moonbeam/tests/integration_test.rs b/runtime/moonbeam/tests/integration_test.rs index 8c816971277..716ccd16d63 100644 --- a/runtime/moonbeam/tests/integration_test.rs +++ b/runtime/moonbeam/tests/integration_test.rs @@ -1433,7 +1433,7 @@ fn root_can_change_default_xcm_vers() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -1445,8 +1445,8 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V1(dest.clone())), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + WeightLimit::Limited(4000000000.into()) ), orml_xtokens::Error::::XcmExecutionFailed ); @@ -1462,8 +1462,8 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(4000000000.into()) )); }) } @@ -1585,7 +1585,7 @@ fn asset_erc20_precompiles_transfer() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(24133) + .expect_cost(23497) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1637,7 +1637,7 @@ fn asset_erc20_precompiles_approve() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(14596) + .expect_cost(13862) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1658,7 +1658,7 @@ fn asset_erc20_precompiles_approve() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(29624) + .expect_cost(29021) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1710,7 +1710,7 @@ fn asset_erc20_precompiles_mint_burn() { value: { 1000 * GLMR }.into(), }, ) - .expect_cost(13249) + .expect_cost(12787) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1737,7 +1737,7 @@ fn asset_erc20_precompiles_mint_burn() { value: { 500 * GLMR }.into(), }, ) - .expect_cost(13575) + .expect_cost(13016) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1782,7 +1782,7 @@ fn asset_erc20_precompiles_freeze_thaw_account() { account: Address(ALICE.into()), }, ) - .expect_cost(7094) + .expect_cost(6699) .expect_no_logs() .execute_returns_encoded(true); @@ -1801,7 +1801,7 @@ fn asset_erc20_precompiles_freeze_thaw_account() { account: Address(ALICE.into()), }, ) - .expect_cost(7074) + .expect_cost(6713) .expect_no_logs() .execute_returns_encoded(true); @@ -1836,7 +1836,7 @@ fn asset_erc20_precompiles_freeze_thaw_asset() { asset_precompile_address, LocalAssetsPCall::freeze_asset {}, ) - .expect_cost(5944) + .expect_cost(5548) .expect_no_logs() .execute_returns_encoded(true); @@ -1853,7 +1853,7 @@ fn asset_erc20_precompiles_freeze_thaw_asset() { asset_precompile_address, LocalAssetsPCall::thaw_asset {}, ) - .expect_cost(5964) + .expect_cost(5550) .expect_no_logs() .execute_returns_encoded(true); @@ -1890,7 +1890,7 @@ fn asset_erc20_precompiles_freeze_transfer_ownership() { owner: Address(BOB.into()), }, ) - .expect_cost(6973) + .expect_cost(6614) .expect_no_logs() .execute_returns_encoded(true); @@ -1932,7 +1932,7 @@ fn asset_erc20_precompiles_freeze_set_team() { issuer: Address(BOB.into()), }, ) - .expect_cost(5940) + .expect_cost(5577) .expect_no_logs() .execute_returns_encoded(true); @@ -2055,7 +2055,7 @@ fn xcm_asset_erc20_precompiles_transfer() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(24133) + .expect_cost(23497) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -2120,7 +2120,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(14596) + .expect_cost(13862) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -2141,7 +2141,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(29624) + .expect_cost(29021) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -2203,7 +2203,7 @@ fn xtokens_precompile_transfer() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -2253,7 +2253,7 @@ fn xtokens_precompile_transfer_multiasset() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -2296,18 +2296,18 @@ fn make_sure_glmr_can_be_transferred_precompile() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; assert_ok!(XTokens::transfer_multiasset( origin_of(AccountId::from(ALICE)), - Box::new(VersionedMultiAsset::V1(MultiAsset { + Box::new(VersionedMultiAsset::V3(MultiAsset { id: Concrete(moonbeam_runtime::xcm_config::SelfReserve::get()), fun: Fungible(1000) })), - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(40000.into()) )); }); } @@ -2330,7 +2330,7 @@ fn make_sure_glmr_can_be_transferred() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -2338,8 +2338,8 @@ fn make_sure_glmr_can_be_transferred() { origin_of(AccountId::from(ALICE)), CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(40000.into()) )); }); } @@ -2361,7 +2361,7 @@ fn make_sure_polkadot_xcm_cannot_be_called() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -2373,9 +2373,9 @@ fn make_sure_polkadot_xcm_cannot_be_called() { .into(); assert_noop!( RuntimeCall::PolkadotXcm(pallet_xcm::Call::::reserve_transfer_assets { - dest: Box::new(VersionedMultiLocation::V1(dest.clone())), - beneficiary: Box::new(VersionedMultiLocation::V1(dest)), - assets: Box::new(VersionedMultiAssets::V1(multiassets)), + dest: Box::new(VersionedMultiLocation::V3(dest.clone())), + beneficiary: Box::new(VersionedMultiLocation::V3(dest)), + assets: Box::new(VersionedMultiAssets::V3(multiassets)), fee_asset_item: 0, }) .dispatch(::RuntimeOrigin::signed( @@ -2408,16 +2408,16 @@ fn transact_through_signed_precompile_not_enabled() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, - Some(4000) + 3000.into(), + 20000.into(), + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1, )); @@ -2464,34 +2464,34 @@ fn transact_through_signed_mult_not_enabled() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), // lets say 1000 per instruction - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); assert_noop!( RuntimeCall::XcmTransactor( pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + dest: Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), fee: CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, call: vec![], weight_info: TransactWeights { - transact_required_weight_at_most: 11000, + transact_required_weight_at_most: 11000.into(), overall_weight: None } } @@ -2527,34 +2527,34 @@ fn transact_through_signed_not_enabled() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), // lets say 1000 per instruction - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); assert_noop!( RuntimeCall::XcmTransactor( pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + dest: Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), fee: CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, call: vec![], weight_info: TransactWeights { - transact_required_weight_at_most: 11000, + transact_required_weight_at_most: 11000.into(), overall_weight: None } } @@ -2598,17 +2598,17 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1, )); @@ -2619,14 +2619,14 @@ fn transactor_cannot_use_more_than_max_weight() { 0, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![], // 2000 is the max TransactWeights { - transact_required_weight_at_most: 17001, + transact_required_weight_at_most: 17001.into(), overall_weight: None } ), @@ -2644,7 +2644,7 @@ fn transactor_cannot_use_more_than_max_weight() { vec![], // 20000 is the max TransactWeights { - transact_required_weight_at_most: 17001, + transact_required_weight_at_most: 17001.into(), overall_weight: None } ), @@ -2678,7 +2678,7 @@ fn call_xtokens_with_fee() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -2692,8 +2692,8 @@ fn call_xtokens_with_fee() { CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, 100, - Box::new(xcm::VersionedMultiLocation::V1(dest.clone())), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + WeightLimit::Limited(4000000000.into()) )); let after_balance = Assets::balance(source_id, &AccountId::from(ALICE)); @@ -2756,7 +2756,7 @@ fn test_xcm_utils_ml_to_account() { X2( Parachain(2000), AccountKey20 { - network: Any, + network: None, key: ALICE, }, ), @@ -2781,9 +2781,9 @@ fn test_xcm_utils_ml_to_account() { fn test_xcm_utils_weight_message() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); - let expected_weight: xcm_primitives::XcmV2Weight = UnitWeightCost::get(); + let expected_weight = UnitWeightCost::get().ref_time(); - let message: Vec = xcm::VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = XcmUtilsPCall::weight_message { message: message.into(), diff --git a/runtime/moonbeam/tests/xcm_mock/parachain.rs b/runtime/moonbeam/tests/xcm_mock/parachain.rs index b4bf79067f7..04f4d07074d 100644 --- a/runtime/moonbeam/tests/xcm_mock/parachain.rs +++ b/runtime/moonbeam/tests/xcm_mock/parachain.rs @@ -25,7 +25,7 @@ use frame_support::{ PalletId, }; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; +use cumulus_primitives_core::relay_chain::HrmpChannelId; use frame_system::{EnsureNever, EnsureRoot}; use orml_traits::parameter_type_with_key; use parity_scale_codec::{Decode, Encode}; @@ -46,14 +46,13 @@ use xcm::latest::{ }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, + AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, - FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, - SovereignSignedViaLocation, TakeWeightCredit, + FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; use scale_info::TypeInfo; use xcm_simulator::{ @@ -124,7 +123,6 @@ parameter_types! { pub const AssetsStringLimit: u32 = 50; pub const MetadataDepositBase: Balance = 0; pub const MetadataDepositPerByte: Balance = 0; - pub const ExecutiveBody: xcm::v0::BodyId = xcm::v0::BodyId::Executive; pub const AssetAccountDeposit: Balance = 0; } @@ -143,7 +141,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -164,7 +162,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -204,7 +202,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( ); parameter_types! { - pub const UnitWeightCost: XcmV2Weight = 1; + pub const UnitWeightCost: Weight = Weight::from_parts(1u64, 1u64); pub MaxInstructions: u32 = 100; } @@ -214,7 +212,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< Assets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, xcm_primitives::AsAssetType, @@ -226,7 +224,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont allow teleports. - Nothing, + NoChecking, // We dont track any teleports (), >; @@ -236,7 +234,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< Balances, // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations - xcm_builder::IsConcrete, + IsConcrete, // We can convert the MultiLocations with our converter above: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -251,7 +249,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< LocalAssets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsPrefixedGeneralIndex, @@ -263,7 +261,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont want to allow teleporting assets - Nothing, + NoChecking, // The account to use for tracking teleports. (), >; @@ -294,7 +292,7 @@ parameter_types! { pub type XcmFeesToAccount_ = xcm_primitives::XcmFeesToAccount< Assets, ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, xcm_primitives::AsAssetType, @@ -308,13 +306,15 @@ pub type XcmFeesToAccount_ = xcm_primitives::XcmFeesToAccount< parameter_types! { // We cannot skip the native trader for some specific tests, so we will have to work with // a native trader that charges same number of units as weight - pub ParaTokensPerSecond: (XcmAssetId, u128) = (Concrete(SelfReserve::get()), 1000000000000); + pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = + (Concrete(SelfReserve::get()), 1000000000000, 0); } parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(MsgQueue::parachain_id().into()).into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); pub SelfReserve: MultiLocation = MultiLocation { parents:0, interior: Junctions::X1( @@ -327,7 +327,7 @@ parameter_types! { PalletInstance(::index() as u8) ) }; - + pub const MaxAssetsIntoHolding: u32 = 64; } pub struct XcmConfig; @@ -340,7 +340,7 @@ impl Config for XcmConfig { xcm_primitives::AbsoluteAndRelativeReserve, >; type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; // We use two traders @@ -356,6 +356,14 @@ impl Config for XcmConfig { type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } impl cumulus_pallet_xcm::Config for Runtime { @@ -395,7 +403,7 @@ where } parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 100; + pub const BaseXcmWeight: Weight = Weight::from_parts(100u64, 100u64); pub const MaxAssetsForTransfer: usize = 2; pub SelfLocation: MultiLocation = MultiLocation::here(); pub SelfLocationAbsolute: MultiLocation = MultiLocation { @@ -424,7 +432,7 @@ impl orml_xtokens::Config for Runtime { type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; @@ -525,16 +533,14 @@ pub mod mock_msg_queue { let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); - match T::XcmExecutor::execute_xcm(location, xcm, max_weight.ref_time()) { + let mut id = [0u8; 32]; + id.copy_from_slice(hash.as_ref()); + match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => { - (Ok(Weight::from_ref_time(w)), Event::Success(Some(hash))) - } + Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => { - (Ok(Weight::from_ref_time(w)), Event::Fail(Some(hash), e)) - } + Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), } } Err(()) => ( @@ -589,8 +595,7 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time()); - + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } } @@ -656,6 +661,10 @@ impl mock_version_changer::Config for Runtime { pub type LocalOriginToLocation = xcm_primitives::SignedToAccountId20; +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); +} + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -667,12 +676,18 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = xcm_builder::LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // We use a custom one to test runtime ugprades type AdvertisedXcmVersion = XcmVersioner; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } // Our AssetType. For now we only handle Xcm Assets @@ -847,7 +862,7 @@ impl pallet_xcm_transactor::Config for Runtime { CurrencyIdtoMultiLocation>; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type XcmSender = XcmRouter; type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; @@ -895,6 +910,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = (); type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } pub struct NormalFilter; diff --git a/runtime/moonbeam/tests/xcm_mock/relay_chain.rs b/runtime/moonbeam/tests/xcm_mock/relay_chain.rs index 625919415c0..0a68dd74f0b 100644 --- a/runtime/moonbeam/tests/xcm_mock/relay_chain.rs +++ b/runtime/moonbeam/tests/xcm_mock/relay_chain.rs @@ -22,7 +22,7 @@ use frame_support::{ }; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, ConstU32, IdentityLookup}, AccountId32, }; @@ -36,11 +36,10 @@ use xcm_builder::{ Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, LocationInverter, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; pub type AccountId = AccountId32; pub type Balance = u128; pub type BlockNumber = u32; @@ -73,7 +72,7 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; + type MaxConsumers = ConstU32<16>; } parameter_types! { @@ -108,11 +107,10 @@ impl configuration::Config for Runtime { } parameter_types! { - pub const KsmLocation: MultiLocation = Here.into(); + pub KsmLocation: MultiLocation = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; - pub const AnyNetwork: NetworkId = NetworkId::Any; - pub Ancestry: MultiLocation = Here.into(); - pub UnitWeightCost: XcmV2Weight = 1_000; + pub const AnyNetwork: Option = None; + pub UniversalLocation: InteriorMultiLocation = Here; } pub type SovereignAccountOf = ( @@ -134,9 +132,11 @@ type LocalOriginConverter = ( ); parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 1_000; - pub KsmPerSecond: (AssetId, u128) = (Concrete(KsmLocation::get()), 1); + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); + pub KsmPerSecond: (AssetId, u128, u128) = (Concrete(KsmLocation::get()), 1, 1); pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; + pub MatcherLocation: MultiLocation = MultiLocation::here(); } use frame_support::ensure; @@ -151,9 +151,9 @@ pub struct AllowTopLevelPaidExecutionDescendOriginFirst(PhantomData); impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { fn should_execute( origin: &MultiLocation, - message: &mut Xcm, - max_weight: XcmV2Weight, - _weight_credit: &mut XcmV2Weight, + message: &mut [Instruction], + max_weight: Weight, + _weight_credit: &mut Weight, ) -> Result<(), ()> { log::trace!( target: "xcm::barriers", @@ -162,7 +162,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes origin, message, max_weight, _weight_credit, ); ensure!(T::contains(origin), ()); - let mut iter = message.0.iter_mut(); + let mut iter = message.iter_mut(); let mut i = iter.next().ok_or(())?; match i { DescendOrigin(..) => (), @@ -180,7 +180,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes BuyExecution { weight_limit: Limited(ref mut weight), .. - } if *weight >= max_weight => { + } if weight.all_gte(max_weight) => { *weight = max_weight; Ok(()) } @@ -215,7 +215,7 @@ impl Config for XcmConfig { type OriginConverter = LocalOriginConverter; type IsReserve = (); type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = FixedRateOfFungible; @@ -224,6 +224,14 @@ impl Config for XcmConfig { type AssetClaims = XcmPallet; type SubscriptionService = XcmPallet; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } pub type LocalOriginToLocation = SignedToAccountId32; @@ -239,11 +247,17 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } parameter_types! { diff --git a/runtime/moonbeam/tests/xcm_mock/statemint_like.rs b/runtime/moonbeam/tests/xcm_mock/statemint_like.rs index c6789af5433..4e7bfd02bd3 100644 --- a/runtime/moonbeam/tests/xcm_mock/statemint_like.rs +++ b/runtime/moonbeam/tests/xcm_mock/statemint_like.rs @@ -39,13 +39,12 @@ use xcm::VersionedXcm; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, - FixedWeightBounds, FungiblesAdapter, IsConcrete, LocationInverter, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; use xcm_simulator::{ DmpMessageHandlerT as DmpMessageHandler, XcmpMessageFormat, XcmpMessageHandlerT as XcmpMessageHandler, @@ -131,7 +130,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = (); - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -141,10 +140,12 @@ parameter_types! { pub const KsmLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(MsgQueue::parachain_id().into()).into(); - pub const Local: MultiLocation = Here.into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); + pub Local: MultiLocation = Here.into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); - pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128) = (Concrete(KsmLocation::get()), 1); + pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128, u128) = + (Concrete(KsmLocation::get()), 1, 1); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -178,7 +179,7 @@ pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: Assets, // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsPrefixedGeneralIndex, @@ -190,7 +191,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AccountId, // We only want to allow teleports of known assets. We use non-zero issuance as an indication // that this asset is known. - Nothing, + NoChecking, // The account to use for tracking teleports. CheckingAccount, >; @@ -223,7 +224,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: XcmV2Weight = 100; + pub UnitWeightCost: Weight = Weight::from_parts(100u64, 100u64); pub const MaxInstructions: u32 = 100; } @@ -251,6 +252,11 @@ pub type Barrier = ( AllowSubscriptionsFrom, ); +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub const MaxAssetsIntoHolding: u32 = 64; +} + pub struct XcmConfig; impl Config for XcmConfig { type RuntimeCall = RuntimeCall; @@ -260,7 +266,7 @@ impl Config for XcmConfig { type IsReserve = orml_xcm_support::MultiNativeAsset; type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = FixedRateOfFungible; @@ -269,6 +275,14 @@ impl Config for XcmConfig { type AssetClaims = PolkadotXcm; type SubscriptionService = PolkadotXcm; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -286,11 +300,17 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } impl cumulus_pallet_xcm::Config for Runtime { @@ -365,16 +385,14 @@ pub mod mock_msg_queue { let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); - match T::XcmExecutor::execute_xcm(location, xcm, max_weight.ref_time()) { + let mut id = [0u8; 32]; + id.copy_from_slice(hash.as_ref()); + match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => { - (Ok(Weight::from_ref_time(w)), Event::Success(Some(hash))) - } + Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => { - (Ok(Weight::from_ref_time(w)), Event::Fail(Some(hash), e)) - } + Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), } } Err(()) => ( @@ -429,8 +447,7 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time()); - + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } } diff --git a/runtime/moonbeam/tests/xcm_tests.rs b/runtime/moonbeam/tests/xcm_tests.rs index f5ad60943aa..4ed134d57f3 100644 --- a/runtime/moonbeam/tests/xcm_tests.rs +++ b/runtime/moonbeam/tests/xcm_tests.rs @@ -20,21 +20,21 @@ mod xcm_mock; use frame_support::{ assert_ok, traits::{PalletInfo, PalletInfoAccess}, - weights::constants::WEIGHT_REF_TIME_PER_SECOND, + weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}, }; use xcm::{VersionedMultiLocation, WrapVersion}; use xcm_mock::parachain; use xcm_mock::relay_chain; use xcm_mock::*; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; +use cumulus_primitives_core::relay_chain::HrmpChannelId; use pallet_asset_manager::LocalAssetIdCreator; use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, }; use xcm::latest::prelude::*; use xcm_executor::traits::Convert; -use xcm_primitives::UtilityEncodeCall; +use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE}; use xcm_simulator::TestExt; // Send a relay asset (like DOT) to a parachain A @@ -69,7 +69,7 @@ fn receive_relay_asset_from_relay() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -78,8 +78,8 @@ fn receive_relay_asset_from_relay() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -125,7 +125,7 @@ fn send_relay_asset_to_relay() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -134,8 +134,8 @@ fn send_relay_asset_to_relay() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -156,7 +156,7 @@ fn send_relay_asset_to_relay() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: RELAYALICE.into(), }), }; @@ -166,8 +166,8 @@ fn send_relay_asset_to_relay() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 123, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -231,15 +231,15 @@ fn send_relay_asset_to_para_b() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -256,7 +256,7 @@ fn send_relay_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -267,8 +267,8 @@ fn send_relay_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -321,7 +321,7 @@ fn send_para_a_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -334,8 +334,8 @@ fn send_para_a_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -407,7 +407,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -417,8 +417,8 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -441,7 +441,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { interior: X2( Parachain(3), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -452,8 +452,8 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -501,7 +501,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -512,8 +512,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -536,7 +536,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { interior: X2( Parachain(1), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -546,8 +546,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -593,7 +593,7 @@ fn receive_relay_asset_with_trader() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -606,8 +606,8 @@ fn receive_relay_asset_with_trader() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 100).into()), 0, )); @@ -656,7 +656,7 @@ fn send_para_a_asset_to_para_b_with_trader() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -669,8 +669,8 @@ fn send_para_a_asset_to_para_b_with_trader() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(10) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(10u64, DEFAULT_PROOF_SIZE)) )); }); ParaA::execute_with(|| { @@ -731,7 +731,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -744,8 +744,8 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { parachain::CurrencyId::SelfReserve, 100, 1, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); ParaA::execute_with(|| { @@ -777,7 +777,7 @@ fn error_when_not_paying_enough() { }; let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -806,8 +806,8 @@ fn error_when_not_paying_enough() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 5).into()), 0, )); @@ -850,16 +850,16 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); @@ -867,7 +867,7 @@ fn transact_through_derivative_multilocation() { // Let's construct the call to know how much weight it is going to require let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -875,9 +875,9 @@ fn transact_through_derivative_multilocation() { // 4000000000 transact + 3000 correspond to 4000003000 tokens. 100 more for the transfer call assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -902,7 +902,7 @@ fn transact_through_derivative_multilocation() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -913,8 +913,8 @@ fn transact_through_derivative_multilocation() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -954,7 +954,7 @@ fn transact_through_derivative_multilocation() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -962,7 +962,7 @@ fn transact_through_derivative_multilocation() { encoded, // 400000000 + 3000 we should have taken out 4000003000 tokens from the caller TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -1008,7 +1008,7 @@ fn transact_through_derivative_with_custom_fee_weight() { // Let's construct the call to know how much weight it is going to require let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1016,9 +1016,9 @@ fn transact_through_derivative_with_custom_fee_weight() { // 4000000000 transact + 3000 correspond to 4000003000 tokens. 100 more for the transfer call assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1043,7 +1043,7 @@ fn transact_through_derivative_with_custom_fee_weight() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1054,8 +1054,8 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1096,7 +1096,7 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), // 1-1 fee weight mapping @@ -1105,8 +1105,8 @@ fn transact_through_derivative_with_custom_fee_weight() { // 4000000000 + 3000 we should have taken out 4000003000 tokens from the caller encoded, TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(overall_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(overall_weight.into()) } )); let event_found: Option = parachain::para_events() @@ -1160,31 +1160,31 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1208,7 +1208,7 @@ fn transact_through_sovereign() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1219,8 +1219,8 @@ fn transact_through_sovereign() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1269,10 +1269,10 @@ fn transact_through_sovereign() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(dest)), + Box::new(xcm::VersionedMultiLocation::V3(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -1280,7 +1280,7 @@ fn transact_through_sovereign() { utility_bytes, OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -1324,16 +1324,16 @@ fn transact_through_sovereign_with_custom_fee_weight() { }); let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1357,7 +1357,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1368,8 +1368,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1419,10 +1419,10 @@ fn transact_through_sovereign_with_custom_fee_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(dest)), + Box::new(xcm::VersionedMultiLocation::V3(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), // 1-1 fee-weight mapping @@ -1431,8 +1431,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { utility_bytes, OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(total_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -1474,19 +1474,21 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { }); let response = Response::Version(2); + let querier: MultiLocation = Here.into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change let mock_message: Xcm<()> = Xcm(vec![QueryResponse { query_id: 0, response, - max_weight: 0, + max_weight: Weight::zero(), + querier: Some(querier), }]); // The router is mocked, and we cannot use WrapVersion in ChildParachainRouter. So we will force // it directly here // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1509,8 +1511,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // Transfer assets. Since it is an unknown destination, it will query for version assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1544,6 +1546,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { interior: Here, }, 2, + vec![].into(), ) .into(); @@ -1608,15 +1611,15 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: fresh_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1641,8 +1644,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1686,15 +1689,15 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: fresh_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1746,15 +1749,15 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: sufficient_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1818,15 +1821,15 @@ fn empty_account_should_not_be_reset() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: sufficient_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1944,7 +1947,7 @@ fn test_statemint_like() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1953,7 +1956,7 @@ fn test_statemint_like() { assert_ok!(StatemintChainPalletXcm::reserve_transfer_assets( statemint_like::RuntimeOrigin::signed(RELAYALICE), Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new( ( X2( @@ -2031,7 +2034,7 @@ fn send_para_a_local_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2043,8 +2046,8 @@ fn send_para_a_local_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::LocalAssetReserve(asset_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2134,7 +2137,7 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_glmr() interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2149,8 +2152,8 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_glmr() (parachain::CurrencyId::SelfReserve, 1000000) ], 0, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2167,7 +2170,7 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_glmr() interior: X2( Parachain(1), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2195,8 +2198,8 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_glmr() ) ], 0, - Box::new(VersionedMultiLocation::V1(new_dest)), - WeightLimit::Limited(4) + Box::new(VersionedMultiLocation::V3(new_dest)), + WeightLimit::Limited(4.into()) )); }); @@ -2220,25 +2223,25 @@ fn transact_through_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2249,7 +2252,7 @@ fn transact_through_signed_multilocation() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), &ancestry) + .reanchor(&MultiLocation::parent(), ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2293,9 +2296,9 @@ fn transact_through_signed_multilocation() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -2303,7 +2306,7 @@ fn transact_through_signed_multilocation() { encoded, // 4000000000 for transfer + 4000 for XCM TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -2346,14 +2349,14 @@ fn hrmp_init_accept_through_root() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -2379,14 +2382,14 @@ fn hrmp_init_accept_through_root() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -2434,14 +2437,14 @@ fn hrmp_close_works() { recipient: 2u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); diff --git a/runtime/moonriver/src/asset_config.rs b/runtime/moonriver/src/asset_config.rs index 2c2b6fe47b8..61a7c3517af 100644 --- a/runtime/moonriver/src/asset_config.rs +++ b/runtime/moonriver/src/asset_config.rs @@ -43,6 +43,14 @@ use sp_std::{ prelude::*, }; +// Number of items that can be destroyed with our configured max extrinsic proof size. +// x = (a - b) / c where: +// a: maxExtrinsic proof size +// b: base proof size for destroy_accounts in pallet_assets weights +// c: proof size for each item +// 656.87 = (3_407_872 - 8232) / 5180 +const REMOVE_ITEMS_LIMIT: u32 = 656; + // Not to disrupt the previous asset instance, we assign () to Foreign pub type ForeignAssetInstance = (); pub type LocalAssetInstance = pallet_assets::Instance1; @@ -85,7 +93,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -107,7 +115,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 3ce1f9f3339..d4d533c0939 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -140,7 +140,7 @@ pub mod currency { /// Maximum weight per block pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND) .saturating_div(2) - .set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64); + .set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64); pub const MILLISECS_PER_BLOCK: u64 = 12000; pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -469,6 +469,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = OnChargeEVMTransaction>; type BlockGasLimit = BlockGasLimit; type FindAuthor = FindAuthorAdapter; + type OnCreate = (); } parameter_types! { diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 25cca995a83..6c4deba29c1 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -27,18 +27,19 @@ use pallet_evm_precompileset_assets_erc20::AccountIdAssetIdConversion; use sp_runtime::traits::Hash as THash; use frame_support::{ + dispatch::Weight, parameter_types, traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess}, }; use frame_system::EnsureRoot; -use sp_core::{H160, H256}; +use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, + AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, - LocationInverter, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, }; @@ -50,7 +51,7 @@ use orml_xcm_support::MultiNativeAsset; use xcm_primitives::{ AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToMultiLocation, AsAssetType, FirstAssetTrader, SignedToAccountId20, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, - XcmV2Weight, + DEFAULT_PROOF_SIZE, }; use parity_scale_codec::{Decode, Encode}; @@ -70,8 +71,9 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Kusama; // The relay chain Origin type pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - // The ancestry, defines the multilocation describing this consensus system - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + // The universal location within the global consensus system + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); // Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such @@ -114,7 +116,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< Assets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsAssetType, @@ -126,7 +128,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont allow teleports. - Nothing, + NoChecking, // We dont track any teleports (), >; @@ -152,7 +154,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< LocalAssets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, // This just tells to convert an assetId into a GeneralIndex junction prepended @@ -166,7 +168,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont want to allow teleporting assets - Nothing, + NoChecking, // The account to use for tracking teleports. (), >; @@ -207,7 +209,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( parameter_types! { /// The amount of weight an XCM operation takes. This is safe overestimate. - pub UnitWeightCost: XcmV2Weight = 200_000_000; + pub UnitWeightCost: Weight = Weight::from_parts(200_000_000u64, DEFAULT_PROOF_SIZE); /// Maximum number of instructions in a single XCM fragment. A sanity check against /// weight caculations getting too crazy. pub MaxInstructions: u32 = 100; @@ -237,7 +239,7 @@ parameter_types! { pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< Assets, ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsAssetType, @@ -248,6 +250,19 @@ pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< XcmFeesAccount, >; +pub struct SafeCallFilter; +impl frame_support::traits::Contains for SafeCallFilter { + fn contains(_call: &RuntimeCall) -> bool { + // TODO review + // This needs to be addressed at EVM level + true + } +} + +parameter_types! { + pub const MaxAssetsIntoHolding: u32 = 64; +} + pub struct XcmExecutorConfig; impl xcm_executor::Config for XcmExecutorConfig { type RuntimeCall = RuntimeCall; @@ -260,7 +275,7 @@ impl xcm_executor::Config for XcmExecutorConfig { // of our chain, we always return the relative reserve type IsReserve = MultiNativeAsset>; type IsTeleporter = (); // No teleport - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = XcmBarrier; type Weigher = XcmWeigher; // We use two traders @@ -283,6 +298,14 @@ impl xcm_executor::Config for XcmExecutorConfig { type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; type CallDispatcher = RuntimeCall; + type PalletInstancesInfo = crate::AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = SafeCallFilter; } type XcmExecutor = xcm_executor::XcmExecutor; @@ -294,11 +317,16 @@ pub type LocalOriginToLocation = SignedToAccountId20, + cumulus_primitives_utility::ParentAsUmp, // ..and XCMP to communicate with the sibling chains. XcmpQueue, ); +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parent.into()); +} + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -309,11 +337,20 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = XcmWeigher; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = LocationToAccountId; + type MaxLockers = ConstU32<8>; + // TODO pallet-xcm weights + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; } impl cumulus_pallet_xcm::Config for Runtime { @@ -330,6 +367,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; + type PriceForSiblingDelivery = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -434,7 +472,7 @@ where } parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 200_000_000; + pub const BaseXcmWeight: Weight = Weight::from_parts(200_000_000u64, DEFAULT_PROOF_SIZE); pub const MaxAssetsForTransfer: usize = 2; // This is how we are going to detect whether the asset is a Reserve asset @@ -467,7 +505,7 @@ impl orml_xtokens::Config for Runtime { type SelfLocation = SelfLocation; type Weigher = XcmWeigher; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; @@ -539,7 +577,7 @@ impl pallet_xcm_transactor::Config for Runtime { type XcmSender = XcmRouter; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; type ReserveProvider = AbsoluteAndRelativeReserve; diff --git a/runtime/moonriver/tests/integration_test.rs b/runtime/moonriver/tests/integration_test.rs index b8aafe5a70b..d3187dbb69c 100644 --- a/runtime/moonriver/tests/integration_test.rs +++ b/runtime/moonriver/tests/integration_test.rs @@ -1464,7 +1464,7 @@ fn root_can_change_default_xcm_vers() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -1476,8 +1476,8 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V1(dest.clone())), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + WeightLimit::Limited(4000000000.into()) ), orml_xtokens::Error::::XcmExecutionFailed ); @@ -1493,8 +1493,8 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(4000000000.into()) )); }) } @@ -1619,7 +1619,7 @@ fn asset_erc20_precompiles_transfer() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(24133) + .expect_cost(23497) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1671,7 +1671,7 @@ fn asset_erc20_precompiles_approve() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(14596) + .expect_cost(13862) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1692,7 +1692,7 @@ fn asset_erc20_precompiles_approve() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(29624) + .expect_cost(29021) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1744,7 +1744,7 @@ fn asset_erc20_precompiles_mint_burn() { value: { 1000 * MOVR }.into(), }, ) - .expect_cost(13249) + .expect_cost(12787) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1771,7 +1771,7 @@ fn asset_erc20_precompiles_mint_burn() { value: { 500 * MOVR }.into(), }, ) - .expect_cost(13575) + .expect_cost(13016) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1816,7 +1816,7 @@ fn asset_erc20_precompiles_freeze_thaw_account() { account: Address(ALICE.into()), }, ) - .expect_cost(7094) + .expect_cost(6699) .expect_no_logs() .execute_returns_encoded(true); @@ -1835,7 +1835,7 @@ fn asset_erc20_precompiles_freeze_thaw_account() { account: Address(ALICE.into()), }, ) - .expect_cost(7074) + .expect_cost(6713) .expect_no_logs() .execute_returns_encoded(true); @@ -1870,7 +1870,7 @@ fn asset_erc20_precompiles_freeze_thaw_asset() { asset_precompile_address, LocalAssetsPCall::freeze_asset {}, ) - .expect_cost(5944) + .expect_cost(5548) .expect_no_logs() .execute_returns_encoded(true); @@ -1887,7 +1887,7 @@ fn asset_erc20_precompiles_freeze_thaw_asset() { asset_precompile_address, LocalAssetsPCall::thaw_asset {}, ) - .expect_cost(5964) + .expect_cost(5550) .expect_no_logs() .execute_returns_encoded(true); @@ -1924,7 +1924,7 @@ fn asset_erc20_precompiles_freeze_transfer_ownership() { owner: Address(BOB.into()), }, ) - .expect_cost(6973) + .expect_cost(6614) .expect_no_logs() .execute_returns_encoded(true); @@ -1966,7 +1966,7 @@ fn asset_erc20_precompiles_freeze_set_team() { freezer: Address(BOB.into()), }, ) - .expect_cost(5940) + .expect_cost(5577) .expect_no_logs() .execute_returns_encoded(true); @@ -2087,7 +2087,7 @@ fn xcm_asset_erc20_precompiles_transfer() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(24133) + .expect_cost(23497) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -2151,7 +2151,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(14596) + .expect_cost(13862) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -2172,7 +2172,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(29624) + .expect_cost(29021) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -2234,7 +2234,7 @@ fn xtokens_precompiles_transfer() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -2284,7 +2284,7 @@ fn xtokens_precompiles_transfer_multiasset() { let destination = MultiLocation::new( 1, Junctions::X1(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), ); @@ -2326,7 +2326,7 @@ fn make_sure_polkadot_xcm_cannot_be_called() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -2338,9 +2338,9 @@ fn make_sure_polkadot_xcm_cannot_be_called() { .into(); assert_noop!( RuntimeCall::PolkadotXcm(pallet_xcm::Call::::reserve_transfer_assets { - dest: Box::new(VersionedMultiLocation::V1(dest.clone())), - beneficiary: Box::new(VersionedMultiLocation::V1(dest)), - assets: Box::new(VersionedMultiAssets::V1(multiassets)), + dest: Box::new(VersionedMultiLocation::V3(dest.clone())), + beneficiary: Box::new(VersionedMultiLocation::V3(dest)), + assets: Box::new(VersionedMultiAssets::V3(multiassets)), fee_asset_item: 0, }) .dispatch(::RuntimeOrigin::signed( @@ -2382,17 +2382,17 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); @@ -2403,14 +2403,14 @@ fn transactor_cannot_use_more_than_max_weight() { 0, CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, vec![], // 2000 is the max TransactWeights { - transact_required_weight_at_most: 17001, + transact_required_weight_at_most: 17001.into(), overall_weight: None } ), @@ -2428,7 +2428,7 @@ fn transactor_cannot_use_more_than_max_weight() { vec![], // 20000 is the max TransactWeights { - transact_required_weight_at_most: 17001, + transact_required_weight_at_most: 17001.into(), overall_weight: None } ), @@ -2459,16 +2459,16 @@ fn transact_through_signed_precompile_not_enabled() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, - Some(4000) + 3000.into(), + 20000.into(), + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1, )); @@ -2515,34 +2515,34 @@ fn transact_through_signed_mult_not_enabled() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), // lets say 1000 per instruction - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); assert_noop!( RuntimeCall::XcmTransactor( pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + dest: Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), fee: CurrencyPayment { currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V1(MultiLocation::parent()) + xcm::VersionedMultiLocation::V3(MultiLocation::parent()) )), fee_amount: None }, call: vec![], weight_info: TransactWeights { - transact_required_weight_at_most: 11000, + transact_required_weight_at_most: 11000.into(), overall_weight: None } } @@ -2581,32 +2581,32 @@ fn transact_through_signed_not_enabled() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000, + 3000.into(), + 20000.into(), // lets say 1000 per instruction - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), 1 )); assert_noop!( RuntimeCall::XcmTransactor( pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + dest: Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), fee: CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::ForeignAsset(source_id)), fee_amount: None }, call: vec![], weight_info: TransactWeights { - transact_required_weight_at_most: 11000, + transact_required_weight_at_most: 11000.into(), overall_weight: None } } @@ -2644,7 +2644,7 @@ fn call_xtokens_with_fee() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }), }; @@ -2658,8 +2658,8 @@ fn call_xtokens_with_fee() { CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, 100, - Box::new(xcm::VersionedMultiLocation::V1(dest.clone())), - WeightLimit::Limited(4000000000) + Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + WeightLimit::Limited(4000000000.into()) ),); let after_balance = Assets::balance(source_id, &AccountId::from(ALICE)); @@ -2722,7 +2722,7 @@ fn test_xcm_utils_ml_to_account() { X2( Parachain(2000), AccountKey20 { - network: Any, + network: None, key: ALICE, }, ), @@ -2747,9 +2747,9 @@ fn test_xcm_utils_ml_to_account() { fn test_xcm_utils_weight_message() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); - let expected_weight: xcm_primitives::XcmV2Weight = UnitWeightCost::get(); + let expected_weight = UnitWeightCost::get().ref_time(); - let message: Vec = xcm::VersionedXcm::<()>::V2(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); let input = XcmUtilsPCall::weight_message { message: message.into(), diff --git a/runtime/moonriver/tests/xcm_mock/parachain.rs b/runtime/moonriver/tests/xcm_mock/parachain.rs index 1aef811dd22..7a07dfc2bb0 100644 --- a/runtime/moonriver/tests/xcm_mock/parachain.rs +++ b/runtime/moonriver/tests/xcm_mock/parachain.rs @@ -34,7 +34,7 @@ use sp_runtime::{ use sp_std::{convert::TryFrom, prelude::*}; use xcm::{latest::prelude::*, Version as XcmVersion, VersionedXcm}; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; +use cumulus_primitives_core::relay_chain::HrmpChannelId; use orml_traits::parameter_type_with_key; use polkadot_core_primitives::BlockNumber as RelayBlockNumber; use polkadot_parachain::primitives::{Id as ParaId, Sibling}; @@ -45,14 +45,13 @@ use xcm::latest::{ }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, + AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, - FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, - SovereignSignedViaLocation, TakeWeightCredit, + FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; use scale_info::TypeInfo; use xcm_simulator::{ @@ -123,7 +122,6 @@ parameter_types! { pub const AssetsStringLimit: u32 = 50; pub const MetadataDepositBase: Balance = 0; pub const MetadataDepositPerByte: Balance = 0; - pub const ExecutiveBody: xcm::v0::BodyId = xcm::v0::BodyId::Executive; pub const AssetAccountDeposit: Balance = 0; } @@ -142,7 +140,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -163,7 +161,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -203,7 +201,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( ); parameter_types! { - pub const UnitWeightCost: XcmV2Weight = 1; + pub const UnitWeightCost: Weight = Weight::from_parts(1u64, 1u64); pub MaxInstructions: u32 = 100; } @@ -213,7 +211,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< Assets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, xcm_primitives::AsAssetType, @@ -225,7 +223,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont allow teleports. - Nothing, + NoChecking, // We dont track any teleports (), >; @@ -235,7 +233,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< Balances, // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations - xcm_builder::IsConcrete, + IsConcrete, // We can convert the MultiLocations with our converter above: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -250,7 +248,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< LocalAssets, // Use this currency when it is a fungible asset matching the given location or name: ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsPrefixedGeneralIndex, @@ -262,7 +260,7 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, // We dont want to allow teleporting assets - Nothing, + NoChecking, // The account to use for tracking teleports. (), >; @@ -294,7 +292,7 @@ parameter_types! { pub type XcmFeesToAccount_ = xcm_primitives::XcmFeesToAccount< Assets, ( - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, xcm_primitives::AsAssetType, @@ -308,16 +306,18 @@ pub type XcmFeesToAccount_ = xcm_primitives::XcmFeesToAccount< parameter_types! { // We cannot skip the native trader for some specific tests, so we will have to work with // a native trader that charges same number of units as weight - pub ParaTokensPerSecond: (XcmAssetId, u128) = ( + pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = ( Concrete(SelfReserve::get()), - 1000000000000 + 1000000000000, + 0, ); } parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(MsgQueue::parachain_id().into()).into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { parents:0, @@ -334,6 +334,7 @@ parameter_types! { PalletInstance(::index() as u8) ) }; + pub const MaxAssetsIntoHolding: u32 = 64; } pub struct XcmConfig; @@ -346,7 +347,7 @@ impl Config for XcmConfig { xcm_primitives::AbsoluteAndRelativeReserve, >; type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; // We use three traders @@ -363,6 +364,14 @@ impl Config for XcmConfig { type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } impl cumulus_pallet_xcm::Config for Runtime { @@ -407,7 +416,7 @@ where } parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 100; + pub const BaseXcmWeight: Weight = Weight::from_parts(100u64, 100u64); pub const MaxAssetsForTransfer: usize = 2; pub SelfLocation: MultiLocation = MultiLocation::here(); pub SelfLocationAbsolute: MultiLocation = MultiLocation { @@ -436,7 +445,7 @@ impl orml_xtokens::Config for Runtime { type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; @@ -537,16 +546,14 @@ pub mod mock_msg_queue { let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); - match T::XcmExecutor::execute_xcm(location, xcm, max_weight.ref_time()) { + let mut id = [0u8; 32]; + id.copy_from_slice(hash.as_ref()); + match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => { - (Ok(Weight::from_ref_time(w)), Event::Success(Some(hash))) - } + Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => { - (Ok(Weight::from_ref_time(w)), Event::Fail(Some(hash), e)) - } + Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), } } Err(()) => ( @@ -601,7 +608,7 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time()); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } @@ -668,6 +675,10 @@ impl mock_version_changer::Config for Runtime { pub type LocalOriginToLocation = xcm_primitives::SignedToAccountId20; +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); +} + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -679,12 +690,18 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = xcm_builder::LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // We use a custom one to test runtime ugprades type AdvertisedXcmVersion = XcmVersioner; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } // Our AssetType. For now we only handle Xcm Assets @@ -855,7 +872,7 @@ impl pallet_xcm_transactor::Config for Runtime { CurrencyIdtoMultiLocation>; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type XcmSender = XcmRouter; type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; @@ -903,6 +920,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = (); type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } pub struct NormalFilter; diff --git a/runtime/moonriver/tests/xcm_mock/relay_chain.rs b/runtime/moonriver/tests/xcm_mock/relay_chain.rs index 625919415c0..0a68dd74f0b 100644 --- a/runtime/moonriver/tests/xcm_mock/relay_chain.rs +++ b/runtime/moonriver/tests/xcm_mock/relay_chain.rs @@ -22,7 +22,7 @@ use frame_support::{ }; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, ConstU32, IdentityLookup}, AccountId32, }; @@ -36,11 +36,10 @@ use xcm_builder::{ Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, LocationInverter, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; pub type AccountId = AccountId32; pub type Balance = u128; pub type BlockNumber = u32; @@ -73,7 +72,7 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; + type MaxConsumers = ConstU32<16>; } parameter_types! { @@ -108,11 +107,10 @@ impl configuration::Config for Runtime { } parameter_types! { - pub const KsmLocation: MultiLocation = Here.into(); + pub KsmLocation: MultiLocation = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; - pub const AnyNetwork: NetworkId = NetworkId::Any; - pub Ancestry: MultiLocation = Here.into(); - pub UnitWeightCost: XcmV2Weight = 1_000; + pub const AnyNetwork: Option = None; + pub UniversalLocation: InteriorMultiLocation = Here; } pub type SovereignAccountOf = ( @@ -134,9 +132,11 @@ type LocalOriginConverter = ( ); parameter_types! { - pub const BaseXcmWeight: XcmV2Weight = 1_000; - pub KsmPerSecond: (AssetId, u128) = (Concrete(KsmLocation::get()), 1); + pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); + pub KsmPerSecond: (AssetId, u128, u128) = (Concrete(KsmLocation::get()), 1, 1); pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; + pub MatcherLocation: MultiLocation = MultiLocation::here(); } use frame_support::ensure; @@ -151,9 +151,9 @@ pub struct AllowTopLevelPaidExecutionDescendOriginFirst(PhantomData); impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { fn should_execute( origin: &MultiLocation, - message: &mut Xcm, - max_weight: XcmV2Weight, - _weight_credit: &mut XcmV2Weight, + message: &mut [Instruction], + max_weight: Weight, + _weight_credit: &mut Weight, ) -> Result<(), ()> { log::trace!( target: "xcm::barriers", @@ -162,7 +162,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes origin, message, max_weight, _weight_credit, ); ensure!(T::contains(origin), ()); - let mut iter = message.0.iter_mut(); + let mut iter = message.iter_mut(); let mut i = iter.next().ok_or(())?; match i { DescendOrigin(..) => (), @@ -180,7 +180,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes BuyExecution { weight_limit: Limited(ref mut weight), .. - } if *weight >= max_weight => { + } if weight.all_gte(max_weight) => { *weight = max_weight; Ok(()) } @@ -215,7 +215,7 @@ impl Config for XcmConfig { type OriginConverter = LocalOriginConverter; type IsReserve = (); type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = FixedRateOfFungible; @@ -224,6 +224,14 @@ impl Config for XcmConfig { type AssetClaims = XcmPallet; type SubscriptionService = XcmPallet; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } pub type LocalOriginToLocation = SignedToAccountId32; @@ -239,11 +247,17 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } parameter_types! { diff --git a/runtime/moonriver/tests/xcm_mock/statemine_like.rs b/runtime/moonriver/tests/xcm_mock/statemine_like.rs index 2f6fa71a818..722557f5c8a 100644 --- a/runtime/moonriver/tests/xcm_mock/statemine_like.rs +++ b/runtime/moonriver/tests/xcm_mock/statemine_like.rs @@ -39,13 +39,12 @@ use xcm::VersionedXcm; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, - FixedWeightBounds, FungiblesAdapter, IsConcrete, LocationInverter, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; -use xcm_primitives::XcmV2Weight; use xcm_simulator::{ DmpMessageHandlerT as DmpMessageHandler, XcmpMessageFormat, XcmpMessageHandlerT as XcmpMessageHandler, @@ -131,7 +130,7 @@ impl pallet_assets::Config for Runtime { type Extra = (); type AssetAccountDeposit = AssetAccountDeposit; type WeightInfo = (); - type RemoveItemsLimit = ConstU32<1000>; + type RemoveItemsLimit = ConstU32<656>; type AssetIdParameter = AssetId; type CreateOrigin = AsEnsureOriginWithArg>; type CallbackHandle = (); @@ -141,10 +140,12 @@ parameter_types! { pub const KsmLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(MsgQueue::parachain_id().into()).into(); - pub const Local: MultiLocation = Here.into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); + pub Local: MultiLocation = Here.into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); - pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128) = (Concrete(KsmLocation::get()), 1); + pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128, u128) = + (Concrete(KsmLocation::get()), 1, 1); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -178,7 +179,7 @@ pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: Assets, // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteAssetId< + ConvertedConcreteId< AssetId, Balance, AsPrefixedGeneralIndex, @@ -190,7 +191,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AccountId, // We only want to allow teleports of known assets. We use non-zero issuance as an indication // that this asset is known. - Nothing, + NoChecking, // The account to use for tracking teleports. CheckingAccount, >; @@ -223,7 +224,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: XcmV2Weight = 100; + pub UnitWeightCost: Weight = Weight::from_parts(100u64, 100u64); pub const MaxInstructions: u32 = 100; } @@ -251,6 +252,11 @@ pub type Barrier = ( AllowSubscriptionsFrom, ); +parameter_types! { + pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub const MaxAssetsIntoHolding: u32 = 64; +} + pub struct XcmConfig; impl Config for XcmConfig { type RuntimeCall = RuntimeCall; @@ -260,7 +266,7 @@ impl Config for XcmConfig { type IsReserve = orml_xcm_support::MultiNativeAsset; type IsTeleporter = (); - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = FixedRateOfFungible; @@ -269,6 +275,14 @@ impl Config for XcmConfig { type AssetClaims = PolkadotXcm; type SubscriptionService = PolkadotXcm; type CallDispatcher = RuntimeCall; + type AssetLocker = (); + type AssetExchanger = (); + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type SafeCallFilter = Everything; } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -286,11 +300,17 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; } impl cumulus_pallet_xcm::Config for Runtime { @@ -359,22 +379,20 @@ pub mod mock_msg_queue { sender: ParaId, _sent_at: RelayBlockNumber, xcm: VersionedXcm, - max_weight: XcmV2Weight, + max_weight: Weight, ) -> Result { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); - match T::XcmExecutor::execute_xcm(location, xcm, max_weight) { + let mut id = [0u8; 32]; + id.copy_from_slice(hash.as_ref()); + match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => { - (Ok(Weight::from_ref_time(w)), Event::Success(Some(hash))) - } + Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => { - (Ok(Weight::from_ref_time(w)), Event::Fail(Some(hash), e)) - } + Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), } } Err(()) => ( @@ -402,8 +420,7 @@ pub mod mock_msg_queue { if let Ok(xcm) = VersionedXcm::::decode(&mut remaining_fragments) { - let _ = - Self::handle_xcmp_message(sender, sent_at, xcm, max_weight.ref_time()); + let _ = Self::handle_xcmp_message(sender, sent_at, xcm, max_weight); } else { debug_assert!(false, "Invalid incoming XCMP message data"); } @@ -430,7 +447,7 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time()); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } diff --git a/runtime/moonriver/tests/xcm_tests.rs b/runtime/moonriver/tests/xcm_tests.rs index 8d411af9186..bbe6291f1d8 100644 --- a/runtime/moonriver/tests/xcm_tests.rs +++ b/runtime/moonriver/tests/xcm_tests.rs @@ -20,7 +20,7 @@ mod xcm_mock; use frame_support::{ assert_ok, traits::{PalletInfo, PalletInfoAccess}, - weights::constants::WEIGHT_REF_TIME_PER_SECOND, + weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}, }; use pallet_asset_manager::LocalAssetIdCreator; use xcm::latest::prelude::*; @@ -32,11 +32,11 @@ use xcm_mock::*; use xcm_simulator::TestExt; mod common; use common::ExtBuilder; -use cumulus_primitives_core::relay_chain::v2::HrmpChannelId; +use cumulus_primitives_core::relay_chain::HrmpChannelId; use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, }; -use xcm_primitives::UtilityEncodeCall; +use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE}; // Send a relay asset (like DOT) to a parachain A #[test] @@ -69,15 +69,15 @@ fn receive_relay_asset_from_relay() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -123,7 +123,7 @@ fn send_relay_asset_to_relay() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -132,8 +132,8 @@ fn send_relay_asset_to_relay() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -154,7 +154,7 @@ fn send_relay_asset_to_relay() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: RELAYALICE.into(), }), }; @@ -164,8 +164,8 @@ fn send_relay_asset_to_relay() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 123, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -229,15 +229,15 @@ fn send_relay_asset_to_para_b() { // First send relay chain asset to Parachain A like in previous test let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -253,7 +253,7 @@ fn send_relay_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -264,8 +264,8 @@ fn send_relay_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -318,7 +318,7 @@ fn send_para_a_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -329,8 +329,8 @@ fn send_para_a_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -405,7 +405,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -415,8 +415,8 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -439,7 +439,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { interior: X2( Parachain(3), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -450,8 +450,8 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -500,7 +500,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -510,8 +510,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -534,7 +534,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { interior: X2( Parachain(1), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -544,8 +544,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -594,7 +594,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -604,8 +604,8 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -632,20 +632,19 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { let reanchored_para_a_balances = MultiLocation::new(0, X1(PalletInstance(1u8))); - let message = xcm::VersionedXcm::<()>::V2(Xcm(vec![ + let message = xcm::VersionedXcm::<()>::V3(Xcm(vec![ WithdrawAsset((reanchored_para_a_balances.clone(), 100).into()), ClearOrigin, BuyExecution { fees: (reanchored_para_a_balances, 100).into(), - weight_limit: Limited(80), + weight_limit: Limited(80.into()), }, DepositAsset { assets: All.into(), - max_assets: 1, beneficiary: MultiLocation::new( 0, X1(AccountKey20 { - network: Any, + network: None, key: PARAALICE, }), ), @@ -676,20 +675,19 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { let reanchored_para_a_balances = MultiLocation::new(0, X1(PalletInstance(1u8))); - let message = xcm::VersionedXcm::<()>::V2(Xcm(vec![ + let message = xcm::VersionedXcm::<()>::V3(Xcm(vec![ WithdrawAsset((reanchored_para_a_balances.clone(), 100).into()), ClearOrigin, BuyExecution { fees: (reanchored_para_a_balances, 100).into(), - weight_limit: Limited(80), + weight_limit: Limited(80.into()), }, DepositAsset { assets: All.into(), - max_assets: 1, beneficiary: MultiLocation::new( 0, X1(AccountKey20 { - network: Any, + network: None, key: PARAALICE, }), ), @@ -747,7 +745,7 @@ fn receive_relay_asset_with_trader() { }); let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -760,8 +758,8 @@ fn receive_relay_asset_with_trader() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 100).into()), 0, )); @@ -810,7 +808,7 @@ fn send_para_a_asset_to_para_b_with_trader() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -823,8 +821,8 @@ fn send_para_a_asset_to_para_b_with_trader() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(10) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(10u64, DEFAULT_PROOF_SIZE)) )); }); ParaA::execute_with(|| { @@ -885,7 +883,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -898,8 +896,8 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { parachain::CurrencyId::SelfReserve, 100, 1, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); ParaA::execute_with(|| { @@ -931,7 +929,7 @@ fn error_when_not_paying_enough() { }; let dest: MultiLocation = Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -960,8 +958,8 @@ fn error_when_not_paying_enough() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 5).into()), 0, )); @@ -1004,16 +1002,16 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); @@ -1021,7 +1019,7 @@ fn transact_through_derivative_multilocation() { // Let's construct the call to know how much weight it is going to require let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1029,9 +1027,9 @@ fn transact_through_derivative_multilocation() { // 4000000000 transact + 3000 correspond to 4000003000 tokens. 100 more for the transfer call assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1056,7 +1054,7 @@ fn transact_through_derivative_multilocation() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1067,8 +1065,8 @@ fn transact_through_derivative_multilocation() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1108,7 +1106,7 @@ fn transact_through_derivative_multilocation() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -1116,7 +1114,7 @@ fn transact_through_derivative_multilocation() { encoded, // 4000000000 + 3000 we should have taken out 4000003000 tokens from the caller TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -1162,7 +1160,7 @@ fn transact_through_derivative_with_custom_fee_weight() { // Let's construct the call to know how much weight it is going to require let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1170,9 +1168,9 @@ fn transact_through_derivative_with_custom_fee_weight() { // 4000000000 transact + 3000 correspond to 4000003000 tokens. 100 more for the transfer call assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1197,7 +1195,7 @@ fn transact_through_derivative_with_custom_fee_weight() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1208,8 +1206,8 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1250,7 +1248,7 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), // 1-1 fee weight mapping @@ -1259,8 +1257,8 @@ fn transact_through_derivative_with_custom_fee_weight() { // 4000000000 + 3000 we should have taken out 4000003000 tokens from the caller encoded, TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(overall_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(overall_weight.into()) } )); let event_found: Option = parachain::para_events() @@ -1314,31 +1312,31 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), None )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1362,7 +1360,7 @@ fn transact_through_sovereign() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1373,8 +1371,8 @@ fn transact_through_sovereign() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1423,10 +1421,10 @@ fn transact_through_sovereign() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(dest)), + Box::new(xcm::VersionedMultiLocation::V3(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -1434,7 +1432,7 @@ fn transact_through_sovereign() { utility_bytes, OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -1478,16 +1476,16 @@ fn transact_through_sovereign_with_custom_fee_weight() { }); let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), - Box::new((Here, 4000003100).into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new((Here, 4000003100u128).into()), 0, )); }); @@ -1511,7 +1509,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { let dest = MultiLocation { parents: 1, interior: X1(AccountId32 { - network: NetworkId::Any, + network: None, id: registered_address.clone().into(), }), }; @@ -1522,8 +1520,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(40000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1573,10 +1571,10 @@ fn transact_through_sovereign_with_custom_fee_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(dest)), + Box::new(xcm::VersionedMultiLocation::V3(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), // 1-1 fee-weight mapping @@ -1585,8 +1583,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { utility_bytes, OriginKind::SovereignAccount, TransactWeights { - transact_required_weight_at_most: 4000000000, - overall_weight: Some(total_weight) + transact_required_weight_at_most: 4000000000.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -1628,19 +1626,21 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { }); let response = Response::Version(2); + let querier: MultiLocation = Here.into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change let mock_message: Xcm<()> = Xcm(vec![QueryResponse { query_id: 0, response, - max_weight: 0, + max_weight: Weight::zero(), + querier: Some(querier), }]); // The router is mocked, and we cannot use WrapVersion in ChildParachainRouter. So we will force // it directly here // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -1663,8 +1663,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // Transfer assets. Since it is an unknown destination, it will query for version assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1698,6 +1698,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { interior: Here, }, 2, + vec![].into(), ) .into(); @@ -1745,13 +1746,15 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { decimals: 18, }; let response = Response::Version(2); + let querier: MultiLocation = Here.into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change let mock_message: Xcm<()> = Xcm(vec![QueryResponse { query_id: 0, response, - max_weight: 0, + max_weight: Weight::zero(), + querier: Some(querier), }]); ParaA::execute_with(|| { @@ -1817,7 +1820,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -1828,8 +1831,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(80) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); // free execution, full amount received assert_eq!( @@ -1850,6 +1853,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { interior: X1(Parachain(1)), }, 2, + vec![].into(), ) .into(); @@ -1915,15 +1919,15 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: fresh_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1948,8 +1952,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -1993,15 +1997,15 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: fresh_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -2053,15 +2057,15 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: sufficient_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -2125,15 +2129,15 @@ fn empty_account_should_not_be_reset() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: sufficient_account, } .into(); Relay::execute_with(|| { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), - Box::new(Parachain(1).into().into()), - Box::new(VersionedMultiLocation::V1(dest.clone()).clone().into()), + Box::new(Parachain(1).into()), + Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), Box::new((Here, 123).into()), 0, )); @@ -2250,7 +2254,7 @@ fn test_statemine_like() { // Actually send relay asset to parachain let dest: MultiLocation = AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, } .into(); @@ -2259,7 +2263,7 @@ fn test_statemine_like() { assert_ok!(StatemineChainPalletXcm::reserve_transfer_assets( statemine_like::RuntimeOrigin::signed(RELAYALICE), Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), - Box::new(VersionedMultiLocation::V1(dest).clone().into()), + Box::new(VersionedMultiLocation::V3(dest).clone().into()), Box::new( ( X2( @@ -2338,7 +2342,7 @@ fn send_para_a_local_asset_to_para_b() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2350,8 +2354,8 @@ fn send_para_a_local_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::LocalAssetReserve(asset_id), 100, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2443,7 +2447,7 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { interior: X2( Parachain(2), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2458,8 +2462,8 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { (parachain::CurrencyId::SelfReserve, 1000000) ], 0, - Box::new(VersionedMultiLocation::V1(dest)), - WeightLimit::Limited(800000) + Box::new(VersionedMultiLocation::V3(dest)), + WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2476,7 +2480,7 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { interior: X2( Parachain(1), AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE.into(), }, ), @@ -2504,8 +2508,8 @@ fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { ) ], 0, - Box::new(VersionedMultiLocation::V1(new_dest)), - WeightLimit::Limited(4) + Box::new(VersionedMultiLocation::V3(new_dest)), + WeightLimit::Limited(Weight::from_parts(4u64, DEFAULT_PROOF_SIZE)) )); }); @@ -2530,25 +2534,25 @@ fn transact_through_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 - 3000, - 20000000000, + 3000.into(), + 20000000000.into(), // 4 instructions in transact through signed - Some(4000) + Some(4000.into()) )); // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); - ancestry = parachain::Ancestry::get(); + ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin let signed_origin: Junctions = X1(AccountKey20 { - network: NetworkId::Any, + network: None, key: PARAALICE, }); @@ -2559,7 +2563,7 @@ fn transact_through_signed_multilocation() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), &ancestry) + .reanchor(&MultiLocation::parent(), ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2603,9 +2607,9 @@ fn transact_through_signed_multilocation() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::parent())), + Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: None @@ -2614,7 +2618,7 @@ fn transact_through_signed_multilocation() { // 4000000000 for transfer + 4000 for XCM // 1-1 to fee TransactWeights { - transact_required_weight_at_most: 4000000000, + transact_required_weight_at_most: 4000000000.into(), overall_weight: None } )); @@ -2657,14 +2661,14 @@ fn hrmp_init_accept_through_root() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -2690,14 +2694,14 @@ fn hrmp_init_accept_through_root() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); @@ -2745,14 +2749,14 @@ fn hrmp_close_works() { recipient: 2u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V1( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( MultiLocation::parent() ))), fee_amount: Some(total_fee) }, TransactWeights { - transact_required_weight_at_most: tx_weight, - overall_weight: Some(total_weight) + transact_required_weight_at_most: tx_weight.into(), + overall_weight: Some(total_weight.into()) } )); }); diff --git a/runtime/relay-encoder/src/kusama.rs b/runtime/relay-encoder/src/kusama.rs index b6959cd1a4a..59222476b06 100644 --- a/runtime/relay-encoder/src/kusama.rs +++ b/runtime/relay-encoder/src/kusama.rs @@ -17,7 +17,7 @@ // We want to avoid including the rococo-runtime here. // TODO: whenever a conclusion is taken from https://github.com/paritytech/substrate/issues/8158 -use cumulus_primitives_core::{relay_chain::v2::HrmpChannelId, ParaId}; +use cumulus_primitives_core::{relay_chain::HrmpChannelId, ParaId}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::traits::{AccountIdLookup, StaticLookup}; use sp_runtime::AccountId32; diff --git a/runtime/relay-encoder/src/polkadot.rs b/runtime/relay-encoder/src/polkadot.rs index 076e896e160..2739176d039 100644 --- a/runtime/relay-encoder/src/polkadot.rs +++ b/runtime/relay-encoder/src/polkadot.rs @@ -17,7 +17,7 @@ // We want to avoid including the rococo-runtime here. // TODO: whenever a conclusion is taken from https://github.com/paritytech/substrate/issues/8158 -use cumulus_primitives_core::{relay_chain::v2::HrmpChannelId, ParaId}; +use cumulus_primitives_core::{relay_chain::HrmpChannelId, ParaId}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::traits::{AccountIdLookup, StaticLookup}; use sp_runtime::AccountId32; diff --git a/runtime/relay-encoder/src/westend.rs b/runtime/relay-encoder/src/westend.rs index d83b720feed..9da131502fe 100644 --- a/runtime/relay-encoder/src/westend.rs +++ b/runtime/relay-encoder/src/westend.rs @@ -17,7 +17,7 @@ // We want to avoid including the rococo-runtime here. // TODO: whenever a conclusion is taken from https://github.com/paritytech/substrate/issues/8158 -use cumulus_primitives_core::{relay_chain::v2::HrmpChannelId, ParaId}; +use cumulus_primitives_core::{relay_chain::HrmpChannelId, ParaId}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::traits::{AccountIdLookup, StaticLookup}; use sp_runtime::AccountId32; diff --git a/tests/tests/test-democracy/test-referenda-general-admin.ts b/tests/tests/test-democracy/test-referenda-general-admin.ts index 1151ca3e8f9..257b211e08d 100644 --- a/tests/tests/test-democracy/test-referenda-general-admin.ts +++ b/tests/tests/test-democracy/test-referenda-general-admin.ts @@ -13,14 +13,14 @@ describeDevMoonbeam("Referenda - GeneralAdmin", (context) => { // Just build the arguments. They dont matter that much though, since // we will not make sure it executes in the relay const transactWeights = context.polkadotApi.createType("PalletXcmTransactorTransactWeights", { - transactRequiredWeightAtMost: 10000, - overallWeight: 10000, + transactRequiredWeightAtMost: { refTime: 10000, proofSize: 10000 }, + overallWeight: { refTime: 10000, proofSize: 10000 }, }); let fee = context.polkadotApi.createType("PalletXcmTransactorCurrencyPayment", { currency: { AsMultiLocation: { - V1: { + V3: { parents: 1, interior: { Here: null, diff --git a/tests/tests/test-fees/test-fee-multiplier.ts b/tests/tests/test-fees/test-fee-multiplier.ts index 37ce0088568..e4459dd31bc 100644 --- a/tests/tests/test-fees/test-fee-multiplier.ts +++ b/tests/tests/test-fees/test-fee-multiplier.ts @@ -314,24 +314,6 @@ describeDevMoonbeam("Fee Multiplier - XCM Executions", (context) => { }, }, }) - .push_any({ - Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), - call: { - encoded: transferCallEncoded, - }, - }, - }) - .push_any({ - Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), - call: { - encoded: transferCallEncoded, - }, - }, - }) .as_v2(); await injectHrmpMessageAndSeal(context, 1, { @@ -425,15 +407,6 @@ describeDevMoonbeam("Fee Multiplier - XCM Executions", (context) => { }, }, }) - .push_any({ - Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), - call: { - encoded: transferCallEncodedV2, - }, - }, - }) .as_v2(); await injectHrmpMessageAndSeal(context, 1, { diff --git a/tests/tests/test-fees/test-length-fees.ts b/tests/tests/test-fees/test-length-fees.ts index 0699413fd83..d204f279086 100644 --- a/tests/tests/test-fees/test-length-fees.ts +++ b/tests/tests/test-fees/test-length-fees.ts @@ -12,7 +12,7 @@ describeDevMoonbeam( (context) => { it("should have low balance transfer fees", async () => { const fee = await testBalanceTransfer(context); - expect(fee).to.equal(82139401520875n); + expect(fee).to.equal(81940601520875n); }); }, "Legacy", @@ -36,7 +36,7 @@ describeDevMoonbeam( (context) => { it("should have low balance transfer fees", async () => { const fee = await testBalanceTransfer(context); - expect(fee).to.equal(99_520_501_520_875n); + expect(fee).to.equal(99272001520875n); }); }, "Legacy", @@ -60,7 +60,7 @@ describeDevMoonbeam( (context) => { it("should have low balance transfer fees", async () => { const fee = await testBalanceTransfer(context); - expect(fee).to.equal(8213940152087500n); + expect(fee).to.equal(8194060152087500n); }); }, "Legacy", diff --git a/tests/tests/test-maintenance/test-maintenance-filter.ts b/tests/tests/test-maintenance/test-maintenance-filter.ts index f32094ade30..1599debe490 100644 --- a/tests/tests/test-maintenance/test-maintenance-filter.ts +++ b/tests/tests/test-maintenance/test-maintenance-filter.ts @@ -119,18 +119,18 @@ describeDevMoonbeam("Maintenance Mode - Filter", (context) => { "SelfReserve", //enum 100n * GLMR, { - V1: { + V3: { parents: 1n, interior: { X2: [ { Parachain: 2000n }, - { AccountKey20: { network: "Any", key: hexToU8a(baltathar.address) } }, + { AccountKey20: { network: null, key: hexToU8a(baltathar.address) } }, ], }, }, - }, + } as any, { - Limited: 4000000000, + Limited: { refTime: 4000000000, proofSize: 64 * 1024 }, } ) .signAsync(baltathar) diff --git a/tests/tests/test-precompile/test-precompile-xcm-transactor.ts b/tests/tests/test-precompile/test-precompile-xcm-transactor.ts index 341a4383e4d..fbe2f051a1c 100644 --- a/tests/tests/test-precompile/test-precompile-xcm-transactor.ts +++ b/tests/tests/test-precompile/test-precompile-xcm-transactor.ts @@ -5,7 +5,7 @@ import { expect } from "chai"; import { ethers } from "ethers"; import { alith } from "../../util/accounts"; -import { mockAssetBalance, RELAY_V1_SOURCE_LOCATION } from "../../util/assets"; +import { mockAssetBalance, RELAY_V3_SOURCE_LOCATION } from "../../util/assets"; import { verifyLatestBlockFees } from "../../util/block"; import { PRECOMPILE_XCM_TRANSACTOR_ADDRESS_V1, @@ -41,10 +41,10 @@ const registerXcmTransactorAndContract = async (context: DevTestContext) => { await context.createBlock( context.polkadotApi.tx.sudo.sudo( context.polkadotApi.tx.xcmTransactor.setTransactInfo( - RELAY_V1_SOURCE_LOCATION, - new BN(0), - new BN(20000000000), - new BN(0) + RELAY_V3_SOURCE_LOCATION, + { refTime: 1, proofSize: 64 * 1024 } as any, + { refTime: 20000000000, proofSize: 256 * 1024 } as any, + { refTime: 1, proofSize: 64 * 1024 } as any ) ) ); @@ -52,7 +52,7 @@ const registerXcmTransactorAndContract = async (context: DevTestContext) => { await context.createBlock( context.polkadotApi.tx.sudo.sudo( context.polkadotApi.tx.xcmTransactor.setFeePerSecond( - RELAY_V1_SOURCE_LOCATION, + RELAY_V3_SOURCE_LOCATION, new BN(1000000000000) ) ) @@ -98,7 +98,7 @@ describeDevMoonbeamAllEthTxTypes("Precompiles - xcm transactor", (context) => { }) ).result ).to.equal( - "0x0000000000000000000000000000000000000000000000000000000000000000" + + "0x0000000000000000000000000000000000000000000000000000000000000001" + "000000000000000000000000000000000000000000000000000000e8d4a51000" + "00000000000000000000000000000000000000000000000000000004a817c800" ); @@ -173,14 +173,14 @@ describeDevMoonbeamAllEthTxTypes("Precompiles - xcm transactor", (context) => { }) ); - // We have used 1000 units to pay for the fees in the relay, so balance and supply should - // have changed + // We have used 1000 units to pay for the fees in the relay (plus 1 transact_extra_weight), so + // balance and supply should have changed const afterAssetBalance = await context.polkadotApi.query.assets.account( assetId.toU8a(), alith.address ); - const expectedBalance = 100000000000000n - 1000n; + const expectedBalance = 100000000000000n - 1000n - 1n; expect(afterAssetBalance.unwrap().balance.toBigInt()).to.equal(expectedBalance); const AfterAssetDetails = await context.polkadotApi.query.assets.asset(assetId.toU8a()); @@ -270,7 +270,7 @@ describeDevMoonbeamAllEthTxTypes("Precompiles - xcm transactor", (context) => { alith.address ); - const expectedBalance = 100000000000000n - 1000n; + const expectedBalance = 100000000000000n - 1000n - 1n; expect(afterAssetBalance.unwrap().balance.toBigInt()).to.equal(expectedBalance); const AfterAssetDetails = await context.polkadotApi.query.assets.asset(assetId.toU8a()); @@ -329,8 +329,8 @@ describeDevMoonbeamAllEthTxTypes("Precompiles - xcm transactor", (context) => { }); expect(tx_call.result).to.equal( - "0x0000000000000000000000000000000000000000000000000000000000000000" + - "0000000000000000000000000000000000000000000000000000000000000000" + + "0x0000000000000000000000000000000000000000000000000000000000000001" + + "0000000000000000000000000000000000000000000000000000000000000001" + "00000000000000000000000000000000000000000000000000000004a817c800" ); }); @@ -725,8 +725,8 @@ describeDevMoonbeamAllEthTxTypes("Precompiles - xcm transactor", (context) => { }) ); - // We have used 1000 units to pay for the fees in the relay, so balance and supply should - // have changed + // We have used 1000 units to pay for the fees in the relay (plus 1 transact_extra_weight), so + // balance and supply should have changed const afterAssetBalance = await context.polkadotApi.query.assets.account( assetId.toU8a(), alith.address diff --git a/tests/tests/test-treasury/test-treasury-proposal.ts b/tests/tests/test-treasury/test-treasury-proposal.ts index 74c223a61a1..85910fe2d06 100644 --- a/tests/tests/test-treasury/test-treasury-proposal.ts +++ b/tests/tests/test-treasury/test-treasury-proposal.ts @@ -198,7 +198,7 @@ describeDevMoonbeam("Treasury proposal #7", (context) => { context.polkadotApi.tx.councilCollective .close(proposalHash, 0, { refTime: 800_000_000, - proofSize: 0 + proofSize: 64 * 1024 } as any, 1_000) .signAsync(dorothy, { nonce: 1 }), ]); @@ -253,7 +253,7 @@ describeDevMoonbeam("Treasury proposal #8", (context) => { context.polkadotApi.tx.councilCollective .close(councilProposalHash, 0, { refTime: 800_000_000, - proofSize: 0 + proofSize: 64 * 1024 } as any, 1_000) .signAsync(dorothy) ); @@ -309,7 +309,7 @@ describeDevMoonbeam("Treasury proposal #9", (context) => { context.polkadotApi.tx.treasuryCouncilCollective .close(proposalHash, 0, { refTime: 800_000_000, - proofSize: 0 + proofSize: 64 * 1024 } as any, 1_000) .signAsync(dorothy, { nonce: 1 }), ]); @@ -364,7 +364,7 @@ describeDevMoonbeam("Treasury proposal #10", (context) => { 0, { refTime: 800_000_000, - proofSize: 0, + proofSize: 64 * 1024, } as any, 1_000 ) diff --git a/tests/tests/test-xcm/test-mock-dmp-queue.ts b/tests/tests/test-xcm/test-mock-dmp-queue.ts index 0325c47e02a..8956ca0642b 100644 --- a/tests/tests/test-xcm/test-mock-dmp-queue.ts +++ b/tests/tests/test-xcm/test-mock-dmp-queue.ts @@ -16,7 +16,9 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { (pallet) => pallet.name === "Balances" ).index; - const numMsgs = 50; + // TODO this test mostly changes it's nature due to proof size accounting + // by now we just decrease the number of supported messages from 50 to 20. + const numMsgs = 20; // let's target half of then being executed // xcmp reserved is BLOCK/4 @@ -111,12 +113,13 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { // lets grab at which point the dmp queue was exhausted const index = events.findIndex((event) => { - if (event.includes("dmpQueue.WeightExhausted.")) { + if (event.includes("dmpQueue.MaxMessagesExhausted.")) { return true; } else { return false; } }); + expect(index).to.be.greaterThanOrEqual(0); const eventsExecutedOnInitialization = events.slice(0, index + 1); const eventsExecutedOnIdle = events.slice(index + 1, events.length); @@ -139,8 +142,8 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { }); // the test was designed to go half and half - expect(executedOnInitialization).to.be.eq(25); - expect(executedOnIdle).to.be.eq(25); + expect(executedOnInitialization).to.be.eq(10); + expect(executedOnIdle).to.be.eq(10); const pageIndex = await apiAt.query.dmpQueue.pageIndex(); expect(pageIndex.beginUsed.toBigInt()).to.eq(0n); expect(pageIndex.endUsed.toBigInt()).to.eq(0n); diff --git a/tests/tests/test-xcm/test-mock-hrmp-queue.ts b/tests/tests/test-xcm/test-mock-hrmp-queue.ts index 8f6d38c1f11..766887feb32 100644 --- a/tests/tests/test-xcm/test-mock-hrmp-queue.ts +++ b/tests/tests/test-xcm/test-mock-hrmp-queue.ts @@ -40,6 +40,9 @@ export async function calculateShufflingAndExecution( weightUsePerMessage: bigint, totalXcmpWeight: bigint ) { + // There is a maximum 20 messages that can be processed by a single queue in a block. + // 10 on initialize and 10 on idle. + expect(numParaMsgs).to.be.lessThanOrEqual(20); // the randomization is as follows // for every rand number, we do module number of paras // the given index is swaped with that obtained with the @@ -61,13 +64,14 @@ export async function calculateShufflingAndExecution( const decay = queueConfig.weightRestrictDecay.refTime.toBigInt(); const thresholdWeight = queueConfig.thresholdWeight.refTime.toBigInt(); + let max_message_processed_per_queue = 10; for (let i = 0; i < numParaMsgs; i++) { let rand = rng.nextU32(); let j = rand % numParaMsgs; [indices[i], indices[j]] = [indices[j], indices[i]]; // mimics the decay algorithm - if (totalXcmpWeight - weightUsed > thresholdWeight) { + if (totalXcmpWeight - weightUsed > thresholdWeight && max_message_processed_per_queue > 0) { if (weightAvailable != totalXcmpWeight) { weightAvailable += (totalXcmpWeight - weightAvailable) / (decay + 1n); if (weightAvailable + thresholdWeight > totalXcmpWeight) { @@ -82,6 +86,7 @@ export async function calculateShufflingAndExecution( shouldItExecute[i] = XcmpExecution.InitializationExecutedPassingBarrier; weightUsed += weightUsePerMessage; } + max_message_processed_per_queue--; } else { // we know this will execute on idle shouldItExecute[i] = XcmpExecution.OnIdleExecutedPassingBarrier; @@ -108,7 +113,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { ) ); - const numParaMsgs = 50; + const numParaMsgs = 20; // let's target half of then being executed // xcmp reserved is BLOCK/4 @@ -210,9 +215,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { // assert we dont have on_idle execution expect(shouldItExecute.indexOf(XcmpExecution.InitializationExecutedPassingBarrier) > -1).to.be .true; - expect(shouldItExecute.indexOf(XcmpExecution.InitializationExecutedNotPassingBarrier) > -1).to - .be.true; - expect(shouldItExecute.indexOf(XcmpExecution.OnIdleExecutedPassingBarrier) > -1).to.be.false; + expect(shouldItExecute.indexOf(XcmpExecution.OnIdleExecutedPassingBarrier) > -1).to.be.true; // check balances for (let i = 0; i < numParaMsgs; i++) { @@ -227,14 +230,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { let balance = await context.polkadotApi.query.system.account(sovereignAddress); - if ( - shouldItExecute[indices.indexOf(i)] == XcmpExecution.InitializationExecutedPassingBarrier || - shouldItExecute[indices.indexOf(i)] == XcmpExecution.OnIdleExecutedPassingBarrier - ) { - expect(balance.data.free.toBigInt()).to.eq(1n * GLMR - 1_000_000_000_000_000n); - } else { - expect(balance.data.free.toBigInt()).to.eq(1n * GLMR); - } + expect(balance.data.free.toBigInt()).to.eq(1n * GLMR - 1_000_000_000_000_000n); } }); }); @@ -248,7 +244,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => { (pallet) => pallet.name === "Balances" ).index; - const numParaMsgs = 50; + const numParaMsgs = 20; // let's target half of then being executed // xcmp reserved is BLOCK/4 @@ -586,7 +582,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal suspend", (context) => { ) as any; const destination = { - V1: { + V3: { parents: 1, interior: { X1: { Parachain: suspendedPara } }, }, diff --git a/tests/tests/test-xcm/test-xcm-transactor.ts b/tests/tests/test-xcm/test-xcm-transactor.ts index 6997176d602..8340a6e4770 100644 --- a/tests/tests/test-xcm/test-xcm-transactor.ts +++ b/tests/tests/test-xcm/test-xcm-transactor.ts @@ -27,14 +27,14 @@ describeDevMoonbeam("Precompiles - xcm transactor", (context) => { // Just build the arguments. They dont matter that much though, since // we will not make sure it executes in the relay const transactWeights = context.polkadotApi.createType("PalletXcmTransactorTransactWeights", { - transactRequiredWeightAtMost: 10000, - overallWeight: 10000, + transactRequiredWeightAtMost: { refTime: 10000, proofSize: 10000 }, + overallWeight: { refTime: 10000, proofSize: 10000 }, }); let fee = context.polkadotApi.createType("PalletXcmTransactorCurrencyPayment", { currency: { AsMultiLocation: { - V1: { + V3: { parents: 1, interior: { Here: null, diff --git a/tests/util/assets.ts b/tests/util/assets.ts index 36d6edc9b12..5577b2f9052 100644 --- a/tests/util/assets.ts +++ b/tests/util/assets.ts @@ -11,7 +11,7 @@ import type { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkad import type { AccountId20 } from "@polkadot/types/interfaces/runtime"; import type { KeyringPair } from "@substrate/txwrapper-core"; export const RELAY_SOURCE_LOCATION = { Xcm: { parents: 1, interior: "Here" } }; -export const RELAY_V1_SOURCE_LOCATION = { V1: { parents: 1, interior: "Here" } }; +export const RELAY_V3_SOURCE_LOCATION = { V3: { parents: 1, interior: "Here" } } as any; export const PARA_1000_SOURCE_LOCATION = { Xcm: { parents: 1, interior: { X1: { Parachain: 1000 } } }, }; diff --git a/tests/util/governance.ts b/tests/util/governance.ts index 017b6e3309b..3b1fbdccb8a 100644 --- a/tests/util/governance.ts +++ b/tests/util/governance.ts @@ -270,7 +270,7 @@ export const execTechnicalCommitteeProposal = async < Number(proposalCount) - 1, { refTime: 1_000_000_000, - proofSize: 0, + proofSize: 64 * 1024, } as any, lengthBound ) diff --git a/tests/util/xcm.ts b/tests/util/xcm.ts index de76f27e89a..93e06be40fa 100644 --- a/tests/util/xcm.ts +++ b/tests/util/xcm.ts @@ -291,7 +291,7 @@ export class XcmFragment { // Ticket seems to indicate the version of the assets ticket: { parents: 0, - interior: { X1: { GeneralIndex: 2 } }, + interior: { X1: { GeneralIndex: 3 } }, }, }, });