diff --git a/Cargo.lock b/Cargo.lock index 264fc8efb0f2d3b2acd4daaaa2448246eae8ee57..7a3c8ca4ccb7dcd1f313fc5997405f3227f9df01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -942,7 +942,7 @@ dependencies = [ "rococo-emulated-chain", "sp-core 28.0.0", "sp-keyring 31.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "testnet-parachains-constants 1.0.0", ] @@ -970,9 +970,9 @@ dependencies = [ "rococo-system-emulated-network", "sp-core 28.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -990,7 +990,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -1053,12 +1053,12 @@ dependencies = [ "sp-version 29.0.0", "sp-weights 27.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -1073,7 +1073,7 @@ dependencies = [ "parachains-common 7.0.0", "sp-core 28.0.0", "sp-keyring 31.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "testnet-parachains-constants 1.0.0", "westend-emulated-chain", ] @@ -1086,7 +1086,7 @@ dependencies = [ "asset-test-utils 7.0.0", "assets-common 0.7.0", "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "emulated-integration-tests-common", "frame-metadata-hash-extension 0.1.0", "frame-support 28.0.0", @@ -1105,11 +1105,11 @@ dependencies = [ "polkadot-runtime-common 7.0.0", "sp-core 28.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "westend-system-emulated-network", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -1127,7 +1127,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -1193,13 +1193,13 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -1207,7 +1207,7 @@ name = "asset-test-utils" version = "7.0.0" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", "frame-system 28.0.0", @@ -1226,11 +1226,11 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -1278,7 +1278,7 @@ dependencies = [ "scale-info", "sp-api 26.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", @@ -2088,7 +2088,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 28.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -2100,7 +2100,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 28.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -2548,7 +2548,7 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -2577,7 +2577,7 @@ dependencies = [ "scale-info", "sp-core 28.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -2606,7 +2606,7 @@ dependencies = [ "sp-core 28.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -2641,7 +2641,7 @@ dependencies = [ "parachains-common 7.0.0", "sp-core 28.0.0", "sp-keyring 31.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "testnet-parachains-constants 1.0.0", ] @@ -2649,7 +2649,7 @@ dependencies = [ name = "bridge-hub-rococo-integration-tests" version = "1.0.0" dependencies = [ - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "emulated-integration-tests-common", "frame-support 28.0.0", "hex-literal", @@ -2671,10 +2671,10 @@ dependencies = [ "snowbridge-router-primitives 0.9.0", "sp-core 28.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -2703,7 +2703,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -2771,12 +2771,12 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -2792,7 +2792,7 @@ dependencies = [ "bp-runtime 0.7.0", "bp-test-utils 0.7.0", "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "frame-support 28.0.0", "frame-system 28.0.0", "impl-trait-for-tuples", @@ -2815,7 +2815,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-std 14.0.0", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -2876,7 +2876,7 @@ dependencies = [ "parachains-common 7.0.0", "sp-core 28.0.0", "sp-keyring 31.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "testnet-parachains-constants 1.0.0", ] @@ -2887,7 +2887,7 @@ dependencies = [ "asset-hub-westend-runtime", "bridge-hub-westend-runtime", "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "emulated-integration-tests-common", "frame-support 28.0.0", "hex-literal", @@ -2910,10 +2910,10 @@ dependencies = [ "snowbridge-router-primitives 0.9.0", "sp-core 28.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -2941,7 +2941,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -3007,14 +3007,14 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", "tracing", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -3046,7 +3046,7 @@ dependencies = [ "sp-std 14.0.0", "sp-trie 29.0.0", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "static_assertions", "tuplex", ] @@ -3649,7 +3649,7 @@ version = "1.0.0" dependencies = [ "assert_matches", "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "emulated-integration-tests-common", "frame-support 28.0.0", "pallet-asset-rate 7.0.0", @@ -3664,7 +3664,7 @@ dependencies = [ "parity-scale-codec", "polkadot-runtime-common 7.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "testnet-parachains-constants 1.0.0", "westend-runtime-constants 7.0.0", @@ -3680,7 +3680,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -3743,13 +3743,13 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -3996,7 +3996,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -4043,12 +4043,12 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -4126,7 +4126,7 @@ dependencies = [ "rococo-runtime-constants 7.0.0", "rococo-system-emulated-network", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -4139,7 +4139,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -4192,12 +4192,12 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -4227,7 +4227,7 @@ dependencies = [ "polkadot-runtime-common 7.0.0", "polkadot-runtime-parachains 7.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "westend-runtime-constants 7.0.0", "westend-system-emulated-network", @@ -4242,7 +4242,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -4294,13 +4294,13 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -4957,7 +4957,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -5019,7 +5019,7 @@ dependencies = [ "sp-tracing 16.0.0", "sp-trie 29.0.0", "sp-version 29.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "trie-db", "trie-standardmap", @@ -5170,7 +5170,7 @@ dependencies = [ "scale-info", "sp-io 30.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -5191,7 +5191,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.7.0" +version = "0.7.1" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router 0.6.0", @@ -5210,7 +5210,7 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -5252,7 +5252,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -5323,7 +5323,7 @@ dependencies = [ "sp-api 26.0.0", "sp-runtime 31.0.1", "sp-trie 29.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -5461,7 +5461,7 @@ dependencies = [ "parity-scale-codec", "polkadot-runtime-common 7.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -6464,7 +6464,7 @@ dependencies = [ "bp-messages 0.7.0", "bp-xcm-bridge-hub 0.2.0", "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", "pallet-assets 29.1.0", @@ -6486,7 +6486,7 @@ dependencies = [ "sp-core 28.0.0", "sp-keyring 31.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "xcm-emulator", ] @@ -8326,7 +8326,7 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", @@ -13200,7 +13200,7 @@ dependencies = [ "sp-keystore 0.34.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "wasm-instrument", "wasmi 0.32.3", @@ -13279,7 +13279,7 @@ dependencies = [ "sp-keystore 0.34.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "xcm-simulator 7.0.0", @@ -15098,7 +15098,7 @@ dependencies = [ "sp-keystore 0.34.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "subxt-signer", ] @@ -15221,7 +15221,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "xcm-simulator 7.0.0", @@ -15735,7 +15735,7 @@ dependencies = [ "sp-core 28.0.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -15750,7 +15750,7 @@ dependencies = [ "sp-core 28.0.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -16348,11 +16348,11 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "tracing", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -16397,7 +16397,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -16443,7 +16443,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -16486,7 +16486,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", ] @@ -16577,7 +16577,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", ] @@ -16633,7 +16633,7 @@ name = "parachains-runtimes-test-utils" version = "7.0.0" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-core 0.7.0", "cumulus-primitives-parachain-inherent 0.7.0", "cumulus-test-relay-sproof-builder 0.7.0", @@ -16654,10 +16654,10 @@ dependencies = [ "sp-runtime 31.0.1", "sp-tracing 16.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -16927,7 +16927,7 @@ dependencies = [ "penpal-runtime", "sp-core 28.0.0", "sp-keyring 31.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -16939,7 +16939,7 @@ dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", "frame-benchmarking 28.0.0", @@ -16987,11 +16987,11 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -17023,7 +17023,7 @@ dependencies = [ "rococo-runtime-constants 7.0.0", "rococo-system-emulated-network", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -17036,7 +17036,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -17089,12 +17089,12 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -17125,7 +17125,7 @@ dependencies = [ "parity-scale-codec", "polkadot-runtime-common 7.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "westend-runtime", "westend-runtime-constants 7.0.0", @@ -17141,7 +17141,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -17193,13 +17193,13 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "testnet-parachains-constants 1.0.0", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -18519,7 +18519,7 @@ dependencies = [ "sp-core 28.0.0", "sp-genesis-builder 0.8.0", "sp-keyring 31.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "substrate-build-script-utils", ] @@ -18732,7 +18732,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-session 27.0.0", "sp-staking 26.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "static_assertions", @@ -18865,7 +18865,7 @@ dependencies = [ "sp-staking 26.0.0", "sp-std 14.0.0", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "static_assertions", "thousands", @@ -18958,7 +18958,7 @@ dependencies = [ "cumulus-pallet-solo-to-para 0.7.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-ping 0.7.0", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", @@ -19287,7 +19287,7 @@ dependencies = [ "staging-node-inspect", "staging-parachain-info 0.7.0", "staging-tracking-allocator", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "subkey", @@ -19304,7 +19304,7 @@ dependencies = [ "tracing-gum-proc-macro", "xcm-emulator", "xcm-procedural 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", "xcm-simulator 7.0.0", ] @@ -19633,7 +19633,7 @@ dependencies = [ "staging-chain-spec-builder", "staging-node-cli", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "subkey", @@ -19740,7 +19740,7 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "7.0.0" +version = "7.0.1" dependencies = [ "assert_matches", "async-trait", @@ -19844,14 +19844,14 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "substrate-prometheus-endpoint", "tempfile", "thiserror 1.0.65", "tracing-gum", "westend-runtime", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -20088,7 +20088,7 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-trie 29.0.0", "sp-version 29.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", @@ -21577,7 +21577,7 @@ dependencies = [ "sp-std 14.0.0", "sp-trie 29.0.0", "sp-version 29.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "thiserror 1.0.65", "tokio", ] @@ -21846,7 +21846,7 @@ dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.7.0", - "cumulus-pallet-xcmp-queue 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-ping 0.7.0", "cumulus-primitives-aura 0.7.0", "cumulus-primitives-core 0.7.0", @@ -21882,7 +21882,7 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-version 29.0.0", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", @@ -21983,13 +21983,13 @@ dependencies = [ "sp-transaction-pool 26.0.0", "sp-trie 29.0.0", "sp-version 29.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "static_assertions", "substrate-wasm-builder 17.0.0", "tokio", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -22003,7 +22003,7 @@ dependencies = [ "sp-core 28.0.0", "sp-runtime 31.0.1", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", ] @@ -25300,7 +25300,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -25538,7 +25538,7 @@ dependencies = [ "sp-keyring 31.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -25660,7 +25660,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -25699,7 +25699,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -25733,7 +25733,7 @@ dependencies = [ "snowbridge-core 0.2.0", "sp-arithmetic 23.0.0", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -25781,7 +25781,7 @@ dependencies = [ "sp-keyring 31.0.0", "sp-runtime 31.0.1", "staging-parachain-info 0.7.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -25825,7 +25825,7 @@ dependencies = [ "snowbridge-core 0.2.0", "sp-api 26.0.0", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -28688,7 +28688,7 @@ version = "2.0.0" [[package]] name = "staging-xcm" -version = "7.0.0" +version = "7.0.1" dependencies = [ "array-bytes", "bounded-collections", @@ -28755,7 +28755,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "tracing", ] @@ -28798,7 +28798,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "tracing", ] @@ -30029,7 +30029,7 @@ dependencies = [ "rococo-runtime-constants 7.0.0", "smallvec", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "westend-runtime-constants 7.0.0", ] @@ -31706,10 +31706,10 @@ dependencies = [ "sp-consensus-beefy 13.0.0", "sp-core 28.0.0", "sp-runtime 31.0.1", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "westend-runtime", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -31814,14 +31814,14 @@ dependencies = [ "sp-tracing 16.0.0", "sp-transaction-pool 26.0.0", "sp-version 29.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "substrate-wasm-builder 17.0.0", "tiny-keccak", "tokio", "westend-runtime-constants 7.0.0", - "xcm-runtime-apis 0.1.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -31835,7 +31835,7 @@ dependencies = [ "sp-core 28.0.0", "sp-runtime 31.0.1", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", ] @@ -32349,7 +32349,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "test-log", @@ -32384,7 +32384,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-std 14.0.0", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -32409,7 +32409,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-state-machine 0.35.0", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", ] @@ -32421,7 +32421,7 @@ dependencies = [ "frame-support 28.0.0", "proc-macro2 1.0.93", "quote 1.0.38", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "syn 2.0.98", "trybuild", ] @@ -32440,7 +32440,7 @@ dependencies = [ [[package]] name = "xcm-runtime-apis" -version = "0.1.0" +version = "0.1.1" dependencies = [ "frame-executive 28.0.0", "frame-support 28.0.0", @@ -32456,7 +32456,7 @@ dependencies = [ "sp-io 30.0.0", "sp-tracing 16.0.0", "sp-weights 27.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -32492,7 +32492,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", ] @@ -32541,7 +32541,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-std 14.0.0", "sp-tracing 16.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "xcm-simulator 7.0.0", @@ -32569,7 +32569,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-std 14.0.0", - "staging-xcm 7.0.0", + "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", "xcm-simulator 7.0.0", diff --git a/cumulus/pallets/xcmp-queue/Cargo.toml b/cumulus/pallets/xcmp-queue/Cargo.toml index 43dfae8927d22e7c70b334efed09977fc9f58572..509b690eed6f1bb624c0570e6d75da8890493e57 100644 --- a/cumulus/pallets/xcmp-queue/Cargo.toml +++ b/cumulus/pallets/xcmp-queue/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cumulus-pallet-xcmp-queue" -version = "0.7.0" +version = "0.7.1" authors.workspace = true edition.workspace = true description = "Pallet to queue outbound and inbound XCMP messages." diff --git a/cumulus/pallets/xcmp-queue/src/lib.rs b/cumulus/pallets/xcmp-queue/src/lib.rs index 08629e6376328e6a3206152bb216ee68e5ed9a72..67f1dec6dc58f368a4d941631950f32756fa730d 100644 --- a/cumulus/pallets/xcmp-queue/src/lib.rs +++ b/cumulus/pallets/xcmp-queue/src/lib.rs @@ -1011,6 +1011,12 @@ impl<T: Config> InspectMessageQueues for Pallet<T> { fn clear_messages() { // Best effort. let _ = OutboundXcmpMessages::<T>::clear(u32::MAX, None); + OutboundXcmpStatus::<T>::mutate(|details_vec| { + for details in details_vec { + details.first_index = 0; + details.last_index = 0; + } + }); } fn get_messages() -> Vec<(VersionedLocation, Vec<VersionedXcm<()>>)> { diff --git a/cumulus/parachains/integration-tests/emulated/common/src/macros.rs b/cumulus/parachains/integration-tests/emulated/common/src/macros.rs index 983ac626177ee60ed14ea4cae75a8096b2191361..7fe753cdbf8b45dd331e647eb36c51cb15e0e3da 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/macros.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/macros.rs @@ -493,7 +493,7 @@ macro_rules! test_can_estimate_and_pay_exact_fees { (Parent, 100_000_000_000u128), ); let origin = OriginCaller::system(RawOrigin::Signed(sender.clone())); - let result = Runtime::dry_run_call(origin, call).unwrap(); + let result = Runtime::dry_run_call(origin, call, xcm::prelude::XCM_VERSION).unwrap(); let local_xcm = result.local_xcm.unwrap().clone(); let local_xcm_weight = Runtime::query_xcm_weight(local_xcm).unwrap(); local_execution_fees = Runtime::query_weight_to_asset_fee( @@ -638,7 +638,7 @@ macro_rules! test_dry_run_transfer_across_pk_bridge { use frame_support::{dispatch::RawOrigin, traits::fungible}; use sp_runtime::AccountId32; use xcm::prelude::*; - use xcm_runtime_apis::dry_run::runtime_decl_for_dry_run_api::DryRunApiV1; + use xcm_runtime_apis::dry_run::runtime_decl_for_dry_run_api::DryRunApiV2; let who = AccountId32::new([1u8; 32]); let transfer_amount = 10_000_000_000_000u128; @@ -668,7 +668,7 @@ macro_rules! test_dry_run_transfer_across_pk_bridge { fee_asset_item: 0, weight_limit: Unlimited, }); - let result = Runtime::dry_run_call(OriginCaller::system(RawOrigin::Signed(who)), call).unwrap(); + let result = Runtime::dry_run_call(OriginCaller::system(RawOrigin::Signed(who)), call, XCM_VERSION).unwrap(); // We assert the dry run succeeds and sends only one message to the local bridge hub. assert!(result.execution_result.is_ok()); assert_eq!(result.forwarded_xcms.len(), 1); diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs index ea210d4f3b65e1568f785901f46db63babcef31b..36a3786cd364a80b3693ae92fe4a1ab6eaeb4f70 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs @@ -19,7 +19,7 @@ use crate::imports::*; use emulated_integration_tests_common::test_can_estimate_and_pay_exact_fees; use frame_support::dispatch::RawOrigin; use xcm_runtime_apis::{ - dry_run::runtime_decl_for_dry_run_api::DryRunApiV1, + dry_run::runtime_decl_for_dry_run_api::DryRunApiV2, fees::runtime_decl_for_xcm_payment_api::XcmPaymentApiV1, }; @@ -146,7 +146,7 @@ fn multi_hop_works() { let call = transfer_assets_para_to_para_through_ah_call(test.clone()); let origin = OriginCaller::system(RawOrigin::Signed(sender.clone())); - let result = Runtime::dry_run_call(origin, call).unwrap(); + let result = Runtime::dry_run_call(origin, call, xcm::prelude::XCM_VERSION).unwrap(); // We filter the result to get only the messages we are interested in. let (destination_to_query, messages_to_query) = &result .forwarded_xcms diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/xcm_fee_estimation.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/xcm_fee_estimation.rs index ec05a074c5acfb4b176009ced7c7ff18bfb39c0b..822de21fa4f6442637fb19e39cabcd3b003585b1 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/xcm_fee_estimation.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/xcm_fee_estimation.rs @@ -20,7 +20,7 @@ use crate::imports::*; use emulated_integration_tests_common::test_can_estimate_and_pay_exact_fees; use frame_support::dispatch::RawOrigin; use xcm_runtime_apis::{ - dry_run::runtime_decl_for_dry_run_api::DryRunApiV1, + dry_run::runtime_decl_for_dry_run_api::DryRunApiV2, fees::runtime_decl_for_xcm_payment_api::XcmPaymentApiV1, }; @@ -148,7 +148,7 @@ fn multi_hop_works() { let call = transfer_assets_para_to_para_through_ah_call(test.clone()); let origin = OriginCaller::system(RawOrigin::Signed(sender.clone())); - let result = Runtime::dry_run_call(origin, call).unwrap(); + let result = Runtime::dry_run_call(origin, call, xcm::prelude::XCM_VERSION).unwrap(); // We filter the result to get only the messages we are interested in. let (destination_to_query, messages_to_query) = &result .forwarded_xcms diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 0a2357dbd3c17f45d48ad7452e135c1d8780cc32..f0da44fba16f7b64cb1b1143f2c1d7377a5297af 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -104,7 +104,8 @@ use xcm::latest::prelude::{ }; use xcm::{ latest::prelude::{AssetId, BodyId}, - VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, + Version as XcmVersion, VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, + VersionedXcm, }; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, @@ -1593,8 +1594,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 66486a42c347459f87518dcbf084f9e366d0cc9b..9ddf14217d9444c12ab766e28b1f5d46a22acdba 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -101,6 +101,7 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use xcm::{ latest::prelude::AssetId, prelude::{VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm}, + Version as XcmVersion, }; #[cfg(feature = "runtime-benchmarks")] @@ -1726,8 +1727,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 5cdfc7fe35a2cf5a53f49c40d711f02eca873d1b..463f2ed1e9f70df1bc419a304e9b28a392a4a5ca 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -95,7 +95,7 @@ use snowbridge_core::{ outbound::{Command, Fee}, AgentId, PricingParameters, }; -use xcm::{latest::prelude::*, prelude::*}; +use xcm::{latest::prelude::*, prelude::*, Version as XcmVersion}; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, fees::Error as XcmPaymentApiError, @@ -891,8 +891,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs index 2fdd3c0619775336a4bdd5a20bff637de44d375b..65f85e3dccaa745b9653aa646f21706f59bedcdf 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs @@ -103,7 +103,7 @@ use snowbridge_core::{ AgentId, PricingParameters, }; use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee, time::*}; -use xcm::VersionedLocation; +use xcm::{Version as XcmVersion, VersionedLocation}; use westend_runtime_constants::system_parachain::{ASSET_HUB_ID, BRIDGE_HUB_ID}; @@ -833,8 +833,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index d09fa83eca9b36148377dce4e4e6d8d086d74de4..c001dae0804f97e3457026d39a9e259a9eaf6164 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -107,7 +107,7 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::{ impls::VersionedLocatableAsset, BlockHashCount, SlowAdjustingFeeUpdate, }; -use xcm::prelude::*; +use xcm::{prelude::*, Version as XcmVersion}; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, fees::Error as XcmPaymentApiError, @@ -1011,8 +1011,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 7dee5443271387361d5425330f4b115dcfbf64da..b89b3e3f58b2a3ab990bc815bd59515ea37a9a1f 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -64,7 +64,7 @@ use parachains_common::{ }; pub use parachains_common::{AuraId, Balance}; use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; -use xcm::prelude::*; +use xcm::{prelude::*, Version as XcmVersion}; use xcm_config::CollatorSelectionUpdateOrigin; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, @@ -645,8 +645,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs index 242efd0b9c5e35602fd01b5049c3dcf5b54e4e25..1e58422bcd96a37e72820fb7ba59557e6b1e2d05 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs @@ -78,7 +78,7 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -use xcm::prelude::*; +use xcm::{prelude::*, Version as XcmVersion}; use xcm_config::{ FellowshipLocation, GovernanceLocation, RocRelayLocation, XcmOriginToTransactDispatchOrigin, }; @@ -878,8 +878,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs index e52d8c258a1012caceb131438bd9a378b94f866e..8c9caa46128eb1fd2cde1872712e317fc42daa44 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs @@ -78,7 +78,7 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee, time::*}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -use xcm::prelude::*; +use xcm::{prelude::*, Version as XcmVersion}; use xcm_config::{ FellowshipLocation, GovernanceLocation, TokenRelayLocation, XcmOriginToTransactDispatchOrigin, }; @@ -879,8 +879,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs index 40a59c5740847dafc353c772c2499f407cdb0a54..c16eb457d6447b92f632ef62757896573e3364c5 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs @@ -70,7 +70,7 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -use xcm::prelude::*; +use xcm::{prelude::*, Version as XcmVersion}; use xcm_config::{ FellowshipLocation, GovernanceLocation, PriceForSiblingParachainDelivery, XcmConfig, XcmOriginToTransactDispatchOrigin, @@ -826,8 +826,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs index 32088276722bb4f7e2caa632df60362d42270d29..83e405bcaebe3902cf74b8bce2ce2ad9283f6700 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs @@ -70,7 +70,7 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee, time::*}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -use xcm::prelude::*; +use xcm::{prelude::*, Version as XcmVersion}; use xcm_config::{ FellowshipLocation, GovernanceLocation, PriceForSiblingParachainDelivery, XcmConfig, XcmOriginToTransactDispatchOrigin, @@ -824,8 +824,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index e5c1dbb936558d6613dc367b8b652bf6361de8ee..d6be7bb16c459d3ee266a64fad2936bfe4383867 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -52,7 +52,6 @@ use assets_common::{ local_and_foreign_assets::{LocalFromLeft, TargetFromLeft}, AssetIdForTrustBackedAssetsConvert, }; -use codec::Encode; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector, ParaId}; use frame_support::{ @@ -87,7 +86,7 @@ pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ generic, impl_opaque_keys, - traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Dispatchable}, + traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -105,7 +104,8 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use xcm::{ latest::prelude::{AssetId as AssetLocationId, BodyId}, - VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, + Version as XcmVersion, VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, + VersionedXcm, }; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, @@ -1044,61 +1044,12 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - use xcm_builder::InspectMessageQueues; - use xcm_executor::RecordXcm; - use xcm::prelude::*; - pallet_xcm::Pallet::<Runtime>::set_record_xcm(true); - frame_system::Pallet::<Runtime>::reset_events(); // To make sure we only record events from current call. - let result = call.dispatch(origin.into()); - pallet_xcm::Pallet::<Runtime>::set_record_xcm(false); - let local_xcm = pallet_xcm::Pallet::<Runtime>::recorded_xcm(); - let forwarded_xcms = xcm_config::XcmRouter::get_messages(); - let events: Vec<RuntimeEvent> = System::read_events_no_consensus().map(|record| record.event.clone()).collect(); - Ok(CallDryRunEffects { - local_xcm: local_xcm.map(VersionedXcm::<()>::from), - forwarded_xcms, - emitted_events: events, - execution_result: result, - }) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } - fn dry_run_xcm(origin_location: VersionedLocation, program: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - use xcm_builder::InspectMessageQueues; - use xcm::prelude::*; - - let origin_location: Location = origin_location.try_into().map_err(|error| { - log::error!( - target: "xcm::DryRunApi::dry_run_xcm", - "Location version conversion failed with error: {:?}", - error, - ); - XcmDryRunApiError::VersionedConversionFailed - })?; - let program: Xcm<RuntimeCall> = program.try_into().map_err(|error| { - log::error!( - target: "xcm::DryRunApi::dry_run_xcm", - "Xcm version conversion failed with error {:?}", - error, - ); - XcmDryRunApiError::VersionedConversionFailed - })?; - let mut hash = program.using_encoded(sp_core::hashing::blake2_256); - frame_system::Pallet::<Runtime>::reset_events(); // To make sure we only record events from current call. - let result = xcm_executor::XcmExecutor::<xcm_config::XcmConfig>::prepare_and_execute( - origin_location, - program, - &mut hash, - Weight::MAX, // Max limit. - Weight::zero(), - ); - let forwarded_xcms = xcm_config::XcmRouter::get_messages(); - let events: Vec<RuntimeEvent> = System::read_events_no_consensus().map(|record| record.event.clone()).collect(); - Ok(XcmDryRunEffects { - forwarded_xcms, - emitted_events: events, - execution_result: result, - }) + fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + PolkadotXcm::dry_run_xcm::<Runtime, xcm_config::XcmRouter, RuntimeCall, xcm_config::XcmConfig>(origin_location, xcm) } } diff --git a/polkadot/node/service/Cargo.toml b/polkadot/node/service/Cargo.toml index 122040a9b20794566d90a177baf790ea595fbb91..7a9596748b63fc51ef0ea6c3b9066bec7cb6864f 100644 --- a/polkadot/node/service/Cargo.toml +++ b/polkadot/node/service/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "polkadot-service" rust-version = "1.60" -version = "7.0.0" +version = "7.0.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/polkadot/node/service/src/fake_runtime_api.rs b/polkadot/node/service/src/fake_runtime_api.rs index d8f147a9cf7b51571a48336108b054ef45639f57..4e31c72d334f74d0130f73bb9a900fc16f247e50 100644 --- a/polkadot/node/service/src/fake_runtime_api.rs +++ b/polkadot/node/service/src/fake_runtime_api.rs @@ -44,7 +44,9 @@ use sp_runtime::{ use sp_version::RuntimeVersion; use sp_weights::Weight; use std::collections::BTreeMap; -use xcm::{VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm}; +use xcm::{ + Version as XcmVersion, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, +}; sp_api::decl_runtime_apis! { /// This runtime API is only implemented for the test runtime! pub trait GetLastTimestamp { @@ -447,7 +449,7 @@ sp_api::impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, (), (), ()> for Runtime { - fn dry_run_call(_: (), _: ()) -> Result<xcm_runtime_apis::dry_run::CallDryRunEffects<()>, xcm_runtime_apis::dry_run::Error> { + fn dry_run_call(_: (), _: (), _: XcmVersion) -> Result<xcm_runtime_apis::dry_run::CallDryRunEffects<()>, xcm_runtime_apis::dry_run::Error> { unimplemented!() } diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 4123a6a1a3558a8dfbca28d421beedeb606214ec..0a6f52890b27262dea144690d6b4456037407fbb 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -126,8 +126,8 @@ use sp_staking::SessionIndex; use sp_version::NativeVersion; use sp_version::RuntimeVersion; use xcm::{ - latest::prelude::*, VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, - VersionedXcm, + latest::prelude::*, Version as XcmVersion, VersionedAsset, VersionedAssetId, VersionedAssets, + VersionedLocation, VersionedXcm, }; use xcm_builder::PayOverXcm; @@ -1920,8 +1920,8 @@ sp_api::impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - XcmPallet::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + XcmPallet::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 5af67ad9bd70a491e357abb859acb1d767f387af..ddc26f4e645b67f0d760c328baef84aca8707159 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -111,8 +111,8 @@ use sp_staking::SessionIndex; use sp_version::NativeVersion; use sp_version::RuntimeVersion; use xcm::{ - latest::prelude::*, VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, - VersionedXcm, + latest::prelude::*, Version as XcmVersion, VersionedAsset, VersionedAssetId, VersionedAssets, + VersionedLocation, VersionedXcm, }; use xcm_builder::PayOverXcm; @@ -2521,8 +2521,8 @@ sp_api::impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - XcmPallet::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + XcmPallet::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { diff --git a/polkadot/xcm/Cargo.toml b/polkadot/xcm/Cargo.toml index f5f824ee409f0b12d05a822f2970d1c92b3c7649..48e2315ab28ac1e547e186e28036973ebf254ab3 100644 --- a/polkadot/xcm/Cargo.toml +++ b/polkadot/xcm/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "staging-xcm" description = "The basic XCM datastructures." -version = "7.0.0" +version = "7.0.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/polkadot/xcm/pallet-xcm/src/lib.rs b/polkadot/xcm/pallet-xcm/src/lib.rs index a422756ed570a6982b481b040af70cfaf70ad553..ba886222266380bb268cbe93c073cc96fa90588d 100644 --- a/polkadot/xcm/pallet-xcm/src/lib.rs +++ b/polkadot/xcm/pallet-xcm/src/lib.rs @@ -2524,6 +2524,7 @@ impl<T: Config> Pallet<T> { pub fn dry_run_call<Runtime, Router, OriginCaller, RuntimeCall>( origin: OriginCaller, call: RuntimeCall, + result_xcms_version: XcmVersion, ) -> Result<CallDryRunEffects<<Runtime as frame_system::Config>::RuntimeEvent>, XcmDryRunApiError> where Runtime: crate::Config, @@ -2538,9 +2539,28 @@ impl<T: Config> Pallet<T> { frame_system::Pallet::<Runtime>::reset_events(); let result = call.dispatch(origin.into()); crate::Pallet::<Runtime>::set_record_xcm(false); - let local_xcm = crate::Pallet::<Runtime>::recorded_xcm(); + let local_xcm = crate::Pallet::<Runtime>::recorded_xcm() + .map(|xcm| VersionedXcm::<()>::from(xcm).into_version(result_xcms_version)) + .transpose() + .map_err(|()| { + tracing::error!( + target: "xcm::DryRunApi::dry_run_call", + "Local xcm version conversion failed" + ); + + XcmDryRunApiError::VersionedConversionFailed + })?; + // Should only get messages from this call since we cleared previous ones. - let forwarded_xcms = Router::get_messages(); + let forwarded_xcms = + Self::convert_forwarded_xcms(result_xcms_version, Router::get_messages()).inspect_err( + |error| { + tracing::error!( + target: "xcm::DryRunApi::dry_run_call", + ?error, "Forwarded xcms version conversion failed with error" + ); + }, + )?; let events: Vec<<Runtime as frame_system::Config>::RuntimeEvent> = frame_system::Pallet::<Runtime>::read_events_no_consensus() .map(|record| record.event.clone()) @@ -2573,6 +2593,7 @@ impl<T: Config> Pallet<T> { ); XcmDryRunApiError::VersionedConversionFailed })?; + let xcm_version = xcm.identify_version(); let xcm: Xcm<RuntimeCall> = xcm.try_into().map_err(|error| { tracing::error!( target: "xcm::DryRunApi::dry_run_xcm", @@ -2581,7 +2602,11 @@ impl<T: Config> Pallet<T> { XcmDryRunApiError::VersionedConversionFailed })?; let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); - frame_system::Pallet::<Runtime>::reset_events(); // To make sure we only record events from current call. + + // To make sure we only record events from current call. + Router::clear_messages(); + frame_system::Pallet::<Runtime>::reset_events(); + let result = xcm_executor::XcmExecutor::<XcmConfig>::prepare_and_execute( origin_location, xcm, @@ -2589,7 +2614,13 @@ impl<T: Config> Pallet<T> { Weight::MAX, // Max limit available for execution. Weight::zero(), ); - let forwarded_xcms = Router::get_messages(); + let forwarded_xcms = Self::convert_forwarded_xcms(xcm_version, Router::get_messages()) + .inspect_err(|error| { + tracing::error!( + target: "xcm::DryRunApi::dry_run_xcm", + ?error, "Forwarded xcms version conversion failed with error" + ); + })?; let events: Vec<<Runtime as frame_system::Config>::RuntimeEvent> = frame_system::Pallet::<Runtime>::read_events_no_consensus() .map(|record| record.event.clone()) @@ -2597,6 +2628,31 @@ impl<T: Config> Pallet<T> { Ok(XcmDryRunEffects { forwarded_xcms, emitted_events: events, execution_result: result }) } + fn convert_xcms( + xcm_version: XcmVersion, + xcms: Vec<VersionedXcm<()>>, + ) -> Result<Vec<VersionedXcm<()>>, ()> { + xcms.into_iter() + .map(|xcm| xcm.into_version(xcm_version)) + .collect::<Result<Vec<_>, ()>>() + } + + fn convert_forwarded_xcms( + xcm_version: XcmVersion, + forwarded_xcms: Vec<(VersionedLocation, Vec<VersionedXcm<()>>)>, + ) -> Result<Vec<(VersionedLocation, Vec<VersionedXcm<()>>)>, XcmDryRunApiError> { + forwarded_xcms + .into_iter() + .map(|(dest, forwarded_xcms)| { + let dest = dest.into_version(xcm_version)?; + let forwarded_xcms = Self::convert_xcms(xcm_version, forwarded_xcms)?; + + Ok((dest, forwarded_xcms)) + }) + .collect::<Result<Vec<_>, ()>>() + .map_err(|()| XcmDryRunApiError::VersionedConversionFailed) + } + /// Given a list of asset ids, returns the correct API response for /// `XcmPaymentApi::query_acceptable_payment_assets`. /// diff --git a/polkadot/xcm/src/lib.rs b/polkadot/xcm/src/lib.rs index 9d3dc56c7d3cf14365a740b8577f6401a3692b8d..0e0998e9b79365195d00fae59e5d6a471a279233 100644 --- a/polkadot/xcm/src/lib.rs +++ b/polkadot/xcm/src/lib.rs @@ -518,6 +518,9 @@ pub mod prelude { VersionedAssetId, VersionedAssets, VersionedInteriorLocation, VersionedLocation, VersionedResponse, VersionedXcm, WrapVersion, }; + + /// The minimal supported XCM version + pub const MIN_XCM_VERSION: XcmVersion = 3; } pub mod opaque { diff --git a/polkadot/xcm/xcm-runtime-apis/Cargo.toml b/polkadot/xcm/xcm-runtime-apis/Cargo.toml index 96afb10e53971cb128d68b1608773fb7ccd265d0..4918faf7e0d440ae014099c9eb855c92cef537d0 100644 --- a/polkadot/xcm/xcm-runtime-apis/Cargo.toml +++ b/polkadot/xcm/xcm-runtime-apis/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xcm-runtime-apis" -version = "0.1.0" +version = "0.1.1" authors.workspace = true edition.workspace = true license = "Apache-2.0" diff --git a/polkadot/xcm/xcm-runtime-apis/src/dry_run.rs b/polkadot/xcm/xcm-runtime-apis/src/dry_run.rs index 7bcc190c98795976e38450b55253c02fd86715ed..9459da674dcee7ee791209619e24fcfce252c2b6 100644 --- a/polkadot/xcm/xcm-runtime-apis/src/dry_run.rs +++ b/polkadot/xcm/xcm-runtime-apis/src/dry_run.rs @@ -57,13 +57,18 @@ sp_api::decl_runtime_apis! { /// Calls or XCMs might fail when executed, this doesn't mean the result of these calls will be an `Err`. /// In those cases, there might still be a valid result, with the execution error inside it. /// The only reasons why these calls might return an error are listed in the [`Error`] enum. + #[api_version(2)] pub trait DryRunApi<Call, Event, OriginCaller> where Call: Encode, Event: Decode, OriginCaller: Encode { - /// Dry run call. + /// Dry run call V2. + fn dry_run_call(origin: OriginCaller, call: Call, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<Event>, Error>; + + /// Dry run call V1. + #[changed_in(2)] fn dry_run_call(origin: OriginCaller, call: Call) -> Result<CallDryRunEffects<Event>, Error>; /// Dry run XCM program diff --git a/polkadot/xcm/xcm-runtime-apis/tests/fee_estimation.rs b/polkadot/xcm/xcm-runtime-apis/tests/fee_estimation.rs index e1ab1ed1cecfb709235b7a7b3d323845c41a9fcd..ba0ba95442e9c1c7f70afa737abce83d7646a4fd 100644 --- a/polkadot/xcm/xcm-runtime-apis/tests/fee_estimation.rs +++ b/polkadot/xcm/xcm-runtime-apis/tests/fee_estimation.rs @@ -20,7 +20,10 @@ use frame_support::sp_runtime::testing::H256; use frame_system::RawOrigin; use sp_api::ProvideRuntimeApi; use xcm::prelude::*; -use xcm_runtime_apis::{dry_run::DryRunApi, fees::XcmPaymentApi}; +use xcm_runtime_apis::{ + dry_run::{CallDryRunEffects, DryRunApi}, + fees::XcmPaymentApi, +}; mod mock; use mock::{ @@ -62,8 +65,10 @@ fn fee_estimation_for_teleport() { weight_limit: Unlimited, }); let origin = OriginCaller::system(RawOrigin::Signed(who)); - let dry_run_effects = - runtime_api.dry_run_call(H256::zero(), origin, call).unwrap().unwrap(); + let dry_run_effects = runtime_api + .dry_run_call(H256::zero(), origin, call, XCM_VERSION) + .unwrap() + .unwrap(); assert_eq!( dry_run_effects.local_xcm, @@ -193,8 +198,11 @@ fn fee_estimation_for_teleport() { // Reserve Asset Transfer Relay Token // Reserve Asset Transfer Relay Token for fees // Parachain(2000) -------------------------------------------> Parachain(1000) -#[test] -fn dry_run_reserve_asset_transfer() { +fn dry_run_reserve_asset_transfer_common( + input_xcm_version: XcmVersion, + expected_result_xcms_version: XcmVersion, + dry_run_call: impl FnOnce(&TestClient, OriginCaller, RuntimeCall) -> CallDryRunEffects<RuntimeEvent>, +) { sp_tracing::init_for_tests(); let who = 1; // AccountId = u64. // Native token used for fees. @@ -202,30 +210,40 @@ fn dry_run_reserve_asset_transfer() { // Relay token is the one we want to transfer. let assets = vec![(1, who, 100)]; // id, account_id, balance. new_test_ext_with_balances_and_assets(balances, assets).execute_with(|| { - let client = TestClient; - let runtime_api = client.runtime_api(); let call = RuntimeCall::XcmPallet(pallet_xcm::Call::transfer_assets { - dest: Box::new(VersionedLocation::from((Parent, Parachain(1000)))), - beneficiary: Box::new(VersionedLocation::from(AccountId32 { - id: [0u8; 32], - network: None, - })), - assets: Box::new(VersionedAssets::from((Parent, 100u128))), + dest: Box::new( + VersionedLocation::from((Parent, Parachain(1000))) + .into_version(input_xcm_version) + .unwrap(), + ), + beneficiary: Box::new( + VersionedLocation::from(AccountId32 { id: [0u8; 32], network: None }) + .into_version(input_xcm_version) + .unwrap(), + ), + assets: Box::new( + VersionedAssets::from((Parent, 100u128)) + .into_version(input_xcm_version) + .unwrap(), + ), fee_asset_item: 0, weight_limit: Unlimited, }); let origin = OriginCaller::system(RawOrigin::Signed(who)); - let dry_run_effects = - runtime_api.dry_run_call(H256::zero(), origin, call).unwrap().unwrap(); + let dry_run_effects = dry_run_call(&TestClient, origin, call); assert_eq!( dry_run_effects.local_xcm, - Some(VersionedXcm::from( - Xcm::builder_unsafe() - .withdraw_asset((Parent, 100u128)) - .burn_asset((Parent, 100u128)) - .build() - )), + Some( + VersionedXcm::from( + Xcm::builder_unsafe() + .withdraw_asset((Parent, 100u128)) + .burn_asset((Parent, 100u128)) + .build() + ) + .into_version(expected_result_xcms_version) + .unwrap() + ), ); // In this case, the transfer type is `DestinationReserve`, so the remote xcm just withdraws @@ -240,8 +258,12 @@ fn dry_run_reserve_asset_transfer() { assert_eq!( dry_run_effects.forwarded_xcms, vec![( - VersionedLocation::from(send_destination.clone()), - vec![VersionedXcm::from(send_message.clone())], + VersionedLocation::from(send_destination.clone()) + .into_version(expected_result_xcms_version) + .unwrap(), + vec![VersionedXcm::from(send_message.clone()) + .into_version(expected_result_xcms_version) + .unwrap()], ),], ); @@ -273,7 +295,49 @@ fn dry_run_reserve_asset_transfer() { } #[test] -fn dry_run_xcm() { +fn dry_run_reserve_asset_transfer_xcm_versions() { + let tested_versions = MIN_XCM_VERSION..=XCM_VERSION; + + for version in tested_versions { + let input_version = version; + let expected_result_xcms_version = version; + dry_run_reserve_asset_transfer_common( + input_version, + expected_result_xcms_version, + |client, origin, call| { + client + .runtime_api() + .dry_run_call(H256::zero(), origin, call, expected_result_xcms_version) + .unwrap() + .unwrap() + }, + ); + } +} + +#[test] +fn dry_run_before_api_v2_reserve_asset_transfer() { + let tested_versions = MIN_XCM_VERSION..=XCM_VERSION; + + for version in tested_versions { + let input_version = version; + let expected_result_xcms_version = XCM_VERSION; + dry_run_reserve_asset_transfer_common( + input_version, + expected_result_xcms_version, + |client, origin, call| { + #[allow(deprecated)] + client + .runtime_api() + .dry_run_call_before_version_2(H256::zero(), origin, call) + .unwrap() + .unwrap() + }, + ); + } +} + +fn dry_run_xcm_common(xcm_version: XcmVersion) { sp_tracing::init_for_tests(); let who = 1; // AccountId = u64. let transfer_amount = 100u128; @@ -291,14 +355,19 @@ fn dry_run_xcm() { let client = TestClient; let runtime_api = client.runtime_api(); let xcm_weight = runtime_api - .query_xcm_weight(H256::zero(), VersionedXcm::from(xcm_to_weigh.clone().into())) + .query_xcm_weight( + H256::zero(), + VersionedXcm::from(xcm_to_weigh.clone().into()) + .into_version(xcm_version) + .unwrap(), + ) .unwrap() .unwrap(); let execution_fees = runtime_api .query_weight_to_asset_fee( H256::zero(), xcm_weight, - VersionedAssetId::from(AssetId(Here.into())), + VersionedAssetId::from(AssetId(Here.into())).into_version(xcm_version).unwrap(), ) .unwrap() .unwrap(); @@ -316,15 +385,19 @@ fn dry_run_xcm() { let dry_run_effects = runtime_api .dry_run_xcm( H256::zero(), - VersionedLocation::from([AccountIndex64 { index: 1, network: None }]), - VersionedXcm::from(xcm), + VersionedLocation::from([AccountIndex64 { index: 1, network: None }]) + .into_version(xcm_version) + .unwrap(), + VersionedXcm::from(xcm).into_version(xcm_version).unwrap(), ) .unwrap() .unwrap(); assert_eq!( dry_run_effects.forwarded_xcms, vec![( - VersionedLocation::from((Parent, Parachain(2100))), + VersionedLocation::from((Parent, Parachain(2100))) + .into_version(xcm_version) + .unwrap(), vec![VersionedXcm::from( Xcm::<()>::builder_unsafe() .reserve_asset_deposited(( @@ -335,7 +408,9 @@ fn dry_run_xcm() { .buy_execution((Here, 1u128), Unlimited) .deposit_asset(AllCounted(1), [0u8; 32]) .build() - )], + ) + .into_version(xcm_version) + .unwrap()], ),] ); @@ -354,6 +429,15 @@ fn dry_run_xcm() { }); } +#[test] +fn dry_run_xcm_versions() { + let tested_versions = [XCM_VERSION, 5, 4, 3]; + + for version in tested_versions { + dry_run_xcm_common(version); + } +} + #[test] fn calling_payment_api_with_a_lower_version_works() { let transfer_amount = 100u128; diff --git a/polkadot/xcm/xcm-runtime-apis/tests/mock.rs b/polkadot/xcm/xcm-runtime-apis/tests/mock.rs index 8c6c47e7ee909eb7da010ecf4c2a49ea5505db09..9da4030fef159fd9f986926a2fa8e1eac3bee937 100644 --- a/polkadot/xcm/xcm-runtime-apis/tests/mock.rs +++ b/polkadot/xcm/xcm-runtime-apis/tests/mock.rs @@ -22,7 +22,7 @@ use core::{cell::RefCell, marker::PhantomData}; use frame_support::{ construct_runtime, derive_impl, parameter_types, sp_runtime, sp_runtime::{ - traits::{Dispatchable, Get, IdentityLookup, MaybeEquivalence, TryConvert}, + traits::{Get, IdentityLookup, MaybeEquivalence, TryConvert}, BuildStorage, SaturatedConversion, }, traits::{ @@ -36,8 +36,8 @@ use pallet_xcm::TestWeightInfo; use xcm::{prelude::*, Version as XcmVersion}; use xcm_builder::{ AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, - FixedWeightBounds, FungibleAdapter, FungiblesAdapter, IsConcrete, MintLocation, NoChecking, - TakeWeightCredit, + FixedWeightBounds, FungibleAdapter, FungiblesAdapter, InspectMessageQueues, IsConcrete, + MintLocation, NoChecking, TakeWeightCredit, }; use xcm_executor::{ traits::{ConvertLocation, JustTry}, @@ -112,10 +112,6 @@ thread_local! { pub static SENT_XCM: RefCell<Vec<(Location, Xcm<()>)>> = const { RefCell::new(Vec::new()) }; } -pub(crate) fn sent_xcm() -> Vec<(Location, Xcm<()>)> { - SENT_XCM.with(|q| (*q.borrow()).clone()) -} - pub struct TestXcmSender; impl SendXcm for TestXcmSender { type Ticket = (Location, Xcm<()>); @@ -133,6 +129,26 @@ impl SendXcm for TestXcmSender { Ok(hash) } } +impl InspectMessageQueues for TestXcmSender { + fn clear_messages() { + SENT_XCM.with(|q| q.borrow_mut().clear()); + } + + fn get_messages() -> Vec<(VersionedLocation, Vec<VersionedXcm<()>>)> { + SENT_XCM.with(|q| { + (*q.borrow()) + .clone() + .iter() + .map(|(location, message)| { + ( + VersionedLocation::from(location.clone()), + vec![VersionedXcm::from(message.clone())], + ) + }) + .collect() + }) + } +} pub(crate) fn fake_message_hash<Call>(message: &Xcm<Call>) -> XcmHash { message.using_encoded(sp_io::hashing::blake2_256) @@ -483,64 +499,23 @@ sp_api::mock_impl_runtime_apis! { } impl DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for RuntimeApi { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - use xcm_executor::RecordXcm; - pallet_xcm::Pallet::<TestRuntime>::set_record_xcm(true); - let result = call.dispatch(origin.into()); - pallet_xcm::Pallet::<TestRuntime>::set_record_xcm(false); - let local_xcm = pallet_xcm::Pallet::<TestRuntime>::recorded_xcm(); - let forwarded_xcms = sent_xcm() - .into_iter() - .map(|(location, message)| ( - VersionedLocation::from(location), - vec![VersionedXcm::from(message)], - )).collect(); - let events: Vec<RuntimeEvent> = System::read_events_no_consensus().map(|record| record.event.clone()).collect(); - Ok(CallDryRunEffects { - local_xcm: local_xcm.map(VersionedXcm::<()>::from), - forwarded_xcms, - emitted_events: events, - execution_result: result, - }) + fn dry_run_call( + origin: OriginCaller, + call: RuntimeCall, + result_xcms_version: XcmVersion, + ) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + pallet_xcm::Pallet::<TestRuntime>::dry_run_call::<TestRuntime, XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version) + } + + fn dry_run_call_before_version_2( + origin: OriginCaller, + call: RuntimeCall, + ) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { + pallet_xcm::Pallet::<TestRuntime>::dry_run_call::<TestRuntime, XcmRouter, OriginCaller, RuntimeCall>(origin, call, xcm::latest::VERSION) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> { - let origin_location: Location = origin_location.try_into().map_err(|error| { - log::error!( - target: "xcm::DryRunApi::dry_run_xcm", - "Location version conversion failed with error: {:?}", - error, - ); - XcmDryRunApiError::VersionedConversionFailed - })?; - let xcm: Xcm<RuntimeCall> = xcm.try_into().map_err(|error| { - log::error!( - target: "xcm::DryRunApi::dry_run_xcm", - "Xcm version conversion failed with error {:?}", - error, - ); - XcmDryRunApiError::VersionedConversionFailed - })?; - let mut hash = fake_message_hash(&xcm); - let result = XcmExecutor::<XcmConfig>::prepare_and_execute( - origin_location, - xcm, - &mut hash, - Weight::MAX, // Max limit available for execution. - Weight::zero(), - ); - let forwarded_xcms = sent_xcm() - .into_iter() - .map(|(location, message)| ( - VersionedLocation::from(location), - vec![VersionedXcm::from(message)], - )).collect(); - let events: Vec<RuntimeEvent> = System::events().iter().map(|record| record.event.clone()).collect(); - Ok(XcmDryRunEffects { - forwarded_xcms, - emitted_events: events, - execution_result: result, - }) + pallet_xcm::Pallet::<TestRuntime>::dry_run_xcm::<TestRuntime, XcmRouter, RuntimeCall, XcmConfig>(origin_location, xcm) } } } diff --git a/prdoc/pr_7438.prdoc b/prdoc/pr_7438.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..10eab04eb699bd8f26f922c31fabad9be731cb55 --- /dev/null +++ b/prdoc/pr_7438.prdoc @@ -0,0 +1,22 @@ +title: Fix DryRunApi client-facing XCM versions + +doc: + - audience: Runtime Dev + description: |- + Fixes https://github.com/paritytech/polkadot-sdk/issues/7413 + + This PR updates the DryRunApi. The signature of the dry_run_call is changed, and the XCM version of the return values of dry_run_xcm now follows the version of the input XCM program. + + It also fixes xcmp-queue's Router's `clear_messages`: the channel details `first_index` and `last_index` are reset when clearing. + +crates: +- name: xcm-runtime-apis + bump: patch +- name: staging-xcm + bump: patch +- name: pallet-xcm + bump: patch +- name: polkadot-service + bump: patch +- name: cumulus-pallet-xcmp-queue + bump: patch