diff --git a/Cargo.lock b/Cargo.lock index 9ac084f30f4..68b2b5e2a3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1147,6 +1147,7 @@ dependencies = [ name = "bridge-hub-test-utils" version = "0.1.0" dependencies = [ + "assert_matches", "asset-test-utils", "bp-bridge-hub-rococo", "bp-bridge-hub-wococo", @@ -5158,7 +5159,7 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kusama-runtime" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "frame-benchmarking", @@ -5257,7 +5258,7 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-support", "polkadot-primitives", @@ -7938,7 +7939,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -7959,7 +7960,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8576,7 +8577,7 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "polkadot-node-jaeger", @@ -8592,7 +8593,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -8606,7 +8607,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "derive_more", "fatality", @@ -8629,7 +8630,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "fatality", "futures", @@ -8650,7 +8651,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "clap", "frame-benchmarking-cli", @@ -8679,7 +8680,7 @@ dependencies = [ [[package]] name = "polkadot-client" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "frame-benchmarking", @@ -8722,7 +8723,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "always-assert", "bitvec", @@ -8744,7 +8745,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -8756,7 +8757,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "derive_more", "fatality", @@ -8781,7 +8782,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -8795,7 +8796,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "futures-timer", @@ -8815,7 +8816,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "always-assert", "async-trait", @@ -8838,7 +8839,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "parity-scale-codec", @@ -8856,7 +8857,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "derive_more", @@ -8885,7 +8886,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "futures", @@ -8906,7 +8907,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "fatality", @@ -8925,7 +8926,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "polkadot-node-subsystem", @@ -8940,7 +8941,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "futures", @@ -8960,7 +8961,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "polkadot-node-metrics", @@ -8975,7 +8976,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "futures-timer", @@ -8992,7 +8993,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "fatality", "futures", @@ -9011,7 +9012,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "futures", @@ -9028,7 +9029,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "fatality", @@ -9046,7 +9047,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "always-assert", "futures", @@ -9073,7 +9074,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "polkadot-node-primitives", @@ -9089,7 +9090,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-worker" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "assert_matches", "cpu-time", @@ -9118,7 +9119,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "futures", "lru 0.9.0", @@ -9133,7 +9134,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "lazy_static", "log", @@ -9151,7 +9152,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bs58", "futures", @@ -9170,7 +9171,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-channel", "async-trait", @@ -9193,7 +9194,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bounded-vec", "futures", @@ -9215,7 +9216,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9225,7 +9226,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "futures", @@ -9243,7 +9244,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "derive_more", @@ -9266,7 +9267,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "derive_more", @@ -9299,7 +9300,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "futures", @@ -9322,7 +9323,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bounded-collections", "derive_more", @@ -9421,7 +9422,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -9439,7 +9440,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -9465,7 +9466,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9497,7 +9498,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "frame-benchmarking", @@ -9592,7 +9593,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "frame-benchmarking", @@ -9638,7 +9639,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-support", "polkadot-primitives", @@ -9652,7 +9653,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bs58", "parity-scale-codec", @@ -9664,7 +9665,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitflags", "bitvec", @@ -9709,7 +9710,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "async-trait", "frame-benchmarking-cli", @@ -9819,7 +9820,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -9840,7 +9841,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -9850,7 +9851,7 @@ dependencies = [ [[package]] name = "polkadot-test-client" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "parity-scale-codec", "polkadot-node-subsystem", @@ -9875,7 +9876,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "frame-election-provider-support", @@ -9936,7 +9937,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-benchmarking", "frame-system", @@ -10716,7 +10717,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -10803,7 +10804,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-support", "polkadot-primitives", @@ -12648,7 +12649,7 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "enumn", "parity-scale-codec", @@ -14065,7 +14066,7 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-runtime-constants" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-support", "polkadot-primitives", @@ -14456,7 +14457,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -14467,7 +14468,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "expander 2.0.0", "proc-macro-crate", @@ -15545,7 +15546,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bitvec", "frame-benchmarking", @@ -15638,7 +15639,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-support", "polkadot-primitives", @@ -16141,7 +16142,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "bounded-collections", "derivative", @@ -16157,7 +16158,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "frame-support", "frame-system", @@ -16212,7 +16213,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "environmental", "frame-benchmarking", @@ -16232,7 +16233,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#039d81563097c03935a519c5de6f3b0f8d8abc15" +source = "git+https://github.com/paritytech/polkadot?branch=master#df3e3c7ca7a61044a5c543aa87c070688f1c11f3" dependencies = [ "Inflector", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 6027e4cf31b..faec5a0288a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,3 +71,4 @@ opt-level = 3 inherits = "release" lto = true codegen-units = 1 + diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index 082fceaf14c..66329007ec0 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -75,7 +75,7 @@ pub struct PageIndexData { /// Simple type used to identify messages for the purpose of reporting events. Secure if and only /// if the message content is unique. -pub type MessageId = [u8; 32]; +pub type MessageId = XcmHash; /// Index used to identify overweight messages. pub type OverweightIndex = u64; @@ -174,23 +174,39 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Downward message is invalid XCM. - InvalidFormat { message_id: MessageId }, + InvalidFormat { message_hash: XcmHash }, /// Downward message is unsupported version of XCM. - UnsupportedVersion { message_id: MessageId }, + UnsupportedVersion { message_hash: XcmHash }, /// Downward message executed with the given outcome. - ExecutedDownward { message_id: MessageId, outcome: Outcome }, + ExecutedDownward { message_hash: XcmHash, message_id: XcmHash, outcome: Outcome }, /// The weight limit for handling downward messages was reached. - WeightExhausted { message_id: MessageId, remaining_weight: Weight, required_weight: Weight }, + WeightExhausted { + message_hash: XcmHash, + message_id: XcmHash, + remaining_weight: Weight, + required_weight: Weight, + }, /// Downward message is overweight and was placed in the overweight queue. OverweightEnqueued { - message_id: MessageId, + message_hash: XcmHash, + message_id: XcmHash, overweight_index: OverweightIndex, required_weight: Weight, }, /// Downward message from the overweight queue was executed. OverweightServiced { overweight_index: OverweightIndex, weight_used: Weight }, - /// The maximum number of downward messages was. - MaxMessagesExhausted { message_id: MessageId }, + /// The maximum number of downward messages was reached. + MaxMessagesExhausted { message_hash: XcmHash }, + } + + /// Error type when a message was failed to be serviced. + pub(crate) struct ServiceMessageError { + /// The message's hash. + message_hash: XcmHash, + /// The message's ID (which could also be its hash if nothing overrides it). + message_id: XcmHash, + /// Weight required for the message to be executed. + required_weight: Weight, } impl Pallet { @@ -250,8 +266,9 @@ pub mod pallet { limit: Weight, _sent_at: RelayBlockNumber, mut data: &[u8], - ) -> Result { - let message_id = sp_io::hashing::blake2_256(data); + ) -> Result { + let message_hash = sp_io::hashing::blake2_256(data); + let mut message_id = message_hash; let maybe_msg = VersionedXcm::::decode_all_with_depth_limit( MAX_XCM_DECODE_DEPTH, &mut data, @@ -259,21 +276,31 @@ pub mod pallet { .map(Xcm::::try_from); match maybe_msg { Err(_) => { - Self::deposit_event(Event::InvalidFormat { message_id }); + Self::deposit_event(Event::InvalidFormat { message_hash }); Ok(Weight::zero()) }, Ok(Err(())) => { - Self::deposit_event(Event::UnsupportedVersion { message_id }); + Self::deposit_event(Event::UnsupportedVersion { message_hash }); Ok(Weight::zero()) }, Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, message_id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut message_id, + limit, + Weight::zero(), + ); match outcome { - Outcome::Error(XcmError::WeightLimitReached(required)) => - Err((message_id, required)), + Outcome::Error(XcmError::WeightLimitReached(required_weight)) => + Err(ServiceMessageError { message_hash, message_id, required_weight }), outcome => { let weight_used = outcome.weight_used(); - Self::deposit_event(Event::ExecutedDownward { message_id, outcome }); + Self::deposit_event(Event::ExecutedDownward { + message_hash, + message_id, + outcome, + }); Ok(weight_used) }, } @@ -314,7 +341,7 @@ pub mod pallet { maybe_enqueue_page = Some(Vec::with_capacity(item_count_left)); Self::deposit_event(Event::MaxMessagesExhausted { - message_id: sp_io::hashing::blake2_256(&data), + message_hash: sp_io::hashing::blake2_256(&data), }); } else { // We're not currently enqueuing - try to execute inline. @@ -322,7 +349,11 @@ pub mod pallet { messages_processed += 1; match Self::try_service_message(remaining_weight, sent_at, &data[..]) { Ok(consumed) => used += consumed, - Err((message_id, required_weight)) => + Err(ServiceMessageError { + message_hash, + message_id, + required_weight, + }) => // Too much weight required right now. { let is_under_limit = @@ -334,6 +365,7 @@ pub mod pallet { let overweight_index = page_index.overweight_count; Overweight::::insert(overweight_index, (sent_at, data)); Self::deposit_event(Event::OverweightEnqueued { + message_hash, message_id, overweight_index, required_weight, @@ -348,6 +380,7 @@ pub mod pallet { let item_count_left = item_count.saturating_sub(i); maybe_enqueue_page = Some(Vec::with_capacity(item_count_left)); Self::deposit_event(Event::WeightExhausted { + message_hash, message_id, remaining_weight, required_weight, @@ -466,50 +499,36 @@ mod tests { }) } - pub enum Weightless {} - impl PreparedMessage for Weightless { + pub struct MockPrepared(Xcm); + impl PreparedMessage for MockPrepared { fn weight_of(&self) -> Weight { - unreachable!() + match ((self.0).0.len(), &(self.0).0.first()) { + (1, Some(Transact { require_weight_at_most, .. })) => *require_weight_at_most, + _ => Weight::from_parts(1, 1), + } } } pub struct MockExec; impl ExecuteXcm for MockExec { - type Prepared = Weightless; + type Prepared = MockPrepared; - fn prepare(_message: Xcm) -> Result { - unreachable!() + fn prepare(message: Xcm) -> Result { + Ok(MockPrepared(message)) } fn execute( _origin: impl Into, - _pre: Weightless, - _hash: XcmHash, - _weight_credit: Weight, - ) -> Outcome { - unreachable!() - } - - fn execute_xcm_in_credit( - _origin: impl Into, - message: Xcm, - _hash: XcmHash, - weight_limit: Weight, + prepared: MockPrepared, + _id: &mut XcmHash, _weight_credit: Weight, ) -> Outcome { + let message = prepared.0; let o = match (message.0.len(), &message.0.first()) { - (1, Some(Transact { require_weight_at_most, .. })) => { - if require_weight_at_most.all_lte(weight_limit) { - Outcome::Complete(*require_weight_at_most) - } else { - Outcome::Error(XcmError::WeightLimitReached(*require_weight_at_most)) - } - }, + (1, Some(Transact { require_weight_at_most, .. })) => + Outcome::Complete(*require_weight_at_most), // use 1000 to decide that it's not supported. - _ => Outcome::Incomplete( - Weight::from_parts(1000, 1000).min(weight_limit), - XcmError::Unimplemented, - ), + _ => Outcome::Incomplete(Weight::from_parts(1, 1), XcmError::Unimplemented), }; TRACE.with(|q| q.borrow_mut().push((message, o.clone()))); o @@ -564,13 +583,6 @@ mod tests { (msg(weight), Outcome::Complete(Weight::from_parts(weight, weight))) } - fn msg_limit_reached(weight: u64) -> (Xcm, Outcome) { - ( - msg(weight), - Outcome::Error(XcmError::WeightLimitReached(Weight::from_parts(weight, weight))), - ) - } - fn pages_queued() -> PageCounter { PageIndex::::get().end_used - PageIndex::::get().begin_used } @@ -613,10 +625,7 @@ mod tests { enqueue(&enqueued); let weight_used = handle_messages(&[], Weight::from_parts(2500, 2500)); assert_eq!(weight_used, Weight::from_parts(2001, 2001)); - assert_eq!( - take_trace(), - vec![msg_complete(1000), msg_complete(1001), msg_limit_reached(1002),] - ); + assert_eq!(take_trace(), vec![msg_complete(1000), msg_complete(1001),]); }); } @@ -631,18 +640,15 @@ mod tests { PageIndexData { begin_used: 0, end_used: 1, overweight_count: 0 } ); assert_eq!(Pages::::get(0).len(), 3); - assert_eq!(take_trace(), vec![msg_limit_reached(1000)]); + assert_eq!(take_trace(), vec![]); let weight_used = handle_messages(&[], Weight::from_parts(2500, 2500)); assert_eq!(weight_used, Weight::from_parts(2001, 2001)); - assert_eq!( - take_trace(), - vec![msg_complete(1000), msg_complete(1001), msg_limit_reached(1002),] - ); + assert_eq!(take_trace(), vec![msg_complete(1000), msg_complete(1001)]); let weight_used = handle_messages(&[], Weight::from_parts(2500, 2500)); assert_eq!(weight_used, Weight::from_parts(1002, 1002)); - assert_eq!(take_trace(), vec![msg_complete(1002),]); + assert_eq!(take_trace(), vec![msg_complete(1002)]); assert!(queue_is_empty()); }); } @@ -655,7 +661,7 @@ mod tests { assert_eq!(weight_used, Weight::from_parts(1000, 1000)); assert_eq!(pages_queued(), 1); assert_eq!(Pages::::get(0).len(), 2); - assert_eq!(take_trace(), vec![msg_complete(1000), msg_limit_reached(1001),]); + assert_eq!(take_trace(), vec![msg_complete(1000)]); let weight_used = handle_messages(&[], Weight::from_parts(2500, 2500)); assert_eq!(weight_used, Weight::from_parts(2003, 2003)); @@ -693,13 +699,13 @@ mod tests { enqueue(&enqueued); let weight_used = handle_messages(&incoming, Weight::from_parts(5000, 5000)); assert_eq!(weight_used, Weight::from_parts(1000, 1000)); - assert_eq!(take_trace(), vec![msg_complete(1000), msg_limit_reached(10001),]); + assert_eq!(take_trace(), vec![msg_complete(1000)]); assert_eq!(pages_queued(), 2); // 5000 is not enough to process the 10001 blocker, so nothing happens. let weight_used = handle_messages(&[], Weight::from_parts(5000, 5000)); assert_eq!(weight_used, Weight::zero()); - assert_eq!(take_trace(), vec![msg_limit_reached(10001),]); + assert_eq!(take_trace(), vec![]); // 20000 is now enough to process everything. let weight_used = handle_messages(&[], Weight::from_parts(20000, 20000)); @@ -720,10 +726,7 @@ mod tests { enqueue(&enqueued); let weight_used = handle_messages(&incoming, Weight::from_parts(5000, 5000)); assert_eq!(weight_used, Weight::from_parts(2001, 2001)); - assert_eq!( - take_trace(), - vec![msg_complete(1000), msg_complete(1001), msg_limit_reached(10002),] - ); + assert_eq!(take_trace(), vec![msg_complete(1000), msg_complete(1001)]); assert_eq!(pages_queued(), 1); // 20000 is now enough to process everything. @@ -744,12 +747,7 @@ mod tests { assert_eq!(weight_used, Weight::from_parts(3003, 3003)); assert_eq!( take_trace(), - vec![ - msg_complete(1000), - msg_complete(1001), - msg_complete(1002), - msg_limit_reached(10003), - ] + vec![msg_complete(1000), msg_complete(1001), msg_complete(1002),] ); assert_eq!(pages_queued(), 1); @@ -768,19 +766,19 @@ mod tests { enqueue(&enqueued); let weight_used = handle_messages(&[msg(1002)], Weight::from_parts(1500, 1500)); assert_eq!(weight_used, Weight::from_parts(1000, 1000)); - assert_eq!(take_trace(), vec![msg_complete(1000), msg_limit_reached(1001),]); + assert_eq!(take_trace(), vec![msg_complete(1000)]); assert_eq!(pages_queued(), 2); assert_eq!(PageIndex::::get().begin_used, 0); let weight_used = handle_messages(&[msg(1003)], Weight::from_parts(1500, 1500)); assert_eq!(weight_used, Weight::from_parts(1001, 1001)); - assert_eq!(take_trace(), vec![msg_complete(1001), msg_limit_reached(1002),]); + assert_eq!(take_trace(), vec![msg_complete(1001)]); assert_eq!(pages_queued(), 2); assert_eq!(PageIndex::::get().begin_used, 1); let weight_used = handle_messages(&[msg(1004)], Weight::from_parts(1500, 1500)); assert_eq!(weight_used, Weight::from_parts(1002, 1002)); - assert_eq!(take_trace(), vec![msg_complete(1002), msg_limit_reached(1003),]); + assert_eq!(take_trace(), vec![msg_complete(1002)]); assert_eq!(pages_queued(), 2); assert_eq!(PageIndex::::get().begin_used, 2); }); @@ -798,10 +796,7 @@ mod tests { let weight_used = handle_messages(&incoming, Weight::from_parts(2500, 2500)); assert_eq!(weight_used, Weight::from_parts(2002, 2002)); assert!(queue_is_empty()); - assert_eq!( - take_trace(), - vec![msg_complete(1000), msg_limit_reached(10001), msg_complete(1002),] - ); + assert_eq!(take_trace(), vec![msg_complete(1000), msg_complete(1002),]); assert_eq!(overweights(), vec![0]); }); @@ -818,7 +813,7 @@ mod tests { let incoming = vec![msg(10000)]; let weight_used = handle_messages(&incoming, Weight::from_parts(2500, 2500)); assert_eq!(weight_used, Weight::zero()); - assert_eq!(take_trace(), vec![msg_limit_reached(10000)]); + assert_eq!(take_trace(), vec![]); assert_eq!(overweights(), vec![0]); assert_noop!( @@ -845,7 +840,7 @@ mod tests { ), Error::::OverLimit ); - assert_eq!(take_trace(), vec![msg_limit_reached(10000)]); + assert_eq!(take_trace(), vec![]); let base_weight = super::Call::::service_overweight { index: 0, weight_limit: Weight::zero() } @@ -891,7 +886,6 @@ mod tests { msg_complete(1002), msg_complete(1003), msg_complete(1004), - msg_limit_reached(1005), ] ); assert_eq!(pages_queued(), 1); diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index 0dc76aa80a1..93c9100f520 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -282,15 +282,15 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Some XCM was executed ok. - Success { message_hash: Option, weight: Weight }, + Success { message_hash: XcmHash, message_id: XcmHash, weight: Weight }, /// Some XCM failed. - Fail { message_hash: Option, error: XcmError, weight: Weight }, + Fail { message_hash: XcmHash, message_id: XcmHash, error: XcmError, weight: Weight }, /// Bad XCM version used. - BadVersion { message_hash: Option }, + BadVersion { message_hash: XcmHash }, /// Bad XCM format used. - BadFormat { message_hash: Option }, + BadFormat { message_hash: XcmHash }, /// An HRMP message was sent to a sibling parachain. - XcmpMessageSent { message_hash: Option }, + XcmpMessageSent { message_hash: XcmHash }, /// An XCM exceeded the individual message weight budget. OverweightEnqueued { sender: ParaId, @@ -619,27 +619,33 @@ impl Pallet { xcm: VersionedXcm, max_weight: Weight, ) -> Result { - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - log::debug!("Processing XCMP-XCM: {:?}", &hash); + let message_hash = xcm.using_encoded(sp_io::hashing::blake2_256); + log::debug!("Processing XCMP-XCM: {:?}", &message_hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = (Parent, Parachain(sender.into())); - - match T::XcmExecutor::execute_xcm(location, xcm, hash, max_weight) { - Outcome::Error(e) => ( - Err(e), - Event::Fail { message_hash: Some(hash), error: e, weight: Weight::zero() }, + let mut message_id = message_hash; + + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut message_id, + max_weight, + Weight::zero(), + ) { + Outcome::Error(error) => ( + Err(error), + Event::Fail { message_hash, message_id, error, weight: Weight::zero() }, ), - Outcome::Complete(w) => - (Ok(w), Event::Success { message_hash: Some(hash), weight: w }), + Outcome::Complete(weight) => + (Ok(weight), Event::Success { message_hash, message_id, weight }), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => - (Ok(w), Event::Fail { message_hash: Some(hash), error: e, weight: w }), + Outcome::Incomplete(weight, error) => + (Ok(weight), Event::Fail { message_hash, message_id, error, weight }), } }, - Err(()) => - (Err(XcmError::UnhandledXcmVersion), Event::BadVersion { message_hash: Some(hash) }), + Err(()) => (Err(XcmError::UnhandledXcmVersion), Event::BadVersion { message_hash }), }; Self::deposit_event(event); result @@ -1183,7 +1189,7 @@ impl SendXcm for Pallet { match Self::send_fragment(id, XcmpMessageFormat::ConcatenatedVersionedXcm, xcm) { Ok(_) => { - Self::deposit_event(Event::XcmpMessageSent { message_hash: Some(hash) }); + Self::deposit_event(Event::XcmpMessageSent { message_hash: hash }); Ok(hash) }, Err(e) => Err(SendError::Transport(<&'static str>::from(e))), diff --git a/parachain-template/runtime/src/xcm_config.rs b/parachain-template/runtime/src/xcm_config.rs index 775455cc622..9eea16068d0 100644 --- a/parachain-template/runtime/src/xcm_config.rs +++ b/parachain-template/runtime/src/xcm_config.rs @@ -2,10 +2,9 @@ use super::{ AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; -use core::{marker::PhantomData, ops::ControlFlow}; use frame_support::{ - log, match_types, parameter_types, - traits::{ConstU32, Everything, Nothing, ProcessMessageError}, + match_types, parameter_types, + traits::{ConstU32, Everything, Nothing}, weights::Weight, }; use frame_system::EnsureRoot; @@ -15,12 +14,13 @@ use polkadot_runtime_common::impls::ToAuthor; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, - CreateMatcher, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, MatchXcm, - NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WithComputedOrigin, + CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, + FixedWeightBounds, IsConcrete, NativeAsset, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, + UsingComponents, WithComputedOrigin, WithUniqueTopic, }; -use xcm_executor::{traits::ShouldExecute, XcmExecutor}; +use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); @@ -90,88 +90,22 @@ match_types! { }; } -//TODO: move DenyThenTry to polkadot's xcm module. -/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) -where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry -where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut [Instruction], - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ProcessMessageError> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - -// See issue -pub struct DenyReserveTransferToRelayChain; -impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( - origin: &MultiLocation, - message: &mut [Instruction], - _max_weight: Weight, - _weight_credit: &mut Weight, - ) -> Result<(), ProcessMessageError> { - message.matcher().match_next_inst_while( - |_| true, - |inst| match inst { - InitiateReserveWithdraw { - reserve: MultiLocation { parents: 1, interior: Here }, - .. - } | - DepositReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, .. - } | - TransferReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, .. - } => { - Err(ProcessMessageError::Unsupported) // Deny - }, - // An unexpected reserve transfer has arrived from the Relay Chain. Generally, - // `IsReserve` should not allow this, but we just log it here. - ReserveAssetDeposited { .. } - if matches!(origin, MultiLocation { parents: 1, interior: Here }) => - { - log::warn!( - target: "xcm::barrier", - "Unexpected ReserveAssetDeposited from the Relay Chain", - ); - Ok(ControlFlow::Continue(())) - }, - _ => Ok(ControlFlow::Continue(())), - }, - )?; - - // Permit everything else - Ok(()) - } -} - -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - TakeWeightCredit, - WithComputedOrigin< - ( - AllowTopLevelPaidExecutionFrom, - AllowExplicitUnpaidExecutionFrom, - // ^^^ Parent and its exec plurality get free execution - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + WithComputedOrigin< + ( + AllowTopLevelPaidExecutionFrom, + AllowExplicitUnpaidExecutionFrom, + // ^^^ Parent and its exec plurality get free execution + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; pub struct XcmConfig; @@ -208,12 +142,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/parachains/common/src/xcm_config.rs b/parachains/common/src/xcm_config.rs index 61e6f389e6d..529822cff16 100644 --- a/parachains/common/src/xcm_config.rs +++ b/parachains/common/src/xcm_config.rs @@ -1,86 +1,12 @@ use crate::impls::AccountIdOf; -use core::{marker::PhantomData, ops::ControlFlow}; +use core::marker::PhantomData; use frame_support::{ log, - traits::{ - fungibles::Inspect, tokens::ConversionToAssetBalance, ContainsPair, ProcessMessageError, - }, + traits::{fungibles::Inspect, tokens::ConversionToAssetBalance, ContainsPair}, weights::Weight, }; use sp_runtime::traits::Get; use xcm::latest::prelude::*; -use xcm_builder::{CreateMatcher, MatchXcm}; -use xcm_executor::traits::ShouldExecute; - -//TODO: move DenyThenTry to polkadot's xcm module. -/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) -where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry -where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut [Instruction], - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ProcessMessageError> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - -// See issue -pub struct DenyReserveTransferToRelayChain; -impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( - origin: &MultiLocation, - message: &mut [Instruction], - _max_weight: Weight, - _weight_credit: &mut Weight, - ) -> Result<(), ProcessMessageError> { - message.matcher().match_next_inst_while( - |_| true, - |inst| match inst { - InitiateReserveWithdraw { - reserve: MultiLocation { parents: 1, interior: Here }, - .. - } | - DepositReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, .. - } | - TransferReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, .. - } => { - Err(ProcessMessageError::Unsupported) // Deny - }, - - // An unexpected reserve transfer has arrived from the Relay Chain. Generally, - // `IsReserve` should not allow this, but we just log it here. - ReserveAssetDeposited { .. } - if matches!(origin, MultiLocation { parents: 1, interior: Here }) => - { - log::warn!( - target: "xcm::barrier", - "Unexpected ReserveAssetDeposited from the Relay Chain", - ); - Ok(ControlFlow::Continue(())) - }, - - _ => Ok(ControlFlow::Continue(())), - }, - )?; - - // Permit everything else - Ok(()) - } -} /// A `ChargeFeeInFungibles` implementation that converts the output of /// a given WeightToFee implementation an amount charged in diff --git a/parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs index 2139e0324b9..bbf272572ac 100644 --- a/parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs @@ -32,7 +32,7 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { assert_expected_events!( Kusama, vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted(Outcome::Complete(weight))) => { + RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) }) => { weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(754_244_000, 0), *weight), }, ] diff --git a/parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs b/parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs index 389f1a365ea..cbb07e4592e 100644 --- a/parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs +++ b/parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs @@ -32,7 +32,9 @@ fn teleport_native_assets_from_relay_to_assets_para() { assert_expected_events!( Kusama, vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted(Outcome::Complete { .. })) => {}, + RuntimeEvent::XcmPallet( + pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } } + ) => {}, ] ); }); diff --git a/parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs index 55d201c5608..b69222670b1 100644 --- a/parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs @@ -32,7 +32,7 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { assert_expected_events!( Polkadot, vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted(Outcome::Complete(weight))) => { + RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) }) => { weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(2_000_000_000, 0), *weight), }, ] diff --git a/parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs b/parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs index ed13d297d4e..19aa5fe1f9e 100644 --- a/parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs +++ b/parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs @@ -32,7 +32,7 @@ fn teleport_native_assets_from_relay_to_assets_para() { assert_expected_events!( Polkadot, vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted(Outcome::Complete { .. })) => {}, + RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } }) => {}, ] ); }); diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index 788a0ec5616..0ef469d2b31 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -27,22 +27,18 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ - AssetFeeAsExistentialDepositMultiplier, DenyReserveTransferToRelayChain, DenyThenTry, - }, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; use polkadot_parachain::primitives::Sibling; use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WeightInfoBounds, WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, + LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, + UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -341,26 +337,28 @@ impl Contains for SafeCallFilter { } } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - // Allow XCMs with some computed origins to pass through. - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + // Allow XCMs with some computed origins to pass through. + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Parent and its pluralities (i.e. governance bodies) get free execution. + AllowExplicitUnpaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; pub type AssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier< @@ -429,12 +427,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index c045b39286f..ba2862742c1 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -27,22 +27,18 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ - AssetFeeAsExistentialDepositMultiplier, DenyReserveTransferToRelayChain, DenyThenTry, - }, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; use polkadot_parachain::primitives::Sibling; use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WeightInfoBounds, WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, + LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, + WeightInfoBounds, WithComputedOrigin, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index 92aad0fbbe3..33c8e487054 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -28,22 +28,18 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ - AssetFeeAsExistentialDepositMultiplier, DenyReserveTransferToRelayChain, DenyThenTry, - }, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; use polkadot_parachain::primitives::Sibling; use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WeightInfoBounds, WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, + LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, + UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -342,26 +338,28 @@ impl Contains for SafeCallFilter { } } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - // Allow XCMs with some computed origins to pass through. - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + // Allow XCMs with some computed origins to pass through. + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Parent and its pluralities (i.e. governance bodies) get free execution. + AllowExplicitUnpaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; pub type AssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier< @@ -429,12 +427,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 5957b2ebbae..6f9c1542423 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -24,19 +24,16 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry}, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; use polkadot_parachain::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, IsConcrete, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -154,26 +151,28 @@ impl Contains for SafeCallFilter { } } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - // Allow local users to buy weight credit. - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + // Allow local users to buy weight credit. + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Parent and its pluralities (i.e. governance bodies) get free execution. + AllowExplicitUnpaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; pub struct XcmConfig; @@ -217,12 +216,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 7b34b5e135b..e2bf2dd4a95 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -24,19 +24,16 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry}, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; use polkadot_parachain::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, IsConcrete, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 1a5bb335964..a08f2f7c426 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -30,20 +30,18 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry}, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; use polkadot_parachain::primitives::Sibling; use sp_core::Get; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - CurrencyAdapter, EnsureXcmOrigin, IsConcrete, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WeightInfoBounds, WithComputedOrigin, + CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, IsConcrete, + ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, + WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{ traits::{ExportXcm, WithOriginFilter}, @@ -197,29 +195,31 @@ impl Contains for SafeCallFilter { } } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - // Allow local users to buy weight credit. - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - // TODO:check-parameter - (https://github.com/paritytech/parity-bridges-common/issues/2084) - // remove this and extend `AllowExplicitUnpaidExecutionFrom` with "or SystemParachains" once merged https://github.com/paritytech/polkadot/pull/7005 - AllowUnpaidExecutionFrom, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + // Allow local users to buy weight credit. + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Parent and its pluralities (i.e. governance bodies) get free execution. + AllowExplicitUnpaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + // TODO:check-parameter - (https://github.com/paritytech/parity-bridges-common/issues/2084) + // remove this and extend `AllowExplicitUnpaidExecutionFrom` with "or SystemParachains" once merged https://github.com/paritytech/polkadot/pull/7005 + AllowUnpaidExecutionFrom, + ), + >, >; pub struct XcmConfig; @@ -263,12 +263,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml b/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml index d9410a1abf0..ade734b6ce2 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml @@ -8,6 +8,7 @@ description = "Utils for BridgeHub testing" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } log = { version = "0.4.17", default-features = false } +assert_matches = "1.4.0" # Substrate frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } diff --git a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs index 7d26b266dc2..14792067e43 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs +++ b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs @@ -16,6 +16,7 @@ //! Module contains predefined test-case scenarios for `Runtime` with bridging capabilities. +use assert_matches::assert_matches; use bp_messages::{ target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch, SourceHeaderChain}, LaneId, MessageKey, OutboundLaneData, Weight, @@ -462,7 +463,7 @@ pub fn relayed_incoming_message_works::ClearOrigin; 42]; - let expected_dispatch = xcm::VersionedXcm::<()>::V3(xcm.clone().into()); + let expected_dispatch = xcm::latest::Xcm::<()>(xcm.clone()); // generate bridged relay chain finality, parachain heads and message proofs, // to be submitted by relayer to this chain. let ( @@ -559,6 +560,9 @@ pub fn relayed_incoming_message_works::try_from(dispatched).unwrap(); + // We use `WithUniqueTopic`, so expect a trailing `SetTopic`. + assert_matches!(dispatched.0.pop(), Some(SetTopic(..))); assert_eq!(dispatched, expected_dispatch); }) } @@ -667,8 +671,8 @@ pub fn complex_relay_extrinsic_works::ClearOrigin; 42]; - let expected_dispatch = xcm::VersionedXcm::<()>::V3(xcm.clone().into()); + let xcm = vec![xcm::latest::Instruction::<()>::ClearOrigin; 42]; + let expected_dispatch = xcm::latest::Xcm::<()>(xcm.clone()); // generate bridged relay chain finality, parachain heads and message proofs, // to be submitted by relayer to this chain. let ( @@ -776,6 +780,9 @@ pub fn complex_relay_extrinsic_works::try_from(dispatched).unwrap(); + // We use `WithUniqueTopic`, so expect a trailing `SetTopic`. + assert_matches!(dispatched.0.pop(), Some(SetTopic(..))); assert_eq!(dispatched, expected_dispatch); }) } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index 3311b819c8f..c8571ebc6f2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -24,19 +24,17 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use parachains_common::{ - impls::ToStakingPot, - xcm_config::{ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry}, -}; +use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; use polkadot_parachain::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, IsConcrete, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, + OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, + WithComputedOrigin, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; diff --git a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index e79d06b1aa1..2f39cc6536d 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -24,16 +24,16 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; -use parachains_common::xcm_config::{DenyReserveTransferToRelayChain, DenyThenTry}; use polkadot_parachain::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, + NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, + WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::XcmExecutor; @@ -118,26 +118,28 @@ match_types! { }; } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - // Allow XCMs with some computed origins to pass through. - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + // Allow XCMs with some computed origins to pass through. + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Parent and its pluralities (i.e. governance bodies) get free execution. + AllowExplicitUnpaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; pub struct XcmConfig; @@ -173,12 +175,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/parachains/runtimes/test-utils/src/lib.rs b/parachains/runtimes/test-utils/src/lib.rs index 7a59650db51..8ff85438b3f 100644 --- a/parachains/runtimes/test-utils/src/lib.rs +++ b/parachains/runtimes/test-utils/src/lib.rs @@ -258,7 +258,7 @@ impl RuntimeHelper { &to, // We aren't able to track the XCM that initiated the fee deposit, so we create a // fake message hash here - &XcmContext::with_message_hash([0; 32]), + &XcmContext::with_message_id([0; 32]), ) } } @@ -344,7 +344,7 @@ impl RuntimeHelper .into_iter() .filter_map(|e| unwrap_pallet_xcm_event(e.event.encode())) .find_map(|e| match e { - pallet_xcm::Event::Attempted(outcome) => Some(outcome), + pallet_xcm::Event::Attempted { outcome } => Some(outcome), _ => None, }) .expect("No `pallet_xcm::Event::Attempted(outcome)` event found!"); @@ -363,7 +363,8 @@ impl RuntimeH .into_iter() .filter_map(|e| unwrap_xcmp_queue_event(e.event.encode())) .find_map(|e| match e { - cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { message_hash } => message_hash, + cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { message_hash } => + Some(message_hash), _ => None, }) } diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index 26beb474169..d005cc664a3 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -38,7 +38,6 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_asset_tx_payment::HandleCredit; use pallet_xcm::XcmPassthrough; -use parachains_common::xcm_config::{DenyReserveTransferToRelayChain, DenyThenTry}; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use sp_runtime::traits::Zero; @@ -46,11 +45,11 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, - IsConcrete, LocalMint, NativeAsset, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, - WithComputedOrigin, + ConvertedConcreteId, CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, + EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::JustTry, XcmExecutor}; @@ -150,29 +149,31 @@ match_types! { }; } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - // Allow XCMs with some computed origins to pass through. - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Common Good Assets parachain, parent and its exec plurality get free execution - AllowExplicitUnpaidExecutionFrom<( - CommonGoodAssetsParachain, - ParentOrParentsExecutivePlurality, - )>, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + // Allow XCMs with some computed origins to pass through. + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Common Good Assets parachain, parent and its exec plurality get free execution + AllowExplicitUnpaidExecutionFrom<( + CommonGoodAssetsParachain, + ParentOrParentsExecutivePlurality, + )>, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; /// Type alias to conveniently refer to `frame_system`'s `Config::AccountId`. @@ -299,12 +300,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/primitives/utility/src/lib.rs b/primitives/utility/src/lib.rs index 81a83fd070b..f2488b83a51 100644 --- a/primitives/utility/src/lib.rs +++ b/primitives/utility/src/lib.rs @@ -288,7 +288,7 @@ impl< &(X1(AccountId32 { network: None, id: receiver.into() }).into()), // We aren't able to track the XCM that initiated the fee deposit, so we create a // fake message hash here - &XcmContext::with_message_hash([0; 32]), + &XcmContext::with_message_id([0; 32]), ) .is_ok();