diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2af58bb98f9..d855812c0b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 - CI_IMAGE: "paritytech/ci-linux@sha256:7c76c3f9639f919447abbf9db535588178fde4df583d6926444d44cc20c094e6" # staging 2023-03-20 + CI_IMAGE: "paritytech/ci-linux:production" DOCKER_OS: "debian:stretch" ARCH: "x86_64" ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.40" diff --git a/Cargo.lock b/Cargo.lock index d2a9576e696..a6fa60d14c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -334,26 +334,42 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" name = "asset-test-utils" version = "1.0.0" dependencies = [ + "assets-common", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", "frame-support", "frame-system", "hex-literal", + "pallet-assets", "pallet-balances", "pallet-collator-selection", "pallet-session", + "pallet-xcm", + "parachain-info", "parachains-common", + "parity-scale-codec", + "polkadot-parachain", "sp-consensus-aura", "sp-core", "sp-io", "sp-runtime", "sp-std", "substrate-wasm-builder", + "xcm", + "xcm-executor", ] [[package]] name = "assets-common" version = "0.1.0" dependencies = [ + "cumulus-primitives-core", "frame-support", + "log", + "pallet-xcm", "parachains-common", "parity-scale-codec", "sp-api", @@ -513,7 +529,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "hash-db", "log", @@ -3315,7 +3331,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", ] @@ -3338,7 +3354,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-support-procedural", @@ -3363,7 +3379,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "Inflector", "array-bytes 4.2.0", @@ -3410,7 +3426,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3421,7 +3437,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3438,7 +3454,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -3467,7 +3483,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "log", @@ -3483,7 +3499,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "bitflags 1.3.2", "environmental", @@ -3516,7 +3532,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "Inflector", "cfg-expr", @@ -3531,7 +3547,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -3543,7 +3559,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro2", "quote", @@ -3553,7 +3569,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "log", @@ -3571,7 +3587,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -3586,7 +3602,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "sp-api", @@ -3595,7 +3611,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "parity-scale-codec", @@ -4558,7 +4574,7 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kusama-runtime" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "frame-benchmarking", @@ -4656,7 +4672,7 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-support", "polkadot-primitives", @@ -5498,7 +5514,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "log", @@ -5517,7 +5533,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "anyhow", "jsonrpsee", @@ -6006,7 +6022,7 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "frame-benchmarking", @@ -6027,7 +6043,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6045,7 +6061,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6060,7 +6076,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6076,7 +6092,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6092,7 +6108,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6106,7 +6122,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6130,7 +6146,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6150,7 +6166,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6165,7 +6181,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6184,7 +6200,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "binary-merkle-tree", @@ -6208,7 +6224,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6226,7 +6242,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6270,7 +6286,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6287,7 +6303,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "bitflags 1.3.2", "environmental", @@ -6317,7 +6333,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -6330,7 +6346,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro2", "quote", @@ -6340,7 +6356,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6357,7 +6373,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6375,7 +6391,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6398,7 +6414,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6411,7 +6427,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6429,7 +6445,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6447,7 +6463,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6470,7 +6486,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6486,7 +6502,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6506,7 +6522,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6523,7 +6539,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6537,7 +6553,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6554,7 +6570,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6571,7 +6587,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6587,7 +6603,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6605,7 +6621,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "pallet-nfts", @@ -6616,7 +6632,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6632,7 +6648,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6649,7 +6665,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6669,7 +6685,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -6680,7 +6696,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6697,7 +6713,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6721,7 +6737,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6738,7 +6754,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6753,7 +6769,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6771,7 +6787,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6786,7 +6802,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6805,7 +6821,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6822,7 +6838,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6843,7 +6859,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6859,7 +6875,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6873,7 +6889,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6896,7 +6912,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6907,7 +6923,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "log", "sp-arithmetic", @@ -6916,7 +6932,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "sp-api", @@ -6925,7 +6941,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6942,7 +6958,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -6971,7 +6987,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6989,7 +7005,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7008,7 +7024,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-support", "frame-system", @@ -7024,7 +7040,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -7040,7 +7056,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -7052,7 +7068,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7069,7 +7085,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7084,7 +7100,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7100,7 +7116,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7115,7 +7131,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7130,7 +7146,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -7151,7 +7167,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7693,7 +7709,7 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "polkadot-node-metrics", @@ -7708,7 +7724,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -7722,7 +7738,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "derive_more", "fatality", @@ -7745,7 +7761,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "fatality", "futures", @@ -7766,7 +7782,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "clap 4.1.11", "frame-benchmarking-cli", @@ -7794,7 +7810,7 @@ dependencies = [ [[package]] name = "polkadot-client" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "frame-benchmarking", @@ -7837,7 +7853,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "always-assert", "bitvec", @@ -7859,7 +7875,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "parity-scale-codec", "scale-info", @@ -7871,7 +7887,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "derive_more", "fatality", @@ -7896,7 +7912,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -7910,7 +7926,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "futures-timer", @@ -7930,7 +7946,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "always-assert", "async-trait", @@ -7953,7 +7969,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "parity-scale-codec", @@ -7971,7 +7987,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "derive_more", @@ -8000,7 +8016,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "futures", @@ -8021,7 +8037,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "fatality", @@ -8040,7 +8056,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "polkadot-node-subsystem", @@ -8055,7 +8071,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "futures", @@ -8075,7 +8091,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "polkadot-node-metrics", @@ -8090,7 +8106,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "futures-timer", @@ -8107,7 +8123,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "fatality", "futures", @@ -8126,7 +8142,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "futures", @@ -8143,7 +8159,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "fatality", @@ -8161,7 +8177,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "always-assert", "assert_matches", @@ -8197,7 +8213,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "polkadot-node-primitives", @@ -8213,7 +8229,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "futures", "lru 0.9.0", @@ -8228,7 +8244,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "lazy_static", "log", @@ -8246,7 +8262,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bs58", "futures", @@ -8265,7 +8281,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "derive_more", @@ -8287,7 +8303,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bounded-vec", "futures", @@ -8310,7 +8326,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -8320,7 +8336,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "futures", @@ -8338,7 +8354,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "derive_more", @@ -8361,7 +8377,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "derive_more", @@ -8394,7 +8410,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "futures", @@ -8417,7 +8433,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bounded-collections", "derive_more", @@ -8514,7 +8530,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -8530,7 +8546,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "hex-literal", @@ -8556,7 +8572,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -8588,7 +8604,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "frame-benchmarking", @@ -8682,7 +8698,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "frame-benchmarking", @@ -8728,7 +8744,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-support", "polkadot-primitives", @@ -8742,7 +8758,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bs58", "parity-scale-codec", @@ -8754,7 +8770,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -8798,7 +8814,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "async-trait", "frame-benchmarking-cli", @@ -8908,7 +8924,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -8929,7 +8945,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -8939,7 +8955,7 @@ dependencies = [ [[package]] name = "polkadot-test-client" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "parity-scale-codec", "polkadot-node-subsystem", @@ -8964,7 +8980,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "frame-election-provider-support", @@ -9025,7 +9041,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-benchmarking", "frame-system", @@ -9761,7 +9777,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -9847,7 +9863,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-support", "polkadot-primitives", @@ -10080,7 +10096,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "log", "sp-core", @@ -10091,7 +10107,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -10119,7 +10135,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "futures-timer", @@ -10142,7 +10158,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -10157,7 +10173,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -10176,7 +10192,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10187,7 +10203,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "chrono", @@ -10227,7 +10243,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "fnv", "futures", @@ -10253,7 +10269,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "hash-db", "kvdb", @@ -10279,7 +10295,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -10304,7 +10320,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -10333,7 +10349,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "fork-tree", @@ -10372,7 +10388,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "jsonrpsee", @@ -10394,7 +10410,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10429,7 +10445,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "jsonrpsee", @@ -10448,7 +10464,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "fork-tree", "parity-scale-codec", @@ -10461,7 +10477,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ahash 0.8.2", "array-bytes 4.2.0", @@ -10501,7 +10517,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "finality-grandpa", "futures", @@ -10521,7 +10537,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -10544,7 +10560,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "lru 0.8.1", "parity-scale-codec", @@ -10568,7 +10584,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -10581,7 +10597,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "log", "sc-allocator", @@ -10594,7 +10610,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "anyhow", "cfg-if", @@ -10612,7 +10628,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ansi_term", "futures", @@ -10628,7 +10644,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10643,7 +10659,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -10687,7 +10703,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "cid", "futures", @@ -10707,7 +10723,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10735,7 +10751,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ahash 0.8.2", "futures", @@ -10754,7 +10770,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10776,7 +10792,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10810,7 +10826,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10830,7 +10846,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "bytes", @@ -10861,7 +10877,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "libp2p", @@ -10874,7 +10890,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10883,7 +10899,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "jsonrpsee", @@ -10913,7 +10929,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10932,7 +10948,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "http", "jsonrpsee", @@ -10947,7 +10963,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10973,7 +10989,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "directories", @@ -11039,7 +11055,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "log", "parity-scale-codec", @@ -11050,7 +11066,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "clap 4.1.11", "fs4", @@ -11066,7 +11082,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11085,7 +11101,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "libc", @@ -11104,7 +11120,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "chrono", "futures", @@ -11123,7 +11139,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ansi_term", "atty", @@ -11154,7 +11170,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11165,7 +11181,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -11192,7 +11208,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -11206,7 +11222,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-channel", "futures", @@ -11687,7 +11703,7 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "enumn", "parity-scale-codec", @@ -11764,7 +11780,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "hash-db", "log", @@ -11782,7 +11798,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "Inflector", "blake2", @@ -11796,7 +11812,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -11809,7 +11825,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "integer-sqrt", "num-traits", @@ -11823,7 +11839,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -11836,7 +11852,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "sp-api", @@ -11848,7 +11864,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "log", @@ -11866,7 +11882,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures", @@ -11881,7 +11897,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "parity-scale-codec", @@ -11899,7 +11915,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "merlin", @@ -11922,7 +11938,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "lazy_static", "parity-scale-codec", @@ -11941,7 +11957,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "finality-grandpa", "log", @@ -11959,7 +11975,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -11971,7 +11987,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -11984,7 +12000,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "base58", @@ -12027,7 +12043,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "blake2b_simd", "byteorder", @@ -12041,7 +12057,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro2", "quote", @@ -12052,7 +12068,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -12061,7 +12077,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro2", "quote", @@ -12071,7 +12087,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "environmental", "parity-scale-codec", @@ -12082,7 +12098,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -12097,7 +12113,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "bytes", "ed25519", @@ -12122,7 +12138,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "lazy_static", "sp-core", @@ -12133,7 +12149,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "merlin", @@ -12149,7 +12165,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "thiserror", "zstd", @@ -12158,7 +12174,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -12176,7 +12192,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -12190,7 +12206,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "sp-api", "sp-core", @@ -12200,7 +12216,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "backtrace", "lazy_static", @@ -12210,7 +12226,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "rustc-hash", "serde", @@ -12220,7 +12236,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "either", "hash256-std-hasher", @@ -12242,7 +12258,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -12260,7 +12276,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "Inflector", "proc-macro-crate", @@ -12272,7 +12288,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "serde", "serde_json", @@ -12281,7 +12297,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -12295,7 +12311,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -12307,7 +12323,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "hash-db", "log", @@ -12327,12 +12343,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12345,7 +12361,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "futures-timer", @@ -12360,7 +12376,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "sp-std", @@ -12372,7 +12388,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "sp-api", "sp-runtime", @@ -12381,7 +12397,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "log", @@ -12397,7 +12413,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ahash 0.8.2", "hash-db", @@ -12420,7 +12436,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12437,7 +12453,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -12448,7 +12464,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -12462,7 +12478,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "parity-scale-codec", "scale-info", @@ -12786,7 +12802,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "platforms", ] @@ -12794,7 +12810,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -12813,7 +12829,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "hyper", "log", @@ -12825,7 +12841,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "jsonrpsee", @@ -12838,7 +12854,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "jsonrpsee", "log", @@ -12857,7 +12873,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -12883,7 +12899,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "futures", "substrate-test-utils-derive", @@ -12893,7 +12909,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12904,7 +12920,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "ansi_term", "build-helper", @@ -13020,7 +13036,7 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-runtime-constants" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-support", "polkadot-primitives", @@ -13411,7 +13427,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -13422,7 +13438,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -13552,7 +13568,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a14236059c2d3da052fb08295082341aa7b87240" +source = "git+https://github.com/paritytech/substrate?branch=master#a9e85ae50d0efbf66f9a715af3b31bf37b884a6e" dependencies = [ "async-trait", "clap 4.1.11", @@ -14480,7 +14496,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bitvec", "frame-benchmarking", @@ -14572,7 +14588,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-support", "polkadot-primitives", @@ -15008,7 +15024,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "bounded-collections", "derivative", @@ -15024,7 +15040,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "frame-support", "frame-system", @@ -15045,7 +15061,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "environmental", "frame-benchmarking", @@ -15065,7 +15081,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?branch=master#e6893165ec49cbaf6b6073a494491af83323815d" +source = "git+https://github.com/paritytech/polkadot?branch=master#d8e6ca5e27aa5e0836853898bcce124648b3850e" dependencies = [ "Inflector", "proc-macro2", diff --git a/file_header.txt b/file_header.txt index 95c7d94c8f3..04f0c5de271 100644 --- a/file_header.txt +++ b/file_header.txt @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachain-template/runtime/src/xcm_config.rs b/parachain-template/runtime/src/xcm_config.rs index 8383e096a7d..b82be7aebf0 100644 --- a/parachain-template/runtime/src/xcm_config.rs +++ b/parachain-template/runtime/src/xcm_config.rs @@ -8,6 +8,7 @@ use frame_support::{ traits::{ConstU32, Everything, Nothing}, weights::Weight, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; @@ -246,6 +247,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/common/src/impls.rs b/parachains/common/src/impls.rs index 40387617bcd..cc89a248e2e 100644 --- a/parachains/common/src/impls.rs +++ b/parachains/common/src/impls.rs @@ -95,6 +95,18 @@ where } } +/// Allow checking in assets that exists. +pub struct AssetExists(PhantomData<(AccountId, Assets)>); +impl Contains<>::AssetId> + for AssetExists +where + Assets: fungibles::Inspect, +{ + fn contains(id: &>::AssetId) -> bool { + Assets::asset_exists(*id) + } +} + /// Asset filter that allows all assets from a certain location. pub struct AssetsFrom(PhantomData); impl> ContainsPair for AssetsFrom { diff --git a/parachains/runtimes/assets/common/Cargo.toml b/parachains/runtimes/assets/common/Cargo.toml index c551a97757b..7a795057cd5 100644 --- a/parachains/runtimes/assets/common/Cargo.toml +++ b/parachains/runtimes/assets/common/Cargo.toml @@ -7,6 +7,7 @@ description = "Assets common utilities" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +log = { version = "0.4.17", default-features = false } # Substrate frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -14,12 +15,14 @@ sp-api = { git = "https://github.com/paritytech/substrate", default-features = f sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } # Cumulus parachains-common = { path = "../../../common", default-features = false } +cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -28,11 +31,20 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran default = [ "std" ] std = [ "codec/std", + "log/std", "frame-support/std", "parachains-common/std", + "cumulus-primitives-core/std", "sp-api/std", "sp-std/std", + "pallet-xcm/std", "xcm/std", "xcm-builder/std", "xcm-executor/std", ] + +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", +] diff --git a/parachains/runtimes/assets/common/src/foreign_creators.rs b/parachains/runtimes/assets/common/src/foreign_creators.rs new file mode 100644 index 00000000000..3d7567409f6 --- /dev/null +++ b/parachains/runtimes/assets/common/src/foreign_creators.rs @@ -0,0 +1,56 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use frame_support::traits::{ + ContainsPair, EnsureOrigin, EnsureOriginWithArg, Everything, OriginTrait, +}; +use pallet_xcm::{EnsureXcm, Origin as XcmOrigin}; +use xcm::latest::MultiLocation; +use xcm_executor::traits::Convert; + +// `EnsureOriginWithArg` impl for `CreateOrigin` that allows only XCM origins that are locations +// containing the class location. +pub struct ForeignCreators( + sp_std::marker::PhantomData<(IsForeign, AccountOf, AccountId)>, +); +impl< + IsForeign: ContainsPair, + AccountOf: Convert, + AccountId: Clone, + RuntimeOrigin: From + OriginTrait + Clone, + > EnsureOriginWithArg + for ForeignCreators +where + RuntimeOrigin::PalletsOrigin: + From + TryInto, +{ + type Success = AccountId; + + fn try_origin( + origin: RuntimeOrigin, + asset_location: &MultiLocation, + ) -> sp_std::result::Result { + let origin_location = EnsureXcm::::try_origin(origin.clone())?; + if !IsForeign::contains(&asset_location, &origin_location) { + return Err(origin) + } + AccountOf::convert(origin_location).map_err(|_| origin) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin(a: &MultiLocation) -> Result { + Ok(pallet_xcm::Origin::Xcm(a.clone()).into()) + } +} diff --git a/parachains/runtimes/assets/common/src/fungible_conversion.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs index 2b8413cfe6e..8ffb44b086b 100644 --- a/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -1,27 +1,25 @@ -// This file is part of Substrate. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. //! Runtime API definition for assets. use crate::runtime_api::FungiblesAccessError; +use frame_support::traits::Contains; use sp_std::{borrow::Borrow, vec::Vec}; use xcm::latest::{MultiAsset, MultiLocation}; -use xcm_builder::ConvertedConcreteId; +use xcm_builder::{ConvertedConcreteId, MatchedConvertedConcreteId}; use xcm_executor::traits::{Convert, MatchesFungibles}; /// Converting any [`(AssetId, Balance)`] to [`MultiAsset`] @@ -60,6 +58,29 @@ impl< } } +impl< + AssetId: Clone, + Balance: Clone, + MatchAssetId: Contains, + ConvertAssetId: Convert, + ConvertBalance: Convert, + > MultiAssetConverter + for MatchedConvertedConcreteId +{ + fn convert_ref( + value: impl Borrow<(AssetId, Balance)>, + ) -> Result { + let (asset_id, balance) = value.borrow(); + match ConvertAssetId::reverse_ref(asset_id) { + Ok(asset_id_as_multilocation) => match ConvertBalance::reverse_ref(balance) { + Ok(amount) => Ok((asset_id_as_multilocation, amount).into()), + Err(_) => Err(FungiblesAccessError::AmountToBalanceConversionFailed), + }, + Err(_) => Err(FungiblesAccessError::AssetIdConversionFailed), + } + } +} + /// Helper function to convert collections with [`(AssetId, Balance)`] to [`MultiAsset`] pub fn convert<'a, AssetId, Balance, ConvertAssetId, ConvertBalance, Converter>( items: impl Iterator, @@ -90,11 +111,12 @@ pub fn convert_balance< #[cfg(test)] mod tests { use super::*; + use frame_support::traits::Everything; use xcm::latest::prelude::*; use xcm_executor::traits::{Identity, JustTry}; - type Converter = ConvertedConcreteId; + type Converter = MatchedConvertedConcreteId; #[test] fn converted_concrete_id_fungible_multi_asset_conversion_roundtrip_works() { diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index 28d8ca59106..8a321ad97aa 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -15,39 +15,79 @@ #![cfg_attr(not(feature = "std"), no_std)] +pub mod foreign_creators; pub mod fungible_conversion; +pub mod matching; pub mod runtime_api; +use crate::matching::{Equals, LocalMultiLocationPattern, ParentLocation, StartsWith}; +use frame_support::traits::EverythingBut; use parachains_common::AssetIdForTrustBackedAssets; -use xcm_builder::{AsPrefixedGeneralIndex, ConvertedConcreteId}; -use xcm_executor::traits::JustTry; +use xcm::prelude::MultiLocation; +use xcm_builder::{AsPrefixedGeneralIndex, MatchedConvertedConcreteId}; +use xcm_executor::traits::{Identity, JustTry}; /// `MultiLocation` vs `AssetIdForTrustBackedAssets` converter for `TrustBackedAssets` pub type AssetIdForTrustBackedAssetsConvert = AsPrefixedGeneralIndex; -/// [`ConvertedConcreteId`] converter dedicated for `TrustBackedAssets` +/// [`MatchedConvertedConcreteId`] converter dedicated for `TrustBackedAssets` pub type TrustBackedAssetsConvertedConcreteId = - ConvertedConcreteId< + MatchedConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, + StartsWith, AssetIdForTrustBackedAssetsConvert, JustTry, >; +/// AssetId used for identifying assets by MultiLocation. +pub type MultiLocationForAssetId = MultiLocation; + +/// [`MatchedConvertedConcreteId`] converter dedicated for storing `AssetId` as `MultiLocation`. +pub type MultiLocationConvertedConcreteId = + MatchedConvertedConcreteId< + MultiLocationForAssetId, + Balance, + MultiLocationFilter, + Identity, + JustTry, + >; + +/// [`MatchedConvertedConcreteId`] converter dedicated for storing `ForeignAssets` with `AssetId` as `MultiLocation`. +/// +/// Excludes by default: +/// - parent as relay chain +/// - all local MultiLocations +/// +/// `AdditionalMultiLocationExclusionFilter` can customize additional excluded MultiLocations +pub type ForeignAssetsConvertedConcreteId = + MultiLocationConvertedConcreteId< + EverythingBut<( + // Excludes relay/parent chain currency + Equals, + // Here we rely on fact that something like this works: + // assert!(MultiLocation::new(1, X1(Parachain(100))).starts_with(&MultiLocation::parent())); + // assert!(X1(Parachain(100)).starts_with(&Here)); + StartsWith, + // Here we can exclude more stuff or leave it as `()` + AdditionalMultiLocationExclusionFilter, + )>, + Balance, + >; + #[cfg(test)] mod tests { - use super::*; + use crate::matching::StartsWithExplicitGlobalConsensus; use xcm::latest::prelude::*; - use xcm_executor::traits::Convert; - - frame_support::parameter_types! { - pub TrustBackedAssetsPalletLocation: MultiLocation = MultiLocation::new(5, X1(PalletInstance(13))); - } + use xcm_executor::traits::{Convert, Error as MatchError, MatchesFungibles}; #[test] fn asset_id_for_trust_backed_assets_convert_works() { + frame_support::parameter_types! { + pub TrustBackedAssetsPalletLocation: MultiLocation = MultiLocation::new(5, X1(PalletInstance(13))); + } let local_asset_id = 123456789 as AssetIdForTrustBackedAssets; let expected_reverse_ref = MultiLocation::new(5, X2(PalletInstance(13), GeneralIndex(local_asset_id.into()))); @@ -67,4 +107,201 @@ mod tests { local_asset_id ); } + + #[test] + fn trust_backed_assets_match_fungibles_works() { + frame_support::parameter_types! { + pub TrustBackedAssetsPalletLocation: MultiLocation = MultiLocation::new(0, X1(PalletInstance(13))); + } + // setup convert + type TrustBackedAssetsConvert = + TrustBackedAssetsConvertedConcreteId; + + let test_data = vec![ + // missing GeneralIndex + (ma_1000(0, X1(PalletInstance(13))), Err(MatchError::AssetIdConversionFailed)), + ( + ma_1000(0, X2(PalletInstance(13), GeneralKey { data: [0; 32], length: 32 })), + Err(MatchError::AssetIdConversionFailed), + ), + ( + ma_1000(0, X2(PalletInstance(13), Parachain(1000))), + Err(MatchError::AssetIdConversionFailed), + ), + // OK + (ma_1000(0, X2(PalletInstance(13), GeneralIndex(1234))), Ok((1234, 1000))), + ( + ma_1000(0, X3(PalletInstance(13), GeneralIndex(1234), GeneralIndex(2222))), + Ok((1234, 1000)), + ), + ( + ma_1000( + 0, + X4( + PalletInstance(13), + GeneralIndex(1234), + GeneralIndex(2222), + GeneralKey { data: [0; 32], length: 32 }, + ), + ), + Ok((1234, 1000)), + ), + // wrong pallet instance + ( + ma_1000(0, X2(PalletInstance(77), GeneralIndex(1234))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000(0, X3(PalletInstance(77), GeneralIndex(1234), GeneralIndex(2222))), + Err(MatchError::AssetNotHandled), + ), + // wrong parent + ( + ma_1000(1, X2(PalletInstance(13), GeneralIndex(1234))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000(1, X3(PalletInstance(13), GeneralIndex(1234), GeneralIndex(2222))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000(1, X2(PalletInstance(77), GeneralIndex(1234))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000(1, X3(PalletInstance(77), GeneralIndex(1234), GeneralIndex(2222))), + Err(MatchError::AssetNotHandled), + ), + // wrong parent + ( + ma_1000(2, X2(PalletInstance(13), GeneralIndex(1234))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000(2, X3(PalletInstance(13), GeneralIndex(1234), GeneralIndex(2222))), + Err(MatchError::AssetNotHandled), + ), + // missing GeneralIndex + (ma_1000(0, X1(PalletInstance(77))), Err(MatchError::AssetNotHandled)), + (ma_1000(1, X1(PalletInstance(13))), Err(MatchError::AssetNotHandled)), + (ma_1000(2, X1(PalletInstance(13))), Err(MatchError::AssetNotHandled)), + ]; + + for (multi_asset, expected_result) in test_data { + assert_eq!( + >::matches_fungibles(&multi_asset), + expected_result, "multi_asset: {:?}", multi_asset); + } + } + + #[test] + fn multi_location_converted_concrete_id_converter_works() { + frame_support::parameter_types! { + pub Parachain100Pattern: MultiLocation = MultiLocation::new(1, X1(Parachain(100))); + pub UniversalLocationNetworkId: NetworkId = NetworkId::ByGenesis([9; 32]); + } + + // setup convert + type Convert = ForeignAssetsConvertedConcreteId< + ( + StartsWith, + StartsWithExplicitGlobalConsensus, + ), + u128, + >; + + let test_data = vec![ + // excluded as local + (ma_1000(0, Here), Err(MatchError::AssetNotHandled)), + (ma_1000(0, X1(Parachain(100))), Err(MatchError::AssetNotHandled)), + ( + ma_1000(0, X2(PalletInstance(13), GeneralIndex(1234))), + Err(MatchError::AssetNotHandled), + ), + // excluded as parent + (ma_1000(1, Here), Err(MatchError::AssetNotHandled)), + // excluded as additional filter - Parachain100Pattern + (ma_1000(1, X1(Parachain(100))), Err(MatchError::AssetNotHandled)), + (ma_1000(1, X2(Parachain(100), GeneralIndex(1234))), Err(MatchError::AssetNotHandled)), + ( + ma_1000(1, X3(Parachain(100), PalletInstance(13), GeneralIndex(1234))), + Err(MatchError::AssetNotHandled), + ), + // excluded as additional filter - StartsWithExplicitGlobalConsensus + ( + ma_1000(1, X1(GlobalConsensus(NetworkId::ByGenesis([9; 32])))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000(2, X1(GlobalConsensus(NetworkId::ByGenesis([9; 32])))), + Err(MatchError::AssetNotHandled), + ), + ( + ma_1000( + 2, + X3( + GlobalConsensus(NetworkId::ByGenesis([9; 32])), + Parachain(200), + GeneralIndex(1234), + ), + ), + Err(MatchError::AssetNotHandled), + ), + // ok + (ma_1000(1, X1(Parachain(200))), Ok((MultiLocation::new(1, X1(Parachain(200))), 1000))), + (ma_1000(2, X1(Parachain(200))), Ok((MultiLocation::new(2, X1(Parachain(200))), 1000))), + ( + ma_1000(1, X2(Parachain(200), GeneralIndex(1234))), + Ok((MultiLocation::new(1, X2(Parachain(200), GeneralIndex(1234))), 1000)), + ), + ( + ma_1000(2, X2(Parachain(200), GeneralIndex(1234))), + Ok((MultiLocation::new(2, X2(Parachain(200), GeneralIndex(1234))), 1000)), + ), + ( + ma_1000(2, X1(GlobalConsensus(NetworkId::ByGenesis([7; 32])))), + Ok(( + MultiLocation::new(2, X1(GlobalConsensus(NetworkId::ByGenesis([7; 32])))), + 1000, + )), + ), + ( + ma_1000( + 2, + X3( + GlobalConsensus(NetworkId::ByGenesis([7; 32])), + Parachain(200), + GeneralIndex(1234), + ), + ), + Ok(( + MultiLocation::new( + 2, + X3( + GlobalConsensus(NetworkId::ByGenesis([7; 32])), + Parachain(200), + GeneralIndex(1234), + ), + ), + 1000, + )), + ), + ]; + + for (multi_asset, expected_result) in test_data { + assert_eq!( + >::matches_fungibles( + &multi_asset + ), + expected_result, + "multi_asset: {:?}", + multi_asset + ); + } + } + + // Create MultiAsset + fn ma_1000(parents: u8, interior: Junctions) -> MultiAsset { + (MultiLocation::new(parents, interior), 1000).into() + } } diff --git a/parachains/runtimes/assets/common/src/matching.rs b/parachains/runtimes/assets/common/src/matching.rs new file mode 100644 index 00000000000..a5e030412b9 --- /dev/null +++ b/parachains/runtimes/assets/common/src/matching.rs @@ -0,0 +1,91 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use cumulus_primitives_core::ParaId; +use frame_support::{ + pallet_prelude::Get, + traits::{Contains, ContainsPair}, +}; +use xcm::{ + latest::prelude::{MultiAsset, MultiLocation}, + prelude::*, +}; + +pub struct StartsWith(sp_std::marker::PhantomData); +impl> Contains for StartsWith { + fn contains(t: &MultiLocation) -> bool { + t.starts_with(&Location::get()) + } +} + +pub struct Equals(sp_std::marker::PhantomData); +impl> Contains for Equals { + fn contains(t: &MultiLocation) -> bool { + t == &Location::get() + } +} + +pub struct StartsWithExplicitGlobalConsensus(sp_std::marker::PhantomData); +impl> Contains + for StartsWithExplicitGlobalConsensus +{ + fn contains(t: &MultiLocation) -> bool { + match t.interior.global_consensus() { + Ok(requested_network) if requested_network.eq(&Network::get()) => true, + _ => false, + } + } +} + +frame_support::parameter_types! { + pub LocalMultiLocationPattern: MultiLocation = MultiLocation::new(0, Here); + pub ParentLocation: MultiLocation = MultiLocation::parent(); +} + +/// Accepts an asset if it is from the origin. +pub struct IsForeignConcreteAsset(sp_std::marker::PhantomData); +impl> ContainsPair + for IsForeignConcreteAsset +{ + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + log::trace!(target: "xcm::contains", "IsForeignConcreteAsset asset: {:?}, origin: {:?}", asset, origin); + matches!(asset.id, Concrete(ref id) if IsForeign::contains(id, &origin)) + } +} + +/// Checks if `a` is from sibling location `b`. Checks that `MultiLocation-a` starts with +/// `MultiLocation-b`, and that the `ParaId` of `b` is not equal to `a`. +pub struct FromSiblingParachain(sp_std::marker::PhantomData); +impl> ContainsPair + for FromSiblingParachain +{ + fn contains(&a: &MultiLocation, b: &MultiLocation) -> bool { + // `a` needs to be from `b` at least + if !a.starts_with(&b) { + return false + } + + // here we check if sibling + match a { + MultiLocation { parents: 1, interior } => match interior.first() { + Some(Parachain(sibling_para_id)) + if sibling_para_id.ne(&u32::from(SelfParaId::get())) => + true, + _ => false, + }, + _ => false, + } + } +} diff --git a/parachains/runtimes/assets/statemine/Cargo.toml b/parachains/runtimes/assets/statemine/Cargo.toml index e2943d0d74d..31f34516a5c 100644 --- a/parachains/runtimes/assets/statemine/Cargo.toml +++ b/parachains/runtimes/assets/statemine/Cargo.toml @@ -112,6 +112,7 @@ runtime-benchmarks = [ "cumulus-pallet-xcmp-queue/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", + "assets-common/runtime-benchmarks", ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index c4fbad66349..4f03b049efa 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -66,19 +66,23 @@ use parachains_common::{ NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - FellowshipLocation, GovernanceLocation, KsmLocation, TrustBackedAssetsConvertedConcreteId, - XcmConfig, + FellowshipLocation, ForeignAssetsConvertedConcreteId, GovernanceLocation, KsmLocation, + TrustBackedAssetsConvertedConcreteId, XcmConfig, }; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; // Polkadot imports +use assets_common::{ + foreign_creators::ForeignCreators, matching::FromSiblingParachain, MultiLocationForAssetId, +}; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm::latest::BodyId; use xcm_executor::XcmExecutor; +use crate::xcm_config::ForeignCreatorsSovereignAccountOf; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; impl_opaque_keys! { @@ -264,6 +268,48 @@ impl pallet_assets::Config for Runtime { type BenchmarkHelper = (); } +parameter_types! { + // we just reuse the same deposits + pub const ForeignAssetsAssetDeposit: Balance = AssetDeposit::get(); + pub const ForeignAssetsAssetAccountDeposit: Balance = AssetAccountDeposit::get(); + pub const ForeignAssetsApprovalDeposit: Balance = ApprovalDeposit::get(); + pub const ForeignAssetsAssetsStringLimit: u32 = AssetsStringLimit::get(); + pub const ForeignAssetsMetadataDepositBase: Balance = MetadataDepositBase::get(); + pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get(); +} + +/// Assets managed by some foreign location. Note: we do not declare a `ForeignAssetsCall` type, as +/// this type is used in proxy definitions. We assume that a foreign location would not want to set +/// an individual, local account as a proxy for the issuance of their assets. This issuance should +/// be managed by the foreign location's governance. +pub type ForeignAssetsInstance = pallet_assets::Instance2; +impl pallet_assets::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type AssetId = MultiLocationForAssetId; + type AssetIdParameter = MultiLocationForAssetId; + type Currency = Balances; + type CreateOrigin = ForeignCreators< + (FromSiblingParachain>,), + ForeignCreatorsSovereignAccountOf, + AccountId, + >; + type ForceOrigin = AssetsForceOrigin; + type AssetDeposit = ForeignAssetsAssetDeposit; + type MetadataDepositBase = ForeignAssetsMetadataDepositBase; + type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte; + type ApprovalDeposit = ForeignAssetsApprovalDeposit; + type StringLimit = ForeignAssetsAssetsStringLimit; + type Freezer = (); + type Extra = (); + type WeightInfo = weights::pallet_assets::WeightInfo; + type CallbackHandle = (); + type AssetAccountDeposit = ForeignAssetsAssetAccountDeposit; + type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = xcm_config::XcmBenchmarkHelper; +} + parameter_types! { // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. pub const DepositBase: Balance = deposit(1, 88); @@ -336,6 +382,7 @@ impl Default for ProxyType { Self::Any } } + impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { @@ -689,6 +736,7 @@ construct_runtime!( Assets: pallet_assets::::{Pallet, Call, Storage, Event} = 50, Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 51, Nfts: pallet_nfts::{Pallet, Call, Storage, Event} = 52, + ForeignAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 53, #[cfg(feature = "state-trie-version-1")] StateTrieMigration: pallet_state_trie_migration = 70, @@ -741,6 +789,7 @@ mod benches { define_benchmarks!( [frame_system, SystemBench::] [pallet_assets, Assets] + [pallet_assets, ForeignAssets] [pallet_balances, Balances] [pallet_multisig, Multisig] [pallet_nfts, Nfts] @@ -916,11 +965,17 @@ impl_runtime_apis! { }, // collect pallet_assets (TrustBackedAssets) convert::<_, _, _, _, TrustBackedAssetsConvertedConcreteId>( - Assets::account_balances(account) + Assets::account_balances(account.clone()) + .iter() + .filter(|(_, balance)| balance > &0) + )?, + // collect pallet_assets (ForeignAssets) + convert::<_, _, _, _, ForeignAssetsConvertedConcreteId>( + ForeignAssets::account_balances(account) .iter() .filter(|(_, balance)| balance > &0) )?, - // collect ... e.g. pallet_assets ForeignAssets + // collect ... e.g. other tokens ].concat()) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index a72d4e04662..8999d55df5b 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-22, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::fungible -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=statemine-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,17 +51,25 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn withdraw_asset() -> Weight { - Weight::from_parts(22_035_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn withdraw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3593` + // Minimum execution time: 22_457_000 picoseconds. + Weight::from_parts(22_952_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn transfer_asset() -> Weight { - Weight::from_parts(54_300_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn transfer_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `6196` + // Minimum execution time: 32_247_000 picoseconds. + Weight::from_parts(32_534_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -76,20 +85,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_parts(78_569_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + pub fn transfer_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `17785` + // Minimum execution time: 53_956_000 picoseconds. + Weight::from_parts(55_144_000, 17785) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } - pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_parts(4_652_000 as u64, 0) + pub fn receive_teleported_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_424_000 picoseconds. + Weight::from_parts(4_494_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn deposit_asset() -> Weight { - Weight::from_parts(23_684_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn deposit_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 25_243_000 picoseconds. + Weight::from_parts(25_666_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -105,10 +126,14 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_parts(45_884_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn deposit_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `14677` + // Minimum execution time: 47_487_000 picoseconds. + Weight::from_parts(80_083_000, 14677) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -122,9 +147,13 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_teleport() -> Weight { - Weight::from_parts(30_239_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 31_674_000 picoseconds. + Weight::from_parts(45_575_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index d5d27b41e57..8424d5d64a9 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-22, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=statemine-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,40 +61,80 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_holding() -> Weight { - Weight::from_parts(450_021_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_holding() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 364_890_000 picoseconds. + Weight::from_parts(367_248_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn buy_execution() -> Weight { - Weight::from_parts(4_086_000 as u64, 0) + pub fn buy_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_032_000 picoseconds. + Weight::from_parts(4_167_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - pub(crate) fn query_response() -> Weight { - Weight::from_parts(11_290_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + pub fn query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `32` + // Estimated: `3497` + // Minimum execution time: 11_093_000 picoseconds. + Weight::from_parts(11_300_000, 3497) + .saturating_add(T::DbWeight::get().reads(1)) } - pub(crate) fn transact() -> Weight { - Weight::from_parts(13_288_000 as u64, 0) + pub fn transact() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_672_000 picoseconds. + Weight::from_parts(13_829_000, 0) } - pub(crate) fn refund_surplus() -> Weight { - Weight::from_parts(4_270_000 as u64, 0) + pub fn refund_surplus() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_451_000 picoseconds. + Weight::from_parts(4_581_000, 0) } - pub(crate) fn set_error_handler() -> Weight { - Weight::from_parts(3_205_000 as u64, 0) + pub fn set_error_handler() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_053_000 picoseconds. + Weight::from_parts(3_148_000, 0) } - pub(crate) fn set_appendix() -> Weight { - Weight::from_parts(3_246_000 as u64, 0) + pub fn set_appendix() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_733_000 picoseconds. + Weight::from_parts(4_784_000, 0) } - pub(crate) fn clear_error() -> Weight { - Weight::from_parts(3_189_000 as u64, 0) + pub fn clear_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_002_000 picoseconds. + Weight::from_parts(3_072_000, 0) } - pub(crate) fn descend_origin() -> Weight { - Weight::from_parts(4_222_000 as u64, 0) + pub fn descend_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_959_000 picoseconds. + Weight::from_parts(4_036_000, 0) } - pub(crate) fn clear_origin() -> Weight { - Weight::from_parts(3_178_000 as u64, 0) + pub fn clear_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_974_000 picoseconds. + Weight::from_parts(3_052_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -107,20 +148,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_error() -> Weight { - Weight::from_parts(24_770_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 24_065_000 picoseconds. + Weight::from_parts(24_646_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) - pub(crate) fn claim_asset() -> Weight { - Weight::from_parts(14_967_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn claim_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `90` + // Estimated: `3555` + // Minimum execution time: 15_036_000 picoseconds. + Weight::from_parts(15_419_000, 3555) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - pub(crate) fn trap() -> Weight { - Weight::from_parts(3_186_000 as u64, 0) + pub fn trap() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_008_000 picoseconds. + Weight::from_parts(3_083_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -134,16 +187,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn subscribe_version() -> Weight { - Weight::from_parts(25_797_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn subscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `13098` + // Minimum execution time: 44_824_000 picoseconds. + Weight::from_parts(45_183_000, 13098) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_parts(5_170_000 as u64, 0) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn unsubscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_969_000 picoseconds. + Weight::from_parts(5_198_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -157,25 +218,49 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_parts(508_189_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 422_661_000 picoseconds. + Weight::from_parts(425_164_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn burn_asset() -> Weight { - Weight::from_parts(156_147_000 as u64, 0) + pub fn burn_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 135_692_000 picoseconds. + Weight::from_parts(136_167_000, 0) } - pub(crate) fn expect_asset() -> Weight { - Weight::from_parts(14_507_000 as u64, 0) + pub fn expect_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_880_000 picoseconds. + Weight::from_parts(13_103_000, 0) } - pub(crate) fn expect_origin() -> Weight { - Weight::from_parts(3_329_000 as u64, 0) + pub fn expect_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_842_000 picoseconds. + Weight::from_parts(4_898_000, 0) } - pub(crate) fn expect_error() -> Weight { - Weight::from_parts(3_164_000 as u64, 0) + pub fn expect_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_026_000 picoseconds. + Weight::from_parts(3_109_000, 0) } - pub(crate) fn expect_transact_status() -> Weight { - Weight::from_parts(3_415_000 as u64, 0) + pub fn expect_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_241_000 picoseconds. + Weight::from_parts(3_281_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -189,13 +274,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn query_pallet() -> Weight { - Weight::from_parts(27_966_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn query_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 27_818_000 picoseconds. + Weight::from_parts(28_080_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn expect_pallet() -> Weight { - Weight::from_parts(5_019_000 as u64, 0) + pub fn expect_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_410_000 picoseconds. + Weight::from_parts(5_514_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -209,24 +302,48 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_transact_status() -> Weight { - Weight::from_parts(25_097_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 24_798_000 picoseconds. + Weight::from_parts(26_833_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn clear_transact_status() -> Weight { - Weight::from_parts(3_193_000 as u64, 0) + pub fn clear_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_083_000 picoseconds. + Weight::from_parts(3_148_000, 0) } - pub(crate) fn set_topic() -> Weight { - Weight::from_parts(3_146_000 as u64, 0) + pub fn set_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_995_000 picoseconds. + Weight::from_parts(3_045_000, 0) } - pub(crate) fn clear_topic() -> Weight { - Weight::from_parts(3_178_000 as u64, 0) + pub fn clear_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_080_000 picoseconds. + Weight::from_parts(3_128_000, 0) } - pub(crate) fn set_fees_mode() -> Weight { - Weight::from_parts(3_134_000 as u64, 0) + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_009_000 picoseconds. + Weight::from_parts(3_102_000, 0) } - pub(crate) fn unpaid_execution() -> Weight { - Weight::from_parts(3_282_000 as u64, 0) + pub fn unpaid_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_202_000 picoseconds. + Weight::from_parts(3_290_000, 0) } } diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index 5f4dacda475..5d4c45fd4f3 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -14,14 +14,18 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ForeignAssets, + ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; +use assets_common::matching::{ + FromSiblingParachain, IsForeignConcreteAsset, StartsWith, StartsWithExplicitGlobalConsensus, +}; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess}, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{ impls::ToStakingPot, @@ -35,8 +39,8 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; @@ -48,7 +52,7 @@ parameter_types! { pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); - pub const Local: MultiLocation = Here.into_location(); + pub UniversalLocationNetworkId: NetworkId = UniversalLocation::get().global_consensus().unwrap(); pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); @@ -82,7 +86,7 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId/Balancer` converter for `TrustBackedAssets` +/// `AssetId/Balance` converter for `TrustBackedAssets` pub type TrustBackedAssetsConvertedConcreteId = assets_common::TrustBackedAssetsConvertedConcreteId; @@ -102,8 +106,38 @@ pub type FungiblesTransactor = FungiblesAdapter< // The account to use for tracking teleports. CheckingAccount, >; + +/// `AssetId/Balance` converter for `TrustBackedAssets` +pub type ForeignAssetsConvertedConcreteId = assets_common::ForeignAssetsConvertedConcreteId< + ( + // Ignore `TrustBackedAssets` explicitly + StartsWith, + // Ignore asset which starts explicitly with our `GlobalConsensus(NetworkId)`, means: + // - foreign assets from our consensus should be: `MultiLocation {parent: 1, X*(Parachain(xyz))} + // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` wont be accepted here + StartsWithExplicitGlobalConsensus, + ), + Balance, +>; + +/// Means for transacting foreign assets from different global consensus. +pub type ForeignFungiblesTransactor = FungiblesAdapter< + // Use this fungibles implementation: + ForeignAssets, + // Use this currency when it is a fungible asset matching the given location or name: + ForeignAssetsConvertedConcreteId, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We dont need to check teleports here. + NoChecking, + // The account to use for tracking teleports. + CheckingAccount, +>; + /// Means for transacting assets on this chain. -pub type AssetTransactors = (CurrencyTransactor, FungiblesTransactor); +pub type AssetTransactors = (CurrencyTransactor, FungiblesTransactor, ForeignFungiblesTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, /// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can @@ -212,6 +246,35 @@ impl Contains for SafeCallFilter { pallet_assets::Call::touch { .. } | pallet_assets::Call::refund { .. }, ) | + RuntimeCall::ForeignAssets( + pallet_assets::Call::create { .. } | + pallet_assets::Call::force_create { .. } | + pallet_assets::Call::start_destroy { .. } | + pallet_assets::Call::destroy_accounts { .. } | + pallet_assets::Call::destroy_approvals { .. } | + pallet_assets::Call::finish_destroy { .. } | + pallet_assets::Call::mint { .. } | + pallet_assets::Call::burn { .. } | + pallet_assets::Call::transfer { .. } | + pallet_assets::Call::transfer_keep_alive { .. } | + pallet_assets::Call::force_transfer { .. } | + pallet_assets::Call::freeze { .. } | + pallet_assets::Call::thaw { .. } | + pallet_assets::Call::freeze_asset { .. } | + pallet_assets::Call::thaw_asset { .. } | + pallet_assets::Call::transfer_ownership { .. } | + pallet_assets::Call::set_team { .. } | + pallet_assets::Call::set_metadata { .. } | + pallet_assets::Call::clear_metadata { .. } | + pallet_assets::Call::force_clear_metadata { .. } | + pallet_assets::Call::force_asset_status { .. } | + pallet_assets::Call::approve_transfer { .. } | + pallet_assets::Call::cancel_approval { .. } | + pallet_assets::Call::force_cancel_approval { .. } | + pallet_assets::Call::transfer_approved { .. } | + pallet_assets::Call::touch { .. } | + pallet_assets::Call::refund { .. }, + ) | RuntimeCall::Nfts( pallet_nfts::Call::create { .. } | pallet_nfts::Call::force_create { .. } | @@ -321,7 +384,13 @@ impl xcm_executor::Config for XcmConfig { // Statemine acting _as_ a reserve location for KSM and assets created under `pallet-assets`. // For KSM, users must use teleport where allowed (e.g. with the Relay Chain). type IsReserve = (); - type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM + // We allow: + // - teleportation of KSM + // - teleportation of sibling parachain's assets (as ForeignCreators) + type IsTeleporter = ( + NativeAsset, + IsForeignConcreteAsset>>, + ); type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = WeightInfoBounds< @@ -407,9 +476,27 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } + +pub type ForeignCreatorsSovereignAccountOf = ( + SiblingParachainConvertsVia, + AccountId32Aliases, + ParentIsPreset, +); + +/// Simple conversion of `u32` into an `AssetId` for use in benchmarking. +pub struct XcmBenchmarkHelper; +#[cfg(feature = "runtime-benchmarks")] +use pallet_assets::BenchmarkHelper; +#[cfg(feature = "runtime-benchmarks")] +impl BenchmarkHelper for XcmBenchmarkHelper { + fn create_asset_id_parameter(id: u32) -> MultiLocation { + MultiLocation { parents: 1, interior: X1(Parachain(id)) } + } +} diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/statemine/tests/tests.rs index b696e4ef1e3..972abe9d427 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/statemine/tests/tests.rs @@ -1,25 +1,27 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; -use codec::Encode; +use codec::{Decode, Encode}; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ - assert_noop, assert_ok, sp_io, + assert_noop, assert_ok, + traits::fungibles::InspectEnumerable, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use parachains_common::{AccountId, AuraId, Balance}; +use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance}; use statemine_runtime::xcm_config::{ AssetFeeAsExistentialDepositMultiplierFeeCharger, KsmLocation, TrustBackedAssetsPalletLocation, }; pub use statemine_runtime::{ - constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, - ReservedDmpWeight, Runtime, SessionKeys, System, + constants::fee::WeightToFee, + xcm_config::{CheckingAccount, ForeignCreatorsSovereignAccountOf, XcmConfig}, + AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, + MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime, RuntimeCall, + RuntimeEvent, SessionKeys, System, TrustBackedAssetsInstance, }; use xcm::latest::prelude::*; -use xcm_executor::{ - traits::{Convert, WeightTrader}, - XcmExecutor, -}; +use xcm_executor::traits::{Convert, Identity, JustTry, WeightTrader}; -pub const ALICE: [u8; 32] = [1u8; 32]; +const ALICE: [u8; 32] = [1u8; 32]; +const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32]; type AssetIdForTrustBackedAssetsConvert = assets_common::AssetIdForTrustBackedAssetsConvert; @@ -371,9 +373,15 @@ fn test_assets_balances_api_works() { .build() .execute_with(|| { let local_asset_id = 1; + let foreign_asset_id_multilocation = + MultiLocation { parents: 1, interior: X2(Parachain(1234), GeneralIndex(12345)) }; // check before assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); + assert_eq!( + ForeignAssets::balance(foreign_asset_id_multilocation, AccountId::from(ALICE)), + 0 + ); assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 0); assert!(Runtime::query_account_balances(AccountId::from(ALICE)).unwrap().is_empty()); @@ -400,15 +408,37 @@ fn test_assets_balances_api_works() { minimum_asset_balance )); + // create foreign asset + let foreign_asset_minimum_asset_balance = 3333333_u128; + assert_ok!(ForeignAssets::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_multilocation.clone().into(), + AccountId::from(SOME_ASSET_ADMIN).into(), + false, + foreign_asset_minimum_asset_balance + )); + + // We first mint enough asset for the account to exist for assets + assert_ok!(ForeignAssets::mint( + RuntimeHelper::::origin_of(AccountId::from(SOME_ASSET_ADMIN)), + foreign_asset_id_multilocation.clone().into(), + AccountId::from(ALICE).into(), + 6 * foreign_asset_minimum_asset_balance + )); + // check after assert_eq!( Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance ); + assert_eq!( + ForeignAssets::balance(foreign_asset_id_multilocation, AccountId::from(ALICE)), + 6 * minimum_asset_balance + ); assert_eq!(Balances::free_balance(AccountId::from(ALICE)), some_currency); let result = Runtime::query_account_balances(AccountId::from(ALICE)).unwrap(); - assert_eq!(result.len(), 2); + assert_eq!(result.len(), 3); // check currency assert!(result.iter().any(|asset| asset.eq( @@ -423,53 +453,162 @@ fn test_assets_balances_api_works() { minimum_asset_balance ) .into()))); + // check foreign asset + assert!(result.iter().any(|asset| asset.eq(&( + Identity::reverse_ref(foreign_asset_id_multilocation).unwrap(), + 6 * foreign_asset_minimum_asset_balance + ) + .into()))); }); } -#[test] -fn receive_teleported_asset_works() { - ExtBuilder::::default() - .with_collators(vec![AccountId::from(ALICE)]) - .with_session_keys(vec![( - AccountId::from(ALICE), - AccountId::from(ALICE), - SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }, - )]) - .build() - .execute_with(|| { - let xcm = Xcm(vec![ - ReceiveTeleportedAsset(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(10000000000000), - }])), - ClearOrigin, - BuyExecution { - fees: MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(10000000000000), - }, - weight_limit: Limited(Weight::from_parts(303531000, 65536)), - }, - DepositAsset { - assets: Wild(AllCounted(1)), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountId32 { - network: None, - id: [ - 18, 153, 85, 112, 1, 245, 88, 21, 211, 252, 181, 60, 116, 70, 58, - 203, 12, 246, 209, 77, 70, 57, 179, 64, 152, 44, 96, 135, 127, 56, - 70, 9, - ], - }), - }, - }, - ]); - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - - let weight_limit = ReservedDmpWeight::get(); - - let outcome = XcmExecutor::::execute_xcm(Parent, xcm, hash, weight_limit); - assert_eq!(outcome.ensure_complete(), Ok(())); - }) -} +asset_test_utils::include_teleports_for_native_asset_works!( + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + ParachainSystem, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }) +); + +asset_test_utils::include_teleports_for_foreign_assets_works!( + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + ParachainSystem, + ForeignCreatorsSovereignAccountOf, + ForeignAssetsInstance, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_local_consensus_currency_works!( + Runtime, + XcmConfig, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_works!( + asset_transactor_transfer_with_trust_backed_assets_works, + Runtime, + XcmConfig, + TrustBackedAssetsInstance, + AssetIdForTrustBackedAssets, + AssetIdForTrustBackedAssetsConvert, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + 12345, + Box::new(|| { + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_works!( + asset_transactor_transfer_with_foreign_assets_works, + Runtime, + XcmConfig, + ForeignAssetsInstance, + MultiLocation, + JustTry, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + MultiLocation { parents: 1, interior: X2(Parachain(1313), GeneralIndex(12345)) }, + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works!( + Runtime, + XcmConfig, + WeightToFee, + ForeignCreatorsSovereignAccountOf, + ForeignAssetsInstance, + MultiLocation, + JustTry, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + AssetDeposit::get(), + MetadataDepositBase::get(), + MetadataDepositPerByte::get(), + Box::new(|pallet_asset_call| RuntimeCall::ForeignAssets(pallet_asset_call).encode()), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::ForeignAssets(pallet_asset_event)) => Some(pallet_asset_event), + _ => None, + } + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert_eq!(ForeignAssets::asset_ids().collect::>().len(), 1); + }) +); diff --git a/parachains/runtimes/assets/statemint/Cargo.toml b/parachains/runtimes/assets/statemint/Cargo.toml index 3b1ee08643e..a8de1be1994 100644 --- a/parachains/runtimes/assets/statemint/Cargo.toml +++ b/parachains/runtimes/assets/statemint/Cargo.toml @@ -101,6 +101,7 @@ runtime-benchmarks = [ "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", + "assets-common/runtime-benchmarks", ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 342b18fc3b7..43de2f7f064 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=statemint-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::fungible -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=statemint-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,17 +51,25 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn withdraw_asset() -> Weight { - Weight::from_parts(21_004_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn withdraw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3593` + // Minimum execution time: 22_450_000 picoseconds. + Weight::from_parts(22_821_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn transfer_asset() -> Weight { - Weight::from_parts(29_344_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn transfer_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `6196` + // Minimum execution time: 32_079_000 picoseconds. + Weight::from_parts(32_591_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -76,20 +85,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_parts(49_988_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + pub fn transfer_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `17785` + // Minimum execution time: 53_770_000 picoseconds. + Weight::from_parts(54_393_000, 17785) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } - pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_parts(4_040_000 as u64, 0) + pub fn receive_teleported_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_485_000 picoseconds. + Weight::from_parts(4_650_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn deposit_asset() -> Weight { - Weight::from_parts(22_762_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn deposit_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 24_725_000 picoseconds. + Weight::from_parts(25_120_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -105,10 +126,14 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_parts(44_404_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn deposit_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `14677` + // Minimum execution time: 47_989_000 picoseconds. + Weight::from_parts(48_573_000, 14677) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -122,9 +147,13 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_teleport() -> Weight { - Weight::from_parts(28_179_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 34_367_000 picoseconds. + Weight::from_parts(34_995_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 969589cb086..dbae6ffe404 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=statemint-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=statemint-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,40 +61,80 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_holding() -> Weight { - Weight::from_parts(352_828_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_holding() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 365_653_000 picoseconds. + Weight::from_parts(368_340_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn buy_execution() -> Weight { - Weight::from_parts(3_719_000 as u64, 0) + pub fn buy_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_920_000 picoseconds. + Weight::from_parts(4_150_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - pub(crate) fn query_response() -> Weight { - Weight::from_parts(10_697_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + pub fn query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `32` + // Estimated: `3497` + // Minimum execution time: 10_988_000 picoseconds. + Weight::from_parts(11_207_000, 3497) + .saturating_add(T::DbWeight::get().reads(1)) } - pub(crate) fn transact() -> Weight { - Weight::from_parts(12_215_000 as u64, 0) + pub fn transact() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_509_000 picoseconds. + Weight::from_parts(13_775_000, 0) } - pub(crate) fn refund_surplus() -> Weight { - Weight::from_parts(3_925_000 as u64, 0) + pub fn refund_surplus() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_497_000 picoseconds. + Weight::from_parts(7_580_000, 0) } - pub(crate) fn set_error_handler() -> Weight { - Weight::from_parts(2_782_000 as u64, 0) + pub fn set_error_handler() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_971_000 picoseconds. + Weight::from_parts(3_086_000, 0) } - pub(crate) fn set_appendix() -> Weight { - Weight::from_parts(2_765_000 as u64, 0) + pub fn set_appendix() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_937_000 picoseconds. + Weight::from_parts(3_081_000, 0) } - pub(crate) fn clear_error() -> Weight { - Weight::from_parts(2_766_000 as u64, 0) + pub fn clear_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_960_000 picoseconds. + Weight::from_parts(3_073_000, 0) } - pub(crate) fn descend_origin() -> Weight { - Weight::from_parts(3_553_000 as u64, 0) + pub fn descend_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_879_000 picoseconds. + Weight::from_parts(4_040_000, 0) } - pub(crate) fn clear_origin() -> Weight { - Weight::from_parts(2_732_000 as u64, 0) + pub fn clear_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_965_000 picoseconds. + Weight::from_parts(3_062_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -107,20 +148,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_error() -> Weight { - Weight::from_parts(23_189_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 24_225_000 picoseconds. + Weight::from_parts(24_520_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) - pub(crate) fn claim_asset() -> Weight { - Weight::from_parts(14_569_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn claim_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `90` + // Estimated: `3555` + // Minimum execution time: 14_899_000 picoseconds. + Weight::from_parts(15_205_000, 3555) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - pub(crate) fn trap() -> Weight { - Weight::from_parts(2_759_000 as u64, 0) + pub fn trap() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_942_000 picoseconds. + Weight::from_parts(3_026_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -134,16 +187,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn subscribe_version() -> Weight { - Weight::from_parts(24_423_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn subscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `13098` + // Minimum execution time: 26_636_000 picoseconds. + Weight::from_parts(27_027_000, 13098) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_parts(4_575_000 as u64, 0) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn unsubscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_074_000 picoseconds. + Weight::from_parts(5_223_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -157,25 +218,49 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_parts(406_184_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 414_125_000 picoseconds. + Weight::from_parts(456_357_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn burn_asset() -> Weight { - Weight::from_parts(125_739_000 as u64, 0) + pub fn burn_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 134_528_000 picoseconds. + Weight::from_parts(135_936_000, 0) } - pub(crate) fn expect_asset() -> Weight { - Weight::from_parts(13_105_000 as u64, 0) + pub fn expect_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_812_000 picoseconds. + Weight::from_parts(12_945_000, 0) } - pub(crate) fn expect_origin() -> Weight { - Weight::from_parts(2_823_000 as u64, 0) + pub fn expect_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_011_000 picoseconds. + Weight::from_parts(3_129_000, 0) } - pub(crate) fn expect_error() -> Weight { - Weight::from_parts(2_771_000 as u64, 0) + pub fn expect_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_769_000 picoseconds. + Weight::from_parts(4_847_000, 0) } - pub(crate) fn expect_transact_status() -> Weight { - Weight::from_parts(2_883_000 as u64, 0) + pub fn expect_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_169_000 picoseconds. + Weight::from_parts(3_350_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -189,13 +274,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn query_pallet() -> Weight { - Weight::from_parts(25_695_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn query_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 27_621_000 picoseconds. + Weight::from_parts(28_085_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn expect_pallet() -> Weight { - Weight::from_parts(4_650_000 as u64, 0) + pub fn expect_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_296_000 picoseconds. + Weight::from_parts(5_413_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -209,24 +302,48 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_transact_status() -> Weight { - Weight::from_parts(23_415_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `11084` + // Minimum execution time: 24_309_000 picoseconds. + Weight::from_parts(24_673_000, 11084) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn clear_transact_status() -> Weight { - Weight::from_parts(2_756_000 as u64, 0) + pub fn clear_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_928_000 picoseconds. + Weight::from_parts(3_066_000, 0) } - pub(crate) fn set_topic() -> Weight { - Weight::from_parts(2_702_000 as u64, 0) + pub fn set_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_904_000 picoseconds. + Weight::from_parts(2_988_000, 0) } - pub(crate) fn clear_topic() -> Weight { - Weight::from_parts(2_738_000 as u64, 0) + pub fn clear_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_906_000 picoseconds. + Weight::from_parts(2_989_000, 0) } - pub(crate) fn set_fees_mode() -> Weight { - Weight::from_parts(2_700_000 as u64, 0) + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_950_000 picoseconds. + Weight::from_parts(3_047_000, 0) } - pub(crate) fn unpaid_execution() -> Weight { - Weight::from_parts(2_894_000 as u64, 0) + pub fn unpaid_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_150_000 picoseconds. + Weight::from_parts(3_243_000, 0) } } diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index 810832d54e9..90b0ee85fef 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -22,6 +22,7 @@ use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess}, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{ impls::ToStakingPot, @@ -48,7 +49,6 @@ parameter_types! { pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); - pub const Local: MultiLocation = MultiLocation::here(); pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); @@ -82,7 +82,7 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId/Balancer` converter for `TrustBackedAssets`` +/// `AssetId/Balance` converter for `TrustBackedAssets`` pub type TrustBackedAssetsConvertedConcreteId = assets_common::TrustBackedAssetsConvertedConcreteId; @@ -372,6 +372,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/statemint/tests/tests.rs index 81aa458b476..501c16960aa 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/statemint/tests/tests.rs @@ -1,25 +1,27 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; -use codec::Encode; +use codec::Decode; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ - assert_noop, assert_ok, sp_io, + assert_noop, assert_ok, + traits::fungibles::InspectEnumerable, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use parachains_common::{AccountId, Balance, StatemintAuraId as AuraId}; +use parachains_common::{ + AccountId, AssetIdForTrustBackedAssets, Balance, StatemintAuraId as AuraId, +}; use statemint_runtime::xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, DotLocation, TrustBackedAssetsPalletLocation, + AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount, DotLocation, + TrustBackedAssetsPalletLocation, }; pub use statemint_runtime::{ - constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, - ReservedDmpWeight, Runtime, SessionKeys, System, + constants::fee::WeightToFee, xcm_config::XcmConfig, AssetDeposit, Assets, Balances, + ExistentialDeposit, ParachainSystem, Runtime, RuntimeEvent, SessionKeys, System, + TrustBackedAssetsInstance, }; use xcm::latest::prelude::*; -use xcm_executor::{ - traits::{Convert, WeightTrader}, - XcmExecutor, -}; +use xcm_executor::traits::{Convert, WeightTrader}; -pub const ALICE: [u8; 32] = [1u8; 32]; +const ALICE: [u8; 32] = [1u8; 32]; type AssetIdForTrustBackedAssetsConvert = assets_common::AssetIdForTrustBackedAssetsConvert; @@ -438,50 +440,63 @@ fn test_assets_balances_api_works() { }); } -#[test] -fn receive_teleported_asset_works() { - ExtBuilder::::default() - .with_collators(vec![AccountId::from(ALICE)]) - .with_session_keys(vec![( - AccountId::from(ALICE), - AccountId::from(ALICE), - SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) }, - )]) - .build() - .execute_with(|| { - let xcm = Xcm(vec![ - ReceiveTeleportedAsset(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(10000000000000), - }])), - ClearOrigin, - BuyExecution { - fees: MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(10000000000000), - }, - weight_limit: Limited(Weight::from_parts(303531000, 65536)), - }, - DepositAsset { - assets: Wild(AllCounted(1)), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountId32 { - network: None, - id: [ - 18, 153, 85, 112, 1, 245, 88, 21, 211, 252, 181, 60, 116, 70, 58, - 203, 12, 246, 209, 77, 70, 57, 179, 64, 152, 44, 96, 135, 127, 56, - 70, 9, - ], - }), - }, - }, - ]); - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - - let weight_limit = ReservedDmpWeight::get(); - - let outcome = XcmExecutor::::execute_xcm(Parent, xcm, hash, weight_limit); - assert_eq!(outcome.ensure_complete(), Ok(())); - }) -} +asset_test_utils::include_teleports_for_native_asset_works!( + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + ParachainSystem, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_local_consensus_currency_works!( + Runtime, + XcmConfig, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_works!( + asset_transactor_transfer_with_pallet_assets_instance_works, + Runtime, + XcmConfig, + TrustBackedAssetsInstance, + AssetIdForTrustBackedAssets, + AssetIdForTrustBackedAssetsConvert, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + 12345, + Box::new(|| {}), + Box::new(|| {}) +); diff --git a/parachains/runtimes/assets/test-utils/Cargo.toml b/parachains/runtimes/assets/test-utils/Cargo.toml index 52ce1d2d9a8..2a9e70ce2dd 100644 --- a/parachains/runtimes/assets/test-utils/Cargo.toml +++ b/parachains/runtimes/assets/test-utils/Cargo.toml @@ -6,11 +6,12 @@ edition = "2021" description = "Statemint parachain runtime" [dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } # Substrate - frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-assets = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -20,8 +21,21 @@ sp-std = { git = "https://github.com/paritytech/substrate", default-features = f sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Cumulus +cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false } +cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false } pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachains-common = { path = "../../../common", default-features = false } +assets-common = { path = "../common", default-features = false } +cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false } +cumulus-primitives-parachain-inherent = { path = "../../../../primitives/parachain-inherent", default-features = false } +cumulus-test-relay-sproof-builder = { path = "../../../../test/relay-sproof-builder", default-features = false } +parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false } + +# Polkadot +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } [dev-dependencies] hex-literal = "0.3.4" @@ -32,14 +46,27 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [features] default = [ "std" ] std = [ + "cumulus-pallet-parachain-system/std", + "cumulus-primitives-core/std", + "cumulus-test-relay-sproof-builder/std", + "cumulus-primitives-parachain-inherent/std", "frame-support/std", "frame-system/std", + "pallet-assets/std", "pallet-balances/std", + "cumulus-pallet-parachain-system/std", "pallet-collator-selection/std", "pallet-session/std", + "assets-common/std", "parachains-common/std", + "parachain-info/std", + "polkadot-parachain/std", "sp-consensus-aura/std", "sp-io/std", "sp-runtime/std", "sp-std/std", + "xcm/std", + "xcm-executor/std", + "pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", ] diff --git a/parachains/runtimes/assets/test-utils/src/lib.rs b/parachains/runtimes/assets/test-utils/src/lib.rs index fb4750bae9e..06d6282e008 100644 --- a/parachains/runtimes/assets/test-utils/src/lib.rs +++ b/parachains/runtimes/assets/test-utils/src/lib.rs @@ -1,11 +1,27 @@ -use frame_support::traits::GenesisBuild; use sp_std::marker::PhantomData; -use frame_support::traits::OriginTrait; +use cumulus_primitives_core::{AbridgedHrmpChannel, ParaId, PersistedValidationData}; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use frame_support::{ + dispatch::{DispatchResult, RawOrigin, UnfilteredDispatchable}, + inherent::{InherentData, ProvideInherent}, + traits::{GenesisBuild, OriginTrait}, + weights::Weight, +}; use parachains_common::AccountId; +use polkadot_parachain::primitives::{HrmpChannelId, RelayChainBlockNumber}; use sp_consensus_aura::AURA_ENGINE_ID; use sp_core::Encode; use sp_runtime::{Digest, DigestItem}; +use xcm::{ + latest::{MultiAsset, MultiLocation, XcmContext, XcmHash}, + prelude::{Concrete, Fungible, Outcome, XcmError, XcmVersion}, +}; +use xcm_executor::{traits::TransactAsset, Assets}; + +pub mod test_cases; +pub use test_cases::CollatorSessionKeys; pub type BalanceOf = ::Balance; pub type AccountIdOf = ::AccountId; @@ -14,7 +30,11 @@ pub type SessionKeysOf = ::Keys; // Basic builder based on balances, collators and pallet_sessopm pub struct ExtBuilder< - Runtime: frame_system::Config + pallet_balances::Config + pallet_session::Config, + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config, > { // endowed accounts with balances balances: Vec<(AccountIdOf, BalanceOf)>, @@ -22,19 +42,40 @@ pub struct ExtBuilder< collators: Vec>, // keys added to pallet session keys: Vec<(AccountIdOf, ValidatorIdOf, SessionKeysOf)>, + // safe xcm version for pallet_xcm + safe_xcm_version: Option, + // para id + para_id: Option, _runtime: PhantomData, } -impl Default - for ExtBuilder +impl< + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config, + > Default for ExtBuilder { fn default() -> ExtBuilder { - ExtBuilder { balances: vec![], collators: vec![], keys: vec![], _runtime: PhantomData } + ExtBuilder { + balances: vec![], + collators: vec![], + keys: vec![], + safe_xcm_version: None, + para_id: None, + _runtime: PhantomData, + } } } -impl - ExtBuilder +impl< + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config, + > ExtBuilder { pub fn with_balances( mut self, @@ -56,6 +97,21 @@ impl Self { + frame_support::sp_tracing::try_init_simple(); + self + } + + pub fn with_safe_xcm_version(mut self, safe_xcm_version: XcmVersion) -> Self { + self.safe_xcm_version = Some(safe_xcm_version); + self + } + + pub fn with_para_id(mut self, para_id: ParaId) -> Self { + self.para_id = Some(para_id); + self + } + pub fn build(self) -> sp_io::TestExternalities where Runtime: @@ -64,6 +120,20 @@ impl().unwrap(); + >::assimilate_storage( + &pallet_xcm::GenesisConfig { safe_xcm_version: self.safe_xcm_version }, + &mut t, + ) + .unwrap(); + + if let Some(para_id) = self.para_id { + >::assimilate_storage( + ¶chain_info::GenesisConfig { parachain_id: para_id }, + &mut t, + ) + .unwrap(); + } + pallet_balances::GenesisConfig:: { balances: self.balances.into() } .assimilate_storage(&mut t) .unwrap(); @@ -132,3 +202,184 @@ where ::RuntimeOrigin::signed(account_id.into()) } } + +impl RuntimeHelper { + pub fn do_transfer( + from: MultiLocation, + to: MultiLocation, + (asset, amount): (MultiLocation, u128), + ) -> Result { + ::transfer_asset( + &MultiAsset { id: Concrete(asset), fun: Fungible(amount) }, + &from, + &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]), + ) + } +} + +impl RuntimeHelper { + pub fn do_teleport_assets( + origin: ::RuntimeOrigin, + dest: MultiLocation, + beneficiary: MultiLocation, + (asset, amount): (MultiLocation, u128), + open_hrmp_channel: Option<(u32, u32)>, + ) -> DispatchResult + where + HrmpChannelOpener: frame_support::inherent::ProvideInherent< + Call = cumulus_pallet_parachain_system::Call, + >, + { + // open hrmp (if needed) + if let Some((source_para_id, target_para_id)) = open_hrmp_channel { + mock_open_hrmp_channel::( + source_para_id.into(), + target_para_id.into(), + ); + } + + // do teleport + >::teleport_assets( + origin, + Box::new(dest.into()), + Box::new(beneficiary.into()), + Box::new((Concrete(asset), amount).into()), + 0, + ) + } +} + +pub enum XcmReceivedFrom { + Parent, + Sibling, +} + +impl RuntimeHelper { + pub fn xcm_max_weight(from: XcmReceivedFrom) -> Weight { + use frame_support::traits::Get; + match from { + XcmReceivedFrom::Parent => ParachainSystem::ReservedDmpWeight::get(), + XcmReceivedFrom::Sibling => ParachainSystem::ReservedXcmpWeight::get(), + } + } +} + +impl RuntimeHelper { + pub fn assert_pallet_xcm_event_outcome( + unwrap_pallet_xcm_event: &Box) -> Option>>, + assert_outcome: fn(Outcome), + ) { + let outcome = >::events() + .into_iter() + .filter_map(|e| unwrap_pallet_xcm_event(e.event.encode())) + .find_map(|e| match e { + pallet_xcm::Event::Attempted(outcome) => Some(outcome), + _ => None, + }); + match outcome { + Some(outcome) => assert_outcome(outcome), + None => assert!(false, "No `pallet_xcm::Event::Attempted(outcome)` event found!"), + } + } +} + +impl RuntimeHelper { + pub fn xcmp_queue_message_sent( + unwrap_xcmp_queue_event: Box< + dyn Fn(Vec) -> Option>, + >, + ) -> Option { + >::events() + .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, + _ => None, + }) + } +} + +pub fn assert_metadata( + asset_id: impl Into + Copy, + expected_name: &str, + expected_symbol: &str, + expected_decimals: u8, +) where + Fungibles: frame_support::traits::tokens::fungibles::metadata::Inspect + + frame_support::traits::tokens::fungibles::Inspect, +{ + assert_eq!(Fungibles::name(asset_id.into()), Vec::from(expected_name),); + assert_eq!(Fungibles::symbol(asset_id.into()), Vec::from(expected_symbol),); + assert_eq!(Fungibles::decimals(asset_id.into()), expected_decimals); +} + +pub fn assert_total( + asset_id: impl Into + Copy, + expected_total_issuance: impl Into, + expected_active_issuance: impl Into, +) where + Fungibles: frame_support::traits::tokens::fungibles::metadata::Inspect + + frame_support::traits::tokens::fungibles::Inspect, +{ + assert_eq!(Fungibles::total_issuance(asset_id.into()), expected_total_issuance.into()); + assert_eq!(Fungibles::active_issuance(asset_id.into()), expected_active_issuance.into()); +} + +/// Helper function which emulates opening HRMP channel which is needed for `XcmpQueue` to pass +pub fn mock_open_hrmp_channel< + C: cumulus_pallet_parachain_system::Config, + T: ProvideInherent>, +>( + sender: ParaId, + recipient: ParaId, +) { + let n = 1_u32; + let mut sproof_builder = RelayStateSproofBuilder::default(); + sproof_builder.para_id = sender; + sproof_builder.hrmp_channels.insert( + HrmpChannelId { sender, recipient }, + AbridgedHrmpChannel { + max_capacity: 10, + max_total_size: 10_000_000_u32, + max_message_size: 10_000_000_u32, + msg_count: 0, + total_size: 0_u32, + mqc_head: None, + }, + ); + sproof_builder.hrmp_egress_channel_index = Some(vec![recipient]); + + let (relay_parent_storage_root, relay_chain_state) = sproof_builder.into_state_root_and_proof(); + let vfp = PersistedValidationData { + relay_parent_number: n as RelayChainBlockNumber, + relay_parent_storage_root, + ..Default::default() + }; + // It is insufficient to push the validation function params + // to storage; they must also be included in the inherent data. + let inherent_data = { + let mut inherent_data = InherentData::default(); + let system_inherent_data = ParachainInherentData { + validation_data: vfp.clone(), + relay_chain_state, + downward_messages: Default::default(), + horizontal_messages: Default::default(), + }; + inherent_data + .put_data( + cumulus_primitives_parachain_inherent::INHERENT_IDENTIFIER, + &system_inherent_data, + ) + .expect("failed to put VFP inherent"); + inherent_data + }; + + // execute the block + T::create_inherent(&inherent_data) + .expect("got an inherent") + .dispatch_bypass_filter(RawOrigin::None.into()) + .expect("dispatch succeeded"); +} diff --git a/parachains/runtimes/assets/test-utils/src/test_cases.rs b/parachains/runtimes/assets/test-utils/src/test_cases.rs new file mode 100644 index 00000000000..3614f03e7d9 --- /dev/null +++ b/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -0,0 +1,1323 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Module contains predefined test-case scenarios for `Runtime` with various assets. + +use crate::{ + assert_metadata, assert_total, AccountIdOf, BalanceOf, ExtBuilder, RuntimeHelper, + SessionKeysOf, ValidatorIdOf, XcmReceivedFrom, +}; +use codec::Encode; +use frame_support::{ + assert_noop, assert_ok, + traits::{fungibles::InspectEnumerable, Get, OriginTrait}, + weights::Weight, +}; +use parachains_common::Balance; +use sp_runtime::{ + traits::{StaticLookup, Zero}, + DispatchError, Saturating, +}; +use xcm::latest::prelude::*; +use xcm_executor::{traits::Convert, XcmExecutor}; + +pub struct CollatorSessionKeys< + Runtime: frame_system::Config + pallet_balances::Config + pallet_session::Config, +> { + collator: AccountIdOf, + validator: ValidatorIdOf, + key: SessionKeysOf, +} + +impl + CollatorSessionKeys +{ + pub fn new( + collator: AccountIdOf, + validator: ValidatorIdOf, + key: SessionKeysOf, + ) -> Self { + Self { collator, validator, key } + } + pub fn collators(&self) -> Vec> { + vec![self.collator.clone()] + } + + pub fn session_keys( + &self, + ) -> Vec<(AccountIdOf, ValidatorIdOf, SessionKeysOf)> { + vec![(self.collator.clone(), self.validator.clone(), self.key.clone())] + } +} + +/// Test-case makes sure that `Runtime` can receive native asset from relay chain +/// and can teleport it back and to the other parachains +pub fn teleports_for_native_asset_works< + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + HrmpChannelOpener, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + target_account: AccountIdOf, + unwrap_pallet_xcm_event: Box) -> Option>>, + unwrap_xcmp_queue_event: Box< + dyn Fn(Vec) -> Option>, + >, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + cumulus_pallet_xcmp_queue::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From + Into, + WeightToFee: frame_support::weights::WeightToFee, + ::Balance: From + Into, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + XcmConfig: xcm_executor::Config, + CheckingAccount: Get>, + HrmpChannelOpener: frame_support::inherent::ProvideInherent< + Call = cumulus_pallet_parachain_system::Call, + >, +{ + let runtime_para_id = 1000; + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_safe_xcm_version(XCM_VERSION) + .with_para_id(runtime_para_id.into()) + .build() + .execute_with(|| { + // check Balances before + assert_eq!(>::free_balance(&target_account), 0.into()); + assert_eq!( + >::free_balance(&CheckingAccount::get()), + 0.into() + ); + + let native_asset_id = MultiLocation::parent(); + let buy_execution_fee_amount_eta = + WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 0)); + let native_asset_amount_unit = existential_deposit; + let native_asset_amount_received = + native_asset_amount_unit * 10.into() + buy_execution_fee_amount_eta.into(); + + // 1. process received teleported assets from relaychain + let xcm = Xcm(vec![ + ReceiveTeleportedAsset(MultiAssets::from(vec![MultiAsset { + id: Concrete(native_asset_id), + fun: Fungible(native_asset_amount_received.into()), + }])), + ClearOrigin, + BuyExecution { + fees: MultiAsset { + id: Concrete(native_asset_id), + fun: Fungible(buy_execution_fee_amount_eta.into()), + }, + weight_limit: Limited(Weight::from_parts(303531000, 65536)), + }, + DepositAsset { + assets: Wild(AllCounted(1)), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: target_account.clone().into(), + }), + }, + }, + ExpectTransactStatus(MaybeErrorCode::Success), + ]); + + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + let outcome = XcmExecutor::::execute_xcm( + Parent, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Parent), + ); + assert_eq!(outcome.ensure_complete(), Ok(())); + + // check Balances after + assert_ne!(>::free_balance(&target_account), 0.into()); + assert_eq!( + >::free_balance(&CheckingAccount::get()), + 0.into() + ); + + // 2. try to teleport asset back to the relaychain + { + let dest = MultiLocation::parent(); + let dest_beneficiary = MultiLocation::parent() + .appended_with(AccountId32 { + network: None, + id: sp_runtime::AccountId32::new([3; 32]).into(), + }) + .unwrap(); + + let target_account_balance_before_teleport = + >::free_balance(&target_account); + let native_asset_to_teleport_away = native_asset_amount_unit * 3.into(); + assert!( + native_asset_to_teleport_away < + target_account_balance_before_teleport - existential_deposit + ); + + assert_ok!(RuntimeHelper::::do_teleport_assets::( + RuntimeHelper::::origin_of(target_account.clone()), + dest, + dest_beneficiary, + (native_asset_id, native_asset_to_teleport_away.clone().into()), + None, + )); + // check balances + assert_eq!( + >::free_balance(&target_account), + target_account_balance_before_teleport - native_asset_to_teleport_away + ); + assert_eq!( + >::free_balance(&CheckingAccount::get()), + 0.into() + ); + + // check events + RuntimeHelper::::assert_pallet_xcm_event_outcome( + &unwrap_pallet_xcm_event, + |outcome| { + assert_ok!(outcome.ensure_complete()); + }, + ); + } + + // 3. try to teleport asset away to other parachain (1234) + { + let other_para_id = 1234; + let dest = MultiLocation::new(1, X1(Parachain(other_para_id))); + let dest_beneficiary = MultiLocation::new(1, X1(Parachain(other_para_id))) + .appended_with(AccountId32 { + network: None, + id: sp_runtime::AccountId32::new([3; 32]).into(), + }) + .unwrap(); + + let target_account_balance_before_teleport = + >::free_balance(&target_account); + let native_asset_to_teleport_away = native_asset_amount_unit * 3.into(); + assert!( + native_asset_to_teleport_away < + target_account_balance_before_teleport - existential_deposit + ); + + assert_ok!(RuntimeHelper::::do_teleport_assets::( + RuntimeHelper::::origin_of(target_account.clone()), + dest, + dest_beneficiary, + (native_asset_id, native_asset_to_teleport_away.clone().into()), + Some((runtime_para_id, other_para_id)), + )); + + // check balances + assert_eq!( + >::free_balance(&target_account), + target_account_balance_before_teleport - native_asset_to_teleport_away + ); + assert_eq!( + >::free_balance(&CheckingAccount::get()), + 0.into() + ); + + // check events + RuntimeHelper::::assert_pallet_xcm_event_outcome( + &unwrap_pallet_xcm_event, + |outcome| { + assert_ok!(outcome.ensure_complete()); + }, + ); + assert!(RuntimeHelper::::xcmp_queue_message_sent(unwrap_xcmp_queue_event) + .is_some()); + } + }) +} + +#[macro_export] +macro_rules! include_teleports_for_native_asset_works( + ( + $runtime:path, + $xcm_config:path, + $checking_account:path, + $weight_to_fee:path, + $hrmp_channel_opener:path, + $collator_session_key:expr, + $existential_deposit:expr, + $unwrap_pallet_xcm_event:expr, + $unwrap_xcmp_queue_event:expr + ) => { + #[test] + fn teleports_for_native_asset_works() { + const BOB: [u8; 32] = [2u8; 32]; + let target_account = parachains_common::AccountId::from(BOB); + + asset_test_utils::test_cases::teleports_for_native_asset_works::< + $runtime, + $xcm_config, + $checking_account, + $weight_to_fee, + $hrmp_channel_opener + >( + $collator_session_key, + $existential_deposit, + target_account, + $unwrap_pallet_xcm_event, + $unwrap_xcmp_queue_event + ) + } + } +); + +/// Test-case makes sure that `Runtime` can receive teleported assets from sibling parachain relay chain +pub fn teleports_for_foreign_assets_works< + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + HrmpChannelOpener, + SovereignAccountOf, + ForeignAssetsPalletInstance, +>( + collator_session_keys: CollatorSessionKeys, + target_account: AccountIdOf, + existential_deposit: BalanceOf, + asset_owner: AccountIdOf, + unwrap_pallet_xcm_event: Box) -> Option>>, + unwrap_xcmp_queue_event: Box< + dyn Fn(Vec) -> Option>, + >, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + cumulus_pallet_xcmp_queue::Config + + pallet_assets::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + XcmConfig: xcm_executor::Config, + CheckingAccount: Get>, + HrmpChannelOpener: frame_support::inherent::ProvideInherent< + Call = cumulus_pallet_parachain_system::Call, + >, + WeightToFee: frame_support::weights::WeightToFee, + ::Balance: From + Into, + SovereignAccountOf: Convert>, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: + From + Into, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + ForeignAssetsPalletInstance: 'static, +{ + // foreign parachain with the same consenus currency as asset + let foreign_para_id = 2222; + let foreign_asset_id_multilocation = MultiLocation { + parents: 1, + interior: X2(Parachain(foreign_para_id), GeneralIndex(1234567)), + }; + + // foreign creator, which can be sibling parachain to match ForeignCreators + let foreign_creator = MultiLocation { parents: 1, interior: X1(Parachain(foreign_para_id)) }; + let foreign_creator_as_account_id = SovereignAccountOf::convert(foreign_creator).expect(""); + + // we want to buy execution with local relay chain currency + let buy_execution_fee_amount = + WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 0)); + let buy_execution_fee = MultiAsset { + id: Concrete(MultiLocation::parent()), + fun: Fungible(buy_execution_fee_amount.into()), + }; + + let teleported_foreign_asset_amount = 10000000000000; + let runtime_para_id = 1000; + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![ + ( + foreign_creator_as_account_id.clone(), + existential_deposit + (buy_execution_fee_amount * 2).into(), + ), + (target_account.clone(), existential_deposit), + (CheckingAccount::get(), existential_deposit), + ]) + .with_safe_xcm_version(XCM_VERSION) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + // checks target_account before + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + assert_eq!( + >::free_balance(&CheckingAccount::get()), + existential_deposit + ); + // check `CheckingAccount` before + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &target_account + ), + 0.into() + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &CheckingAccount::get() + ), + 0.into() + ); + // check totals before + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >(foreign_asset_id_multilocation, 0, 0); + + // create foreign asset (0 total issuance) + let asset_minimum_asset_balance = 3333333_u128; + assert_ok!( + >::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_multilocation.into(), + asset_owner.into(), + false, + asset_minimum_asset_balance.into() + ) + ); + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >(foreign_asset_id_multilocation, 0, 0); + assert!(teleported_foreign_asset_amount > asset_minimum_asset_balance); + + // 1. process received teleported assets from relaychain + let xcm = Xcm(vec![ + // BuyExecution with relaychain native token + WithdrawAsset(buy_execution_fee.clone().into()), + BuyExecution { + fees: MultiAsset { + id: Concrete(MultiLocation::parent()), + fun: Fungible(buy_execution_fee_amount.into()), + }, + weight_limit: Limited(Weight::from_parts(403531000, 65536)), + }, + // Process teleported asset + ReceiveTeleportedAsset(MultiAssets::from(vec![MultiAsset { + id: Concrete(foreign_asset_id_multilocation), + fun: Fungible(teleported_foreign_asset_amount), + }])), + DepositAsset { + assets: Wild(AllOf { + id: Concrete(foreign_asset_id_multilocation), + fun: WildFungibility::Fungible, + }), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: target_account.clone().into(), + }), + }, + }, + ExpectTransactStatus(MaybeErrorCode::Success), + ]); + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + let outcome = XcmExecutor::::execute_xcm( + foreign_creator, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ); + assert_eq!(outcome.ensure_complete(), Ok(())); + + // checks target_account after + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &target_account + ), + teleported_foreign_asset_amount.into() + ); + // checks `CheckingAccount` after + assert_eq!( + >::free_balance(&CheckingAccount::get()), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &CheckingAccount::get() + ), + 0.into() + ); + // check total after (twice: target_account + CheckingAccount) + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >( + foreign_asset_id_multilocation, + teleported_foreign_asset_amount, + teleported_foreign_asset_amount, + ); + + // 2. try to teleport asset back to source parachain (foreign_para_id) + { + let dest = MultiLocation::new(1, X1(Parachain(foreign_para_id))); + let dest_beneficiary = MultiLocation::new(1, X1(Parachain(foreign_para_id))) + .appended_with(AccountId32 { + network: None, + id: sp_runtime::AccountId32::new([3; 32]).into(), + }) + .unwrap(); + + let target_account_balance_before_teleport = + >::balance( + foreign_asset_id_multilocation.into(), + &target_account, + ); + let asset_to_teleport_away = asset_minimum_asset_balance * 3; + assert!( + asset_to_teleport_away < + (target_account_balance_before_teleport - + asset_minimum_asset_balance.into()) + .into() + ); + + assert_ok!(RuntimeHelper::::do_teleport_assets::( + RuntimeHelper::::origin_of(target_account.clone()), + dest, + dest_beneficiary, + (foreign_asset_id_multilocation, asset_to_teleport_away.clone().into()), + Some((runtime_para_id, foreign_para_id)), + )); + + // check balances + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &target_account + ), + (target_account_balance_before_teleport - asset_to_teleport_away.into()) + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &CheckingAccount::get() + ), + 0.into() + ); + // check total after (twice: target_account + CheckingAccount) + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >( + foreign_asset_id_multilocation, + teleported_foreign_asset_amount - asset_to_teleport_away, + teleported_foreign_asset_amount - asset_to_teleport_away, + ); + + // check events + RuntimeHelper::::assert_pallet_xcm_event_outcome( + &unwrap_pallet_xcm_event, + |outcome| { + assert_ok!(outcome.ensure_complete()); + }, + ); + assert!(RuntimeHelper::::xcmp_queue_message_sent(unwrap_xcmp_queue_event) + .is_some()); + } + }) +} + +#[macro_export] +macro_rules! include_teleports_for_foreign_assets_works( + ( + $runtime:path, + $xcm_config:path, + $checking_account:path, + $weight_to_fee:path, + $hrmp_channel_opener:path, + $sovereign_account_of:path, + $assets_pallet_instance:path, + $collator_session_key:expr, + $existential_deposit:expr, + $unwrap_pallet_xcm_event:expr, + $unwrap_xcmp_queue_event:expr + ) => { + #[test] + fn teleports_for_foreign_assets_works() { + const BOB: [u8; 32] = [2u8; 32]; + let target_account = parachains_common::AccountId::from(BOB); + const SOME_ASSET_OWNER: [u8; 32] = [5u8; 32]; + let asset_owner = parachains_common::AccountId::from(SOME_ASSET_OWNER); + + asset_test_utils::test_cases::teleports_for_foreign_assets_works::< + $runtime, + $xcm_config, + $checking_account, + $weight_to_fee, + $hrmp_channel_opener, + $sovereign_account_of, + $assets_pallet_instance + >( + $collator_session_key, + target_account, + $existential_deposit, + asset_owner, + $unwrap_pallet_xcm_event, + $unwrap_xcmp_queue_event + ) + } + } +); + +/// Test-case makes sure that `Runtime`'s `xcm::AssetTransactor` can handle native relay chain currency +pub fn asset_transactor_transfer_with_local_consensus_currency_works( + collator_session_keys: CollatorSessionKeys, + source_account: AccountIdOf, + target_account: AccountIdOf, + existential_deposit: BalanceOf, + additional_checks_before: Box, + additional_checks_after: Box, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + XcmConfig: xcm_executor::Config, + ::Balance: From + Into, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, +{ + let unit = existential_deposit; + + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![(source_account.clone(), (BalanceOf::::from(10_u128) * unit))]) + .with_tracing() + .build() + .execute_with(|| { + // check Balances before + assert_eq!( + >::free_balance(&source_account), + (BalanceOf::::from(10_u128) * unit) + ); + assert_eq!( + >::free_balance(&target_account), + (BalanceOf::::zero() * unit) + ); + + // additional check before + additional_checks_before(); + + // transfer_asset (deposit/withdraw) ALICE -> BOB + let _ = RuntimeHelper::::do_transfer( + MultiLocation { + parents: 0, + interior: X1(AccountId32 { network: None, id: source_account.clone().into() }), + }, + MultiLocation { + parents: 0, + interior: X1(AccountId32 { network: None, id: target_account.clone().into() }), + }, + // local_consensus_currency_asset, e.g.: relaychain token (KSM, DOT, ...) + ( + MultiLocation { parents: 1, interior: Here }, + (BalanceOf::::from(1_u128) * unit).into(), + ), + ) + .expect("no error"); + + // check Balances after + assert_eq!( + >::free_balance(source_account), + (BalanceOf::::from(9_u128) * unit) + ); + assert_eq!( + >::free_balance(target_account), + (BalanceOf::::from(1_u128) * unit) + ); + + additional_checks_after(); + }) +} + +#[macro_export] +macro_rules! include_asset_transactor_transfer_with_local_consensus_currency_works( + ( + $runtime:path, + $xcm_config:path, + $collator_session_key:expr, + $existential_deposit:expr, + $additional_checks_before:expr, + $additional_checks_after:expr + ) => { + #[test] + fn asset_transactor_transfer_with_local_consensus_currency_works() { + const ALICE: [u8; 32] = [1u8; 32]; + let source_account = parachains_common::AccountId::from(ALICE); + const BOB: [u8; 32] = [2u8; 32]; + let target_account = parachains_common::AccountId::from(BOB); + + asset_test_utils::test_cases::asset_transactor_transfer_with_local_consensus_currency_works::< + $runtime, + $xcm_config + >( + $collator_session_key, + source_account, + target_account, + $existential_deposit, + $additional_checks_before, + $additional_checks_after + ) + } + } +); + +///Test-case makes sure that `Runtime`'s `xcm::AssetTransactor` can handle native relay chain currency +pub fn asset_transactor_transfer_with_pallet_assets_instance_works< + Runtime, + XcmConfig, + AssetsPalletInstance, + AssetId, + AssetIdConverter, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + asset_id: AssetId, + asset_owner: AccountIdOf, + alice_account: AccountIdOf, + bob_account: AccountIdOf, + charlie_account: AccountIdOf, + additional_checks_before: Box, + additional_checks_after: Box, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + pallet_assets::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + XcmConfig: xcm_executor::Config, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: From + Into, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + AssetsPalletInstance: 'static, + AssetId: Clone + Copy, + AssetIdConverter: Convert, +{ + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![ + (asset_owner.clone(), existential_deposit), + (alice_account.clone(), existential_deposit), + (bob_account.clone(), existential_deposit), + ]) + .with_tracing() + .build() + .execute_with(|| { + // create some asset class + let asset_minimum_asset_balance = 3333333_u128; + let asset_id_as_multilocation = AssetIdConverter::reverse_ref(&asset_id).unwrap(); + assert_ok!(>::force_create( + RuntimeHelper::::root_origin(), + asset_id.into(), + asset_owner.clone().into(), + false, + asset_minimum_asset_balance.into() + )); + + // We first mint enough asset for the account to exist for assets + assert_ok!(>::mint( + RuntimeHelper::::origin_of(asset_owner.clone()), + asset_id.into(), + alice_account.clone().into(), + (6 * asset_minimum_asset_balance).into() + )); + + // check Assets before + assert_eq!( + >::balance( + asset_id.into(), + &alice_account + ), + (6 * asset_minimum_asset_balance).into() + ); + assert_eq!( + >::balance( + asset_id.into(), + &bob_account + ), + 0.into() + ); + assert_eq!( + >::balance( + asset_id.into(), + &charlie_account + ), + 0.into() + ); + assert_eq!( + >::balance( + asset_id.into(), + &asset_owner + ), + 0.into() + ); + assert_eq!( + >::free_balance(&alice_account), + existential_deposit + ); + assert_eq!( + >::free_balance(&bob_account), + existential_deposit + ); + assert_eq!( + >::free_balance(&charlie_account), + 0.into() + ); + assert_eq!( + >::free_balance(&asset_owner), + existential_deposit + ); + additional_checks_before(); + + // transfer_asset (deposit/withdraw) ALICE -> CHARLIE (not ok - Charlie does not have ExistentialDeposit) + assert_noop!( + RuntimeHelper::::do_transfer( + MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: alice_account.clone().into() + }), + }, + MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: charlie_account.clone().into() + }), + }, + (asset_id_as_multilocation, 1 * asset_minimum_asset_balance), + ), + XcmError::FailedToTransactAsset(Into::<&str>::into( + sp_runtime::TokenError::CannotCreate + )) + ); + + // transfer_asset (deposit/withdraw) ALICE -> BOB (ok - has ExistentialDeposit) + assert!(matches!( + RuntimeHelper::::do_transfer( + MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: alice_account.clone().into() + }), + }, + MultiLocation { + parents: 0, + interior: X1(AccountId32 { network: None, id: bob_account.clone().into() }), + }, + (asset_id_as_multilocation, 1 * asset_minimum_asset_balance), + ), + Ok(_) + )); + + // check Assets after + assert_eq!( + >::balance( + asset_id.into(), + &alice_account + ), + (5 * asset_minimum_asset_balance).into() + ); + assert_eq!( + >::balance( + asset_id.into(), + &bob_account + ), + (1 * asset_minimum_asset_balance).into() + ); + assert_eq!( + >::balance( + asset_id.into(), + &charlie_account + ), + 0.into() + ); + assert_eq!( + >::balance( + asset_id.into(), + &asset_owner + ), + 0.into() + ); + assert_eq!( + >::free_balance(&alice_account), + existential_deposit + ); + assert_eq!( + >::free_balance(&bob_account), + existential_deposit + ); + assert_eq!( + >::free_balance(&charlie_account), + 0.into() + ); + assert_eq!( + >::free_balance(&asset_owner), + existential_deposit + ); + + additional_checks_after(); + }) +} + +#[macro_export] +macro_rules! include_asset_transactor_transfer_with_pallet_assets_instance_works( + ( + $test_name:tt, + $runtime:path, + $xcm_config:path, + $assets_pallet_instance:path, + $asset_id:path, + $asset_id_converter:path, + $collator_session_key:expr, + $existential_deposit:expr, + $tested_asset_id:expr, + $additional_checks_before:expr, + $additional_checks_after:expr + ) => { + #[test] + fn $test_name() { + const SOME_ASSET_OWNER: [u8; 32] = [5u8; 32]; + let asset_owner = parachains_common::AccountId::from(SOME_ASSET_OWNER); + const ALICE: [u8; 32] = [1u8; 32]; + let alice_account = parachains_common::AccountId::from(ALICE); + const BOB: [u8; 32] = [2u8; 32]; + let bob_account = parachains_common::AccountId::from(BOB); + const CHARLIE: [u8; 32] = [3u8; 32]; + let charlie_account = parachains_common::AccountId::from(CHARLIE); + + asset_test_utils::test_cases::asset_transactor_transfer_with_pallet_assets_instance_works::< + $runtime, + $xcm_config, + $assets_pallet_instance, + $asset_id, + $asset_id_converter + >( + $collator_session_key, + $existential_deposit, + $tested_asset_id, + asset_owner, + alice_account, + bob_account, + charlie_account, + $additional_checks_before, + $additional_checks_after + ) + } + } +); + +pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works< + Runtime, + XcmConfig, + WeightToFee, + SovereignAccountOf, + ForeignAssetsPalletInstance, + AssetId, + AssetIdConverter, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + asset_deposit: BalanceOf, + metadata_deposit_base: BalanceOf, + metadata_deposit_per_byte: BalanceOf, + alice_account: AccountIdOf, + bob_account: AccountIdOf, + runtime_call_encode: Box< + dyn Fn(pallet_assets::Call) -> Vec, + >, + unwrap_pallet_assets_event: Box< + dyn Fn(Vec) -> Option>, + >, + additional_checks_before: Box, + additional_checks_after: Box, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + pallet_assets::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + XcmConfig: xcm_executor::Config, + WeightToFee: frame_support::weights::WeightToFee, + ::Balance: From + Into, + SovereignAccountOf: Convert>, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: + From + Into, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + ForeignAssetsPalletInstance: 'static, + AssetId: Clone + Copy, + AssetIdConverter: Convert, +{ + // foreign parachain with the same consenus currency as asset + let foreign_asset_id_multilocation = + MultiLocation { parents: 1, interior: X2(Parachain(2222), GeneralIndex(1234567)) }; + let asset_id = AssetIdConverter::convert(foreign_asset_id_multilocation).unwrap(); + + // foreign creator, which can be sibling parachain to match ForeignCreators + let foreign_creator = MultiLocation { parents: 1, interior: X1(Parachain(2222)) }; + let foreign_creator_as_account_id = SovereignAccountOf::convert(foreign_creator).expect(""); + + // we want to buy execution with local relay chain currency + let buy_execution_fee_amount = + WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 0)); + let buy_execution_fee = MultiAsset { + id: Concrete(MultiLocation::parent()), + fun: Fungible(buy_execution_fee_amount), + }; + + const ASSET_NAME: &str = "My super coin"; + const ASSET_SYMBOL: &str = "MY_S_COIN"; + let metadata_deposit_per_byte_eta = metadata_deposit_per_byte + .saturating_mul(((ASSET_NAME.len() + ASSET_SYMBOL.len()) as u128).into()); + + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![( + foreign_creator_as_account_id.clone(), + existential_deposit + + asset_deposit + metadata_deposit_base + + metadata_deposit_per_byte_eta + + buy_execution_fee_amount.into() + + buy_execution_fee_amount.into(), + )]) + .with_tracing() + .build() + .execute_with(|| { + assert!(>::asset_ids() + .collect::>() + .is_empty()); + assert_eq!( + >::free_balance(&foreign_creator_as_account_id), + existential_deposit + + asset_deposit + metadata_deposit_base + + metadata_deposit_per_byte_eta + + buy_execution_fee_amount.into() + + buy_execution_fee_amount.into() + ); + additional_checks_before(); + + // execute XCM with Transacts to create/manage foreign assets by foreign governance + // prepapre data for xcm::Transact(create) + let foreign_asset_create = runtime_call_encode(pallet_assets::Call::< + Runtime, + ForeignAssetsPalletInstance, + >::create { + id: asset_id.into(), + // admin as sovereign_account + admin: foreign_creator_as_account_id.clone().into(), + min_balance: 1.into(), + }); + // prepapre data for xcm::Transact(set_metadata) + let foreign_asset_set_metadata = runtime_call_encode(pallet_assets::Call::< + Runtime, + ForeignAssetsPalletInstance, + >::set_metadata { + id: asset_id.into(), + name: Vec::from(ASSET_NAME), + symbol: Vec::from(ASSET_SYMBOL), + decimals: 12, + }); + // prepapre data for xcm::Transact(set_team - change just freezer to Bob) + let foreign_asset_set_team = runtime_call_encode(pallet_assets::Call::< + Runtime, + ForeignAssetsPalletInstance, + >::set_team { + id: asset_id.into(), + issuer: foreign_creator_as_account_id.clone().into(), + admin: foreign_creator_as_account_id.clone().into(), + freezer: bob_account.clone().into(), + }); + + // lets simulate this was triggered by relay chain from local consensus sibling parachain + let xcm = Xcm(vec![ + WithdrawAsset(buy_execution_fee.clone().into()), + BuyExecution { fees: buy_execution_fee.clone().into(), weight_limit: Unlimited }, + Transact { + origin_kind: OriginKind::Xcm, + require_weight_at_most: Weight::from_parts(40_000_000_000, 6000), + call: foreign_asset_create.into(), + }, + Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most: Weight::from_parts(20_000_000_000, 6000), + call: foreign_asset_set_metadata.into(), + }, + Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most: Weight::from_parts(20_000_000_000, 6000), + call: foreign_asset_set_team.into(), + }, + ExpectTransactStatus(MaybeErrorCode::Success), + ]); + + // messages with different consensus should go through the local bridge-hub + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + // execute xcm as XcmpQueue would do + let outcome = XcmExecutor::::execute_xcm( + foreign_creator, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ); + assert_eq!(outcome.ensure_complete(), Ok(())); + + // check events + let mut events = >::events() + .into_iter() + .filter_map(|e| unwrap_pallet_assets_event(e.event.encode())); + assert!(events.any(|e| matches!(e, pallet_assets::Event::Created { .. }))); + assert!(events.any(|e| matches!(e, pallet_assets::Event::MetadataSet { .. }))); + assert!(events.any(|e| matches!(e, pallet_assets::Event::TeamChanged { .. }))); + + // check assets after + assert!(!>::asset_ids() + .collect::>() + .is_empty()); + + // check update metadata + use frame_support::traits::tokens::fungibles::roles::Inspect as InspectRoles; + assert_eq!( + >::owner( + asset_id.into() + ), + Some(foreign_creator_as_account_id.clone()) + ); + assert_eq!( + >::admin( + asset_id.into() + ), + Some(foreign_creator_as_account_id.clone()) + ); + assert_eq!( + >::issuer( + asset_id.into() + ), + Some(foreign_creator_as_account_id.clone()) + ); + assert_eq!( + >::freezer( + asset_id.into() + ), + Some(bob_account.clone()) + ); + assert!( + >::free_balance(&foreign_creator_as_account_id) >= + existential_deposit + buy_execution_fee_amount.into(), + "Free balance: {:?} should be ge {:?}", + >::free_balance(&foreign_creator_as_account_id), + existential_deposit + buy_execution_fee_amount.into() + ); + assert_metadata::< + pallet_assets::Pallet, + AccountIdOf, + >(asset_id, ASSET_NAME, ASSET_SYMBOL, 12); + + // check if changed freezer, can freeze + assert_noop!( + >::freeze( + RuntimeHelper::::origin_of(bob_account), + asset_id.into(), + alice_account.clone().into() + ), + pallet_assets::Error::::NoAccount + ); + assert_noop!( + >::freeze( + RuntimeHelper::::origin_of(foreign_creator_as_account_id.clone()), + asset_id.into(), + alice_account.into() + ), + pallet_assets::Error::::NoPermission + ); + + // lets try create asset for different parachain(3333) (foreign_creator(2222) can create just his assets) + let foreign_asset_id_multilocation = + MultiLocation { parents: 1, interior: X2(Parachain(3333), GeneralIndex(1234567)) }; + let asset_id = AssetIdConverter::convert(foreign_asset_id_multilocation).unwrap(); + + // prepare data for xcm::Transact(create) + let foreign_asset_create = runtime_call_encode(pallet_assets::Call::< + Runtime, + ForeignAssetsPalletInstance, + >::create { + id: asset_id.into(), + // admin as sovereign_account + admin: foreign_creator_as_account_id.clone().into(), + min_balance: 1.into(), + }); + let xcm = Xcm(vec![ + WithdrawAsset(buy_execution_fee.clone().into()), + BuyExecution { fees: buy_execution_fee.clone().into(), weight_limit: Unlimited }, + Transact { + origin_kind: OriginKind::Xcm, + require_weight_at_most: Weight::from_parts(20_000_000_000, 6000), + call: foreign_asset_create.into(), + }, + ExpectTransactStatus(MaybeErrorCode::from(DispatchError::BadOrigin.encode())), + ]); + + // messages with different consensus should go through the local bridge-hub + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + // execute xcm as XcmpQueue would do + let outcome = XcmExecutor::::execute_xcm( + foreign_creator, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ); + assert_eq!(outcome.ensure_complete(), Ok(())); + + additional_checks_after(); + }) +} + +#[macro_export] +macro_rules! include_create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works( + ( + $runtime:path, + $xcm_config:path, + $weight_to_fee:path, + $sovereign_account_of:path, + $assets_pallet_instance:path, + $asset_id:path, + $asset_id_converter:path, + $collator_session_key:expr, + $existential_deposit:expr, + $asset_deposit:expr, + $metadata_deposit_base:expr, + $metadata_deposit_per_byte:expr, + $runtime_call_encode:expr, + $unwrap_pallet_assets_event:expr, + $additional_checks_before:expr, + $additional_checks_after:expr + ) => { + #[test] + fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works() { + const ALICE: [u8; 32] = [1u8; 32]; + let alice_account = parachains_common::AccountId::from(ALICE); + const BOB: [u8; 32] = [2u8; 32]; + let bob_account = parachains_common::AccountId::from(BOB); + + asset_test_utils::test_cases::create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works::< + $runtime, + $xcm_config, + $weight_to_fee, + $sovereign_account_of, + $assets_pallet_instance, + $asset_id, + $asset_id_converter + >( + $collator_session_key, + $existential_deposit, + $asset_deposit, + $metadata_deposit_base, + $metadata_deposit_per_byte, + alice_account, + bob_account, + $runtime_call_encode, + $unwrap_pallet_assets_event, + $additional_checks_before, + $additional_checks_after + ) + } + } +); diff --git a/parachains/runtimes/assets/westmint/Cargo.toml b/parachains/runtimes/assets/westmint/Cargo.toml index 31e98071b18..c08d432ec33 100644 --- a/parachains/runtimes/assets/westmint/Cargo.toml +++ b/parachains/runtimes/assets/westmint/Cargo.toml @@ -103,6 +103,7 @@ runtime-benchmarks = [ "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", + "assets-common/runtime-benchmarks", ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 5f36862ae98..8fca37c35bf 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -69,17 +69,20 @@ use parachains_common::{ NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - TrustBackedAssetsConvertedConcreteId, WestendLocation, XcmConfig, - XcmOriginToTransactDispatchOrigin, + ForeignAssetsConvertedConcreteId, TrustBackedAssetsConvertedConcreteId, WestendLocation, + XcmConfig, XcmOriginToTransactDispatchOrigin, }; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -// Polkadot imports +use assets_common::{ + foreign_creators::ForeignCreators, matching::FromSiblingParachain, MultiLocationForAssetId, +}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm_executor::XcmExecutor; +use crate::xcm_config::ForeignCreatorsSovereignAccountOf; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; impl_opaque_keys! { @@ -250,6 +253,48 @@ impl pallet_assets::Config for Runtime { type BenchmarkHelper = (); } +parameter_types! { + // we just reuse the same deposits + pub const ForeignAssetsAssetDeposit: Balance = AssetDeposit::get(); + pub const ForeignAssetsAssetAccountDeposit: Balance = AssetAccountDeposit::get(); + pub const ForeignAssetsApprovalDeposit: Balance = ApprovalDeposit::get(); + pub const ForeignAssetsAssetsStringLimit: u32 = AssetsStringLimit::get(); + pub const ForeignAssetsMetadataDepositBase: Balance = MetadataDepositBase::get(); + pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get(); +} + +/// Assets managed by some foreign location. Note: we do not declare a `ForeignAssetsCall` type, as +/// this type is used in proxy definitions. We assume that a foreign location would not want to set +/// an individual, local account as a proxy for the issuance of their assets. This issuance should +/// be managed by the foreign location's governance. +pub type ForeignAssetsInstance = pallet_assets::Instance2; +impl pallet_assets::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type AssetId = MultiLocationForAssetId; + type AssetIdParameter = MultiLocationForAssetId; + type Currency = Balances; + type CreateOrigin = ForeignCreators< + (FromSiblingParachain>,), + ForeignCreatorsSovereignAccountOf, + AccountId, + >; + type ForceOrigin = AssetsForceOrigin; + type AssetDeposit = ForeignAssetsAssetDeposit; + type MetadataDepositBase = ForeignAssetsMetadataDepositBase; + type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte; + type ApprovalDeposit = ForeignAssetsApprovalDeposit; + type StringLimit = ForeignAssetsAssetsStringLimit; + type Freezer = (); + type Extra = (); + type WeightInfo = weights::pallet_assets::WeightInfo; + type CallbackHandle = (); + type AssetAccountDeposit = ForeignAssetsAssetAccountDeposit; + type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = xcm_config::XcmBenchmarkHelper; +} + parameter_types! { // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. pub const DepositBase: Balance = deposit(1, 88); @@ -322,6 +367,7 @@ impl Default for ProxyType { Self::Any } } + impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { @@ -661,6 +707,7 @@ construct_runtime!( Assets: pallet_assets::::{Pallet, Call, Storage, Event} = 50, Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 51, Nfts: pallet_nfts::{Pallet, Call, Storage, Event} = 52, + ForeignAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 53, } ); @@ -710,6 +757,7 @@ mod benches { define_benchmarks!( [frame_system, SystemBench::] [pallet_assets, Assets] + [pallet_assets, ForeignAssets] [pallet_balances, Balances] [pallet_multisig, Multisig] [pallet_nfts, Nfts] @@ -929,11 +977,17 @@ impl_runtime_apis! { }, // collect pallet_assets (TrustBackedAssets) convert::<_, _, _, _, TrustBackedAssetsConvertedConcreteId>( - Assets::account_balances(account) + Assets::account_balances(account.clone()) + .iter() + .filter(|(_, balance)| balance > &0) + )?, + // collect pallet_assets (ForeignAssets) + convert::<_, _, _, _, ForeignAssetsConvertedConcreteId>( + ForeignAssets::account_balances(account) .iter() .filter(|(_, balance)| balance > &0) )?, - // collect ... e.g. pallet_assets ForeignAssets + // collect ... e.g. other tokens ].concat()) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index c3317d540aa..bbaef6c16ec 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=westmint-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::fungible -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=westmint-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,17 +51,25 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn withdraw_asset() -> Weight { - Weight::from_parts(20_735_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn withdraw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3593` + // Minimum execution time: 37_770_000 picoseconds. + Weight::from_parts(38_616_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn transfer_asset() -> Weight { - Weight::from_parts(28_940_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn transfer_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `6196` + // Minimum execution time: 33_080_000 picoseconds. + Weight::from_parts(33_350_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -76,20 +85,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_parts(50_175_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + pub fn transfer_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `176` + // Estimated: `17970` + // Minimum execution time: 94_868_000 picoseconds. + Weight::from_parts(95_349_000, 17970) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } - pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_parts(4_059_000 as u64, 0) + pub fn receive_teleported_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_378_000 picoseconds. + Weight::from_parts(4_471_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn deposit_asset() -> Weight { - Weight::from_parts(22_181_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn deposit_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 25_401_000 picoseconds. + Weight::from_parts(25_744_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -105,10 +126,14 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_parts(45_905_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn deposit_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `14862` + // Minimum execution time: 54_166_000 picoseconds. + Weight::from_parts(54_680_000, 14862) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -122,9 +147,13 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_teleport() -> Weight { - Weight::from_parts(29_820_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `11269` + // Minimum execution time: 34_063_000 picoseconds. + Weight::from_parts(34_404_000, 11269) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 3a0e0efc098..1da9e6ecca4 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=westmint-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=westmint-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,40 +61,80 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_holding() -> Weight { - Weight::from_parts(360_208_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_holding() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `11269` + // Minimum execution time: 366_645_000 picoseconds. + Weight::from_parts(368_433_000, 11269) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn buy_execution() -> Weight { - Weight::from_parts(3_876_000 as u64, 0) + pub fn buy_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_034_000 picoseconds. + Weight::from_parts(4_167_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - pub(crate) fn query_response() -> Weight { - Weight::from_parts(11_240_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + pub fn query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `69` + // Estimated: `3534` + // Minimum execution time: 11_582_000 picoseconds. + Weight::from_parts(11_769_000, 3534) + .saturating_add(T::DbWeight::get().reads(1)) } - pub(crate) fn transact() -> Weight { - Weight::from_parts(12_244_000 as u64, 0) + pub fn transact() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_412_000 picoseconds. + Weight::from_parts(13_744_000, 0) } - pub(crate) fn refund_surplus() -> Weight { - Weight::from_parts(3_963_000 as u64, 0) + pub fn refund_surplus() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_363_000 picoseconds. + Weight::from_parts(7_435_000, 0) } - pub(crate) fn set_error_handler() -> Weight { - Weight::from_parts(2_871_000 as u64, 0) + pub fn set_error_handler() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_950_000 picoseconds. + Weight::from_parts(3_067_000, 0) } - pub(crate) fn set_appendix() -> Weight { - Weight::from_parts(2_805_000 as u64, 0) + pub fn set_appendix() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_024_000 picoseconds. + Weight::from_parts(3_077_000, 0) } - pub(crate) fn clear_error() -> Weight { - Weight::from_parts(2_759_000 as u64, 0) + pub fn clear_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_962_000 picoseconds. + Weight::from_parts(3_034_000, 0) } - pub(crate) fn descend_origin() -> Weight { - Weight::from_parts(3_596_000 as u64, 0) + pub fn descend_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_660_000 picoseconds. + Weight::from_parts(5_745_000, 0) } - pub(crate) fn clear_origin() -> Weight { - Weight::from_parts(2_750_000 as u64, 0) + pub fn clear_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_934_000 picoseconds. + Weight::from_parts(3_053_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -107,20 +148,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_error() -> Weight { - Weight::from_parts(24_921_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `11269` + // Minimum execution time: 25_725_000 picoseconds. + Weight::from_parts(26_363_000, 11269) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) - pub(crate) fn claim_asset() -> Weight { - Weight::from_parts(15_880_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn claim_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `126` + // Estimated: `3591` + // Minimum execution time: 16_532_000 picoseconds. + Weight::from_parts(16_751_000, 3591) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - pub(crate) fn trap() -> Weight { - Weight::from_parts(2_771_000 as u64, 0) + pub fn trap() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_902_000 picoseconds. + Weight::from_parts(3_028_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -134,16 +187,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn subscribe_version() -> Weight { - Weight::from_parts(27_043_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn subscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `13320` + // Minimum execution time: 47_079_000 picoseconds. + Weight::from_parts(47_483_000, 13320) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_parts(4_668_000 as u64, 0) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn unsubscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_275_000 picoseconds. + Weight::from_parts(5_381_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -157,25 +218,49 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_parts(399_081_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `11269` + // Minimum execution time: 411_960_000 picoseconds. + Weight::from_parts(422_231_000, 11269) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn burn_asset() -> Weight { - Weight::from_parts(123_792_000 as u64, 0) + pub fn burn_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 128_264_000 picoseconds. + Weight::from_parts(129_704_000, 0) } - pub(crate) fn expect_asset() -> Weight { - Weight::from_parts(13_056_000 as u64, 0) + pub fn expect_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_474_000 picoseconds. + Weight::from_parts(12_684_000, 0) } - pub(crate) fn expect_origin() -> Weight { - Weight::from_parts(2_780_000 as u64, 0) + pub fn expect_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_005_000 picoseconds. + Weight::from_parts(3_157_000, 0) } - pub(crate) fn expect_error() -> Weight { - Weight::from_parts(2_839_000 as u64, 0) + pub fn expect_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_737_000 picoseconds. + Weight::from_parts(4_777_000, 0) } - pub(crate) fn expect_transact_status() -> Weight { - Weight::from_parts(2_951_000 as u64, 0) + pub fn expect_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_126_000 picoseconds. + Weight::from_parts(3_195_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -189,13 +274,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn query_pallet() -> Weight { - Weight::from_parts(28_130_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn query_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `11269` + // Minimum execution time: 30_134_000 picoseconds. + Weight::from_parts(30_412_000, 11269) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn expect_pallet() -> Weight { - Weight::from_parts(4_754_000 as u64, 0) + pub fn expect_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_087_000 picoseconds. + Weight::from_parts(10_289_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -209,24 +302,48 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_transact_status() -> Weight { - Weight::from_parts(25_584_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `75` + // Estimated: `11269` + // Minimum execution time: 26_158_000 picoseconds. + Weight::from_parts(26_668_000, 11269) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn clear_transact_status() -> Weight { - Weight::from_parts(2_832_000 as u64, 0) + pub fn clear_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_035_000 picoseconds. + Weight::from_parts(3_172_000, 0) } - pub(crate) fn set_topic() -> Weight { - Weight::from_parts(2_804_000 as u64, 0) + pub fn set_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_687_000 picoseconds. + Weight::from_parts(4_738_000, 0) } - pub(crate) fn clear_topic() -> Weight { - Weight::from_parts(2_747_000 as u64, 0) + pub fn clear_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_976_000 picoseconds. + Weight::from_parts(3_113_000, 0) } - pub(crate) fn set_fees_mode() -> Weight { - Weight::from_parts(2_736_000 as u64, 0) + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_918_000 picoseconds. + Weight::from_parts(3_033_000, 0) } - pub(crate) fn unpaid_execution() -> Weight { - Weight::from_parts(2_969_000 as u64, 0) + pub fn unpaid_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_191_000 picoseconds. + Weight::from_parts(3_257_000, 0) } } diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index 064094e03d3..1f57b34fcae 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -18,10 +18,15 @@ use super::{ ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; +use crate::ForeignAssets; +use assets_common::matching::{ + FromSiblingParachain, IsForeignConcreteAsset, StartsWith, StartsWithExplicitGlobalConsensus, +}; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess}, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{ impls::ToStakingPot, @@ -35,8 +40,8 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; @@ -48,7 +53,7 @@ parameter_types! { pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); - pub const Local: MultiLocation = Here.into_location(); + pub UniversalLocationNetworkId: NetworkId = UniversalLocation::get().global_consensus().unwrap(); pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); @@ -80,7 +85,7 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId/Balancer` converter for `TrustBackedAssets` +/// `AssetId/Balance` converter for `TrustBackedAssets` pub type TrustBackedAssetsConvertedConcreteId = assets_common::TrustBackedAssetsConvertedConcreteId; @@ -100,8 +105,38 @@ pub type FungiblesTransactor = FungiblesAdapter< // The account to use for tracking teleports. CheckingAccount, >; + +/// `AssetId/Balance` converter for `TrustBackedAssets` +pub type ForeignAssetsConvertedConcreteId = assets_common::ForeignAssetsConvertedConcreteId< + ( + // Ignore `TrustBackedAssets` explicitly + StartsWith, + // Ignore asset which starts explicitly with our `GlobalConsensus(NetworkId)`, means: + // - foreign assets from our consensus should be: `MultiLocation {parent: 1, X*(Parachain(xyz))} + // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` wont be accepted here + StartsWithExplicitGlobalConsensus, + ), + Balance, +>; + +/// Means for transacting foreign assets from different global consensus. +pub type ForeignFungiblesTransactor = FungiblesAdapter< + // Use this fungibles implementation: + ForeignAssets, + // Use this currency when it is a fungible asset matching the given location or name: + ForeignAssetsConvertedConcreteId, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We dont need to check teleports here. + NoChecking, + // The account to use for tracking teleports. + CheckingAccount, +>; + /// Means for transacting assets on this chain. -pub type AssetTransactors = (CurrencyTransactor, FungiblesTransactor); +pub type AssetTransactors = (CurrencyTransactor, FungiblesTransactor, ForeignFungiblesTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, /// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can @@ -176,7 +211,11 @@ impl Contains for SafeCallFilter { RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | RuntimeCall::XcmpQueue(..) | RuntimeCall::DmpQueue(..) | - RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) | + RuntimeCall::Utility( + pallet_utility::Call::as_derivative { .. } | + pallet_utility::Call::batch { .. } | + pallet_utility::Call::batch_all { .. }, + ) | RuntimeCall::Assets( pallet_assets::Call::create { .. } | pallet_assets::Call::force_create { .. } | @@ -205,6 +244,35 @@ impl Contains for SafeCallFilter { pallet_assets::Call::touch { .. } | pallet_assets::Call::refund { .. }, ) | + RuntimeCall::ForeignAssets( + pallet_assets::Call::create { .. } | + pallet_assets::Call::force_create { .. } | + pallet_assets::Call::start_destroy { .. } | + pallet_assets::Call::destroy_accounts { .. } | + pallet_assets::Call::destroy_approvals { .. } | + pallet_assets::Call::finish_destroy { .. } | + pallet_assets::Call::mint { .. } | + pallet_assets::Call::burn { .. } | + pallet_assets::Call::transfer { .. } | + pallet_assets::Call::transfer_keep_alive { .. } | + pallet_assets::Call::force_transfer { .. } | + pallet_assets::Call::freeze { .. } | + pallet_assets::Call::thaw { .. } | + pallet_assets::Call::freeze_asset { .. } | + pallet_assets::Call::thaw_asset { .. } | + pallet_assets::Call::transfer_ownership { .. } | + pallet_assets::Call::set_team { .. } | + pallet_assets::Call::set_metadata { .. } | + pallet_assets::Call::clear_metadata { .. } | + pallet_assets::Call::force_clear_metadata { .. } | + pallet_assets::Call::force_asset_status { .. } | + pallet_assets::Call::approve_transfer { .. } | + pallet_assets::Call::cancel_approval { .. } | + pallet_assets::Call::force_cancel_approval { .. } | + pallet_assets::Call::transfer_approved { .. } | + pallet_assets::Call::touch { .. } | + pallet_assets::Call::refund { .. }, + ) | RuntimeCall::Nfts( pallet_nfts::Call::create { .. } | pallet_nfts::Call::force_create { .. } | @@ -314,7 +382,13 @@ impl xcm_executor::Config for XcmConfig { // Westmint acting _as_ a reserve location for WND and assets created under `pallet-assets`. // For WND, users must use teleport where allowed (e.g. with the Relay Chain). type IsReserve = (); - type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of WND + // We allow: + // - teleportation of WND + // - teleportation of sibling parachain's assets (as ForeignCreators) + type IsTeleporter = ( + NativeAsset, + IsForeignConcreteAsset>>, + ); type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = WeightInfoBounds< @@ -395,9 +469,27 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } + +pub type ForeignCreatorsSovereignAccountOf = ( + SiblingParachainConvertsVia, + AccountId32Aliases, + ParentIsPreset, +); + +/// Simple conversion of `u32` into an `AssetId` for use in benchmarking. +pub struct XcmBenchmarkHelper; +#[cfg(feature = "runtime-benchmarks")] +use pallet_assets::BenchmarkHelper; +#[cfg(feature = "runtime-benchmarks")] +impl BenchmarkHelper for XcmBenchmarkHelper { + fn create_asset_id_parameter(id: u32) -> MultiLocation { + MultiLocation { parents: 1, interior: X1(Parachain(id)) } + } +} diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index 5d7a6187869..e04c163b01f 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -1,27 +1,34 @@ -use asset_test_utils::{ExtBuilder, RuntimeHelper}; -use codec::{DecodeLimit, Encode}; +use asset_test_utils::{ExtBuilder, RuntimeHelper, XcmReceivedFrom}; +use codec::{Decode, DecodeLimit, Encode}; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ assert_noop, assert_ok, sp_io, + traits::fungibles::InspectEnumerable, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use parachains_common::{AccountId, AuraId, Balance}; +use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance}; +use std::convert::Into; pub use westmint_runtime::{ constants::fee::WeightToFee, - xcm_config::{TrustBackedAssetsPalletLocation, XcmConfig}, - Assets, Balances, ExistentialDeposit, ReservedDmpWeight, Runtime, SessionKeys, System, + xcm_config::{CheckingAccount, TrustBackedAssetsPalletLocation, XcmConfig}, + AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, + ParachainSystem, Runtime, SessionKeys, System, TrustBackedAssetsInstance, }; use westmint_runtime::{ - xcm_config::{AssetFeeAsExistentialDepositMultiplierFeeCharger, WestendLocation}, - RuntimeCall, + xcm_config::{ + AssetFeeAsExistentialDepositMultiplierFeeCharger, ForeignCreatorsSovereignAccountOf, + WestendLocation, + }, + MetadataDepositBase, MetadataDepositPerByte, RuntimeCall, RuntimeEvent, }; use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH}; use xcm_executor::{ - traits::{Convert, WeightTrader}, + traits::{Convert, Identity, JustTry, WeightTrader}, XcmExecutor, }; -pub const ALICE: [u8; 32] = [1u8; 32]; +const ALICE: [u8; 32] = [1u8; 32]; +const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32]; type AssetIdForTrustBackedAssetsConvert = assets_common::AssetIdForTrustBackedAssetsConvert; @@ -371,9 +378,15 @@ fn test_assets_balances_api_works() { .build() .execute_with(|| { let local_asset_id = 1; + let foreign_asset_id_multilocation = + MultiLocation { parents: 1, interior: X2(Parachain(1234), GeneralIndex(12345)) }; // check before assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); + assert_eq!( + ForeignAssets::balance(foreign_asset_id_multilocation, AccountId::from(ALICE)), + 0 + ); assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 0); assert!(Runtime::query_account_balances(AccountId::from(ALICE)).unwrap().is_empty()); @@ -400,15 +413,37 @@ fn test_assets_balances_api_works() { minimum_asset_balance )); + // create foreign asset + let foreign_asset_minimum_asset_balance = 3333333_u128; + assert_ok!(ForeignAssets::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_multilocation.clone().into(), + AccountId::from(SOME_ASSET_ADMIN).into(), + false, + foreign_asset_minimum_asset_balance + )); + + // We first mint enough asset for the account to exist for assets + assert_ok!(ForeignAssets::mint( + RuntimeHelper::::origin_of(AccountId::from(SOME_ASSET_ADMIN)), + foreign_asset_id_multilocation.clone().into(), + AccountId::from(ALICE).into(), + 6 * foreign_asset_minimum_asset_balance + )); + // check after assert_eq!( Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance ); + assert_eq!( + ForeignAssets::balance(foreign_asset_id_multilocation, AccountId::from(ALICE)), + 6 * minimum_asset_balance + ); assert_eq!(Balances::free_balance(AccountId::from(ALICE)), some_currency); let result = Runtime::query_account_balances(AccountId::from(ALICE)).unwrap(); - assert_eq!(result.len(), 2); + assert_eq!(result.len(), 3); // check currency assert!(result.iter().any(|asset| asset.eq( @@ -423,56 +458,165 @@ fn test_assets_balances_api_works() { minimum_asset_balance ) .into()))); + // check foreign asset + assert!(result.iter().any(|asset| asset.eq(&( + Identity::reverse_ref(foreign_asset_id_multilocation).unwrap(), + 6 * foreign_asset_minimum_asset_balance + ) + .into()))); }); } -#[test] -fn receive_teleported_asset_works() { - ExtBuilder::::default() - .with_collators(vec![AccountId::from(ALICE)]) - .with_session_keys(vec![( - AccountId::from(ALICE), - AccountId::from(ALICE), - SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }, - )]) - .build() - .execute_with(|| { - let xcm = Xcm(vec![ - ReceiveTeleportedAsset(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(10000000000000), - }])), - ClearOrigin, - BuyExecution { - fees: MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(10000000000000), - }, - weight_limit: Limited(Weight::from_parts(303531000, 65536)), - }, - DepositAsset { - assets: Wild(AllCounted(1)), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountId32 { - network: None, - id: [ - 18, 153, 85, 112, 1, 245, 88, 21, 211, 252, 181, 60, 116, 70, 58, - 203, 12, 246, 209, 77, 70, 57, 179, 64, 152, 44, 96, 135, 127, 56, - 70, 9, - ], - }), - }, - }, - ]); - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - - let weight_limit = ReservedDmpWeight::get(); - - let outcome = XcmExecutor::::execute_xcm(Parent, xcm, hash, weight_limit); - assert_eq!(outcome.ensure_complete(), Ok(())); - }) -} +asset_test_utils::include_teleports_for_native_asset_works!( + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + ParachainSystem, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }) +); + +asset_test_utils::include_teleports_for_foreign_assets_works!( + Runtime, + XcmConfig, + CheckingAccount, + WeightToFee, + ParachainSystem, + ForeignCreatorsSovereignAccountOf, + ForeignAssetsInstance, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_local_consensus_currency_works!( + Runtime, + XcmConfig, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_works!( + asset_transactor_transfer_with_trust_backed_assets_works, + Runtime, + XcmConfig, + TrustBackedAssetsInstance, + AssetIdForTrustBackedAssets, + AssetIdForTrustBackedAssetsConvert, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + 12345, + Box::new(|| { + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_works!( + asset_transactor_transfer_with_foreign_assets_works, + Runtime, + XcmConfig, + ForeignAssetsInstance, + MultiLocation, + JustTry, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + MultiLocation { parents: 1, interior: X2(Parachain(1313), GeneralIndex(12345)) }, + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + }) +); + +asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works!( + Runtime, + XcmConfig, + WeightToFee, + ForeignCreatorsSovereignAccountOf, + ForeignAssetsInstance, + MultiLocation, + JustTry, + asset_test_utils::CollatorSessionKeys::new( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } + ), + ExistentialDeposit::get(), + AssetDeposit::get(), + MetadataDepositBase::get(), + MetadataDepositPerByte::get(), + Box::new(|pallet_asset_call| RuntimeCall::ForeignAssets(pallet_asset_call).encode()), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::ForeignAssets(pallet_asset_event)) => Some(pallet_asset_event), + _ => None, + } + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert!(ForeignAssets::asset_ids().collect::>().is_empty()); + }), + Box::new(|| { + assert!(Assets::asset_ids().collect::>().is_empty()); + assert_eq!(ForeignAssets::asset_ids().collect::>().len(), 1); + }) +); #[test] fn plain_receive_teleported_asset_works() { @@ -494,10 +638,8 @@ fn plain_receive_teleported_asset_works() { ) .map(xcm::v3::Xcm::::try_from).expect("failed").expect("failed"); - let weight_limit = ReservedDmpWeight::get(); - let outcome = - XcmExecutor::::execute_xcm(Parent, maybe_msg, message_id, weight_limit); + XcmExecutor::::execute_xcm(Parent, maybe_msg, message_id, RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Parent)); assert_eq!(outcome.ensure_complete(), Ok(())); }) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index ccc353e62fa..f2bda0d0fdf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,29 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// ./target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=bridge-hub-kusama-dev +// --steps=50 +// --repeat=20 +// --extrinsic= // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 // --pallet=pallet_xcm_benchmarks::fungible -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,17 +50,25 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn withdraw_asset() -> Weight { - Weight::from_parts(18_301_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn withdraw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3593` + // Minimum execution time: 22_950_000 picoseconds. + Weight::from_parts(23_170_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn transfer_asset() -> Weight { - Weight::from_parts(29_321_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn transfer_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `153` + // Estimated: `6196` + // Minimum execution time: 48_472_000 picoseconds. + Weight::from_parts(49_063_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -76,20 +84,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_parts(50_754_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + pub fn transfer_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `223` + // Estimated: `18205` + // Minimum execution time: 71_887_000 picoseconds. + Weight::from_parts(73_047_000, 18205) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } - pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_parts(3_814_000 as u64, 0) + pub fn receive_teleported_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_215_000 picoseconds. + Weight::from_parts(4_324_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn deposit_asset() -> Weight { - Weight::from_parts(21_596_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn deposit_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `52` + // Estimated: `3593` + // Minimum execution time: 26_047_000 picoseconds. + Weight::from_parts(26_386_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -105,10 +125,14 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_parts(45_534_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn deposit_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `122` + // Estimated: `15097` + // Minimum execution time: 51_076_000 picoseconds. + Weight::from_parts(51_638_000, 15097) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -122,9 +146,13 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_teleport() -> Weight { - Weight::from_parts(26_876_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_242_000 picoseconds. + Weight::from_parts(28_778_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 91d84385f55..06d99ecdc55 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=bridge-hub-kusama-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,40 +61,80 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_holding() -> Weight { - Weight::from_parts(30_320_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_holding() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 32_352_000 picoseconds. + Weight::from_parts(32_888_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn buy_execution() -> Weight { - Weight::from_parts(2_776_000 as u64, 0) + pub fn buy_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_953_000 picoseconds. + Weight::from_parts(3_074_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - pub(crate) fn query_response() -> Weight { - Weight::from_parts(10_396_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + pub fn query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `32` + // Estimated: `3497` + // Minimum execution time: 10_911_000 picoseconds. + Weight::from_parts(11_165_000, 3497) + .saturating_add(T::DbWeight::get().reads(1)) } - pub(crate) fn transact() -> Weight { - Weight::from_parts(11_646_000 as u64, 0) + pub fn transact() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_130_000 picoseconds. + Weight::from_parts(13_550_000, 0) } - pub(crate) fn refund_surplus() -> Weight { - Weight::from_parts(2_853_000 as u64, 0) + pub fn refund_surplus() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_254_000 picoseconds. + Weight::from_parts(3_371_000, 0) } - pub(crate) fn set_error_handler() -> Weight { - Weight::from_parts(2_746_000 as u64, 0) + pub fn set_error_handler() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_729_000 picoseconds. + Weight::from_parts(4_785_000, 0) } - pub(crate) fn set_appendix() -> Weight { - Weight::from_parts(2_742_000 as u64, 0) + pub fn set_appendix() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_686_000 picoseconds. + Weight::from_parts(4_740_000, 0) } - pub(crate) fn clear_error() -> Weight { - Weight::from_parts(2_750_000 as u64, 0) + pub fn clear_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_921_000 picoseconds. + Weight::from_parts(3_038_000, 0) } - pub(crate) fn descend_origin() -> Weight { - Weight::from_parts(3_512_000 as u64, 0) + pub fn descend_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_927_000 picoseconds. + Weight::from_parts(4_046_000, 0) } - pub(crate) fn clear_origin() -> Weight { - Weight::from_parts(2_710_000 as u64, 0) + pub fn clear_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_990_000 picoseconds. + Weight::from_parts(3_109_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -107,20 +148,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_error() -> Weight { - Weight::from_parts(23_834_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 25_335_000 picoseconds. + Weight::from_parts(25_862_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) - pub(crate) fn claim_asset() -> Weight { - Weight::from_parts(14_091_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn claim_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `90` + // Estimated: `3555` + // Minimum execution time: 15_097_000 picoseconds. + Weight::from_parts(15_401_000, 3555) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - pub(crate) fn trap() -> Weight { - Weight::from_parts(2_702_000 as u64, 0) + pub fn trap() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_693_000 picoseconds. + Weight::from_parts(4_750_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -134,16 +187,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn subscribe_version() -> Weight { - Weight::from_parts(24_071_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn subscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `13098` + // Minimum execution time: 26_630_000 picoseconds. + Weight::from_parts(27_169_000, 13098) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_parts(4_648_000 as u64, 0) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn unsubscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_050_000 picoseconds. + Weight::from_parts(5_304_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -157,25 +218,49 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_parts(26_772_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_942_000 picoseconds. + Weight::from_parts(29_475_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn burn_asset() -> Weight { - Weight::from_parts(4_249_000 as u64, 0) + pub fn burn_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_736_000 picoseconds. + Weight::from_parts(4_871_000, 0) } - pub(crate) fn expect_asset() -> Weight { - Weight::from_parts(2_860_000 as u64, 0) + pub fn expect_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_127_000 picoseconds. + Weight::from_parts(3_217_000, 0) } - pub(crate) fn expect_origin() -> Weight { - Weight::from_parts(2_849_000 as u64, 0) + pub fn expect_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_972_000 picoseconds. + Weight::from_parts(3_073_000, 0) } - pub(crate) fn expect_error() -> Weight { - Weight::from_parts(2_692_000 as u64, 0) + pub fn expect_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_737_000 picoseconds. + Weight::from_parts(4_810_000, 0) } - pub(crate) fn expect_transact_status() -> Weight { - Weight::from_parts(2_886_000 as u64, 0) + pub fn expect_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_166_000 picoseconds. + Weight::from_parts(3_240_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -189,13 +274,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn query_pallet() -> Weight { - Weight::from_parts(28_452_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn query_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 44_516_000 picoseconds. + Weight::from_parts(45_018_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn expect_pallet() -> Weight { - Weight::from_parts(4_257_000 as u64, 0) + pub fn expect_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_137_000 picoseconds. + Weight::from_parts(5_289_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -209,24 +302,48 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_transact_status() -> Weight { - Weight::from_parts(24_235_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 25_978_000 picoseconds. + Weight::from_parts(26_490_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn clear_transact_status() -> Weight { - Weight::from_parts(2_749_000 as u64, 0) + pub fn clear_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_018_000 picoseconds. + Weight::from_parts(3_148_000, 0) } - pub(crate) fn set_topic() -> Weight { - Weight::from_parts(2_718_000 as u64, 0) + pub fn set_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_667_000 picoseconds. + Weight::from_parts(4_737_000, 0) } - pub(crate) fn clear_topic() -> Weight { - Weight::from_parts(2_685_000 as u64, 0) + pub fn clear_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_955_000 picoseconds. + Weight::from_parts(3_018_000, 0) } - pub(crate) fn set_fees_mode() -> Weight { - Weight::from_parts(2_735_000 as u64, 0) + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_008_000 picoseconds. + Weight::from_parts(3_113_000, 0) } - pub(crate) fn unpaid_execution() -> Weight { - Weight::from_parts(2_842_000 as u64, 0) + pub fn unpaid_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_137_000 picoseconds. + Weight::from_parts(3_230_000, 0) } } 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 b9992438c83..cfe8662cb7c 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 @@ -22,6 +22,7 @@ use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing}, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::{ ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry, @@ -73,7 +74,7 @@ pub type CurrencyTransactor = CurrencyAdapter< LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, - // We don't track any teleports. + // We don't track any teleports of `Balances`. (), >; @@ -260,6 +261,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index fd418500c27..a7527f00baf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,29 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// ./target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=bridge-hub-polkadot-dev +// --steps=50 +// --repeat=20 +// --extrinsic= // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 // --pallet=pallet_xcm_benchmarks::fungible -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-polkadot-dev // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,17 +50,25 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn withdraw_asset() -> Weight { - Weight::from_parts(18_910_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn withdraw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3593` + // Minimum execution time: 22_155_000 picoseconds. + Weight::from_parts(22_991_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn transfer_asset() -> Weight { - Weight::from_parts(29_462_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn transfer_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `153` + // Estimated: `6196` + // Minimum execution time: 48_986_000 picoseconds. + Weight::from_parts(49_467_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -76,20 +84,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_parts(51_265_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + pub fn transfer_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `223` + // Estimated: `18205` + // Minimum execution time: 72_291_000 picoseconds. + Weight::from_parts(72_898_000, 18205) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } - pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_parts(3_874_000 as u64, 0) + pub fn receive_teleported_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_225_000 picoseconds. + Weight::from_parts(4_328_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn deposit_asset() -> Weight { - Weight::from_parts(23_139_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn deposit_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `52` + // Estimated: `3593` + // Minimum execution time: 26_357_000 picoseconds. + Weight::from_parts(26_841_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -105,10 +125,14 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_parts(49_375_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn deposit_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `122` + // Estimated: `15097` + // Minimum execution time: 50_981_000 picoseconds. + Weight::from_parts(51_488_000, 15097) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -122,9 +146,13 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_teleport() -> Weight { - Weight::from_parts(28_809_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_333_000 picoseconds. + Weight::from_parts(28_863_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 261efbeb0f1..44bd54ab174 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=bridge-hub-polkadot-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-polkadot-dev // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,40 +61,80 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_holding() -> Weight { - Weight::from_parts(30_138_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_holding() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 47_079_000 picoseconds. + Weight::from_parts(47_477_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn buy_execution() -> Weight { - Weight::from_parts(2_860_000 as u64, 0) + pub fn buy_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_810_000 picoseconds. + Weight::from_parts(4_856_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - pub(crate) fn query_response() -> Weight { - Weight::from_parts(10_421_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + pub fn query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `32` + // Estimated: `3497` + // Minimum execution time: 11_148_000 picoseconds. + Weight::from_parts(17_709_000, 3497) + .saturating_add(T::DbWeight::get().reads(1)) } - pub(crate) fn transact() -> Weight { - Weight::from_parts(11_744_000 as u64, 0) + pub fn transact() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_942_000 picoseconds. + Weight::from_parts(13_226_000, 0) } - pub(crate) fn refund_surplus() -> Weight { - Weight::from_parts(3_024_000 as u64, 0) + pub fn refund_surplus() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_413_000 picoseconds. + Weight::from_parts(3_490_000, 0) } - pub(crate) fn set_error_handler() -> Weight { - Weight::from_parts(2_820_000 as u64, 0) + pub fn set_error_handler() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_110_000 picoseconds. + Weight::from_parts(3_144_000, 0) } - pub(crate) fn set_appendix() -> Weight { - Weight::from_parts(2_869_000 as u64, 0) + pub fn set_appendix() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_038_000 picoseconds. + Weight::from_parts(3_118_000, 0) } - pub(crate) fn clear_error() -> Weight { - Weight::from_parts(2_838_000 as u64, 0) + pub fn clear_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_044_000 picoseconds. + Weight::from_parts(4_700_000, 0) } - pub(crate) fn descend_origin() -> Weight { - Weight::from_parts(3_620_000 as u64, 0) + pub fn descend_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_936_000 picoseconds. + Weight::from_parts(4_039_000, 0) } - pub(crate) fn clear_origin() -> Weight { - Weight::from_parts(2_819_000 as u64, 0) + pub fn clear_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_070_000 picoseconds. + Weight::from_parts(3_286_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -107,20 +148,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_error() -> Weight { - Weight::from_parts(23_931_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 25_430_000 picoseconds. + Weight::from_parts(25_714_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) - pub(crate) fn claim_asset() -> Weight { - Weight::from_parts(13_776_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn claim_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `90` + // Estimated: `3555` + // Minimum execution time: 15_180_000 picoseconds. + Weight::from_parts(24_431_000, 3555) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - pub(crate) fn trap() -> Weight { - Weight::from_parts(2_784_000 as u64, 0) + pub fn trap() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_682_000 picoseconds. + Weight::from_parts(4_753_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -134,16 +187,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn subscribe_version() -> Weight { - Weight::from_parts(23_940_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn subscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `13098` + // Minimum execution time: 26_337_000 picoseconds. + Weight::from_parts(26_730_000, 13098) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_parts(4_676_000 as u64, 0) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn unsubscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_260_000 picoseconds. + Weight::from_parts(5_417_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -157,25 +218,49 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_parts(26_390_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_590_000 picoseconds. + Weight::from_parts(28_931_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn burn_asset() -> Weight { - Weight::from_parts(4_435_000 as u64, 0) + pub fn burn_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_745_000 picoseconds. + Weight::from_parts(4_853_000, 0) } - pub(crate) fn expect_asset() -> Weight { - Weight::from_parts(2_940_000 as u64, 0) + pub fn expect_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_214_000 picoseconds. + Weight::from_parts(3_276_000, 0) } - pub(crate) fn expect_origin() -> Weight { - Weight::from_parts(2_898_000 as u64, 0) + pub fn expect_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_779_000 picoseconds. + Weight::from_parts(4_824_000, 0) } - pub(crate) fn expect_error() -> Weight { - Weight::from_parts(2_795_000 as u64, 0) + pub fn expect_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_986_000 picoseconds. + Weight::from_parts(3_098_000, 0) } - pub(crate) fn expect_transact_status() -> Weight { - Weight::from_parts(2_908_000 as u64, 0) + pub fn expect_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_272_000 picoseconds. + Weight::from_parts(3_351_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -189,13 +274,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn query_pallet() -> Weight { - Weight::from_parts(26_452_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn query_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_219_000 picoseconds. + Weight::from_parts(28_796_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn expect_pallet() -> Weight { - Weight::from_parts(4_303_000 as u64, 0) + pub fn expect_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_023_000 picoseconds. + Weight::from_parts(5_108_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -209,24 +302,48 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_transact_status() -> Weight { - Weight::from_parts(23_994_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 25_253_000 picoseconds. + Weight::from_parts(25_685_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn clear_transact_status() -> Weight { - Weight::from_parts(2_789_000 as u64, 0) + pub fn clear_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_085_000 picoseconds. + Weight::from_parts(3_135_000, 0) } - pub(crate) fn set_topic() -> Weight { - Weight::from_parts(2_789_000 as u64, 0) + pub fn set_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_099_000 picoseconds. + Weight::from_parts(3_147_000, 0) } - pub(crate) fn clear_topic() -> Weight { - Weight::from_parts(2_836_000 as u64, 0) + pub fn clear_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_101_000 picoseconds. + Weight::from_parts(3_174_000, 0) } - pub(crate) fn set_fees_mode() -> Weight { - Weight::from_parts(2_763_000 as u64, 0) + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_034_000 picoseconds. + Weight::from_parts(3_118_000, 0) } - pub(crate) fn unpaid_execution() -> Weight { - Weight::from_parts(2_872_000 as u64, 0) + pub fn unpaid_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_156_000 picoseconds. + Weight::from_parts(3_254_000, 0) } } 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 e52bca88daf..189e7c74f81 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 @@ -22,6 +22,7 @@ use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing}, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::{ ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry, @@ -73,7 +74,7 @@ pub type CurrencyTransactor = CurrencyAdapter< LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, - // We don't track any teleports. + // We don't track any teleports of `Balances`. (), >; @@ -260,6 +261,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 6bc6c282c6b..36bcef1cc4a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,29 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// ./target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=bridge-hub-rococo-dev +// --steps=50 +// --repeat=20 +// --extrinsic= // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 // --pallet=pallet_xcm_benchmarks::fungible -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-rococo-dev // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,17 +50,25 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn withdraw_asset() -> Weight { - Weight::from_parts(20_377_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn withdraw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3593` + // Minimum execution time: 22_222_000 picoseconds. + Weight::from_parts(22_591_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn transfer_asset() -> Weight { - Weight::from_parts(31_004_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn transfer_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `153` + // Estimated: `6196` + // Minimum execution time: 47_612_000 picoseconds. + Weight::from_parts(48_901_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -76,20 +84,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_parts(54_173_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + pub fn transfer_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `223` + // Estimated: `18205` + // Minimum execution time: 72_062_000 picoseconds. + Weight::from_parts(73_077_000, 18205) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } - pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_parts(4_635_000 as u64, 0) + pub fn receive_teleported_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_363_000 picoseconds. + Weight::from_parts(4_430_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - pub(crate) fn deposit_asset() -> Weight { - Weight::from_parts(23_155_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn deposit_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `52` + // Estimated: `3593` + // Minimum execution time: 26_314_000 picoseconds. + Weight::from_parts(26_624_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -105,10 +125,14 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_parts(52_599_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn deposit_reserve_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `122` + // Estimated: `15097` + // Minimum execution time: 51_846_000 picoseconds. + Weight::from_parts(52_430_000, 15097) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -122,9 +146,13 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_teleport() -> Weight { - Weight::from_parts(34_004_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_548_000 picoseconds. + Weight::from_parts(28_880_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 9f225ab514f..d3df54c32e5 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,29 +14,29 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . - //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// ./target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=bridge-hub-rococo-dev +// --steps=50 +// --repeat=20 +// --extrinsic= // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-rococo-dev // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,40 +60,80 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_holding() -> Weight { - Weight::from_parts(32_598_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_holding() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 32_220_000 picoseconds. + Weight::from_parts(32_574_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn buy_execution() -> Weight { - Weight::from_parts(3_195_000 as u64, 0) + pub fn buy_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_996_000 picoseconds. + Weight::from_parts(3_070_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - pub(crate) fn query_response() -> Weight { - Weight::from_parts(10_939_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + pub fn query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `32` + // Estimated: `3497` + // Minimum execution time: 11_181_000 picoseconds. + Weight::from_parts(11_426_000, 3497) + .saturating_add(T::DbWeight::get().reads(1)) } - pub(crate) fn transact() -> Weight { - Weight::from_parts(12_473_000 as u64, 0) + pub fn transact() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_273_000 picoseconds. + Weight::from_parts(13_574_000, 0) } - pub(crate) fn refund_surplus() -> Weight { - Weight::from_parts(3_458_000 as u64, 0) + pub fn refund_surplus() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_283_000 picoseconds. + Weight::from_parts(3_387_000, 0) } - pub(crate) fn set_error_handler() -> Weight { - Weight::from_parts(3_252_000 as u64, 0) + pub fn set_error_handler() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_008_000 picoseconds. + Weight::from_parts(3_062_000, 0) } - pub(crate) fn set_appendix() -> Weight { - Weight::from_parts(3_249_000 as u64, 0) + pub fn set_appendix() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_901_000 picoseconds. + Weight::from_parts(2_989_000, 0) } - pub(crate) fn clear_error() -> Weight { - Weight::from_parts(3_190_000 as u64, 0) + pub fn clear_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_924_000 picoseconds. + Weight::from_parts(3_008_000, 0) } - pub(crate) fn descend_origin() -> Weight { - Weight::from_parts(4_268_000 as u64, 0) + pub fn descend_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_820_000 picoseconds. + Weight::from_parts(3_887_000, 0) } - pub(crate) fn clear_origin() -> Weight { - Weight::from_parts(3_255_000 as u64, 0) + pub fn clear_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_939_000 picoseconds. + Weight::from_parts(3_004_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -107,20 +147,32 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_error() -> Weight { - Weight::from_parts(25_755_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 25_166_000 picoseconds. + Weight::from_parts(25_591_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) - pub(crate) fn claim_asset() -> Weight { - Weight::from_parts(15_124_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn claim_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `90` + // Estimated: `3555` + // Minimum execution time: 15_169_000 picoseconds. + Weight::from_parts(15_391_000, 3555) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - pub(crate) fn trap() -> Weight { - Weight::from_parts(3_164_000 as u64, 0) + pub fn trap() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_909_000 picoseconds. + Weight::from_parts(3_048_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -134,16 +186,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn subscribe_version() -> Weight { - Weight::from_parts(25_329_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + pub fn subscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `13098` + // Minimum execution time: 26_031_000 picoseconds. + Weight::from_parts(26_630_000, 13098) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_parts(5_253_000 as u64, 0) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + pub fn unsubscribe_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_011_000 picoseconds. + Weight::from_parts(5_237_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -157,25 +217,49 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_parts(29_304_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_361_000 picoseconds. + Weight::from_parts(28_811_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn burn_asset() -> Weight { - Weight::from_parts(5_275_000 as u64, 0) + pub fn burn_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_542_000 picoseconds. + Weight::from_parts(4_636_000, 0) } - pub(crate) fn expect_asset() -> Weight { - Weight::from_parts(3_355_000 as u64, 0) + pub fn expect_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_041_000 picoseconds. + Weight::from_parts(3_123_000, 0) } - pub(crate) fn expect_origin() -> Weight { - Weight::from_parts(3_391_000 as u64, 0) + pub fn expect_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_004_000 picoseconds. + Weight::from_parts(3_103_000, 0) } - pub(crate) fn expect_error() -> Weight { - Weight::from_parts(3_192_000 as u64, 0) + pub fn expect_error() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_976_000 picoseconds. + Weight::from_parts(3_033_000, 0) } - pub(crate) fn expect_transact_status() -> Weight { - Weight::from_parts(3_342_000 as u64, 0) + pub fn expect_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_116_000 picoseconds. + Weight::from_parts(3_196_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -189,13 +273,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn query_pallet() -> Weight { - Weight::from_parts(28_426_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn query_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 28_513_000 picoseconds. + Weight::from_parts(28_839_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn expect_pallet() -> Weight { - Weight::from_parts(4_826_000 as u64, 0) + pub fn expect_pallet() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_977_000 picoseconds. + Weight::from_parts(5_091_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -209,24 +301,48 @@ impl WeightInfo { // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub(crate) fn report_transact_status() -> Weight { - Weight::from_parts(26_238_000 as u64, 0) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + pub fn report_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `70` + // Estimated: `11244` + // Minimum execution time: 25_256_000 picoseconds. + Weight::from_parts(25_827_000, 11244) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) } - pub(crate) fn clear_transact_status() -> Weight { - Weight::from_parts(3_240_000 as u64, 0) + pub fn clear_transact_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_979_000 picoseconds. + Weight::from_parts(3_078_000, 0) } - pub(crate) fn set_topic() -> Weight { - Weight::from_parts(3_181_000 as u64, 0) + pub fn set_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_939_000 picoseconds. + Weight::from_parts(3_000_000, 0) } - pub(crate) fn clear_topic() -> Weight { - Weight::from_parts(3_142_000 as u64, 0) + pub fn clear_topic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_832_000 picoseconds. + Weight::from_parts(2_910_000, 0) } - pub(crate) fn set_fees_mode() -> Weight { - Weight::from_parts(3_216_000 as u64, 0) + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_901_000 picoseconds. + Weight::from_parts(2_977_000, 0) } - pub(crate) fn unpaid_execution() -> Weight { - Weight::from_parts(3_394_000 as u64, 0) + pub fn unpaid_execution() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_031_000 picoseconds. + Weight::from_parts(3_128_000, 0) } } 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 3067cb3f507..17ac293c62b 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 @@ -22,6 +22,7 @@ use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing}, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::{ ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry, @@ -71,7 +72,7 @@ pub type CurrencyTransactor = CurrencyAdapter< LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, - // We don't track any teleports. + // We don't track any teleports of `Balances`. (), >; @@ -258,6 +259,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index 3e63b6fe7c2..3e726b5b4b7 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -22,6 +22,7 @@ use frame_support::{ traits::{ConstU32, Contains, Everything, Nothing}, weights::Weight, }; +use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{ impls::ToStakingPot, @@ -45,7 +46,6 @@ parameter_types! { pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); - pub const Local: MultiLocation = Here.into_location(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); pub const GovernanceLocation: MultiLocation = MultiLocation::parent(); } @@ -295,6 +295,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index c71a60107e3..d8ed043fb54 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -212,6 +212,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index 58051e1df34..89cfc2ced65 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -35,6 +35,7 @@ use frame_support::{ }, weights::Weight, }; +use frame_system::EnsureRoot; use pallet_asset_tx_payment::HandleCredit; use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::{DenyReserveTransferToRelayChain, DenyThenTry}; @@ -337,6 +338,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 8232556b720..532f39f368b 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -469,6 +469,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/templates/xcm-bench-template.hbs b/templates/xcm-bench-template.hbs index 3c9deb44606..e8e754ca91f 100644 --- a/templates/xcm-bench-template.hbs +++ b/templates/xcm-bench-template.hbs @@ -1,24 +1,9 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . - - +{{header}} //! Autogenerated weights for `{{pallet}}` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} -//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` //! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` //! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} @@ -41,27 +26,37 @@ impl WeightInfo { {{#each benchmark.comments as |comment|}} // {{comment}} {{/each}} - pub(crate) fn {{benchmark.name~}} + {{#each benchmark.component_ranges as |range|}} + /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. + {{/each}} + pub fn {{benchmark.name~}} ( {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}} as u64)) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) {{/each}} } {{/each}}