diff --git a/.github/workflows/quick-check.yml b/.github/workflows/quick-check.yml deleted file mode 100644 index 5026aeaf09..0000000000 --- a/.github/workflows/quick-check.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Quick check Formatting - -on: - push: - branches: - - "*" - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - -jobs: - quick_check: - strategy: - matrix: - os: ["ubuntu-latest"] - runs-on: ${{ matrix.os }} - steps: - - name: Install Rust nightly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: clippy, rustfmt - - - name: Cache Dependencies & Build Outputs - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - uses: actions/checkout@v3 - - - name: Cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check diff --git a/.github/workflows/release-20_extrinsic-ordering-check-from-bin.yml b/.github/workflows/release-20_extrinsic-ordering-check-from-bin.yml index 704cee5d70..442f7793f4 100644 --- a/.github/workflows/release-20_extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/release-20_extrinsic-ordering-check-from-bin.yml @@ -65,7 +65,7 @@ jobs: $CMD >> output.txt sed -z -i 's/\n\n/\n/g' output.txt cat output.txt | egrep -n -i '' - SUMMARY=$(./scripts/ci/extrinsic-ordering-filter.sh output.txt) + SUMMARY=$(./scripts/ci/github/extrinsic-ordering-filter.sh output.txt) echo -e $SUMMARY echo -e $SUMMARY >> output.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78a189fbce..2f899e378a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ variables: CI_IMAGE: "paritytech/ci-linux:production" DOCKER_OS: "debian:stretch" ARCH: "x86_64" - ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.56" + ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.59" .collect-artifacts: &collect-artifacts artifacts: @@ -69,6 +69,11 @@ variables: - if: $CI_COMMIT_REF_NAME =~ /^release-parachains-v[0-9].*$/ # i.e. release-parachains-v1.0, release-parachains-v2.1rc1, release-parachains-v3000 - if: $CI_COMMIT_REF_NAME =~ /^polkadot-v[0-9]+\.[0-9]+.*$/ # i.e. polkadot-v1.0.99, polkadot-v2.1rc1 +.pr-refs: &pr-refs + # these jobs run always* + rules: + - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + .publish-refs: &publish-refs rules: - if: $CI_COMMIT_REF_NAME == "master" @@ -212,7 +217,7 @@ build-test-parachain: variables: # Enable debug assertions since we are running optimized builds for testing # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" + RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs needs: - job: check-rustdoc @@ -226,9 +231,74 @@ build-test-parachain: - mkdir -p ./artifacts/zombienet - mv ./target/release/wbuild/cumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/. +# build runtime only if files in $RUNTIME_PATH/$RUNTIME_NAME were changed +.build-runtime-template: &build-runtime-template + stage: build + <<: *docker-env + <<: *pr-refs + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: check-rustdoc + artifacts: false + variables: + RUNTIME_PATH: "parachains/runtimes/assets" + script: + - cd ${RUNTIME_PATH} + - for directory in $(echo */); do + echo "_____Running cargo check for ${directory} ______"; + cd ${directory}; + pwd; + SKIP_WASM_BUILD=1 cargo check; + cd ..; + done + +# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts +# DAG: build-runtime-assets ->build-runtime-starters -> build-runtime-testing +build-runtime-assets: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/assets" + +build-runtime-collectives: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/collectives" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-assets + artifacts: false + +build-runtime-contracts: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/contracts" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-collectives + artifacts: false + +build-runtime-starters: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/starters" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-assets + artifacts: false + +build-runtime-testing: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/testing" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-starters + artifacts: false + + #### stage: publish -.build-push-image: &build-push-image +.build-push-image: &build-push-image image: quay.io/buildah/stable variables: DOCKERFILE: "" # docker/path-to.Dockerfile @@ -599,5 +669,5 @@ cancel-pipeline: PR_NUM: "${PR_NUM}" trigger: project: "parity/infrastructure/ci_cd/pipeline-stopper" - # remove branch, when pipeline-stopper for substrate and polakdot is updated to the same branch - branch: "as-improve" + + diff --git a/Cargo.lock b/Cargo.lock index a189550c04..4ab6cc3329 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,9 +75,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] @@ -90,13 +90,19 @@ checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" [[package]] name = "android_system_properties" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "ansi_term" version = "0.12.1" @@ -108,9 +114,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.62" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" [[package]] name = "approx" @@ -121,6 +127,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "array-bytes" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a913633b0c922e6b745072795f50d90ebea78ba31a57e2ac8c2fc7b50950949" + [[package]] name = "arrayref" version = "0.3.6" @@ -230,9 +242,9 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" +checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca" dependencies = [ "async-channel", "async-executor", @@ -240,15 +252,14 @@ dependencies = [ "async-lock", "blocking", "futures-lite", - "num_cpus", "once_cell", ] [[package]] name = "async-io" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab006897723d9352f63e2b13047177c3982d8d79709d713ce7747a8f19fd1b0" +checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7" dependencies = [ "autocfg", "concurrent-queue", @@ -412,7 +423,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.29.0", + "object", "rustc-demangle", ] @@ -440,6 +451,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2b2456fd614d856680dcd9fcc660a51a820fa09daef2e49772b56a193c8474" + [[package]] name = "beef" version = "0.5.2" @@ -452,14 +469,14 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "async-trait", "beefy-primitives", "fnv", "futures", "futures-timer", - "hex", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -488,7 +505,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -508,7 +525,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "beefy-primitives", "sp-api", @@ -517,7 +534,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -586,7 +603,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -632,7 +649,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "constant_time_eq", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -659,9 +676,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array 0.14.6", ] @@ -719,7 +736,6 @@ dependencies = [ "lazy_static", "memchr", "regex-automata", - "serde", ] [[package]] @@ -804,7 +820,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", ] @@ -833,6 +849,15 @@ dependencies = [ "nom", ] +[[package]] +name = "cfg-expr" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -891,6 +916,33 @@ dependencies = [ "winapi", ] +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "cid" version = "0.8.6" @@ -924,9 +976,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.3.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", @@ -935,20 +987,9 @@ dependencies = [ [[package]] name = "clap" -version = "2.34.0" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "bitflags", - "textwrap 0.11.0", - "unicode-width", -] - -[[package]] -name = "clap" -version = "3.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", @@ -958,14 +999,14 @@ dependencies = [ "once_cell", "strsim", "termcolor", - "textwrap 0.15.0", + "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.17" +version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", @@ -1045,7 +1086,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "polkadot-runtime-constants", "scale-info", @@ -1071,9 +1112,9 @@ dependencies = [ [[package]] name = "comfy-table" -version = "6.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121d8a5b0346092c18a4b2fd6f620d7a06f0eb7ac0a45860939a0884bc579c56" +checksum = "85914173c2f558d61613bfbbf1911f14e630895087a7ed2fafc0f5319e1536e7" dependencies = [ "strum", "strum_macros", @@ -1144,7 +1185,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "scale-info", "serde", @@ -1209,28 +1250,30 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" +checksum = "b27bbd3e6c422cf6282b047bcdd51ecd9ca9f3497a3be0132ffa08e509b824b0" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" +checksum = "872f5d4557a411b087bd731df6347c142ae1004e6467a144a7e33662e5715a01" dependencies = [ + "arrayvec 0.7.2", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", @@ -1245,33 +1288,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" +checksum = "21b49fdebb29c62c1fc4da1eeebd609e9d530ecde24a9876def546275f73a244" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" +checksum = "5fc0c091e2db055d4d7f6b7cec2d2ead286bcfaea3357c6a52c2a2613a8cb5ac" [[package]] name = "cranelift-entity" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" +checksum = "354a9597be87996c9b278655e68b8447f65dd907256855ad773864edee8d985c" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" +checksum = "0cd8dd3fb8b82c772f4172e87ae1677b971676fffa7c4e3398e3047e650a266b" dependencies = [ "cranelift-codegen", "log", @@ -1281,15 +1324,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" +checksum = "b82527802b1f7d8da288adc28f1dc97ea52943f5871c041213f7b5035ac698a7" [[package]] name = "cranelift-native" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" +checksum = "c30ba8b910f1be023af0c39109cb28a8809734942a6b3eecbf2de8993052ea5e" dependencies = [ "cranelift-codegen", "libc", @@ -1298,9 +1341,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.85.3" +version = "0.88.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" +checksum = "776a8916d201894aca9637a20814f1e11abc62acd5cfbe0b4eb2e63922756971" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1323,15 +1366,16 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" dependencies = [ + "anes", "atty", "cast", - "clap 2.34.0", + "ciborium", + "clap", "criterion-plot", - "csv", "futures", "itertools", "lazy_static", @@ -1341,7 +1385,6 @@ dependencies = [ "rayon", "regex", "serde", - "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -1351,9 +1394,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", "itertools", @@ -1427,7 +1470,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" dependencies = [ "generic-array 0.14.6", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1462,28 +1505,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "csv" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" -dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - [[package]] name = "ctor" version = "0.1.23" @@ -1518,7 +1539,7 @@ dependencies = [ name = "cumulus-client-cli" version = "0.1.0" dependencies = [ - "clap 3.2.17", + "clap", "parity-scale-codec", "sc-chain-spec", "sc-cli", @@ -1648,7 +1669,7 @@ dependencies = [ "parking_lot 0.12.1", "polkadot-client", "polkadot-node-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-service", "polkadot-test-client", @@ -1779,7 +1800,7 @@ dependencies = [ "log", "pallet-balances", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "sc-client-api", "scale-info", "serde", @@ -1899,7 +1920,7 @@ dependencies = [ "frame-support", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "sp-api", "sp-runtime", @@ -1955,7 +1976,7 @@ dependencies = [ "log", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-runtime-common", "sp-io", @@ -2060,7 +2081,7 @@ dependencies = [ "pallet-balances", "pallet-transaction-payment", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "sc-block-builder", "sc-consensus", @@ -2135,7 +2156,7 @@ name = "cumulus-test-service" version = "0.1.0" dependencies = [ "async-trait", - "clap 3.2.17", + "clap", "criterion", "cumulus-client-cli", "cumulus-client-consensus-common", @@ -2228,7 +2249,7 @@ checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -2318,11 +2339,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.3", "crypto-common", "subtle", ] @@ -2466,7 +2487,7 @@ checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" dependencies = [ "curve25519-dalek 3.2.0", "hex", - "rand_core 0.6.3", + "rand_core 0.6.4", "sha2 0.9.9", "thiserror", "zeroize", @@ -2490,7 +2511,7 @@ dependencies = [ "ff", "generic-array 0.14.6", "group", - "rand_core 0.6.3", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -2541,9 +2562,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" dependencies = [ "atty", "humantime", @@ -2680,7 +2701,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] @@ -2760,25 +2781,24 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -2801,11 +2821,12 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "Inflector", + "array-bytes", "chrono", - "clap 3.2.17", + "clap", "comfy-table", "frame-benchmarking", "frame-support", @@ -2813,7 +2834,6 @@ dependencies = [ "gethostname", "handlebars", "hash-db", - "hex", "itertools", "kvdb", "lazy_static", @@ -2852,7 +2872,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2863,7 +2883,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2879,10 +2899,11 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", + "frame-try-runtime", "parity-scale-codec", "scale-info", "sp-core", @@ -2907,7 +2928,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "bitflags", "frame-metadata", @@ -2932,16 +2953,19 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-tracing", + "sp-weights", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "Inflector", + "cfg-expr", "frame-support-procedural-tools", + "itertools", "proc-macro2", "quote", "syn", @@ -2950,7 +2974,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2962,7 +2986,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro2", "quote", @@ -2972,7 +2996,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "log", @@ -2984,12 +3008,13 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", + "sp-weights", ] [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -3004,7 +3029,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "sp-api", @@ -3013,9 +3038,10 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", + "parity-scale-codec", "sp-api", "sp-runtime", "sp-std", @@ -3063,9 +3089,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab30e97ab6aacfe635fad58f22c2bb06c8b685f7421eb1e064a729e2a5f481fa" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", @@ -3078,9 +3104,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", "futures-sink", @@ -3088,15 +3114,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-executor" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d11aa21b5b587a64682c0094c2bdd4df0076c5324961a40cc3abd7f37930528" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" dependencies = [ "futures-core", "futures-task", @@ -3106,9 +3132,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-lite" @@ -3127,9 +3153,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -3149,15 +3175,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-timer" @@ -3167,9 +3193,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures-channel", "futures-core", @@ -3304,7 +3330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] @@ -3335,9 +3361,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.3.3" +version = "4.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360d9740069b2f6cbb63ce2dbaa71a20d3185350cbb990d7bebeb9318415eb17" +checksum = "56b224eaa4987c03c30b251de7ef0c15a6a59f34222905850dbc3026dfb24d5f" dependencies = [ "log", "pest", @@ -3362,15 +3388,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -3479,9 +3496,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -3536,13 +3553,14 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.46" +version = "0.1.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501" +checksum = "237a0714f28b1ee39ccec0770ccb544eb02c9ef2c82bb096230eefcffa6468b0" dependencies = [ "android_system_properties", "core-foundation-sys", "js-sys", + "once_cell", "wasm-bindgen", "winapi", ] @@ -3558,6 +3576,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if-addrs" version = "0.7.0" @@ -3622,7 +3650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.3", + "hashbrown", "serde", ] @@ -3650,12 +3678,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "io-lifetimes" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" - [[package]] name = "io-lifetimes" version = "0.7.3" @@ -3688,9 +3710,9 @@ checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -3718,9 +3740,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -3889,8 +3911,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-primitives", "bitvec", @@ -3982,8 +4004,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "polkadot-primitives", @@ -4054,9 +4076,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.132" +version = "0.2.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" [[package]] name = "libloading" @@ -4142,8 +4164,8 @@ dependencies = [ "libp2p-request-response", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", ] @@ -4169,12 +4191,12 @@ dependencies = [ "multistream-select", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "ring", "rw-stream-sink", - "sha2 0.10.2", + "sha2 0.10.6", "smallvec", "thiserror", "unsigned-varint", @@ -4220,8 +4242,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "smallvec", ] @@ -4244,11 +4266,11 @@ dependencies = [ "libp2p-swarm", "log", "prometheus-client", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "regex", - "sha2 0.10.2", + "sha2 0.10.6", "smallvec", "unsigned-varint", "wasm-timer", @@ -4267,8 +4289,8 @@ dependencies = [ "libp2p-swarm", "log", "lru 0.7.8", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "prost-codec", "smallvec", "thiserror", @@ -4292,10 +4314,10 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", - "sha2 0.10.2", + "sha2 0.10.6", "smallvec", "thiserror", "uint", @@ -4370,10 +4392,10 @@ dependencies = [ "lazy_static", "libp2p-core", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", - "sha2 0.10.2", + "sha2 0.10.6", "snow", "static_assertions", "x25519-dalek", @@ -4407,8 +4429,8 @@ dependencies = [ "futures", "libp2p-core", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "unsigned-varint", "void", ] @@ -4443,8 +4465,8 @@ dependencies = [ "libp2p-swarm", "log", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "prost-codec", "rand 0.8.5", "smallvec", @@ -4467,10 +4489,10 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", - "sha2 0.10.2", + "sha2 0.10.6", "thiserror", "unsigned-varint", "void", @@ -4698,12 +4720,6 @@ dependencies = [ "statrs", ] -[[package]] -name = "linux-raw-sys" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" - [[package]] name = "linux-raw-sys" version = "0.0.46" @@ -4712,9 +4728,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -4730,22 +4746,22 @@ dependencies = [ "value-bag", ] -[[package]] -name = "lru" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" -dependencies = [ - "hashbrown 0.11.2", -] - [[package]] name = "lru" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", +] + +[[package]] +name = "lru" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936d98d2ddd79c18641c6709e7bb09981449694e402d1a0f0f657ea8d61f4a51" +dependencies = [ + "hashbrown", ] [[package]] @@ -4759,9 +4775,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.23.3" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edcb94251b1c375c459e5abe9fb0168c1c826c3370172684844f8f3f8d1a885" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" dependencies = [ "libc", "lz4-sys", @@ -4769,9 +4785,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7be8908e2ed6f31c02db8a9fa962f03e36c53fbfde437363eae3306b85d7e17" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" dependencies = [ "cc", "libc", @@ -4824,20 +4840,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.4.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +checksum = "480b5a5de855d11ff13195950bdc8b98b5e942ef47afc447f6615cdcc4e15d80" dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" -dependencies = [ - "libc", + "rustix", ] [[package]] @@ -4865,24 +4872,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "parity-util-mem", ] [[package]] name = "memory-lru" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" +checksum = "ce95ae042940bad7e312857b929ee3d11b8f799a80cb7b9c7ec5125516906395" dependencies = [ - "lru 0.6.6", + "lru 0.8.0", ] [[package]] name = "memory_units" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "merlin" @@ -4915,9 +4922,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -4934,12 +4941,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - [[package]] name = "multiaddr" version = "0.14.0" @@ -4979,10 +4980,10 @@ dependencies = [ "blake2s_simd", "blake3", "core2", - "digest 0.10.3", + "digest 0.10.5", "multihash-derive", - "sha2 0.10.2", - "sha3 0.10.2", + "sha2 0.10.6", + "sha3 0.10.5", "unsigned-varint", ] @@ -5188,6 +5189,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.2" @@ -5224,7 +5236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ "autocfg", - "num-bigint", + "num-bigint 0.2.6", "num-integer", "num-traits", ] @@ -5236,6 +5248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", + "num-bigint 0.4.3", "num-integer", "num-traits", ] @@ -5262,30 +5275,21 @@ dependencies = [ [[package]] name = "object" -version = "0.28.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "hashbrown", "indexmap", "memchr", ] -[[package]] -name = "object" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "oorandom" @@ -5314,7 +5318,7 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "dyn-clonable", @@ -5330,7 +5334,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "expander 0.0.6", "itertools", @@ -5368,18 +5372,18 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "frame-benchmarking", "frame-support", "frame-system", - "hex", "log", "pallet-collective", "pallet-identity", "parity-scale-codec", "scale-info", - "sha2 0.10.2", + "sha2 0.10.6", "sp-core", "sp-io", "sp-runtime", @@ -5389,7 +5393,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -5406,7 +5410,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5420,7 +5424,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -5436,7 +5440,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -5452,7 +5456,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -5467,7 +5471,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5491,7 +5495,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5511,7 +5515,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5526,7 +5530,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "beefy-primitives", "frame-support", @@ -5542,13 +5546,13 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "beefy-merkle-tree", "beefy-primitives", "frame-support", "frame-system", - "hex", "log", "pallet-beefy", "pallet-mmr", @@ -5565,7 +5569,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5583,7 +5587,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5628,7 +5632,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5645,7 +5649,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "bitflags", "frame-benchmarking", @@ -5673,7 +5677,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "bitflags", "parity-scale-codec", @@ -5688,7 +5692,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro2", "quote", @@ -5698,7 +5702,7 @@ dependencies = [ [[package]] name = "pallet-contracts-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "jsonrpsee", "pallet-contracts-primitives", @@ -5715,7 +5719,7 @@ dependencies = [ [[package]] name = "pallet-contracts-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "pallet-contracts-primitives", "parity-scale-codec", @@ -5728,7 +5732,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5744,13 +5748,14 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "log", + "pallet-election-provider-support-benchmarking", "parity-scale-codec", "rand 0.7.3", "scale-info", @@ -5767,7 +5772,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5780,7 +5785,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5798,7 +5803,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5813,7 +5818,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5836,7 +5841,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5852,7 +5857,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5872,7 +5877,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5889,7 +5894,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5906,7 +5911,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5924,7 +5929,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5939,7 +5944,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5954,7 +5959,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -5971,7 +5976,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5983,6 +5988,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", + "sp-runtime-interface", "sp-staking", "sp-std", ] @@ -5990,7 +5996,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "sp-api", @@ -6000,7 +6006,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -6017,7 +6023,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6040,7 +6046,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6056,7 +6062,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6071,7 +6077,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -6085,7 +6091,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6100,7 +6106,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6116,7 +6122,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -6137,7 +6143,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6153,7 +6159,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -6167,7 +6173,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6190,7 +6196,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6201,7 +6207,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "sp-arithmetic", @@ -6210,7 +6216,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -6239,7 +6245,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6257,7 +6263,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6276,7 +6282,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-support", "frame-system", @@ -6292,7 +6298,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6307,7 +6313,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6318,7 +6324,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6335,7 +6341,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6350,7 +6356,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6366,7 +6372,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6380,8 +6386,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "frame-system", @@ -6398,8 +6404,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-benchmarking", "frame-support", @@ -6429,7 +6435,7 @@ dependencies = [ name = "parachain-template-node" version = "0.1.0" dependencies = [ - "clap 3.2.17", + "clap", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -6451,7 +6457,7 @@ dependencies = [ "parachain-template-runtime", "parity-scale-codec", "polkadot-cli", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-service", "sc-basic-authorship", @@ -6527,7 +6533,7 @@ dependencies = [ "pallet-xcm", "parachain-info", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "scale-info", "serde", @@ -6580,9 +6586,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb474d0ed0836e185cb998a6b140ed1073d1fbf27d690ecf9ede8030289382c" +checksum = "2c8fdb726a43661fa54b43e7114e6b88b2289cae388eb3ad766d9d1754d83fce" dependencies = [ "blake2-rfc", "crc32fast", @@ -6591,17 +6597,17 @@ dependencies = [ "libc", "log", "lz4", - "memmap2 0.2.3", - "parking_lot 0.11.2", + "memmap2", + "parking_lot 0.12.1", "rand 0.8.5", "snap", ] [[package]] name = "parity-scale-codec" -version = "3.1.5" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -6637,7 +6643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.12.3", + "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot 0.12.1", @@ -6668,9 +6674,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" @@ -6728,9 +6734,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pbkdf2" @@ -6758,7 +6764,7 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "penpal-runtime" -version = "0.1.0" +version = "0.9.27" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -6793,7 +6799,7 @@ dependencies = [ "parachain-info", "parachains-common", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-runtime-common", "scale-info", @@ -6819,15 +6825,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4" +checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" dependencies = [ "thiserror", "ucd-trie", @@ -6835,9 +6841,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "905708f7f674518498c1f8d644481440f476d39ca6ecae83319bba7c6c12da91" +checksum = "502b62a6d0245378b04ffe0a7fb4f4419a4815fce813bd8a0ec89a56e07d67b1" dependencies = [ "pest", "pest_generator", @@ -6845,9 +6851,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5803d8284a629cc999094ecd630f55e91b561a1d1ba75e233b00ae13b91a69ad" +checksum = "451e629bf49b750254da26132f1a5a9d11fd8a95a3df51d15c4abd1ba154cb6c" dependencies = [ "pest", "pest_meta", @@ -6858,13 +6864,13 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1538eb784f07615c6d9a8ab061089c6c54a344c5b4301db51990ca1c241e8c04" +checksum = "bcec162c71c45e269dfc3fc2916eaeb97feab22993a21bcce4721d08cd7801a6" dependencies = [ "once_cell", "pest", - "sha-1 0.10.0", + "sha1", ] [[package]] @@ -6915,6 +6921,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "pkg-config" version = "0.3.25" @@ -6929,9 +6946,9 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "plotters" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716b4eeb6c4a1d3ecc956f75b43ec2e8e8ba80026413e70a3f41fd3313d3492b" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" dependencies = [ "num-traits", "plotters-backend", @@ -6957,8 +6974,8 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -6972,8 +6989,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -6986,8 +7003,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "derive_more", "fatality", @@ -7009,8 +7026,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "fatality", "futures", @@ -7030,10 +7047,10 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ - "clap 3.2.17", + "clap", "frame-benchmarking-cli", "futures", "log", @@ -7056,8 +7073,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -7097,8 +7114,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "always-assert", "fatality", @@ -7118,8 +7135,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -7131,8 +7148,8 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "derive_more", "fatality", @@ -7154,8 +7171,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -7168,8 +7185,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "futures-timer", @@ -7188,8 +7205,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "always-assert", "async-trait", @@ -7212,8 +7229,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "parity-scale-codec", @@ -7230,8 +7247,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bitvec", "derive_more", @@ -7259,8 +7276,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bitvec", "futures", @@ -7279,8 +7296,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bitvec", "fatality", @@ -7298,8 +7315,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "polkadot-node-subsystem", @@ -7313,8 +7330,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "futures", @@ -7323,7 +7340,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "sp-maybe-compressed-blob", "tracing-gum", @@ -7331,8 +7348,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "polkadot-node-subsystem", @@ -7346,8 +7363,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "futures-timer", @@ -7363,8 +7380,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "fatality", "futures", @@ -7382,8 +7399,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "futures", @@ -7399,8 +7416,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bitvec", "fatality", @@ -7417,8 +7434,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "always-assert", "assert_matches", @@ -7429,8 +7446,8 @@ dependencies = [ "parity-scale-codec", "pin-project", "polkadot-core-primitives", - "polkadot-node-subsystem-util", - "polkadot-parachain 0.9.27", + "polkadot-node-metrics", + "polkadot-parachain 0.9.29", "rand 0.8.5", "rayon", "sc-executor", @@ -7449,8 +7466,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "polkadot-node-primitives", @@ -7465,8 +7482,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "futures", "memory-lru", @@ -7481,8 +7498,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-std", "lazy_static", @@ -7499,8 +7516,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bs58", "futures", @@ -7518,8 +7535,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "derive_more", @@ -7540,13 +7557,13 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bounded-vec", "futures", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "schnorrkel", "serde", @@ -7562,8 +7579,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7572,8 +7589,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "futures", @@ -7590,8 +7607,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "derive_more", @@ -7613,8 +7630,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "derive_more", @@ -7646,8 +7663,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "futures", @@ -7669,8 +7686,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "derive_more", "frame-support", @@ -7690,7 +7707,7 @@ version = "0.9.230" dependencies = [ "assert_cmd", "async-trait", - "clap 3.2.17", + "clap", "collectives-polkadot-runtime", "contracts-rococo-runtime", "cumulus-client-cli", @@ -7717,7 +7734,7 @@ dependencies = [ "parity-scale-codec", "penpal-runtime", "polkadot-cli", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-service", "rococo-parachain-runtime", @@ -7769,8 +7786,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "env_logger", "kusama-runtime", @@ -7784,8 +7801,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bitvec", "frame-system", @@ -7793,7 +7810,7 @@ dependencies = [ "parity-scale-codec", "parity-util-mem", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "scale-info", "serde", "sp-api", @@ -7814,8 +7831,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7846,8 +7863,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-primitives", "bitvec", @@ -7881,6 +7898,7 @@ dependencies = [ "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -7933,8 +7951,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-primitives", "bitvec", @@ -7980,8 +7998,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "polkadot-primitives", @@ -7992,8 +8010,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bs58", "parity-scale-codec", @@ -8004,8 +8022,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "bitflags", "bitvec", @@ -8047,12 +8065,13 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "async-trait", "beefy-gadget", "beefy-primitives", + "frame-support", "frame-system-rpc-runtime-api", "futures", "hex-literal", @@ -8093,7 +8112,7 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", @@ -8151,8 +8170,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -8172,8 +8191,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -8182,8 +8201,8 @@ dependencies = [ [[package]] name = "polkadot-test-client" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "parity-scale-codec", "polkadot-node-subsystem", @@ -8207,8 +8226,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-primitives", "bitvec", @@ -8235,7 +8254,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -8268,8 +8287,8 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-benchmarking", "frame-system", @@ -8281,7 +8300,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime-common", @@ -8415,7 +8434,7 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "coarsetime", "crossbeam-queue", @@ -8473,9 +8492,9 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cface98dfa6d645ea4c789839f176e4b072265d085bfcc48eaa8d137f58d3c39" +checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" dependencies = [ "cfg-if 1.0.0", "fnv", @@ -8515,7 +8534,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.10.1", +] + +[[package]] +name = "prost" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" +dependencies = [ + "bytes", + "prost-derive 0.11.0", ] [[package]] @@ -8533,8 +8562,28 @@ dependencies = [ "log", "multimap", "petgraph", - "prost", - "prost-types", + "prost 0.10.4", + "prost-types 0.10.1", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost 0.11.0", + "prost-types 0.11.1", "regex", "tempfile", "which", @@ -8548,7 +8597,7 @@ checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" dependencies = [ "asynchronous-codec", "bytes", - "prost", + "prost 0.10.4", "thiserror", "unsigned-varint", ] @@ -8566,6 +8615,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.10.1" @@ -8573,7 +8635,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ "bytes", - "prost", + "prost 0.10.4", +] + +[[package]] +name = "prost-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" +dependencies = [ + "bytes", + "prost 0.11.0", ] [[package]] @@ -8639,7 +8711,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -8659,7 +8731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -8673,9 +8745,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom 0.2.7", ] @@ -8714,7 +8786,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -8776,7 +8848,7 @@ dependencies = [ "derive_more", "fs-err", "itertools", - "static_init", + "static_init 0.5.2", "thiserror", ] @@ -8802,9 +8874,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" dependencies = [ "fxhash", "log", @@ -8838,22 +8910,10 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "env_logger", "jsonrpsee", @@ -8951,7 +9011,7 @@ dependencies = [ "parachain-info", "parachains-common", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "scale-info", "serde", "sp-api", @@ -8974,8 +9034,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -8993,25 +9053,39 @@ dependencies = [ "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-gilt", "pallet-grandpa", + "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-offences", + "pallet-preimage", "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", "pallet-session", + "pallet-society", "pallet-staking", "pallet-sudo", "pallet-timestamp", + "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", "pallet-utility", + "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -9035,6 +9109,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "static_assertions", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -9043,8 +9118,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "polkadot-primitives", @@ -9111,34 +9186,20 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.14", ] [[package]] name = "rustix" -version = "0.33.7" +version = "0.35.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" +checksum = "af895b90e5c071badc3136fc10ff0bcfc98747eadbaf43ed8f214e07ba8f8477" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.5.3", + "io-lifetimes", "libc", - "linux-raw-sys 0.0.42", - "winapi", -] - -[[package]] -name = "rustix" -version = "0.35.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes 0.7.3", - "libc", - "linux-raw-sys 0.0.46", + "linux-raw-sys", "windows-sys", ] @@ -9228,7 +9289,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "sp-core", @@ -9239,16 +9300,17 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "async-trait", "futures", "futures-timer", "ip_network", "libp2p", "log", "parity-scale-codec", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -9265,7 +9327,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "futures-timer", @@ -9288,7 +9350,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -9304,10 +9366,10 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "impl-trait-for-tuples", - "memmap2 0.5.7", + "memmap2", "parity-scale-codec", "sc-chain-spec-derive", "sc-network-common", @@ -9321,7 +9383,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9332,13 +9394,13 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "chrono", - "clap 3.2.17", + "clap", "fdlimit", "futures", - "hex", "libp2p", "log", "names", @@ -9371,7 +9433,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "fnv", "futures", @@ -9399,7 +9461,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "hash-db", "kvdb", @@ -9424,7 +9486,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "futures", @@ -9448,7 +9510,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "futures", @@ -9477,14 +9539,14 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "fork-tree", "futures", "log", "merlin", - "num-bigint", + "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", "parity-scale-codec", @@ -9519,7 +9581,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "jsonrpsee", @@ -9541,7 +9603,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "fork-tree", "parity-scale-codec", @@ -9554,7 +9616,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "futures", @@ -9579,7 +9641,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9606,7 +9668,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "environmental", "parity-scale-codec", @@ -9622,7 +9684,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "parity-scale-codec", @@ -9637,15 +9699,15 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "cfg-if 1.0.0", "libc", "log", "once_cell", "parity-scale-codec", - "parity-wasm 0.42.2", - "rustix 0.35.9", + "parity-wasm 0.45.0", + "rustix", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9657,16 +9719,16 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", "futures", "futures-timer", - "hex", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9698,7 +9760,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "finality-grandpa", "futures", @@ -9719,7 +9781,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ansi_term", "futures", @@ -9736,10 +9798,10 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "async-trait", - "hex", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -9751,8 +9813,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "async-trait", "asynchronous-codec", "bitflags", @@ -9763,7 +9826,6 @@ dependencies = [ "fork-tree", "futures", "futures-timer", - "hex", "ip_network", "libp2p", "linked-hash-map", @@ -9773,8 +9835,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9793,14 +9854,33 @@ dependencies = [ "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", - "void", "zeroize", ] +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" +dependencies = [ + "cid", + "futures", + "libp2p", + "log", + "prost 0.11.0", + "prost-build 0.11.1", + "sc-client-api", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", + "void", +] + [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "bitflags", @@ -9808,11 +9888,12 @@ dependencies = [ "futures", "libp2p", "parity-scale-codec", - "prost-build", + "prost-build 0.10.4", "sc-consensus", "sc-peerset", "serde", "smallvec", + "sp-blockchain", "sp-consensus", "sp-finality-grandpa", "sp-runtime", @@ -9822,7 +9903,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ahash", "futures", @@ -9840,15 +9921,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "futures", - "hex", "libp2p", "log", "parity-scale-codec", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "sc-client-api", "sc-network-common", "sc-peerset", @@ -9861,17 +9942,17 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "fork-tree", "futures", - "hex", "libp2p", "log", "lru 0.7.8", "parity-scale-codec", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "sc-client-api", "sc-consensus", "sc-network-common", @@ -9889,13 +9970,13 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "bytes", "fnv", "futures", "futures-timer", - "hex", "hyper", "hyper-rustls", "libp2p", @@ -9919,7 +10000,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "libp2p", @@ -9932,7 +10013,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9941,7 +10022,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "hash-db", @@ -9971,7 +10052,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "jsonrpsee", @@ -9994,7 +10075,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "jsonrpsee", @@ -10007,7 +10088,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "directories", @@ -10031,6 +10112,7 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", + "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", @@ -10063,6 +10145,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", + "static_init 1.0.3", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -10074,7 +10157,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "parity-scale-codec", @@ -10088,7 +10171,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10107,7 +10190,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "libc", @@ -10126,7 +10209,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "chrono", "futures", @@ -10144,7 +10227,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ansi_term", "atty", @@ -10175,7 +10258,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10186,7 +10269,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "futures-timer", @@ -10212,7 +10295,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "log", @@ -10225,7 +10308,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "futures-timer", @@ -10237,9 +10320,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -10251,9 +10334,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +checksum = "53f56acbd0743d29ffa08f911ab5397def774ad01bab3786804cf6ee057fb5e1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10313,6 +10396,7 @@ checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der", "generic-array 0.14.6", + "pkcs8", "subtle", "zeroize", ] @@ -10419,9 +10503,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" dependencies = [ "serde", ] @@ -10441,16 +10525,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.144" @@ -10496,14 +10570,14 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "sha1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -10533,13 +10607,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -10556,11 +10630,11 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.2" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a31480366ec990f395a61b7c08122d99bd40544fdb5abcfc1b06bb29994312c" +checksum = "e2904bea16a1ae962b483322a1c7b81d976029203aea1f461e51cd7705db7ba9" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", "keccak", ] @@ -10641,7 +10715,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" dependencies = [ "digest 0.9.0", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -10673,8 +10747,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "enumn", "parity-scale-codec", @@ -10714,18 +10788,18 @@ dependencies = [ "blake2", "chacha20poly1305", "curve25519-dalek 4.0.0-pre.1", - "rand_core 0.6.3", + "rand_core 0.6.4", "ring", "rustc_version 0.4.0", - "sha2 0.10.2", + "sha2 0.10.6", "subtle", ] [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -10744,13 +10818,13 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "sha-1 0.9.8", + "sha-1", ] [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "hash-db", "log", @@ -10768,7 +10842,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "blake2", "proc-macro-crate", @@ -10780,7 +10854,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -10793,7 +10867,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "integer-sqrt", "num-traits", @@ -10808,7 +10882,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -10821,7 +10895,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "parity-scale-codec", @@ -10833,7 +10907,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "sp-api", @@ -10845,7 +10919,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "log", @@ -10863,7 +10937,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "futures", @@ -10882,7 +10956,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "parity-scale-codec", @@ -10900,7 +10974,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "merlin", @@ -10923,7 +10997,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -10937,7 +11011,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -10950,18 +11024,18 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "base58", "bitflags", - "blake2-rfc", + "blake2", "byteorder", "dyn-clonable", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "hex", "impl-serde", "lazy_static", "libsecp256k1", @@ -10996,13 +11070,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "blake2", "byteorder", - "digest 0.10.3", - "sha2 0.10.2", - "sha3 0.10.2", + "digest 0.10.5", + "sha2 0.10.6", + "sha3 0.10.5", "sp-std", "twox-hash", ] @@ -11010,7 +11084,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro2", "quote", @@ -11021,7 +11095,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11030,7 +11104,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro2", "quote", @@ -11040,7 +11114,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "environmental", "parity-scale-codec", @@ -11051,7 +11125,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "finality-grandpa", "log", @@ -11069,7 +11143,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11083,7 +11157,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "bytes", "futures", @@ -11109,7 +11183,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "lazy_static", "sp-core", @@ -11120,7 +11194,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "futures", @@ -11137,7 +11211,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "thiserror", "zstd", @@ -11146,7 +11220,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "parity-scale-codec", @@ -11161,7 +11235,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -11175,7 +11249,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "sp-api", "sp-core", @@ -11185,7 +11259,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "backtrace", "lazy_static", @@ -11195,7 +11269,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "rustc-hash", "serde", @@ -11205,7 +11279,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "either", "hash256-std-hasher", @@ -11222,12 +11296,13 @@ dependencies = [ "sp-core", "sp-io", "sp-std", + "sp-weights", ] [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11245,7 +11320,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "Inflector", "proc-macro-crate", @@ -11257,7 +11332,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "parity-scale-codec", @@ -11271,7 +11346,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "serde", "serde_json", @@ -11280,7 +11355,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -11294,7 +11369,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "scale-info", @@ -11305,7 +11380,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "hash-db", "log", @@ -11327,12 +11402,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11345,7 +11420,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "log", "sp-core", @@ -11358,7 +11433,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "futures-timer", @@ -11374,7 +11449,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "sp-std", @@ -11386,7 +11461,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "sp-api", "sp-runtime", @@ -11395,7 +11470,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "async-trait", "log", @@ -11411,11 +11486,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ahash", "hash-db", - "hashbrown 0.12.3", + "hashbrown", "lazy_static", "lru 0.7.8", "memory-db", @@ -11434,11 +11509,11 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "impl-serde", "parity-scale-codec", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "scale-info", "serde", "sp-core-hashing-proc-macro", @@ -11451,7 +11526,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -11462,7 +11537,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "impl-trait-for-tuples", "log", @@ -11472,6 +11547,22 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "spin" version = "0.5.2" @@ -11479,10 +11570,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "ss58-registry" -version = "1.28.0" +name = "spki" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c8a1e645fa0bd3e81a90e592a677f7ada3182ac338c4a71cd9ec0ba911f6abb" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ss58-registry" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0837b5d62f42082c9d56cd946495ae273a3c68083b637b9153341d5e465146d" dependencies = [ "Inflector", "num-format", @@ -11539,11 +11640,12 @@ dependencies = [ "pallet-uniques", "pallet-utility", "pallet-xcm", + "pallet-xcm-benchmarks", "parachain-info", "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "scale-info", "serde", @@ -11605,11 +11707,12 @@ dependencies = [ "pallet-uniques", "pallet-utility", "pallet-xcm", + "pallet-xcm-benchmarks", "parachain-info", "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "polkadot-runtime-constants", "scale-info", @@ -11648,7 +11751,22 @@ dependencies = [ "cfg_aliases", "libc", "parking_lot 0.11.2", - "static_init_macro", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.5", + "static_init_macro 1.0.2", + "winapi", ] [[package]] @@ -11664,6 +11782,19 @@ dependencies = [ "syn", ] +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "statrs" version = "0.15.0" @@ -11721,7 +11852,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "platforms", ] @@ -11729,7 +11860,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11750,7 +11881,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures-util", "hyper", @@ -11763,7 +11894,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "jsonrpsee", "log", @@ -11784,11 +11915,11 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ + "array-bytes", "async-trait", "futures", - "hex", "parity-scale-codec", "sc-client-api", "sc-client-db", @@ -11810,7 +11941,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11820,7 +11951,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11831,7 +11962,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ "ansi_term", "build-helper", @@ -11853,9 +11984,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" dependencies = [ "proc-macro2", "quote", @@ -11938,8 +12069,8 @@ checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" [[package]] name = "test-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "polkadot-primitives", @@ -11950,33 +12081,24 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.11.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" dependencies = [ "proc-macro2", "quote", @@ -12088,9 +12210,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.1" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" dependencies = [ "autocfg", "bytes", @@ -12131,9 +12253,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" dependencies = [ "futures-core", "pin-project-lite 0.2.9", @@ -12142,9 +12264,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -12215,8 +12337,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -12226,8 +12348,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -12287,7 +12409,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "log", "rustc-hex", "smallvec", @@ -12315,7 +12437,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.2.3", "ipnet", "lazy_static", "log", @@ -12354,9 +12476,10 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#40703f41167c718e13b491228efeafb4a6194448" +source = "git+https://github.com/paritytech/substrate?branch=master#cc4d5cc8654d280f03a13421669ba03632e14aa7" dependencies = [ - "clap 3.2.17", + "clap", + "frame-try-runtime", "jsonrpsee", "log", "parity-scale-codec", @@ -12389,7 +12512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if 1.0.0", - "digest 0.10.3", + "digest 0.10.5", "rand 0.8.5", "static_assertions", ] @@ -12402,15 +12525,15 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uint" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" dependencies = [ "byteorder", "crunchy", @@ -12435,30 +12558,30 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" @@ -12490,13 +12613,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna", - "matches", + "idna 0.3.0", "percent-encoding", ] @@ -12590,9 +12712,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -12600,9 +12722,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", "log", @@ -12615,9 +12737,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -12627,9 +12749,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12637,9 +12759,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -12650,9 +12772,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-gc-api" @@ -12667,11 +12789,11 @@ dependencies = [ [[package]] name = "wasm-instrument" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", ] [[package]] @@ -12691,58 +12813,63 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.9.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ - "downcast-rs", - "libc", - "libm", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "wasmi-validation", + "wasmi_core", ] [[package]] name = "wasmi-validation" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational 0.4.1", + "num-traits", ] [[package]] name = "wasmparser" -version = "0.85.0" +version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ "indexmap", ] [[package]] name = "wasmtime" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" +checksum = "8a10dc9784d8c3a33c970e3939180424955f08af2e7f20368ec02685a0e8f065" dependencies = [ "anyhow", - "backtrace", "bincode", "cfg-if 1.0.0", "indexmap", - "lazy_static", "libc", "log", - "object 0.28.4", + "object", "once_cell", "paste", "psm", "rayon", - "region", "serde", "target-lexicon", "wasmparser", @@ -12751,14 +12878,23 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "winapi", + "windows-sys", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4dbdc6daf68528cad1275ac91e3f51848ce9824385facc94c759f529decdf8" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] name = "wasmtime-cache" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" +checksum = "9f507f3fa1ee1b2f9a83644e2514242b1dfe580782c0eb042f1ef70255bc4ffe" dependencies = [ "anyhow", "base64", @@ -12766,19 +12902,19 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.33.7", + "rustix", "serde", "sha2 0.9.9", "toml", - "winapi", + "windows-sys", "zstd", ] [[package]] name = "wasmtime-cranelift" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" +checksum = "8f03cf79d982fc68e94ba0bea6a300a3b94621c4eb9705eece0a4f06b235a3b5" dependencies = [ "anyhow", "cranelift-codegen", @@ -12788,8 +12924,7 @@ dependencies = [ "cranelift-wasm", "gimli", "log", - "more-asserts", - "object 0.28.4", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -12798,17 +12933,16 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" +checksum = "5c587c62e91c5499df62012b87b88890d0eb470b2ffecc5964e9da967b70c77c" dependencies = [ "anyhow", "cranelift-entity", "gimli", "indexmap", "log", - "more-asserts", - "object 0.28.4", + "object", "serde", "target-lexicon", "thiserror", @@ -12818,9 +12952,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" +checksum = "047839b5dabeae5424a078c19b8cc897e5943a7fadc69e3d888b9c9a897666b3" dependencies = [ "addr2line", "anyhow", @@ -12829,38 +12963,36 @@ dependencies = [ "cpp_demangle", "gimli", "log", - "object 0.28.4", - "region", + "object", "rustc-demangle", - "rustix 0.33.7", + "rustix", "serde", "target-lexicon", "thiserror", "wasmtime-environ", "wasmtime-jit-debug", "wasmtime-runtime", - "winapi", + "windows-sys", ] [[package]] name = "wasmtime-jit-debug" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" +checksum = "b299569abf6f99b7b8e020afaf84a700e8636c6a42e242069267322cd5818235" dependencies = [ - "lazy_static", - "object 0.28.4", - "rustix 0.33.7", + "object", + "once_cell", + "rustix", ] [[package]] name = "wasmtime-runtime" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" +checksum = "ae79e0515160bd5abee5df50a16c4eb8db9f71b530fc988ae1d9ce34dcb8dd01" dependencies = [ "anyhow", - "backtrace", "cc", "cfg-if 1.0.0", "indexmap", @@ -12869,21 +13001,21 @@ dependencies = [ "mach", "memfd", "memoffset", - "more-asserts", + "paste", "rand 0.8.5", - "region", - "rustix 0.33.7", + "rustix", "thiserror", + "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "winapi", + "windows-sys", ] [[package]] name = "wasmtime-types" -version = "0.38.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" +checksum = "790cf43ee8e2d5dad1780af30f00d7a972b74725fb1e4f90c28d62733819b185" dependencies = [ "cranelift-entity", "serde", @@ -12893,9 +13025,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -12931,8 +13063,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "beefy-primitives", "bitvec", @@ -12986,7 +13118,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -13020,8 +13152,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "polkadot-primitives", @@ -13069,11 +13201,12 @@ dependencies = [ "pallet-uniques", "pallet-utility", "pallet-xcm", + "pallet-xcm-benchmarks", "parachain-info", "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "scale-info", "serde", @@ -13099,13 +13232,13 @@ dependencies = [ [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] @@ -13262,8 +13395,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -13276,15 +13409,15 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-support", "frame-system", "log", "pallet-transaction-payment", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "scale-info", "sp-arithmetic", "sp-io", @@ -13296,8 +13429,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "frame-benchmarking", "frame-support", @@ -13314,8 +13447,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=master#f23b88302570f800234bacc6f92153b9433e3429" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=master#9ffe6e9e3da28d2b2d93b40c5790124dacba2089" dependencies = [ "Inflector", "proc-macro2", diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 39e7c33f83..4f20e564dd 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -clap = { version = "3.2.17", features = ["derive", "deprecated"] } +clap = { version = "3.2.22", features = ["derive", "deprecated"] } codec = { package = "parity-scale-codec", version = "3.0.0" } -url = "2.2.2" +url = "2.3.1" # Substrate sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml index e4c459e48f..9e3118c846 100644 --- a/client/consensus/aura/Cargo.toml +++ b/client/consensus/aura/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } -futures = "0.3.23" +futures = "0.3.24" tracing = "0.1.36" # Substrate diff --git a/client/consensus/aura/src/import_queue.rs b/client/consensus/aura/src/import_queue.rs index 31ed577985..80b35a2bab 100644 --- a/client/consensus/aura/src/import_queue.rs +++ b/client/consensus/aura/src/import_queue.rs @@ -25,7 +25,7 @@ use sc_telemetry::TelemetryHandle; use sp_api::{ApiExt, ProvideRuntimeApi}; use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::HeaderBackend; -use sp_consensus::{CanAuthorWith, Error as ConsensusError}; +use sp_consensus::Error as ConsensusError; use sp_consensus_aura::AuraApi; use sp_core::crypto::Pair; use sp_inherents::CreateInherentDataProviders; @@ -34,7 +34,7 @@ use std::{fmt::Debug, hash::Hash, sync::Arc}; use substrate_prometheus_endpoint::Registry; /// Parameters of [`import_queue`]. -pub struct ImportQueueParams<'a, I, C, CIDP, S, CAW> { +pub struct ImportQueueParams<'a, I, C, CIDP, S> { /// The block import to use. pub block_import: I, /// The client to interact with the chain. @@ -45,23 +45,20 @@ pub struct ImportQueueParams<'a, I, C, CIDP, S, CAW> { pub spawner: &'a S, /// The prometheus registry. pub registry: Option<&'a Registry>, - /// Can we author with the current node? - pub can_author_with: CAW, /// The telemetry handle. pub telemetry: Option, } /// Start an import queue for the Aura consensus algorithm. -pub fn import_queue<'a, P, Block, I, C, S, CAW, CIDP>( +pub fn import_queue<'a, P, Block, I, C, S, CIDP>( ImportQueueParams { block_import, client, create_inherent_data_providers, spawner, registry, - can_author_with, telemetry, - }: ImportQueueParams<'a, I, C, CIDP, S, CAW>, + }: ImportQueueParams<'a, I, C, CIDP, S>, ) -> Result, sp_consensus::Error> where Block: BlockT, @@ -82,48 +79,41 @@ where P::Public: Clone + Eq + Send + Sync + Hash + Debug + Codec, P::Signature: Codec, S: sp_core::traits::SpawnEssentialNamed, - CAW: CanAuthorWith + Send + Sync + 'static, CIDP: CreateInherentDataProviders + Sync + Send + 'static, CIDP::InherentDataProviders: InherentDataProviderExt + Send + Sync, { - sc_consensus_aura::import_queue::(sc_consensus_aura::ImportQueueParams { + sc_consensus_aura::import_queue::(sc_consensus_aura::ImportQueueParams { block_import: cumulus_client_consensus_common::ParachainBlockImport::new(block_import), justification_import: None, client, create_inherent_data_providers, spawner, registry, - can_author_with, check_for_equivocation: sc_consensus_aura::CheckForEquivocation::No, telemetry, }) } /// Parameters of [`build_verifier`]. -pub struct BuildVerifierParams { +pub struct BuildVerifierParams { /// The client to interact with the chain. pub client: Arc, /// The inherent data providers, to create the inherent data. pub create_inherent_data_providers: CIDP, - /// Can we author with the current node? - pub can_author_with: CAW, /// The telemetry handle. pub telemetry: Option, } /// Build the [`AuraVerifier`]. -pub fn build_verifier( - BuildVerifierParams { - client, - create_inherent_data_providers, - can_author_with, - telemetry, - }: BuildVerifierParams, -) -> AuraVerifier { +pub fn build_verifier( + BuildVerifierParams { client, create_inherent_data_providers, telemetry }: BuildVerifierParams< + C, + CIDP, + >, +) -> AuraVerifier { sc_consensus_aura::build_verifier(sc_consensus_aura::BuildVerifierParams { client, create_inherent_data_providers, - can_author_with, telemetry, check_for_equivocation: sc_consensus_aura::CheckForEquivocation::No, }) diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index bddbf56f4e..633d3630bc 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } dyn-clone = "1.0.9" -futures = "0.3.23" +futures = "0.3.24" tracing = "0.1.36" # Substrate diff --git a/client/consensus/relay-chain/Cargo.toml b/client/consensus/relay-chain/Cargo.toml index e9d0dae40f..e86e9d99f5 100644 --- a/client/consensus/relay-chain/Cargo.toml +++ b/client/consensus/relay-chain/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] async-trait = "0.1.57" -futures = "0.3.23" +futures = "0.3.24" parking_lot = "0.12.1" tracing = "0.1.36" diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index b4b1704a7d..fe28547003 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } derive_more = "0.99.2" -futures = "0.3.23" +futures = "0.3.24" futures-timer = "3.0.2" parking_lot = "0.12.1" tracing = "0.1.36" @@ -33,8 +33,8 @@ cumulus-relay-chain-interface = { path = "../relay-chain-interface" } [dev-dependencies] portpicker = "0.1.1" -tokio = { version = "1.19.2", features = ["macros"] } -url = "2.2.2" +tokio = { version = "1.21.1", features = ["macros"] } +url = "2.3.1" # Substrate sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/client/pov-recovery/Cargo.toml b/client/pov-recovery/Cargo.toml index 73920c6101..fd70e341f2 100644 --- a/client/pov-recovery/Cargo.toml +++ b/client/pov-recovery/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } -futures = "0.3.23" +futures = "0.3.24" futures-timer = "3.0.2" rand = "0.8.5" tracing = "0.1.36" @@ -31,7 +31,7 @@ cumulus-primitives-core = { path = "../../primitives/core" } cumulus-relay-chain-interface = {path = "../relay-chain-interface"} [dev-dependencies] -tokio = { version = "1.19.2", features = ["macros"] } +tokio = { version = "1.21.1", features = ["macros"] } # Cumulus cumulus-test-service = { path = "../../test/service" } diff --git a/client/relay-chain-inprocess-interface/Cargo.toml b/client/relay-chain-inprocess-interface/Cargo.toml index 612b56c0ad..c8d5b93a2d 100644 --- a/client/relay-chain-inprocess-interface/Cargo.toml +++ b/client/relay-chain-inprocess-interface/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] async-trait = "0.1.57" -futures = "0.3.23" +futures = "0.3.24" futures-timer = "3.0.2" tracing = "0.1.36" @@ -26,7 +26,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot -polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false } +polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, features = ["cli"] } polkadot-client = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" } diff --git a/client/relay-chain-interface/Cargo.toml b/client/relay-chain-interface/Cargo.toml index 49cf0bf380..c84a4265d0 100644 --- a/client/relay-chain-interface/Cargo.toml +++ b/client/relay-chain-interface/Cargo.toml @@ -17,10 +17,10 @@ sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "mas sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -futures = "0.3.23" +futures = "0.3.24" parking_lot = "0.12.1" derive_more = "0.99.2" async-trait = "0.1.57" -thiserror = "1.0.32" +thiserror = "1.0.35" jsonrpsee-core = "0.15.1" -parity-scale-codec = "3.1.5" +parity-scale-codec = "3.2.1" diff --git a/client/relay-chain-rpc-interface/Cargo.toml b/client/relay-chain-rpc-interface/Cargo.toml index 34f49a69f8..188f709bae 100644 --- a/client/relay-chain-rpc-interface/Cargo.toml +++ b/client/relay-chain-rpc-interface/Cargo.toml @@ -18,14 +18,14 @@ sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = " sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio = { version = "1.19.2", features = ["sync"] } +tokio = { version = "1.21.1", features = ["sync"] } -futures = "0.3.23" +futures = "0.3.24" futures-timer = "3.0.2" -parity-scale-codec = "3.1.5" +parity-scale-codec = "3.2.1" parking_lot = "0.12.1" jsonrpsee = { version = "0.15.1", features = ["ws-client"] } tracing = "0.1.36" async-trait = "0.1.57" -url = "2.2.2" +url = "2.3.1" backoff = { version = "0.4.0", features = ["tokio"] } diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 5ca73a530a..600e1fcf44 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -27,7 +27,7 @@ use sc_client_api::{ Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, UsageProvider, }; use sc_consensus::{ - import_queue::{ImportQueue, IncomingBlock, Link, Origin}, + import_queue::{ImportQueue, IncomingBlock, Link, RuntimeOrigin}, BlockImport, }; use sc_service::{Configuration, TaskManager}; @@ -261,7 +261,7 @@ impl ImportQueue for SharedImportQueue { fn import_justifications( &mut self, - who: Origin, + who: RuntimeOrigin, hash: Block::Hash, number: NumberFor, justifications: Justifications, diff --git a/pallets/aura-ext/Cargo.toml b/pallets/aura-ext/Cargo.toml index 30f5214a92..22874e3edb 100644 --- a/pallets/aura-ext/Cargo.toml +++ b/pallets/aura-ext/Cargo.toml @@ -7,7 +7,7 @@ description = "AURA consensus extension pallet for parachains" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } # Substrate @@ -40,3 +40,4 @@ std = [ "sp-runtime/std", "sp-std/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/collator-selection/Cargo.toml b/pallets/collator-selection/Cargo.toml index 4ed02a07c5..81f1d0f97c 100644 --- a/pallets/collator-selection/Cargo.toml +++ b/pallets/collator-selection/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] log = { version = "0.4.17", default-features = false } codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.0.0" } rand = { version = "0.8.5", features = ["std_rng"], default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", default-features = false } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/pallets/collator-selection/src/benchmarking.rs b/pallets/collator-selection/src/benchmarking.rs index a08b2c7a43..f5467fbd09 100644 --- a/pallets/collator-selection/src/benchmarking.rs +++ b/pallets/collator-selection/src/benchmarking.rs @@ -44,9 +44,9 @@ macro_rules! whitelist { }; } -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { let events = frame_system::Pallet::::events(); - let system_event: ::Event = generic_event.into(); + let system_event: ::RuntimeEvent = generic_event.into(); // compare to the last event record let EventRecord { event, .. } = &events[events.len() - 1]; assert_eq!(event, &system_event); diff --git a/pallets/collator-selection/src/lib.rs b/pallets/collator-selection/src/lib.rs index 918ec95a3d..1644034484 100644 --- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -77,7 +77,7 @@ pub mod pallet { pub use crate::weights::WeightInfo; use core::ops::Div; use frame_support::{ - dispatch::DispatchResultWithPostInfo, + dispatch::{DispatchClass, DispatchResultWithPostInfo}, inherent::Vec, pallet_prelude::*, sp_runtime::{ @@ -88,7 +88,6 @@ pub mod pallet { Currency, EnsureOrigin, ExistenceRequirement::KeepAlive, ReservableCurrency, ValidatorRegistration, }, - weights::DispatchClass, BoundedVec, PalletId, }; use frame_system::{pallet_prelude::*, Config as SystemConfig}; @@ -112,13 +111,13 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The currency mechanism. type Currency: ReservableCurrency; /// Origin that can dictate updating parameters of this pallet. - type UpdateOrigin: EnsureOrigin; + type UpdateOrigin: EnsureOrigin; /// Account Identifier from which the internal Pot is generated. type PotId: Get; diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index a3aa8a20cc..4b3cc49773 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -59,8 +59,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -68,7 +68,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -88,7 +88,7 @@ parameter_types! { impl pallet_balances::Config for Test { type Balance = u64; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -171,7 +171,7 @@ parameter_types! { } impl pallet_session::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = IdentityCollator; @@ -207,7 +207,7 @@ impl ValidatorRegistration for IsRegistered { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = EnsureSignedBy; type PotId = PotId; diff --git a/pallets/collator-selection/src/tests.rs b/pallets/collator-selection/src/tests.rs index 730bfd489c..459b107ecc 100644 --- a/pallets/collator-selection/src/tests.rs +++ b/pallets/collator-selection/src/tests.rs @@ -38,14 +38,14 @@ fn it_should_set_invulnerables() { new_test_ext().execute_with(|| { let new_set = vec![1, 2, 3, 4]; assert_ok!(CollatorSelection::set_invulnerables( - Origin::signed(RootAccount::get()), + RuntimeOrigin::signed(RootAccount::get()), new_set.clone() )); assert_eq!(CollatorSelection::invulnerables(), new_set); // cannot set with non-root. assert_noop!( - CollatorSelection::set_invulnerables(Origin::signed(1), new_set.clone()), + CollatorSelection::set_invulnerables(RuntimeOrigin::signed(1), new_set.clone()), BadOrigin ); @@ -53,7 +53,7 @@ fn it_should_set_invulnerables() { let invulnerables = vec![7]; assert_noop!( CollatorSelection::set_invulnerables( - Origin::signed(RootAccount::get()), + RuntimeOrigin::signed(RootAccount::get()), invulnerables.clone() ), Error::::ValidatorNotRegistered @@ -69,13 +69,16 @@ fn set_desired_candidates_works() { // can set assert_ok!(CollatorSelection::set_desired_candidates( - Origin::signed(RootAccount::get()), + RuntimeOrigin::signed(RootAccount::get()), 7 )); assert_eq!(CollatorSelection::desired_candidates(), 7); // rejects bad origin - assert_noop!(CollatorSelection::set_desired_candidates(Origin::signed(1), 8), BadOrigin); + assert_noop!( + CollatorSelection::set_desired_candidates(RuntimeOrigin::signed(1), 8), + BadOrigin + ); }); } @@ -86,11 +89,14 @@ fn set_candidacy_bond() { assert_eq!(CollatorSelection::candidacy_bond(), 10); // can set - assert_ok!(CollatorSelection::set_candidacy_bond(Origin::signed(RootAccount::get()), 7)); + assert_ok!(CollatorSelection::set_candidacy_bond( + RuntimeOrigin::signed(RootAccount::get()), + 7 + )); assert_eq!(CollatorSelection::candidacy_bond(), 7); // rejects bad origin. - assert_noop!(CollatorSelection::set_candidacy_bond(Origin::signed(1), 8), BadOrigin); + assert_noop!(CollatorSelection::set_candidacy_bond(RuntimeOrigin::signed(1), 8), BadOrigin); }); } @@ -102,17 +108,17 @@ fn cannot_register_candidate_if_too_many() { // can't accept anyone anymore. assert_noop!( - CollatorSelection::register_as_candidate(Origin::signed(3)), + CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3)), Error::::TooManyCandidates, ); // reset desired candidates: >::put(1); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(4))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(4))); // but no more assert_noop!( - CollatorSelection::register_as_candidate(Origin::signed(5)), + CollatorSelection::register_as_candidate(RuntimeOrigin::signed(5)), Error::::TooManyCandidates, ); }) @@ -123,11 +129,11 @@ fn cannot_unregister_candidate_if_too_few() { new_test_ext().execute_with(|| { // reset desired candidates: >::put(1); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(4))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(4))); // can not remove too few assert_noop!( - CollatorSelection::leave_intent(Origin::signed(4)), + CollatorSelection::leave_intent(RuntimeOrigin::signed(4)), Error::::TooFewCandidates, ); }) @@ -140,7 +146,7 @@ fn cannot_register_as_candidate_if_invulnerable() { // can't 1 because it is invulnerable. assert_noop!( - CollatorSelection::register_as_candidate(Origin::signed(1)), + CollatorSelection::register_as_candidate(RuntimeOrigin::signed(1)), Error::::AlreadyInvulnerable, ); }) @@ -151,7 +157,7 @@ fn cannot_register_as_candidate_if_keys_not_registered() { new_test_ext().execute_with(|| { // can't 7 because keys not registered. assert_noop!( - CollatorSelection::register_as_candidate(Origin::signed(7)), + CollatorSelection::register_as_candidate(RuntimeOrigin::signed(7)), Error::::ValidatorNotRegistered ); }) @@ -161,7 +167,7 @@ fn cannot_register_as_candidate_if_keys_not_registered() { fn cannot_register_dupe_candidate() { new_test_ext().execute_with(|| { // can add 3 as candidate - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); let addition = CandidateInfo { who: 3, deposit: 10 }; assert_eq!(CollatorSelection::candidates(), vec![addition]); assert_eq!(CollatorSelection::last_authored_block(3), 10); @@ -169,7 +175,7 @@ fn cannot_register_dupe_candidate() { // but no more assert_noop!( - CollatorSelection::register_as_candidate(Origin::signed(3)), + CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3)), Error::::AlreadyCandidate, ); }) @@ -182,11 +188,11 @@ fn cannot_register_as_candidate_if_poor() { assert_eq!(Balances::free_balance(&33), 0); // works - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); // poor assert_noop!( - CollatorSelection::register_as_candidate(Origin::signed(33)), + CollatorSelection::register_as_candidate(RuntimeOrigin::signed(33)), BalancesError::::InsufficientBalance, ); }); @@ -205,8 +211,8 @@ fn register_as_candidate_works() { assert_eq!(Balances::free_balance(&3), 100); assert_eq!(Balances::free_balance(&4), 100); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(4))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(4))); assert_eq!(Balances::free_balance(&3), 90); assert_eq!(Balances::free_balance(&4), 90); @@ -219,21 +225,21 @@ fn register_as_candidate_works() { fn leave_intent() { new_test_ext().execute_with(|| { // register a candidate. - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); assert_eq!(Balances::free_balance(3), 90); // register too so can leave above min candidates - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(5))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(5))); assert_eq!(Balances::free_balance(5), 90); // cannot leave if not candidate. assert_noop!( - CollatorSelection::leave_intent(Origin::signed(4)), + CollatorSelection::leave_intent(RuntimeOrigin::signed(4)), Error::::NotCandidate ); // bond is returned - assert_ok!(CollatorSelection::leave_intent(Origin::signed(3))); + assert_ok!(CollatorSelection::leave_intent(RuntimeOrigin::signed(3))); assert_eq!(Balances::free_balance(3), 100); assert_eq!(CollatorSelection::last_authored_block(3), 0); }); @@ -247,7 +253,7 @@ fn authorship_event_handler() { // 4 is the default author. assert_eq!(Balances::free_balance(4), 100); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(4))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(4))); // triggers `note_author` Authorship::on_initialize(1); @@ -272,7 +278,7 @@ fn fees_edgecases() { Balances::make_free_balance_be(&CollatorSelection::account_id(), 5); // 4 is the default author. assert_eq!(Balances::free_balance(4), 100); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(4))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(4))); // triggers `note_author` Authorship::on_initialize(1); @@ -301,7 +307,7 @@ fn session_management_works() { assert_eq!(SessionHandlerCollators::get(), vec![1, 2]); // add a new collator - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); // session won't see this. assert_eq!(SessionHandlerCollators::get(), vec![1, 2]); @@ -328,8 +334,8 @@ fn session_management_works() { fn kick_mechanism() { new_test_ext().execute_with(|| { // add a new collator - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(4))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(4))); initialize_to_block(10); assert_eq!(CollatorSelection::candidates().len(), 2); initialize_to_block(20); @@ -353,8 +359,8 @@ fn kick_mechanism() { fn should_not_kick_mechanism_too_few() { new_test_ext().execute_with(|| { // add a new collator - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(3))); - assert_ok!(CollatorSelection::register_as_candidate(Origin::signed(5))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(3))); + assert_ok!(CollatorSelection::register_as_candidate(RuntimeOrigin::signed(5))); initialize_to_block(10); assert_eq!(CollatorSelection::candidates().len(), 2); initialize_to_block(20); diff --git a/pallets/collator-selection/src/weights.rs b/pallets/collator-selection/src/weights.rs index 513e780834..66292751b9 100644 --- a/pallets/collator-selection/src/weights.rs +++ b/pallets/collator-selection/src/weights.rs @@ -39,91 +39,93 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn set_invulnerables(b: u32) -> Weight { - (18_563_000 as Weight) + Weight::from_ref_time(18_563_000 as u64) // Standard Error: 0 - .saturating_add((68_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn set_desired_candidates() -> Weight { - (16_363_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_363_000 as u64).saturating_add(T::DbWeight::get().writes(1 as u64)) } fn set_candidacy_bond() -> Weight { - (16_840_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_840_000 as u64).saturating_add(T::DbWeight::get().writes(1 as u64)) } fn register_as_candidate(c: u32) -> Weight { - (71_196_000 as Weight) + Weight::from_ref_time(71_196_000 as u64) // Standard Error: 0 - .saturating_add((198_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } fn leave_intent(c: u32) -> Weight { - (55_336_000 as Weight) + Weight::from_ref_time(55_336_000 as u64) // Standard Error: 0 - .saturating_add((151_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } fn note_author() -> Weight { - (71_461_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(71_461_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } fn new_session(r: u32, c: u32) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_010_000 - .saturating_add((109_961_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(Weight::from_ref_time(109_961_000 as u64).saturating_mul(r as u64)) // Standard Error: 1_010_000 - .saturating_add((151_952_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(Weight::from_ref_time(151_952_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(c as u64))) } } // For backwards compatibility and tests impl WeightInfo for () { fn set_invulnerables(b: u32) -> Weight { - (18_563_000 as Weight) + Weight::from_ref_time(18_563_000 as u64) // Standard Error: 0 - .saturating_add((68_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } fn set_desired_candidates() -> Weight { - (16_363_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_363_000 as u64) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } fn set_candidacy_bond() -> Weight { - (16_840_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_840_000 as u64) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } fn register_as_candidate(c: u32) -> Weight { - (71_196_000 as Weight) + Weight::from_ref_time(71_196_000 as u64) // Standard Error: 0 - .saturating_add((198_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } fn leave_intent(c: u32) -> Weight { - (55_336_000 as Weight) + Weight::from_ref_time(55_336_000 as u64) // Standard Error: 0 - .saturating_add((151_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } fn note_author() -> Weight { - (71_461_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(71_461_000 as u64) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } fn new_session(r: u32, c: u32) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_010_000 - .saturating_add((109_961_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(Weight::from_ref_time(109_961_000 as u64).saturating_mul(r as u64)) // Standard Error: 1_010_000 - .saturating_add((151_952_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(r as Weight))) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(Weight::from_ref_time(151_952_000 as u64).saturating_mul(c as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(r as u64))) + .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(r as u64))) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(c as u64))) } } diff --git a/pallets/dmp-queue/Cargo.toml b/pallets/dmp-queue/Cargo.toml index 846bf801ca..b4f1be08ba 100644 --- a/pallets/dmp-queue/Cargo.toml +++ b/pallets/dmp-queue/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ], default-features = false } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } # Substrate frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -42,3 +42,4 @@ std = [ "xcm/std", "cumulus-primitives-core/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index a50b3df1cf..5c3a0dc572 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -24,7 +24,8 @@ use codec::{Decode, DecodeLimit, Encode}; use cumulus_primitives_core::{relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler}; use frame_support::{ - dispatch::Weight, traits::EnsureOrigin, weights::constants::WEIGHT_PER_MILLIS, + traits::EnsureOrigin, + weights::{constants::WEIGHT_PER_MILLIS, Weight}, }; pub use pallet::*; use scale_info::TypeInfo; @@ -43,7 +44,7 @@ pub struct ConfigData { impl Default for ConfigData { fn default() -> Self { Self { - max_individual: 10 * WEIGHT_PER_MILLIS, // 10 ms of execution time maximum by default + max_individual: 10u64 * WEIGHT_PER_MILLIS, // 10 ms of execution time maximum by default } } } @@ -84,12 +85,12 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; - type XcmExecutor: ExecuteXcm; + type XcmExecutor: ExecuteXcm; /// Origin which is allowed to execute overweight messages. - type ExecuteOverweightOrigin: EnsureOrigin; + type ExecuteOverweightOrigin: EnsureOrigin; } /// The configuration. @@ -140,7 +141,7 @@ pub mod pallet { /// /// Events: /// - `OverweightServiced`: On success. - #[pallet::weight(weight_limit.saturating_add(1_000_000))] + #[pallet::weight(weight_limit.saturating_add(Weight::from_ref_time(1_000_000)))] pub fn service_overweight( origin: OriginFor, index: OverweightIndex, @@ -153,7 +154,7 @@ pub mod pallet { .map_err(|_| Error::::OverLimit)?; Overweight::::remove(index); Self::deposit_event(Event::OverweightServiced { overweight_index: index, weight_used }); - Ok(Some(weight_used.saturating_add(1_000_000)).into()) + Ok(Some(weight_used.saturating_add(Weight::from_ref_time(1_000_000))).into()) } } @@ -189,7 +190,7 @@ pub mod pallet { /// Exactly equivalent to `service_queue` but expects a mutable `page_index` to be passed /// in and any changes stored. fn do_service_queue(limit: Weight, page_index: &mut PageIndexData) -> Weight { - let mut used = 0; + let mut used = Weight::zero(); while page_index.begin_used < page_index.end_used { let page = Pages::::take(page_index.begin_used); for (i, &(sent_at, ref data)) in page.iter().enumerate() { @@ -224,27 +225,27 @@ pub mod pallet { mut data: &[u8], ) -> Result { let message_id = sp_io::hashing::blake2_256(data); - let maybe_msg = VersionedXcm::::decode_all_with_depth_limit( + let maybe_msg = VersionedXcm::::decode_all_with_depth_limit( MAX_XCM_DECODE_DEPTH, &mut data, ) - .map(Xcm::::try_from); + .map(Xcm::::try_from); match maybe_msg { Err(_) => { Self::deposit_event(Event::InvalidFormat { message_id }); - Ok(0) + Ok(Weight::zero()) }, Ok(Err(())) => { Self::deposit_event(Event::UnsupportedVersion { message_id }); - Ok(0) + Ok(Weight::zero()) }, Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, message_id, limit); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, message_id, limit.ref_time()); match outcome { Outcome::Error(XcmError::WeightLimitReached(required)) => - Err((message_id, required)), + Err((message_id, Weight::from_ref_time(required))), outcome => { - let weight_used = outcome.weight_used(); + let weight_used = Weight::from_ref_time(outcome.weight_used()); Self::deposit_event(Event::ExecutedDownward { message_id, outcome }); Ok(weight_used) }, @@ -287,7 +288,7 @@ pub mod pallet { Err((message_id, required_weight)) => // Too much weight required right now. { - if required_weight > config.max_individual { + if required_weight.any_gt(config.max_individual) { // overweight - add to overweight queue and continue with // message execution. let overweight_index = page_index.overweight_count; @@ -349,11 +350,11 @@ mod tests { }; use sp_version::RuntimeVersion; use std::cell::RefCell; - use xcm::latest::{MultiLocation, OriginKind}; + use xcm::latest::{MultiLocation, OriginKind, Weight as XCMWeight}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; - type Xcm = xcm::latest::Xcm; + type Xcm = xcm::latest::Xcm; frame_support::construct_runtime!( pub enum Test where @@ -379,15 +380,15 @@ mod tests { state_version: 1, }; pub const ParachainId: ParaId = ParaId::new(200); - pub const ReservedXcmpWeight: Weight = 0; - pub const ReservedDmpWeight: Weight = 0; + pub const ReservedXcmpWeight: Weight = Weight::zero(); + pub const ReservedDmpWeight: Weight = Weight::zero(); } type AccountId = u64; impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -395,7 +396,7 @@ mod tests { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockWeights = (); @@ -443,7 +444,7 @@ mod tests { _origin: impl Into, _: Weightless, _hash: XcmHash, - _weight_limit: Weight, + _weight_limit: XCMWeight, ) -> Outcome { unreachable!() } @@ -454,7 +455,7 @@ mod tests { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = MockExec; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } @@ -470,7 +471,7 @@ mod tests { index.end_used, enqueued .iter() - .map(|m| (0, VersionedXcm::::from(m.clone()).encode())) + .map(|m| (0, VersionedXcm::::from(m.clone()).encode())) .collect::>(), ); index.end_used += 1; @@ -479,11 +480,13 @@ mod tests { } fn handle_messages(incoming: &[Xcm], limit: Weight) -> Weight { - let iter = incoming.iter().map(|m| (0, VersionedXcm::::from(m.clone()).encode())); + let iter = incoming + .iter() + .map(|m| (0, VersionedXcm::::from(m.clone()).encode())); DmpQueue::handle_dmp_messages(iter, limit) } - fn msg(weight: Weight) -> Xcm { + fn msg(weight: XCMWeight) -> Xcm { Xcm(vec![Transact { origin_kind: OriginKind::Native, require_weight_at_most: weight, @@ -491,11 +494,11 @@ mod tests { }]) } - fn msg_complete(weight: Weight) -> (Xcm, Outcome) { + fn msg_complete(weight: XCMWeight) -> (Xcm, Outcome) { (msg(weight), Outcome::Complete(weight)) } - fn msg_limit_reached(weight: Weight) -> (Xcm, Outcome) { + fn msg_limit_reached(weight: XCMWeight) -> (Xcm, Outcome) { (msg(weight), Outcome::Error(XcmError::WeightLimitReached(weight))) } @@ -516,8 +519,8 @@ mod tests { #[test] fn basic_setup_works() { new_test_ext().execute_with(|| { - let weight_used = handle_messages(&[], 1000); - assert_eq!(weight_used, 0); + let weight_used = handle_messages(&[], Weight::from_ref_time(1000)); + assert_eq!(weight_used, Weight::zero()); assert_eq!(take_trace(), Vec::new()); assert!(queue_is_empty()); }); @@ -527,8 +530,8 @@ mod tests { fn service_inline_complete_works() { new_test_ext().execute_with(|| { let incoming = vec![msg(1000), msg(1001)]; - let weight_used = handle_messages(&incoming, 2500); - assert_eq!(weight_used, 2001); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::from_ref_time(2001)); assert_eq!(take_trace(), vec![msg_complete(1000), msg_complete(1001)]); assert!(queue_is_empty()); }); @@ -539,8 +542,8 @@ mod tests { new_test_ext().execute_with(|| { let enqueued = vec![msg(1000), msg(1001), msg(1002)]; enqueue(&enqueued); - let weight_used = handle_messages(&[], 2500); - assert_eq!(weight_used, 2001); + let weight_used = handle_messages(&[], Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::from_ref_time(2001)); assert_eq!( take_trace(), vec![msg_complete(1000), msg_complete(1001), msg_limit_reached(1002),] @@ -552,8 +555,8 @@ mod tests { fn enqueue_works() { new_test_ext().execute_with(|| { let incoming = vec![msg(1000), msg(1001), msg(1002)]; - let weight_used = handle_messages(&incoming, 999); - assert_eq!(weight_used, 0); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(999)); + assert_eq!(weight_used, Weight::zero()); assert_eq!( PageIndex::::get(), PageIndexData { begin_used: 0, end_used: 1, overweight_count: 0 } @@ -561,15 +564,15 @@ mod tests { assert_eq!(Pages::::get(0).len(), 3); assert_eq!(take_trace(), vec![msg_limit_reached(1000)]); - let weight_used = handle_messages(&[], 2500); - assert_eq!(weight_used, 2001); + let weight_used = handle_messages(&[], Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::from_ref_time(2001)); assert_eq!( take_trace(), vec![msg_complete(1000), msg_complete(1001), msg_limit_reached(1002),] ); - let weight_used = handle_messages(&[], 2500); - assert_eq!(weight_used, 1002); + let weight_used = handle_messages(&[], Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::from_ref_time(1002)); assert_eq!(take_trace(), vec![msg_complete(1002),]); assert!(queue_is_empty()); }); @@ -579,14 +582,14 @@ mod tests { fn service_inline_then_enqueue_works() { new_test_ext().execute_with(|| { let incoming = vec![msg(1000), msg(1001), msg(1002)]; - let weight_used = handle_messages(&incoming, 1500); - assert_eq!(weight_used, 1000); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(1500)); + assert_eq!(weight_used, Weight::from_ref_time(1000)); assert_eq!(pages_queued(), 1); assert_eq!(Pages::::get(0).len(), 2); assert_eq!(take_trace(), vec![msg_complete(1000), msg_limit_reached(1001),]); - let weight_used = handle_messages(&[], 2500); - assert_eq!(weight_used, 2003); + let weight_used = handle_messages(&[], Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::from_ref_time(2003)); assert_eq!(take_trace(), vec![msg_complete(1001), msg_complete(1002),]); assert!(queue_is_empty()); }); @@ -598,8 +601,8 @@ mod tests { let enqueued = vec![msg(1000), msg(1001)]; let incoming = vec![msg(1002), msg(1003)]; enqueue(&enqueued); - let weight_used = handle_messages(&incoming, 5000); - assert_eq!(weight_used, 4006); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(5000)); + assert_eq!(weight_used, Weight::from_ref_time(4006)); assert_eq!( take_trace(), vec![ @@ -619,19 +622,19 @@ mod tests { let enqueued = vec![msg(1000), msg(10001)]; let incoming = vec![msg(1002), msg(1003)]; enqueue(&enqueued); - let weight_used = handle_messages(&incoming, 5000); - assert_eq!(weight_used, 1000); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(5000)); + assert_eq!(weight_used, Weight::from_ref_time(1000)); assert_eq!(take_trace(), vec![msg_complete(1000), msg_limit_reached(10001),]); assert_eq!(pages_queued(), 2); // 5000 is not enough to process the 10001 blocker, so nothing happens. - let weight_used = handle_messages(&[], 5000); - assert_eq!(weight_used, 0); + let weight_used = handle_messages(&[], Weight::from_ref_time(5000)); + assert_eq!(weight_used, Weight::zero()); assert_eq!(take_trace(), vec![msg_limit_reached(10001),]); // 20000 is now enough to process everything. - let weight_used = handle_messages(&[], 20000); - assert_eq!(weight_used, 12006); + let weight_used = handle_messages(&[], Weight::from_ref_time(20000)); + assert_eq!(weight_used, Weight::from_ref_time(12006)); assert_eq!( take_trace(), vec![msg_complete(10001), msg_complete(1002), msg_complete(1003),] @@ -646,8 +649,8 @@ mod tests { let enqueued = vec![msg(1000), msg(1001)]; let incoming = vec![msg(10002), msg(1003)]; enqueue(&enqueued); - let weight_used = handle_messages(&incoming, 5000); - assert_eq!(weight_used, 2001); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(5000)); + assert_eq!(weight_used, Weight::from_ref_time(2001)); assert_eq!( take_trace(), vec![msg_complete(1000), msg_complete(1001), msg_limit_reached(10002),] @@ -655,8 +658,8 @@ mod tests { assert_eq!(pages_queued(), 1); // 20000 is now enough to process everything. - let weight_used = handle_messages(&[], 20000); - assert_eq!(weight_used, 11005); + let weight_used = handle_messages(&[], Weight::from_ref_time(20000)); + assert_eq!(weight_used, Weight::from_ref_time(11005)); assert_eq!(take_trace(), vec![msg_complete(10002), msg_complete(1003),]); assert!(queue_is_empty()); }); @@ -668,8 +671,8 @@ mod tests { let enqueued = vec![msg(1000), msg(1001)]; let incoming = vec![msg(1002), msg(10003)]; enqueue(&enqueued); - let weight_used = handle_messages(&incoming, 5000); - assert_eq!(weight_used, 3003); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(5000)); + assert_eq!(weight_used, Weight::from_ref_time(3003)); assert_eq!( take_trace(), vec![ @@ -682,8 +685,8 @@ mod tests { assert_eq!(pages_queued(), 1); // 20000 is now enough to process everything. - let weight_used = handle_messages(&[], 20000); - assert_eq!(weight_used, 10003); + let weight_used = handle_messages(&[], Weight::from_ref_time(20000)); + assert_eq!(weight_used, Weight::from_ref_time(10003)); assert_eq!(take_trace(), vec![msg_complete(10003),]); assert!(queue_is_empty()); }); @@ -694,20 +697,20 @@ mod tests { new_test_ext().execute_with(|| { let enqueued = vec![msg(1000), msg(1001)]; enqueue(&enqueued); - let weight_used = handle_messages(&vec![msg(1002)], 1500); - assert_eq!(weight_used, 1000); + let weight_used = handle_messages(&vec![msg(1002)], Weight::from_ref_time(1500)); + assert_eq!(weight_used, Weight::from_ref_time(1000)); assert_eq!(take_trace(), vec![msg_complete(1000), msg_limit_reached(1001),]); assert_eq!(pages_queued(), 2); assert_eq!(PageIndex::::get().begin_used, 0); - let weight_used = handle_messages(&vec![msg(1003)], 1500); - assert_eq!(weight_used, 1001); + let weight_used = handle_messages(&vec![msg(1003)], Weight::from_ref_time(1500)); + assert_eq!(weight_used, Weight::from_ref_time(1001)); assert_eq!(take_trace(), vec![msg_complete(1001), msg_limit_reached(1002),]); assert_eq!(pages_queued(), 2); assert_eq!(PageIndex::::get().begin_used, 1); - let weight_used = handle_messages(&vec![msg(1004)], 1500); - assert_eq!(weight_used, 1002); + let weight_used = handle_messages(&vec![msg(1004)], Weight::from_ref_time(1500)); + assert_eq!(weight_used, Weight::from_ref_time(1002)); assert_eq!(take_trace(), vec![msg_complete(1002), msg_limit_reached(1003),]); assert_eq!(pages_queued(), 2); assert_eq!(PageIndex::::get().begin_used, 2); @@ -718,11 +721,11 @@ mod tests { fn overweight_should_not_block_queue() { new_test_ext().execute_with(|| { // Set the overweight threshold to 9999. - Configuration::::put(ConfigData { max_individual: 9999 }); + Configuration::::put(ConfigData { max_individual: Weight::from_ref_time(9999) }); let incoming = vec![msg(1000), msg(10001), msg(1002)]; - let weight_used = handle_messages(&incoming, 2500); - assert_eq!(weight_used, 2002); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::from_ref_time(2002)); assert!(queue_is_empty()); assert_eq!( take_trace(), @@ -737,37 +740,58 @@ mod tests { fn overweights_should_be_manually_executable() { new_test_ext().execute_with(|| { // Set the overweight threshold to 9999. - Configuration::::put(ConfigData { max_individual: 9999 }); + Configuration::::put(ConfigData { max_individual: Weight::from_ref_time(9999) }); let incoming = vec![msg(10000)]; - let weight_used = handle_messages(&incoming, 2500); - assert_eq!(weight_used, 0); + let weight_used = handle_messages(&incoming, Weight::from_ref_time(2500)); + assert_eq!(weight_used, Weight::zero()); assert_eq!(take_trace(), vec![msg_limit_reached(10000)]); assert_eq!(overweights(), vec![0]); - assert_noop!(DmpQueue::service_overweight(Origin::signed(1), 0, 20000), BadOrigin); assert_noop!( - DmpQueue::service_overweight(Origin::root(), 1, 20000), + DmpQueue::service_overweight( + RuntimeOrigin::signed(1), + 0, + Weight::from_ref_time(20000) + ), + BadOrigin + ); + assert_noop!( + DmpQueue::service_overweight( + RuntimeOrigin::root(), + 1, + Weight::from_ref_time(20000) + ), Error::::Unknown ); assert_noop!( - DmpQueue::service_overweight(Origin::root(), 0, 9999), + DmpQueue::service_overweight(RuntimeOrigin::root(), 0, Weight::from_ref_time(9999)), Error::::OverLimit ); assert_eq!(take_trace(), vec![msg_limit_reached(10000)]); - let base_weight = super::Call::::service_overweight { index: 0, weight_limit: 0 } - .get_dispatch_info() - .weight; - use frame_support::weights::GetDispatchInfo; - let info = DmpQueue::service_overweight(Origin::root(), 0, 20000).unwrap(); + let base_weight = + super::Call::::service_overweight { index: 0, weight_limit: Weight::zero() } + .get_dispatch_info() + .weight; + use frame_support::dispatch::GetDispatchInfo; + let info = DmpQueue::service_overweight( + RuntimeOrigin::root(), + 0, + Weight::from_ref_time(20000), + ) + .unwrap(); let actual_weight = info.actual_weight.unwrap(); - assert_eq!(actual_weight, base_weight + 10000); + assert_eq!(actual_weight, base_weight + Weight::from_ref_time(10000)); assert_eq!(take_trace(), vec![msg_complete(10000)]); assert!(overweights().is_empty()); assert_noop!( - DmpQueue::service_overweight(Origin::root(), 0, 20000), + DmpQueue::service_overweight( + RuntimeOrigin::root(), + 0, + Weight::from_ref_time(20000) + ), Error::::Unknown ); }); @@ -780,8 +804,8 @@ mod tests { enqueue(&vec![msg(1002), msg(1003)]); enqueue(&vec![msg(1004), msg(1005)]); - let weight_used = DmpQueue::on_idle(1, 6000); - assert_eq!(weight_used, 5010); + let weight_used = DmpQueue::on_idle(1, Weight::from_ref_time(6000)); + assert_eq!(weight_used, Weight::from_ref_time(5010)); assert_eq!( take_trace(), vec![ diff --git a/pallets/parachain-system/Cargo.toml b/pallets/parachain-system/Cargo.toml index 16fdfe1af9..4fa139422a 100644 --- a/pallets/parachain-system/Cargo.toml +++ b/pallets/parachain-system/Cargo.toml @@ -11,7 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = environmental = { version = "1.1.2", default-features = false } impl-trait-for-tuples = "0.2.1" log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } # Substrate @@ -78,3 +78,5 @@ std = [ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks" ] + +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/parachain-system/src/lib.rs b/pallets/parachain-system/src/lib.rs index 546562ac35..d1f521a613 100644 --- a/pallets/parachain-system/src/lib.rs +++ b/pallets/parachain-system/src/lib.rs @@ -36,12 +36,12 @@ use cumulus_primitives_core::{ }; use cumulus_primitives_parachain_inherent::{MessageQueueChain, ParachainInherentData}; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::{DispatchError, DispatchResult, Pays, PostDispatchInfo}, ensure, inherent::{InherentData, InherentIdentifier, ProvideInherent}, storage, traits::Get, - weights::{Pays, PostDispatchInfo, Weight}, + weights::Weight, }; use frame_system::{ensure_none, ensure_root}; use polkadot_parachain::primitives::RelayChainBlockNumber; @@ -147,7 +147,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config> { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Something which can be notified when the validation data is set. type OnSystemEvent: OnSystemEvent; @@ -269,7 +269,7 @@ pub mod pallet { } fn on_initialize(_n: T::BlockNumber) -> Weight { - let mut weight = 0; + let mut weight = Weight::zero(); // To prevent removing `NewValidationCode` that was set by another `on_initialize` // like for example from scheduler, we only kill the storage entry if it was not yet @@ -416,7 +416,7 @@ pub mod pallet { ::on_validation_data(&vfp); // TODO: This is more than zero, but will need benchmarking to figure out what. - let mut total_weight = 0; + let mut total_weight = Weight::zero(); total_weight += Self::process_inbound_downward_messages( relevant_messaging_state.dmq_mqc_head, downward_messages, @@ -808,7 +808,7 @@ impl Pallet { let dm_count = downward_messages.len() as u32; let mut dmq_head = >::get(); - let mut weight_used = 0; + let mut weight_used = Weight::zero(); if dm_count != 0 { Self::deposit_event(Event::DownwardMessagesReceived { count: dm_count }); let max_weight = diff --git a/pallets/parachain-system/src/migration.rs b/pallets/parachain-system/src/migration.rs index b3738d2151..f5eff920ae 100644 --- a/pallets/parachain-system/src/migration.rs +++ b/pallets/parachain-system/src/migration.rs @@ -25,7 +25,7 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); /// Call this during the next runtime upgrade for this module. pub fn on_runtime_upgrade() -> Weight { - let mut weight: Weight = 0; + let mut weight: Weight = Weight::zero(); if StorageVersion::get::>() == 0 { weight = weight diff --git a/pallets/parachain-system/src/tests.rs b/pallets/parachain-system/src/tests.rs index 65896fa9b2..9b4b24a242 100755 --- a/pallets/parachain-system/src/tests.rs +++ b/pallets/parachain-system/src/tests.rs @@ -69,12 +69,12 @@ parameter_types! { state_version: 1, }; pub const ParachainId: ParaId = ParaId::new(200); - pub const ReservedXcmpWeight: Weight = 0; - pub const ReservedDmpWeight: Weight = 0; + pub const ReservedXcmpWeight: Weight = Weight::zero(); + pub const ReservedDmpWeight: Weight = Weight::zero(); } impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -82,7 +82,7 @@ impl frame_system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockWeights = (); @@ -99,7 +99,7 @@ impl frame_system::Config for Test { type MaxConsumers = frame_support::traits::ConstU32<16>; } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = ParachainId; type OutboundXcmpMessageSource = FromThreadLocal; @@ -155,7 +155,7 @@ impl DmpMessageHandler for SaveIntoThreadLocal { for i in iter { m.borrow_mut().push(i); } - 0 + Weight::zero() }) } } @@ -169,7 +169,7 @@ impl XcmpMessageHandler for SaveIntoThreadLocal { for (sender, sent_at, message) in iter { m.borrow_mut().push((sender, sent_at, message.to_vec())); } - 0 + Weight::zero() }) } } @@ -403,7 +403,7 @@ fn events() { let events = System::events(); assert_eq!( events[0].event, - Event::ParachainSystem(crate::Event::ValidationFunctionStored.into()) + RuntimeEvent::ParachainSystem(crate::Event::ValidationFunctionStored.into()) ); }, ) @@ -414,7 +414,7 @@ fn events() { let events = System::events(); assert_eq!( events[0].event, - Event::ParachainSystem( + RuntimeEvent::ParachainSystem( crate::Event::ValidationFunctionApplied { relay_chain_block_num: 1234 } .into() ) @@ -490,7 +490,7 @@ fn aborted_upgrade() { let events = System::events(); assert_eq!( events[0].event, - Event::ParachainSystem(crate::Event::ValidationFunctionDiscarded.into()) + RuntimeEvent::ParachainSystem(crate::Event::ValidationFunctionDiscarded.into()) ); }, ); diff --git a/pallets/parachain-system/src/validate_block/implementation.rs b/pallets/parachain-system/src/validate_block/implementation.rs index f37622688d..8c03f012be 100644 --- a/pallets/parachain-system/src/validate_block/implementation.rs +++ b/pallets/parachain-system/src/validate_block/implementation.rs @@ -118,6 +118,11 @@ where let inherent_data = block .extrinsics() .iter() + // Inherents are at the front of the block and are unsigned. + // + // If `is_signed` is returning `None`, we keep it safe and assume that it is "signed". + // We are searching for unsigned transactions anyway. + .take_while(|e| !e.is_signed().unwrap_or(true)) .filter_map(|e| e.call().is_sub_type()) .find_map(|c| match c { crate::Call::set_validation_data { data: validation_data } => diff --git a/pallets/parachain-system/src/validate_block/tests.rs b/pallets/parachain-system/src/validate_block/tests.rs index 6453b9cd39..e06c2cafdc 100644 --- a/pallets/parachain-system/src/validate_block/tests.rs +++ b/pallets/parachain-system/src/validate_block/tests.rs @@ -251,3 +251,40 @@ fn check_inherent_fails_on_validate_block_as_expected() { ); } } + +#[test] +fn check_inherents_are_unsigned_and_before_all_other_extrinsics() { + sp_tracing::try_init_simple(); + + if env::var("RUN_TEST").is_ok() { + let (client, parent_head) = create_test_client(); + + let TestBlockData { block, validation_data } = + build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default()); + + let (header, mut extrinsics, proof) = block.deconstruct(); + + extrinsics.insert(0, transfer(&client, Alice, Bob, 69)); + + call_validate_block( + parent_head, + ParachainBlockData::new(header, extrinsics, proof), + validation_data.relay_parent_storage_root, + ) + .unwrap_err(); + } else { + let output = Command::new(env::current_exe().unwrap()) + .args(&[ + "check_inherents_are_unsigned_and_before_all_other_extrinsics", + "--", + "--nocapture", + ]) + .env("RUN_TEST", "1") + .output() + .expect("Runs the test"); + assert!(output.status.success()); + + assert!(String::from_utf8(output.stderr).unwrap() + .contains("Could not find `set_validation_data` inherent")); + } +} diff --git a/pallets/session-benchmarking/Cargo.toml b/pallets/session-benchmarking/Cargo.toml index a9e8724714..e30b460161 100644 --- a/pallets/session-benchmarking/Cargo.toml +++ b/pallets/session-benchmarking/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { version = "3.1.5", default-features = false } +parity-scale-codec = { version = "3.2.1", default-features = false } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/pallets/solo-to-para/Cargo.toml b/pallets/solo-to-para/Cargo.toml index 6a234f49b8..298699ae15 100644 --- a/pallets/solo-to-para/Cargo.toml +++ b/pallets/solo-to-para/Cargo.toml @@ -37,3 +37,4 @@ std = [ "sp-runtime/std", "sp-std/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/solo-to-para/src/lib.rs b/pallets/solo-to-para/src/lib.rs index 202d91cae9..b1e7c99d6a 100644 --- a/pallets/solo-to-para/src/lib.rs +++ b/pallets/solo-to-para/src/lib.rs @@ -18,7 +18,10 @@ use codec::{Decode, Encode}; use cumulus_pallet_parachain_system as parachain_system; -use frame_support::{dispatch::DispatchResult, pallet_prelude::*, weights::DispatchInfo}; +use frame_support::{ + dispatch::{DispatchInfo, DispatchResult}, + pallet_prelude::*, +}; use frame_system::pallet_prelude::*; pub use pallet::*; use polkadot_primitives::v2::PersistedValidationData; @@ -40,7 +43,7 @@ pub mod pallet { pub trait Config: frame_system::Config + parachain_system::Config + pallet_sudo::Config { - type Event: From + IsType<::Event>; + type RuntimeEvent: From + IsType<::RuntimeEvent>; } #[pallet::pallet] @@ -133,10 +136,10 @@ pub mod pallet { impl SignedExtension for CheckSudo where - ::Call: Dispatchable, + ::RuntimeCall: Dispatchable, { type AccountId = T::AccountId; - type Call = ::Call; + type Call = ::RuntimeCall; type AdditionalSigned = (); type Pre = (); const IDENTIFIER: &'static str = "CheckSudo"; @@ -169,7 +172,7 @@ pub mod pallet { if *who == root_account { Ok(ValidTransaction { - priority: info.weight as TransactionPriority, + priority: info.weight.ref_time() as TransactionPriority, longevity: TransactionLongevity::max_value(), propagate: true, ..Default::default() diff --git a/pallets/xcm/Cargo.toml b/pallets/xcm/Cargo.toml index 6ea825c07f..36a8e433f2 100644 --- a/pallets/xcm/Cargo.toml +++ b/pallets/xcm/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -31,3 +31,4 @@ std = [ "frame-support/std", "frame-system/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/xcm/src/lib.rs b/pallets/xcm/src/lib.rs index c43d7d4aa2..1d87187cde 100644 --- a/pallets/xcm/src/lib.rs +++ b/pallets/xcm/src/lib.rs @@ -48,9 +48,9 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; - type XcmExecutor: ExecuteXcm; + type XcmExecutor: ExecuteXcm; } #[pallet::error] @@ -111,20 +111,20 @@ impl DmpMessageHandler for UnlimitedDmpExecution { iter: impl Iterator)>, limit: Weight, ) -> Weight { - let mut used = 0; + let mut used = Weight::zero(); for (_sent_at, data) in iter { let id = sp_io::hashing::blake2_256(&data[..]); - let msg = VersionedXcm::::decode_all_with_depth_limit( + let msg = VersionedXcm::::decode_all_with_depth_limit( MAX_XCM_DECODE_DEPTH, &mut data.as_slice(), ) - .map(Xcm::::try_from); + .map(Xcm::::try_from); match msg { Err(_) => Pallet::::deposit_event(Event::InvalidFormat(id)), Ok(Err(())) => Pallet::::deposit_event(Event::UnsupportedVersion(id)), Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); - used += outcome.weight_used(); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit.ref_time()); + used += Weight::from_ref_time(outcome.weight_used()); Pallet::::deposit_event(Event::ExecutedDownward(id, outcome)); }, } @@ -144,21 +144,21 @@ impl DmpMessageHandler for LimitAndDropDmpExecution { iter: impl Iterator)>, limit: Weight, ) -> Weight { - let mut used = 0; + let mut used = Weight::zero(); for (_sent_at, data) in iter { let id = sp_io::hashing::blake2_256(&data[..]); - let msg = VersionedXcm::::decode_all_with_depth_limit( + let msg = VersionedXcm::::decode_all_with_depth_limit( MAX_XCM_DECODE_DEPTH, &mut data.as_slice(), ) - .map(Xcm::::try_from); + .map(Xcm::::try_from); match msg { Err(_) => Pallet::::deposit_event(Event::InvalidFormat(id)), Ok(Err(())) => Pallet::::deposit_event(Event::UnsupportedVersion(id)), Ok(Ok(x)) => { let weight_limit = limit.saturating_sub(used); - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, weight_limit); - used += outcome.weight_used(); + let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, weight_limit.ref_time()); + used += Weight::from_ref_time(outcome.weight_used()); Pallet::::deposit_event(Event::ExecutedDownward(id, outcome)); }, } diff --git a/pallets/xcmp-queue/Cargo.toml b/pallets/xcmp-queue/Cargo.toml index 1baf210f06..6629400255 100644 --- a/pallets/xcmp-queue/Cargo.toml +++ b/pallets/xcmp-queue/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ], default-features = false } log = { version = "0.4.17", default-features = false } rand_chacha = { version = "0.3.0", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } # Substrate frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -62,3 +62,4 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/xcmp-queue/src/benchmarking.rs b/pallets/xcmp-queue/src/benchmarking.rs index 29245870a3..5ac78bee76 100644 --- a/pallets/xcmp-queue/src/benchmarking.rs +++ b/pallets/xcmp-queue/src/benchmarking.rs @@ -22,7 +22,7 @@ use frame_system::RawOrigin; benchmarks! { set_config_with_u32 {}: update_resume_threshold(RawOrigin::Root, 100) - set_config_with_weight {}: update_weight_restrict_decay(RawOrigin::Root, 3_000_000 as Weight) + set_config_with_weight {}: update_weight_restrict_decay(RawOrigin::Root, Weight::from_ref_time(3_000_000)) } impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index ae5a51fe51..72f1c12011 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -79,10 +79,10 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Something to execute an XCM message. We need this to service the XCMoXCMP queue. - type XcmExecutor: ExecuteXcm; + type XcmExecutor: ExecuteXcm; /// Information on the avaialble XCMP channels. type ChannelInfo: GetChannelInfo; @@ -91,14 +91,14 @@ pub mod pallet { type VersionWrapper: WrapVersion; /// The origin that is allowed to execute overweight messages. - type ExecuteOverweightOrigin: EnsureOrigin; + type ExecuteOverweightOrigin: EnsureOrigin; /// The origin that is allowed to resume or suspend the XCMP queue. - type ControllerOrigin: EnsureOrigin; + type ControllerOrigin: EnsureOrigin; /// The conversion function used to attempt to convert an XCM `MultiLocation` origin to a /// superuser origin. - type ControllerOriginConverter: ConvertOrigin; + type ControllerOriginConverter: ConvertOrigin; /// The price for delivering an XCM to a sibling parachain destination. type PriceForSiblingDelivery: PriceForSiblingDelivery; @@ -134,7 +134,7 @@ pub mod pallet { /// /// Events: /// - `OverweightServiced`: On success. - #[pallet::weight((weight_limit.saturating_add(1_000_000), DispatchClass::Operational,))] + #[pallet::weight((weight_limit.saturating_add(Weight::from_ref_time(1_000_000)), DispatchClass::Operational,))] pub fn service_overweight( origin: OriginFor, index: OverweightIndex, @@ -144,7 +144,7 @@ pub mod pallet { let (sender, sent_at, data) = Overweight::::get(index).ok_or(Error::::BadOverweightIndex)?; - let xcm = VersionedXcm::::decode_all_with_depth_limit( + let xcm = VersionedXcm::::decode_all_with_depth_limit( MAX_XCM_DECODE_DEPTH, &mut data.as_slice(), ) @@ -153,7 +153,7 @@ pub mod pallet { .map_err(|_| Error::::WeightOverLimit)?; Overweight::::remove(index); Self::deposit_event(Event::OverweightServiced { index, used }); - Ok(Some(used.saturating_add(1_000_000)).into()) + Ok(Some(used.saturating_add(Weight::from_ref_time(1_000_000))).into()) } /// Suspends all XCM executions for the XCMP queue, regardless of the sender's origin. @@ -453,9 +453,9 @@ impl Default for QueueConfigData { suspend_threshold: 2, drop_threshold: 5, resume_threshold: 1, - threshold_weight: 100_000, - weight_restrict_decay: 2, - xcmp_max_individual_weight: 20 * WEIGHT_PER_MILLIS, + threshold_weight: Weight::from_ref_time(100_000), + weight_restrict_decay: Weight::from_ref_time(2), + xcmp_max_individual_weight: 20u64 * WEIGHT_PER_MILLIS, } } } @@ -600,24 +600,37 @@ impl Pallet { fn handle_xcm_message( sender: ParaId, _sent_at: RelayBlockNumber, - xcm: VersionedXcm, + xcm: VersionedXcm, max_weight: Weight, ) -> Result { let hash = xcm.using_encoded(sp_io::hashing::blake2_256); log::debug!("Processing XCMP-XCM: {:?}", &hash); - let (result, event) = match Xcm::::try_from(xcm) { + let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { let location = (Parent, Parachain(sender.into())); - match T::XcmExecutor::execute_xcm(location, xcm, hash, max_weight) { - Outcome::Error(e) => - (Err(e), Event::Fail { message_hash: Some(hash), error: e, weight: 0 }), - Outcome::Complete(w) => - (Ok(w), Event::Success { message_hash: Some(hash), weight: w }), + match T::XcmExecutor::execute_xcm(location, xcm, hash, max_weight.ref_time()) { + Outcome::Error(e) => ( + Err(e), + Event::Fail { message_hash: Some(hash), error: e, weight: Weight::zero() }, + ), + Outcome::Complete(w) => ( + Ok(Weight::from_ref_time(w)), + Event::Success { + message_hash: Some(hash), + weight: Weight::from_ref_time(w), + }, + ), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => - (Ok(w), Event::Fail { message_hash: Some(hash), error: e, weight: w }), + Outcome::Incomplete(w, e) => ( + Ok(Weight::from_ref_time(w)), + Event::Fail { + message_hash: Some(hash), + error: e, + weight: Weight::from_ref_time(w), + }, + ), } }, Err(()) => @@ -636,12 +649,12 @@ impl Pallet { let data = >::get(sender, sent_at); let mut last_remaining_fragments; let mut remaining_fragments = &data[..]; - let mut weight_used = 0; + let mut weight_used = Weight::zero(); match format { XcmpMessageFormat::ConcatenatedVersionedXcm => { while !remaining_fragments.is_empty() { last_remaining_fragments = remaining_fragments; - if let Ok(xcm) = VersionedXcm::::decode_with_depth_limit( + if let Ok(xcm) = VersionedXcm::::decode_with_depth_limit( MAX_XCM_DECODE_DEPTH, &mut remaining_fragments, ) { @@ -649,7 +662,7 @@ impl Pallet { match Self::handle_xcm_message(sender, sent_at, xcm, weight) { Ok(used) => weight_used = weight_used.saturating_add(used), Err(XcmError::WeightLimitReached(required)) - if required > max_individual_weight => + if required > max_individual_weight.ref_time() => { // overweight - add to overweight queue and continue with message // execution consuming the message. @@ -658,12 +671,16 @@ impl Pallet { .saturating_sub(remaining_fragments.len()); let overweight_xcm = last_remaining_fragments[..msg_len].to_vec(); let index = Self::stash_overweight(sender, sent_at, overweight_xcm); - let e = - Event::OverweightEnqueued { sender, sent_at, index, required }; + let e = Event::OverweightEnqueued { + sender, + sent_at, + index, + required: Weight::from_ref_time(required), + }; Self::deposit_event(e); }, Err(XcmError::WeightLimitReached(required)) - if required <= max_weight => + if required <= max_weight.ref_time() => { // That message didn't get processed this time because of being // too heavy. We leave it around for next time and bail. @@ -770,7 +787,7 @@ impl Pallet { let mut status = >::get(); // <- sorted. if status.is_empty() { - return 0 + return Weight::zero() } let QueueConfigData { @@ -782,8 +799,8 @@ impl Pallet { } = >::get(); let mut shuffled = Self::create_shuffle(status.len()); - let mut weight_used = 0; - let mut weight_available = 0; + let mut weight_used = Weight::zero(); + let mut weight_available = Weight::zero(); // We don't want the possibility of a chain sending a series of really heavy messages and // tying up the block's execution time from other chains. Therefore we execute any remaining @@ -795,7 +812,7 @@ impl Pallet { let mut shuffle_index = 0; while shuffle_index < shuffled.len() && - max_weight.saturating_sub(weight_used) >= threshold_weight + max_weight.saturating_sub(weight_used).all_gte(threshold_weight) { let index = shuffled[shuffle_index]; let sender = status[index].sender; @@ -817,8 +834,8 @@ impl Pallet { // on the first round to unlocking everything, then we do so. if shuffle_index < status.len() { weight_available += - (max_weight - weight_available) / (weight_restrict_decay + 1); - if weight_available + threshold_weight > max_weight { + (max_weight - weight_available) / (weight_restrict_decay.ref_time() + 1); + if (weight_available + threshold_weight).any_gt(max_weight) { weight_available = max_weight; } } else { @@ -828,7 +845,7 @@ impl Pallet { let weight_processed = if status[index].message_metadata.is_empty() { debug_assert!(false, "channel exists in status; there must be messages; qed"); - 0 + Weight::zero() } else { // Process up to one block's worth for now. let weight_remaining = weight_available.saturating_sub(weight_used); @@ -858,7 +875,7 @@ impl Pallet { // other channels a look in. If we've still not unlocked all weight, then we set them // up for processing a second time anyway. if !status[index].message_metadata.is_empty() && - (weight_processed > 0 || weight_available != max_weight) + (weight_processed.any_gt(Weight::zero()) || weight_available != max_weight) { if shuffle_index + 1 == shuffled.len() { // Only this queue left. Just run around this loop once more. diff --git a/pallets/xcmp-queue/src/migration.rs b/pallets/xcmp-queue/src/migration.rs index db5833e2df..bedd5ffd6e 100644 --- a/pallets/xcmp-queue/src/migration.rs +++ b/pallets/xcmp-queue/src/migration.rs @@ -25,7 +25,7 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); /// Migrates the pallet storage to the most recent version, checking and setting the /// `StorageVersion`. pub fn migrate_to_latest() -> Weight { - let mut weight = 0; + let mut weight = Weight::zero(); if StorageVersion::get::>() == 0 { weight += migrate_to_v1::(); @@ -54,8 +54,8 @@ mod v0 { suspend_threshold: 2, drop_threshold: 5, resume_threshold: 1, - threshold_weight: 100_000, - weight_restrict_decay: 2, + threshold_weight: Weight::from_ref_time(100_000), + weight_restrict_decay: Weight::from_ref_time(2), } } } @@ -102,8 +102,8 @@ mod tests { suspend_threshold: 5, drop_threshold: 12, resume_threshold: 3, - threshold_weight: 333_333, - weight_restrict_decay: 1, + threshold_weight: Weight::from_ref_time(333_333), + weight_restrict_decay: Weight::from_ref_time(1), }; new_test_ext().execute_with(|| { @@ -122,7 +122,7 @@ mod tests { assert_eq!(v0.resume_threshold, v1.resume_threshold); assert_eq!(v0.threshold_weight, v1.threshold_weight); assert_eq!(v0.weight_restrict_decay, v1.weight_restrict_decay); - assert_eq!(v1.xcmp_max_individual_weight, 20_000_000_000); + assert_eq!(v1.xcmp_max_individual_weight, Weight::from_ref_time(20_000_000_000)); }); } } diff --git a/pallets/xcmp-queue/src/mock.rs b/pallets/xcmp-queue/src/mock.rs index bd30f52fb2..17ca7129a3 100644 --- a/pallets/xcmp-queue/src/mock.rs +++ b/pallets/xcmp-queue/src/mock.rs @@ -63,8 +63,8 @@ impl frame_system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -72,7 +72,7 @@ impl frame_system::Config for Test { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -92,7 +92,7 @@ parameter_types! { impl pallet_balances::Config for Test { type Balance = u64; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -103,7 +103,7 @@ impl pallet_balances::Config for Test { } impl cumulus_pallet_parachain_system::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = (); type OutboundXcmpMessageSource = XcmpQueue; @@ -117,7 +117,7 @@ impl cumulus_pallet_parachain_system::Config for Test { parameter_types! { pub const RelayChain: MultiLocation = MultiLocation::parent(); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(1u32.into())).into(); - pub UnitWeightCost: Weight = 1_000_000; + pub UnitWeightCost: u64 = 1_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -140,7 +140,7 @@ pub type LocationToAccountId = (ParentIsPreset,); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; @@ -149,7 +149,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; type UniversalLocation = UniversalLocation; type Barrier = (); - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = (); type ResponseHandler = (); type AssetTrap = (); @@ -170,12 +170,14 @@ pub type XcmRouter = ( XcmpQueue, ); -pub struct SystemParachainAsSuperuser(PhantomData); -impl ConvertOrigin for SystemParachainAsSuperuser { +pub struct SystemParachainAsSuperuser(PhantomData); +impl ConvertOrigin + for SystemParachainAsSuperuser +{ fn convert_origin( origin: impl Into, kind: OriginKind, - ) -> Result { + ) -> Result { let origin = origin.into(); if kind == OriginKind::Superuser && matches!( @@ -185,7 +187,7 @@ impl ConvertOrigin for SystemParachainAsSuperuser ConvertOrigin for SystemParachainAsSuperuser; type ChannelInfo = ParachainSystem; type VersionWrapper = (); type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = SystemParachainAsSuperuser; + type ControllerOriginConverter = SystemParachainAsSuperuser; type WeightInfo = (); type PriceForSiblingDelivery = (); } diff --git a/pallets/xcmp-queue/src/tests.rs b/pallets/xcmp-queue/src/tests.rs index 62e674004e..1b6303ddaf 100644 --- a/pallets/xcmp-queue/src/tests.rs +++ b/pallets/xcmp-queue/src/tests.rs @@ -16,7 +16,7 @@ use super::*; use cumulus_primitives_core::XcmpMessageHandler; use frame_support::{assert_noop, assert_ok}; -use mock::{new_test_ext, Call, Origin, Test, XcmpQueue}; +use mock::{new_test_ext, RuntimeCall, RuntimeOrigin, Test, XcmpQueue}; use sp_runtime::traits::BadOrigin; #[test] @@ -26,7 +26,7 @@ fn one_message_does_not_panic() { let messages = vec![(Default::default(), 1u32.into(), message_format.as_slice())]; // This shouldn't cause a panic - XcmpQueue::handle_xcmp_messages(messages.into_iter(), Weight::max_value()); + XcmpQueue::handle_xcmp_messages(messages.into_iter(), Weight::MAX); }) } @@ -43,7 +43,12 @@ fn bad_message_is_handled() { InboundXcmpMessages::::insert(ParaId::from(1000), 1, bad_data); let format = XcmpMessageFormat::ConcatenatedEncodedBlob; // This should exit with an error. - XcmpQueue::process_xcmp_message(1000.into(), (1, format), 10_000_000_000, 10_000_000_000); + XcmpQueue::process_xcmp_message( + 1000.into(), + (1, format), + Weight::from_ref_time(10_000_000_000), + Weight::from_ref_time(10_000_000_000), + ); }); } @@ -61,7 +66,12 @@ fn handle_blob_message() { ]; InboundXcmpMessages::::insert(ParaId::from(1000), 1, bad_data); let format = XcmpMessageFormat::ConcatenatedEncodedBlob; - XcmpQueue::process_xcmp_message(1000.into(), (1, format), 10_000_000_000, 10_000_000_000); + XcmpQueue::process_xcmp_message( + 1000.into(), + (1, format), + Weight::from_ref_time(10_000_000_000), + Weight::from_ref_time(10_000_000_000), + ); }); } @@ -73,7 +83,12 @@ fn handle_invalid_data() { let data = Xcm::(vec![]).encode(); InboundXcmpMessages::::insert(ParaId::from(1000), 1, data); let format = XcmpMessageFormat::ConcatenatedVersionedXcm; - XcmpQueue::process_xcmp_message(1000.into(), (1, format), 10_000_000_000, 10_000_000_000); + XcmpQueue::process_xcmp_message( + 1000.into(), + (1, format), + Weight::from_ref_time(10_000_000_000), + Weight::from_ref_time(10_000_000_000), + ); }); } @@ -81,7 +96,7 @@ fn handle_invalid_data() { fn service_overweight_unknown() { new_test_ext().execute_with(|| { assert_noop!( - XcmpQueue::service_overweight(Origin::root(), 0, 1000), + XcmpQueue::service_overweight(RuntimeOrigin::root(), 0, Weight::from_ref_time(1000)), Error::::BadOverweightIndex, ); }); @@ -93,7 +108,10 @@ fn service_overweight_bad_xcm_format() { let bad_xcm = vec![255]; Overweight::::insert(0, (ParaId::from(1000), 0, bad_xcm)); - assert_noop!(XcmpQueue::service_overweight(Origin::root(), 0, 1000), Error::::BadXcm); + assert_noop!( + XcmpQueue::service_overweight(RuntimeOrigin::root(), 0, Weight::from_ref_time(1000)), + Error::::BadXcm + ); }); } @@ -102,13 +120,15 @@ fn suspend_xcm_execution_works() { new_test_ext().execute_with(|| { QueueSuspended::::put(true); - let xcm = VersionedXcm::from(Xcm::(vec![Instruction::::ClearOrigin])).encode(); + let xcm = + VersionedXcm::from(Xcm::(vec![Instruction::::ClearOrigin])) + .encode(); let mut message_format = XcmpMessageFormat::ConcatenatedVersionedXcm.encode(); message_format.extend(xcm.clone()); let messages = vec![(ParaId::from(999), 1u32.into(), message_format.as_slice())]; // This should have executed the incoming XCM, because it came from a system parachain - XcmpQueue::handle_xcmp_messages(messages.into_iter(), Weight::max_value()); + XcmpQueue::handle_xcmp_messages(messages.into_iter(), Weight::MAX); let queued_xcm = InboundXcmpMessages::::get(ParaId::from(999), 1u32); assert!(queued_xcm.is_empty()); @@ -116,7 +136,7 @@ fn suspend_xcm_execution_works() { let messages = vec![(ParaId::from(2000), 1u32.into(), message_format.as_slice())]; // This shouldn't have executed the incoming XCM - XcmpQueue::handle_xcmp_messages(messages.into_iter(), Weight::max_value()); + XcmpQueue::handle_xcmp_messages(messages.into_iter(), Weight::MAX); let queued_xcm = InboundXcmpMessages::::get(ParaId::from(2000), 1u32); assert_eq!(queued_xcm, xcm); @@ -128,8 +148,8 @@ fn update_suspend_threshold_works() { new_test_ext().execute_with(|| { let data: QueueConfigData = >::get(); assert_eq!(data.suspend_threshold, 2); - assert_ok!(XcmpQueue::update_suspend_threshold(Origin::root(), 3)); - assert_noop!(XcmpQueue::update_suspend_threshold(Origin::signed(2), 5), BadOrigin); + assert_ok!(XcmpQueue::update_suspend_threshold(RuntimeOrigin::root(), 3)); + assert_noop!(XcmpQueue::update_suspend_threshold(RuntimeOrigin::signed(2), 5), BadOrigin); let data: QueueConfigData = >::get(); assert_eq!(data.suspend_threshold, 3); @@ -141,8 +161,8 @@ fn update_drop_threshold_works() { new_test_ext().execute_with(|| { let data: QueueConfigData = >::get(); assert_eq!(data.drop_threshold, 5); - assert_ok!(XcmpQueue::update_drop_threshold(Origin::root(), 6)); - assert_noop!(XcmpQueue::update_drop_threshold(Origin::signed(2), 7), BadOrigin); + assert_ok!(XcmpQueue::update_drop_threshold(RuntimeOrigin::root(), 6)); + assert_noop!(XcmpQueue::update_drop_threshold(RuntimeOrigin::signed(2), 7), BadOrigin); let data: QueueConfigData = >::get(); assert_eq!(data.drop_threshold, 6); @@ -154,8 +174,8 @@ fn update_resume_threshold_works() { new_test_ext().execute_with(|| { let data: QueueConfigData = >::get(); assert_eq!(data.resume_threshold, 1); - assert_ok!(XcmpQueue::update_resume_threshold(Origin::root(), 2)); - assert_noop!(XcmpQueue::update_resume_threshold(Origin::signed(7), 3), BadOrigin); + assert_ok!(XcmpQueue::update_resume_threshold(RuntimeOrigin::root(), 2)); + assert_noop!(XcmpQueue::update_resume_threshold(RuntimeOrigin::signed(7), 3), BadOrigin); let data: QueueConfigData = >::get(); assert_eq!(data.resume_threshold, 2); @@ -166,12 +186,21 @@ fn update_resume_threshold_works() { fn update_threshold_weight_works() { new_test_ext().execute_with(|| { let data: QueueConfigData = >::get(); - assert_eq!(data.threshold_weight, 100_000); - assert_ok!(XcmpQueue::update_threshold_weight(Origin::root(), 10_000)); - assert_noop!(XcmpQueue::update_threshold_weight(Origin::signed(5), 10_000_000), BadOrigin); + assert_eq!(data.threshold_weight, Weight::from_ref_time(100_000)); + assert_ok!(XcmpQueue::update_threshold_weight( + RuntimeOrigin::root(), + Weight::from_ref_time(10_000) + )); + assert_noop!( + XcmpQueue::update_threshold_weight( + RuntimeOrigin::signed(5), + Weight::from_ref_time(10_000_000) + ), + BadOrigin + ); let data: QueueConfigData = >::get(); - assert_eq!(data.threshold_weight, 10_000); + assert_eq!(data.threshold_weight, Weight::from_ref_time(10_000)); }); } @@ -179,12 +208,21 @@ fn update_threshold_weight_works() { fn update_weight_restrict_decay_works() { new_test_ext().execute_with(|| { let data: QueueConfigData = >::get(); - assert_eq!(data.weight_restrict_decay, 2); - assert_ok!(XcmpQueue::update_weight_restrict_decay(Origin::root(), 5)); - assert_noop!(XcmpQueue::update_weight_restrict_decay(Origin::signed(6), 4), BadOrigin); + assert_eq!(data.weight_restrict_decay, Weight::from_ref_time(2)); + assert_ok!(XcmpQueue::update_weight_restrict_decay( + RuntimeOrigin::root(), + Weight::from_ref_time(5) + )); + assert_noop!( + XcmpQueue::update_weight_restrict_decay( + RuntimeOrigin::signed(6), + Weight::from_ref_time(4) + ), + BadOrigin + ); let data: QueueConfigData = >::get(); - assert_eq!(data.weight_restrict_decay, 5); + assert_eq!(data.weight_restrict_decay, Weight::from_ref_time(5)); }); } @@ -192,17 +230,20 @@ fn update_weight_restrict_decay_works() { fn update_xcmp_max_individual_weight() { new_test_ext().execute_with(|| { let data: QueueConfigData = >::get(); - assert_eq!(data.xcmp_max_individual_weight, 20 * WEIGHT_PER_MILLIS); + assert_eq!(data.xcmp_max_individual_weight, 20u64 * WEIGHT_PER_MILLIS); assert_ok!(XcmpQueue::update_xcmp_max_individual_weight( - Origin::root(), - 30 * WEIGHT_PER_MILLIS + RuntimeOrigin::root(), + 30u64 * WEIGHT_PER_MILLIS )); assert_noop!( - XcmpQueue::update_xcmp_max_individual_weight(Origin::signed(3), 10 * WEIGHT_PER_MILLIS), + XcmpQueue::update_xcmp_max_individual_weight( + RuntimeOrigin::signed(3), + 10u64 * WEIGHT_PER_MILLIS + ), BadOrigin ); let data: QueueConfigData = >::get(); - assert_eq!(data.xcmp_max_individual_weight, 30 * WEIGHT_PER_MILLIS); + assert_eq!(data.xcmp_max_individual_weight, 30u64 * WEIGHT_PER_MILLIS); }); } diff --git a/pallets/xcmp-queue/src/weights.rs b/pallets/xcmp-queue/src/weights.rs index 559ff644e8..41a3d812fb 100644 --- a/pallets/xcmp-queue/src/weights.rs +++ b/pallets/xcmp-queue/src/weights.rs @@ -18,31 +18,31 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (2_717_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(2_717_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (2_717_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(2_717_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } impl WeightInfo for () { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (2_717_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(2_717_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (2_717_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(2_717_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index 2dad3ab4e5..4bfda52d30 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" build = "build.rs" [dependencies] -clap = { version = "3.2.17", features = ["derive"] } +clap = { version = "3.2.22", features = ["derive"] } derive_more = "0.99.2" log = "0.4.17" codec = { package = "parity-scale-codec", version = "3.0.0" } diff --git a/parachain-template/node/src/command.rs b/parachain-template/node/src/command.rs index 735af3e42a..7f7bfd140a 100644 --- a/parachain-template/node/src/command.rs +++ b/parachain-template/node/src/command.rs @@ -217,6 +217,15 @@ pub fn run() -> Result<()> { )?; cmd.run(partials.client) }), + #[cfg(not(feature = "runtime-benchmarks"))] + BenchmarkCmd::Storage(_) => + return Err(sc_cli::Error::Input( + "Compile with --features=runtime-benchmarks \ + to enable storage benchmarks." + .into(), + ) + .into()), + #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| { let partials = new_partial::( &config, @@ -348,7 +357,7 @@ impl CliConfiguration for RelayChainCli { fn base_path(&self) -> Result> { Ok(self .shared_params() - .base_path() + .base_path()? .or_else(|| self.base_path.clone().map(Into::into))) } diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index 9ad3c38e1a..f57411642b 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -25,7 +25,6 @@ use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayC use cumulus_relay_chain_rpc_interface::{create_client_and_start_worker, RelayChainRpcInterface}; // Substrate Imports -use sc_client_api::ExecutorProvider; use sc_executor::NativeElseWasmExecutor; use sc_network::NetworkService; use sc_network_common::service::NetworkBlock; @@ -424,7 +423,6 @@ pub fn parachain_build_import_queue( _, _, _, - _, >(cumulus_client_consensus_aura::ImportQueueParams { block_import: client.clone(), client: client.clone(), @@ -440,7 +438,6 @@ pub fn parachain_build_import_queue( Ok((time, slot)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), spawner: &task_manager.spawn_essential_handle(), telemetry, }) diff --git a/parachain-template/pallets/template/src/lib.rs b/parachain-template/pallets/template/src/lib.rs index 0afd7c6d72..18d94bedb9 100644 --- a/parachain-template/pallets/template/src/lib.rs +++ b/parachain-template/pallets/template/src/lib.rs @@ -23,7 +23,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Because this pallet emits events, it depends on the runtime's definition of an event. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; } #[pallet::pallet] @@ -67,7 +67,7 @@ pub mod pallet { impl Pallet { /// An example dispatchable that takes a singles value as a parameter, writes the value to /// storage and emits an event. This function must be dispatched by a signed extrinsic. - #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + #[pallet::weight(Weight::from_ref_time(10_000) + T::DbWeight::get().writes(1))] pub fn do_something(origin: OriginFor, something: u32) -> DispatchResultWithPostInfo { // Check that the extrinsic was signed and get the signer. // This function will return an error if the extrinsic is not signed. @@ -84,7 +84,7 @@ pub mod pallet { } /// An example dispatchable that may throw a custom error. - #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] + #[pallet::weight(Weight::from_ref_time(10_000) + T::DbWeight::get().reads_writes(1,1))] pub fn cause_error(origin: OriginFor) -> DispatchResultWithPostInfo { let _who = ensure_signed(origin)?; diff --git a/parachain-template/pallets/template/src/mock.rs b/parachain-template/pallets/template/src/mock.rs index 917356c1d9..4a7ebac0fa 100644 --- a/parachain-template/pallets/template/src/mock.rs +++ b/parachain-template/pallets/template/src/mock.rs @@ -32,8 +32,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -41,7 +41,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -55,7 +55,7 @@ impl system::Config for Test { } impl pallet_template::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } // Build genesis storage according to the mock runtime. diff --git a/parachain-template/pallets/template/src/tests.rs b/parachain-template/pallets/template/src/tests.rs index 2205658601..527aec8ed0 100644 --- a/parachain-template/pallets/template/src/tests.rs +++ b/parachain-template/pallets/template/src/tests.rs @@ -5,7 +5,7 @@ use frame_support::{assert_noop, assert_ok}; fn it_works_for_default_value() { new_test_ext().execute_with(|| { // Dispatch a signed extrinsic. - assert_ok!(TemplateModule::do_something(Origin::signed(1), 42)); + assert_ok!(TemplateModule::do_something(RuntimeOrigin::signed(1), 42)); // Read pallet storage and assert an expected result. assert_eq!(TemplateModule::something(), Some(42)); }); @@ -15,6 +15,9 @@ fn it_works_for_default_value() { fn correct_error_for_none_value() { new_test_ext().execute_with(|| { // Ensure the expected error is thrown when no value is present. - assert_noop!(TemplateModule::cause_error(Origin::signed(1)), Error::::NoneValue); + assert_noop!( + TemplateModule::cause_error(RuntimeOrigin::signed(1)), + Error::::NoneValue + ); }); } diff --git a/parachain-template/runtime/Cargo.toml b/parachain-template/runtime/Cargo.toml index 12d25abbe1..1662313ab7 100644 --- a/parachain-template/runtime/Cargo.toml +++ b/parachain-template/runtime/Cargo.toml @@ -18,7 +18,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } smallvec = "1.9.0" @@ -131,7 +131,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", @@ -145,6 +145,23 @@ runtime-benchmarks = [ ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-template/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index bbd720633a..871198da6b 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -26,11 +26,13 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::Everything, weights::{ - constants::WEIGHT_PER_SECOND, ConstantMultiplier, DispatchClass, Weight, - WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, + constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, }, PalletId, }; @@ -104,10 +106,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -135,7 +138,7 @@ impl WeightToFeePolynomial for WeightToFee { // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT: // in our template, we map to 1/10 of that, or 1/10 MILLIUNIT let p = MILLIUNIT / 10; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, @@ -214,7 +217,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 0.5 of a second of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] @@ -258,7 +261,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -272,9 +275,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -338,7 +341,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -354,7 +357,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; @@ -363,12 +366,12 @@ impl pallet_transaction_payment::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -384,7 +387,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = (); @@ -396,7 +399,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -408,7 +411,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -440,7 +443,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -457,7 +460,7 @@ impl pallet_collator_selection::Config for Runtime { /// Configure the pallet template in pallets/template. impl pallet_template::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -614,17 +617,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -645,8 +648,15 @@ impl_runtime_apis! { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::parachain-template", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } diff --git a/parachain-template/runtime/src/weights/block_weights.rs b/parachain-template/runtime/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachain-template/runtime/src/weights/block_weights.rs +++ b/parachain-template/runtime/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachain-template/runtime/src/weights/extrinsic_weights.rs b/parachain-template/runtime/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachain-template/runtime/src/weights/extrinsic_weights.rs +++ b/parachain-template/runtime/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachain-template/runtime/src/weights/paritydb_weights.rs b/parachain-template/runtime/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachain-template/runtime/src/weights/paritydb_weights.rs +++ b/parachain-template/runtime/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachain-template/runtime/src/weights/rocksdb_weights.rs b/parachain-template/runtime/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachain-template/runtime/src/weights/rocksdb_weights.rs +++ b/parachain-template/runtime/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachain-template/runtime/src/xcm_config.rs b/parachain-template/runtime/src/xcm_config.rs index ccbb6eb99d..61349391f8 100644 --- a/parachain-template/runtime/src/xcm_config.rs +++ b/parachain-template/runtime/src/xcm_config.rs @@ -1,17 +1,16 @@ use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use core::marker::PhantomData; use frame_support::{ log, match_types, parameter_types, traits::{ConstU32, Everything, Nothing}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; -use xcm::latest::prelude::*; +use xcm::latest::{prelude::*, Weight as XCMWeight}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, NativeAsset, ParentIsPreset, @@ -24,7 +23,7 @@ use xcm_executor::{traits::ShouldExecute, XcmExecutor}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: Option = None; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } @@ -61,23 +60,23 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -102,11 +101,11 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, message: &mut [Instruction], - max_weight: Weight, - weight_credit: &mut Weight, + max_weight: XCMWeight, + weight_credit: &mut XCMWeight, ) -> Result<(), ()> { Deny::should_execute(origin, message, max_weight, weight_credit)?; Allow::should_execute(origin, message, max_weight, weight_credit) @@ -116,11 +115,11 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, message: &mut [Instruction], - _max_weight: Weight, - _weight_credit: &mut Weight, + _max_weight: XCMWeight, + _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { if message.iter().any(|inst| { matches!( @@ -165,7 +164,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; @@ -174,7 +173,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); // Teleporting is disabled. type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -192,7 +191,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -204,20 +203,20 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default @@ -230,6 +229,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/parachains/common/Cargo.toml b/parachains/common/Cargo.toml index dd70f4436a..041f02a73d 100644 --- a/parachains/common/Cargo.toml +++ b/parachains/common/Cargo.toml @@ -10,7 +10,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } # Substrate frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/parachains/common/src/impls.rs b/parachains/common/src/impls.rs index a9e1c8212a..c1158263da 100644 --- a/parachains/common/src/impls.rs +++ b/parachains/common/src/impls.rs @@ -40,7 +40,7 @@ where R: pallet_balances::Config + pallet_collator_selection::Config, AccountIdOf: From + Into, - ::Event: From>, + ::RuntimeEvent: From>, { fn on_nonzero_unbalanced(amount: NegativeImbalance) { let staking_pot = >::account_id(); @@ -56,7 +56,7 @@ where R: pallet_balances::Config + pallet_collator_selection::Config, AccountIdOf: From + Into, - ::Event: From>, + ::RuntimeEvent: From>, { fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { if let Some(mut fees) = fees_then_tips.next() { @@ -152,16 +152,16 @@ mod tests { impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type Index = u64; type BlockNumber = u64; - type Call = Call; + type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = BlockLength; type BlockWeights = (); @@ -179,7 +179,7 @@ mod tests { impl pallet_balances::Config for Test { type Balance = u64; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = (); type AccountStore = System; @@ -214,7 +214,7 @@ mod tests { } impl pallet_collator_selection::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = EnsureRoot; type PotId = PotId; diff --git a/parachains/common/src/lib.rs b/parachains/common/src/lib.rs index fcec189a21..478e405e79 100644 --- a/parachains/common/src/lib.rs +++ b/parachains/common/src/lib.rs @@ -92,7 +92,7 @@ mod constants { pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 0.5 seconds of compute with a 6 second average block time. - pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; + pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); } /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know diff --git a/parachains/common/src/xcm_config.rs b/parachains/common/src/xcm_config.rs index bfcaa9d49e..4b78f21400 100644 --- a/parachains/common/src/xcm_config.rs +++ b/parachains/common/src/xcm_config.rs @@ -5,8 +5,9 @@ use frame_support::{ traits::{fungibles::Inspect, tokens::BalanceConversion}, weights::{Weight, WeightToFee, WeightToFeePolynomial}, }; -use xcm::latest::prelude::*; -use xcm_executor::traits::ShouldExecute; +use sp_runtime::traits::Get; +use xcm::latest::{prelude::*, Weight as XCMWeight}; +use xcm_executor::traits::{FilterAssetLocation, ShouldExecute}; //TODO: move DenyThenTry to polkadot's xcm module. /// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. @@ -21,11 +22,11 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, message: &mut [Instruction], - max_weight: Weight, - weight_credit: &mut Weight, + max_weight: XCMWeight, + weight_credit: &mut XCMWeight, ) -> Result<(), ()> { Deny::should_execute(origin, message, max_weight, weight_credit)?; Allow::should_execute(origin, message, max_weight, weight_credit) @@ -35,11 +36,11 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, message: &mut [Instruction], - _max_weight: Weight, - _weight_credit: &mut Weight, + _max_weight: XCMWeight, + _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { if message.iter().any(|inst| { matches!( @@ -107,3 +108,14 @@ where Ok(asset_amount) } } + +/// Accepts an asset if it is a native asset from a particular `MultiLocation`. +pub struct ConcreteNativeAssetFrom(PhantomData); +impl> FilterAssetLocation for ConcreteNativeAssetFrom { + fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { + log::trace!(target: "xcm::filter_asset_location", + "ConcreteNativeAsset asset: {:?}, origin: {:?}, location: {:?}", + asset, origin, Location::get()); + matches!(asset.id, Concrete(ref id) if id == origin && origin == &Location::get()) + } +} diff --git a/parachains/integration-tests/statemine/xcm/0_init.yml b/parachains/integration-tests/statemine/xcm/0_init.yml index 6f0db4cd61..b964051771 100644 --- a/parachains/integration-tests/statemine/xcm/0_init.yml +++ b/parachains/integration-tests/statemine/xcm/0_init.yml @@ -56,7 +56,7 @@ tests: ] events: - name: sudo.Sudid - attributes: + attribute: type: Result value: Ok - name: xcmPallet.SupportedVersionChanged @@ -82,7 +82,7 @@ tests: ] events: - name: sudo.Sudid - attributes: + attribute: type: Result value: Ok - name: xcmPallet.SupportedVersionChanged diff --git a/parachains/integration-tests/statemine/xcm/3_hrmp-open-channels.yml b/parachains/integration-tests/statemine/xcm/3_hrmp-open-channels.yml index 0745c30742..ee4b946cb4 100644 --- a/parachains/integration-tests/statemine/xcm/3_hrmp-open-channels.yml +++ b/parachains/integration-tests/statemine/xcm/3_hrmp-open-channels.yml @@ -200,10 +200,10 @@ tests: - name: polkadotXcm.Sent - name: ump.ExecutedUpward chain: *relay_chain - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true - value: 4,000,000 + value: 1,160,892,000 - name: hrmp.OpenChannelRequested chain: *relay_chain - queries: @@ -394,9 +394,9 @@ tests: - name: polkadotXcm.Sent - name: ump.ExecutedUpward chain: *relay_chain - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true - value: 4,000,000 + value: 1,160,892,000 - name: hrmp.OpenChannelAccepted chain: *relay_chain diff --git a/parachains/integration-tests/statemine/xcm/4_hrmp.yml b/parachains/integration-tests/statemine/xcm/4_hrmp.yml index a8b79ed3b9..febec32af7 100644 --- a/parachains/integration-tests/statemine/xcm/4_hrmp.yml +++ b/parachains/integration-tests/statemine/xcm/4_hrmp.yml @@ -165,16 +165,16 @@ tests: ] events: - name: polkadotXcm.Attempted - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true value: 1,000,000,000 - name: assets.Transferred - attributes: + attribute: type: AccountId32 value: *pp_sovereign_sibl - name: assets.Transferred - attributes: + attribute: type: u128 value: *amount_to_send @@ -212,16 +212,16 @@ tests: ] events: - name: polkadotXcm.Attempted - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true value: 1,000,000,000 - name: balances.Endowed - attributes: + attribute: type: AccountId32 value: *pp_sovereign_sibl - name: balances.Endowed - attributes: + attribute: type: u128 value: *amount @@ -278,17 +278,17 @@ tests: - name: polkadotXcm.Sent - name: assets.Burned chain: *assets_parachain - attributes: + attribute: type: AccountId32 value: *pp_sovereign_sibl - name: assets.Issued chain: *assets_parachain - attributes: + attribute: type: u32 value: *asset_id - name: system.Remarked chain: *assets_parachain - attributes: + attribute: type: AccountId32 value: *pp_sovereign_sibl - queries: @@ -348,6 +348,6 @@ tests: events: - name: xcmpQueue.Fail chain: *assets_parachain - attributes: + attribute: type: XcmV2TraitsError value: FailedToTransactAsset diff --git a/parachains/integration-tests/statemint/xcm/0_init.yml b/parachains/integration-tests/statemint/xcm/0_init.yml index 6f0db4cd61..b964051771 100644 --- a/parachains/integration-tests/statemint/xcm/0_init.yml +++ b/parachains/integration-tests/statemint/xcm/0_init.yml @@ -56,7 +56,7 @@ tests: ] events: - name: sudo.Sudid - attributes: + attribute: type: Result value: Ok - name: xcmPallet.SupportedVersionChanged @@ -82,7 +82,7 @@ tests: ] events: - name: sudo.Sudid - attributes: + attribute: type: Result value: Ok - name: xcmPallet.SupportedVersionChanged diff --git a/parachains/integration-tests/statemint/xcm/3_hrmp-open-channels.yml b/parachains/integration-tests/statemint/xcm/3_hrmp-open-channels.yml index c8d1d85290..a164ce9c98 100644 --- a/parachains/integration-tests/statemint/xcm/3_hrmp-open-channels.yml +++ b/parachains/integration-tests/statemint/xcm/3_hrmp-open-channels.yml @@ -198,10 +198,10 @@ tests: - name: polkadotXcm.Sent - name: ump.ExecutedUpward chain: *relay_chain - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true - value: 4,000,000 + value: 4,000,000,000 - name: hrmp.OpenChannelRequested chain: *relay_chain - queries: @@ -392,9 +392,9 @@ tests: - name: polkadotXcm.Sent - name: ump.ExecutedUpward chain: *relay_chain - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true - value: 4,000,000 + value: 4,000,000,000 - name: hrmp.OpenChannelAccepted chain: *relay_chain diff --git a/parachains/integration-tests/statemint/xcm/4_hrmp.yml b/parachains/integration-tests/statemint/xcm/4_hrmp.yml index 94783d5ed7..b6e5d4ff9d 100644 --- a/parachains/integration-tests/statemint/xcm/4_hrmp.yml +++ b/parachains/integration-tests/statemint/xcm/4_hrmp.yml @@ -33,7 +33,7 @@ settings: suff_asset_fungible: &ap_suff_asset_fungible { id: *suff_asset, fun: { fungible: *weight_at_most }} suff_asset_fungible_fail: &ap_suff_asset_fungible_fail { id: *suff_asset_fail, fun: { fungible: *weight_at_most }} penpal_parachain: - sovereign_account: &pp_sovereign_sibl FBeL7EAeUroLWXW1yfKboiqTqVfbRBcsUKd6QqVf4kGBySS + sovereign_account: &pp_sovereign_sibl 13cKp89Msu7M2PiaCuuGr1BzAsD5V3vaVbDMs3YtjMZHdGwR signer: &pp_signer //Alice penpal_parachain_account: &pp_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' decodedCalls: @@ -164,16 +164,16 @@ tests: ] events: - name: polkadotXcm.Attempted - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true value: 1,000,000,000 - name: assets.Transferred - attributes: + attribute: type: AccountId32 value: *pp_sovereign_sibl - name: assets.Transferred - attributes: + attribute: type: u128 value: *amount_to_send @@ -211,142 +211,15 @@ tests: ] events: - name: polkadotXcm.Attempted - attributes: + attribute: type: XcmV2TraitsOutcome isComplete: true value: 1,000,000,000 - name: balances.Endowed - attributes: + attribute: type: AccountId32 value: *pp_sovereign_sibl - name: balances.Endowed - attributes: + attribute: type: u128 value: *amount - - - name: polkadotXcm.send( system.remarkWithEvent() ) | Penpal Parachain -> Assets Parachain - before: - - name: Get the asset balance of the Penpal Parachain Sovereign account in Assets Parachain - actions: - - queries: - assets_balance_pp_sovereign_before: - chain: *assets_parachain - pallet: assets - call: account - args: [ - *asset_id, - *pp_sovereign_sibl - ] - its: - - name: Penpal Parachain should be able to send XCM message paying its fee with sufficient asset[2] in Assets Parachain - actions: - - extrinsics: - - chain: *penpal_parachain - signer: *pp_signer - sudo: true - pallet: polkadotXcm - call: send - args: [ - *ap_dest_routed, # destination - { - v2: [ #message - { - WithdrawAsset: [*ap_suff_asset_fungible] - }, - { - BuyExecution: { - fees: *ap_suff_asset_fungible, - weightLimit: Unlimited - } - }, - { - Transact: { - originType: SovereignAccount, - requireWeightAtMost: *weight_at_most, - call: $system_remark_with_event - } - } - ] - } - ] - events: - - name: sudo.Sudid - attribute: - type: Result - value: Ok - - name: polkadotXcm.Sent - - name: assets.Burned - chain: *assets_parachain - attributes: - type: AccountId32 - value: *pp_sovereign_sibl - - name: assets.Issued - chain: *assets_parachain - attributes: - type: u32 - value: *asset_id - - name: system.Remarked - chain: *assets_parachain - attributes: - type: AccountId32 - value: *pp_sovereign_sibl - - queries: - assets_balance_pp_sovereign_after: - chain: *assets_parachain - pallet: assets - call: account - args: [ - *asset_id, - *pp_sovereign_sibl - ] - - - name: Should reduce the asset[2] balance of the Penpal Parachain's SovereignAccount in the Assets Parachain - actions: - - asserts: - assetsDecreased: - args: [ - { - balances: { - before: $assets_balance_pp_sovereign_before, - after: $assets_balance_pp_sovereign_after, - }, - } - ] - - - name: Penpal Parachain SHOULD NOT be able to send XCM message paying its fee with sufficient asset[3] if not balance - actions: - - extrinsics: - - chain: *penpal_parachain - signer: *pp_signer - sudo: true - pallet: polkadotXcm - call: send - args: [ - *ap_dest_routed, # destination - { - v2: [ #message - { - WithdrawAsset: [*ap_suff_asset_fungible_fail] - }, - { - BuyExecution: { - fees: *ap_suff_asset_fungible_fail, - weightLimit: Unlimited - } - }, - { - Transact: { - originType: SovereignAccount, - requireWeightAtMost: *weight_at_most, - call: $system_remark_with_event - } - } - ] - } - ] - events: - - name: xcmpQueue.Fail - chain: *assets_parachain - attributes: - type: XcmV2TraitsError - value: FailedToTransactAsset diff --git a/parachains/pallets/parachain-info/Cargo.toml b/parachains/pallets/parachain-info/Cargo.toml index 3544ba4f79..7cccb7db5e 100644 --- a/parachains/pallets/parachain-info/Cargo.toml +++ b/parachains/pallets/parachain-info/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -24,3 +24,4 @@ std = [ "frame-support/std", "frame-system/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/parachains/pallets/ping/Cargo.toml b/parachains/pallets/ping/Cargo.toml index 4e97fcb6b8..00c17d6567 100644 --- a/parachains/pallets/ping/Cargo.toml +++ b/parachains/pallets/ping/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/parachains/pallets/ping/src/lib.rs b/parachains/pallets/ping/src/lib.rs index f6e85a7bb8..5d509a86a0 100644 --- a/parachains/pallets/ping/src/lib.rs +++ b/parachains/pallets/ping/src/lib.rs @@ -47,13 +47,13 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; - type Origin: From<::Origin> - + Into::Origin>>; + type RuntimeOrigin: From<::RuntimeOrigin> + + Into::RuntimeOrigin>>; /// The overarching call type; we assume sibling chains use the same type. - type Call: From> + Encode; + type RuntimeCall: From> + Encode; type XcmSender: SendXcm; } @@ -108,7 +108,7 @@ pub mod pallet { Xcm(vec![Transact { origin_kind: OriginKind::Native, require_weight_at_most: 1_000, - call: ::Call::from(Call::::ping { + call: ::RuntimeCall::from(Call::::ping { seq, payload: payload.clone().to_vec(), }) @@ -196,7 +196,7 @@ pub mod pallet { #[pallet::weight(0)] pub fn ping(origin: OriginFor, seq: u32, payload: Vec) -> DispatchResult { // Only accept pings from other chains. - let para = ensure_sibling_para(::Origin::from(origin))?; + let para = ensure_sibling_para(::RuntimeOrigin::from(origin))?; Self::deposit_event(Event::Pinged(para, seq, payload.clone())); match send_xcm::( @@ -204,7 +204,7 @@ pub mod pallet { Xcm(vec![Transact { origin_kind: OriginKind::Native, require_weight_at_most: 1_000, - call: ::Call::from(Call::::pong { + call: ::RuntimeCall::from(Call::::pong { seq, payload: payload.clone(), }) @@ -222,7 +222,7 @@ pub mod pallet { #[pallet::weight(0)] pub fn pong(origin: OriginFor, seq: u32, payload: Vec) -> DispatchResult { // Only accept pings from other chains. - let para = ensure_sibling_para(::Origin::from(origin))?; + let para = ensure_sibling_para(::RuntimeOrigin::from(origin))?; if let Some(sent_at) = Pings::::take(seq) { Self::deposit_event(Event::Ponged( diff --git a/parachains/runtimes/assets/statemine/Cargo.toml b/parachains/runtimes/assets/statemine/Cargo.toml index 78f540c279..519cb07390 100644 --- a/parachains/runtimes/assets/statemine/Cargo.toml +++ b/parachains/runtimes/assets/statemine/Cargo.toml @@ -9,7 +9,7 @@ description = "Kusama variant of Statemint parachain runtime" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } smallvec = "1.9.0" @@ -71,6 +71,7 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default- pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } [dev-dependencies] @@ -86,7 +87,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -101,10 +102,32 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-asset-tx-payment/try-runtime", + "pallet-assets/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-multisig/try-runtime", + "pallet-proxy/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-uniques/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] std = [ "codec/std", diff --git a/parachains/runtimes/assets/statemine/src/constants.rs b/parachains/runtimes/assets/statemine/src/constants.rs index fabc09d017..6dccf0089c 100644 --- a/parachains/runtimes/assets/statemine/src/constants.rs +++ b/parachains/runtimes/assets/statemine/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { // in Kusama, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: // in Statemine, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 57b7c7eee2..44f96c1af6 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -46,9 +46,11 @@ use sp_version::RuntimeVersion; use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{AsEnsureOriginWithArg, EitherOfDiverse, InstanceFilter}, - weights::{ConstantMultiplier, DispatchClass, Weight}, + weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; use frame_system::{ @@ -85,10 +87,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, - spec_version: 9230, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 7, + transaction_version: 8, state_version: 0, }; @@ -129,15 +131,15 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = Version; @@ -185,7 +187,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -201,7 +203,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -227,7 +229,7 @@ pub type AssetsForceOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -252,8 +254,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -262,8 +264,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -315,65 +317,75 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, Call::Balances { .. } | Call::Assets { .. } | Call::Uniques { .. }), + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances { .. } | + RuntimeCall::Assets { .. } | + RuntimeCall::Uniques { .. } + ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Assets => { matches!( c, - Call::Assets { .. } | - Call::Utility { .. } | Call::Multisig { .. } | - Call::Uniques { .. } + RuntimeCall::Assets { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( c, - Call::Assets(pallet_assets::Call::create { .. }) | - Call::Assets(pallet_assets::Call::destroy { .. }) | - Call::Assets(pallet_assets::Call::transfer_ownership { .. }) | - Call::Assets(pallet_assets::Call::set_team { .. }) | - Call::Assets(pallet_assets::Call::set_metadata { .. }) | - Call::Assets(pallet_assets::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::create { .. }) | - Call::Uniques(pallet_uniques::Call::destroy { .. }) | - Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | - Call::Uniques(pallet_uniques::Call::set_team { .. }) | - Call::Uniques(pallet_uniques::Call::set_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::create { .. }) | + RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) | + RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) | + RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::AssetManager => matches!( c, - Call::Assets(pallet_assets::Call::mint { .. }) | - Call::Assets(pallet_assets::Call::burn { .. }) | - Call::Assets(pallet_assets::Call::freeze { .. }) | - Call::Assets(pallet_assets::Call::thaw { .. }) | - Call::Assets(pallet_assets::Call::freeze_asset { .. }) | - Call::Assets(pallet_assets::Call::thaw_asset { .. }) | - Call::Uniques(pallet_uniques::Call::mint { .. }) | - Call::Uniques(pallet_uniques::Call::burn { .. }) | - Call::Uniques(pallet_uniques::Call::freeze { .. }) | - Call::Uniques(pallet_uniques::Call::thaw { .. }) | - Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) | - Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::mint { .. }) | + RuntimeCall::Assets(pallet_assets::Call::burn { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -392,8 +404,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -407,12 +419,12 @@ impl pallet_proxy::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -428,7 +440,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -443,7 +455,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -455,7 +467,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -487,7 +499,7 @@ pub type CollatorSelectionUpdateOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -503,7 +515,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -523,7 +535,7 @@ parameter_types! { } impl pallet_uniques::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type CollectionId = u32; type ItemId = u32; type Currency = Balances; @@ -608,9 +620,10 @@ pub type SignedExtra = ( pallet_asset_tx_payment::ChargeAssetTxPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -639,6 +652,10 @@ mod benches { [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] + // XCM + // NOTE: Make sure you point to the individual modules below. + [pallet_xcm_benchmarks::fungible, XcmBalances] + [pallet_xcm_benchmarks::generic, XcmGeneric] ); } @@ -743,17 +760,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -774,8 +791,15 @@ impl_runtime_apis! { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::statemine", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } @@ -790,6 +814,12 @@ impl_runtime_apis! { use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + // This is defined once again in dispatch_benchmark, because list_benchmarks! + // and add_benchmarks! are macros exported by define_benchmarks! macros and those types + // are referenced in that call. + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; + let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -800,7 +830,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError, + TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; impl frame_system_benchmarking::Config for Runtime {} @@ -808,6 +839,95 @@ impl_runtime_apis! { use cumulus_pallet_session_benchmarking::Pallet as SessionBench; impl cumulus_pallet_session_benchmarking::Config for Runtime {} + use xcm::latest::prelude::*; + use xcm_config::KsmLocation; + use pallet_xcm_benchmarks::asset_instance_from; + + impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = xcm_config::XcmConfig; + type AccountIdConverter = xcm_config::LocationToAccountId; + fn valid_destination() -> Result { + Ok(KsmLocation::get()) + } + fn worst_case_holding() -> MultiAssets { + // A mix of fungible, non-fungible, and concrete assets. + const HOLDING_FUNGIBLES: u32 = 100; + const HOLDING_NON_FUNGIBLES: u32 = 100; + let fungibles_amount: u128 = 100; + let mut assets = (0..HOLDING_FUNGIBLES) + .map(|i| { + MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: Fungible(fungibles_amount * i as u128), + } + .into() + }) + .chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) })) + .chain((0..HOLDING_NON_FUNGIBLES).map(|i| MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: NonFungible(asset_instance_from(i)), + })) + .collect::>(); + + assets.push(MultiAsset{ + id: Concrete(KsmLocation::get()), + fun: Fungible(1_000_000 * UNITS), + }); + assets.into() + } + } + + parameter_types! { + pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some(( + KsmLocation::get(), + MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(KsmLocation::get()) }, + )); + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; + pub const CheckedAccount: Option = None; + + } + + impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; + + type CheckedAccount = CheckedAccount; + type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; + + fn get_multi_asset() -> MultiAsset { + MultiAsset { + id: Concrete(KsmLocation::get()), + fun: Fungible(1 * UNITS), + } + } + } + + impl pallet_xcm_benchmarks::generic::Config for Runtime { + type RuntimeCall = RuntimeCall; + + fn worst_case_response() -> (u64, Response) { + (0u64, Response::Version(Default::default())) + } + + fn transact_origin() -> Result { + Ok(KsmLocation::get()) + } + + fn subscribe_origin() -> Result { + Ok(KsmLocation::get()) + } + + fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { + let origin = KsmLocation::get(); + let assets: MultiAssets = (Concrete(KsmLocation::get()), 1_000 * UNITS).into(); + let ticket = MultiLocation { parents: 0, interior: Here }; + Ok((origin, ticket, assets)) + } + } + + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; + let whitelist: Vec = vec![ // Block Number hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), @@ -819,13 +939,14 @@ impl_runtime_apis! { hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), // System Events hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + //TODO: use from relay_well_known_keys::ACTIVE_CONFIG + hex_literal::hex!("06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385").to_vec().into(), ]; let mut batches = Vec::::new(); let params = (&config, &whitelist); add_benchmarks!(params, batches); - if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/block_weights.rs b/parachains/runtimes/assets/statemine/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachains/runtimes/assets/statemine/src/weights/block_weights.rs +++ b/parachains/runtimes/assets/statemine/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs index fe16b470b1..16a431d8b1 100644 --- a/parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs @@ -48,14 +48,14 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (5_634_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_634_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (5_559_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_559_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/extrinsic_weights.rs b/parachains/runtimes/assets/statemine/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachains/runtimes/assets/statemine/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/assets/statemine/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/assets/statemine/src/weights/frame_system.rs b/parachains/runtimes/assets/statemine/src/weights/frame_system.rs index 58e679ffb8..73e8820614 100644 --- a/parachains/runtimes/assets/statemine/src/weights/frame_system.rs +++ b/parachains/runtimes/assets/statemine/src/weights/frame_system.rs @@ -48,43 +48,43 @@ pub struct WeightInfo(PhantomData); impl frame_system::WeightInfo for WeightInfo { /// The range of component `b` is `[0, 3932160]`. fn remark(_b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (5_461_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(5_461_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn set_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((622_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(622_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn kill_storage(i: u32, ) -> Weight { - (351_000 as Weight) + Weight::from_ref_time(351_000 as u64) // Standard Error: 1_000 - .saturating_add((513_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(513_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `p` is `[1, 1000]`. fn kill_prefix(p: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((1_054_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + .saturating_add(Weight::from_ref_time(1_054_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/mod.rs b/parachains/runtimes/assets/statemine/src/weights/mod.rs index bfe3c7bba5..080584f2cf 100644 --- a/parachains/runtimes/assets/statemine/src/weights/mod.rs +++ b/parachains/runtimes/assets/statemine/src/weights/mod.rs @@ -13,6 +13,7 @@ pub mod pallet_uniques; pub mod pallet_utility; pub mod paritydb_weights; pub mod rocksdb_weights; +pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; pub use extrinsic_weights::constants::ExtrinsicBaseWeight; diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs index 5e6847175d..8b9097bef4 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs @@ -48,15 +48,15 @@ pub struct WeightInfo(PhantomData); impl pallet_assets::WeightInfo for WeightInfo { // Storage: Assets Asset (r:1 w:1) fn create() -> Weight { - (26_670_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(26_670_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn force_create() -> Weight { - (15_063_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(15_063_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:5002 w:5001) @@ -67,165 +67,165 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 5000]`. /// The range of component `a` is `[0, 500]`. fn destroy(c: u32, s: u32, a: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 46_000 - .saturating_add((16_382_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(16_382_000 as u64).saturating_mul(c as u64)) // Standard Error: 46_000 - .saturating_add((19_187_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(19_187_000 as u64).saturating_mul(s as u64)) // Standard Error: 465_000 - .saturating_add((16_818_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(Weight::from_ref_time(16_818_000 as u64).saturating_mul(a as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(a as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(a as u64))) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn mint() -> Weight { - (29_655_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(29_655_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn burn() -> Weight { - (33_648_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(33_648_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (47_414_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(47_414_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (39_871_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(39_871_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (47_454_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(47_454_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn freeze() -> Weight { - (20_827_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_827_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn thaw() -> Weight { - (21_249_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_249_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn freeze_asset() -> Weight { - (17_775_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_775_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn thaw_asset() -> Weight { - (17_917_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_917_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Metadata (r:1 w:0) fn transfer_ownership() -> Weight { - (18_724_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_724_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn set_team() -> Weight { - (17_448_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_448_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. fn set_metadata(_n: u32, _s: u32, ) -> Weight { - (31_859_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_859_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn clear_metadata() -> Weight { - (31_293_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_293_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. fn force_set_metadata(_n: u32, _s: u32, ) -> Weight { - (19_595_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(19_595_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn force_clear_metadata() -> Weight { - (31_366_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_366_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn force_asset_status() -> Weight { - (16_884_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_884_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn approve_transfer() -> Weight { - (34_730_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_730_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Approvals (r:1 w:1) // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_approved() -> Weight { - (59_797_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(59_797_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn cancel_approval() -> Weight { - (35_178_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(35_178_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn force_cancel_approval() -> Weight { - (36_840_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(36_840_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs index 346712c553..20a24494aa 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs @@ -48,44 +48,44 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (41_804_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(41_804_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (31_899_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_899_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (20_638_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_638_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (24_081_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_081_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (41_357_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(41_357_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (37_382_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(37_382_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (18_476_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_476_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs index d7aaeceeef..ee9bf010d7 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs @@ -50,21 +50,21 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - (8_196_000 as Weight) + Weight::from_ref_time(8_196_000 as u64) // Standard Error: 3_000 - .saturating_add((3_354_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(3_354_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - (9_141_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_141_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - (9_554_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_554_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection DesiredCandidates (r:1 w:0) @@ -74,29 +74,29 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[1, 1000]`. fn register_as_candidate(c: u32, ) -> Weight { - (55_660_000 as Weight) + Weight::from_ref_time(55_660_000 as u64) // Standard Error: 1_000 - .saturating_add((103_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(103_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[6, 1000]`. fn leave_intent(c: u32, ) -> Weight { - (56_380_000 as Weight) + Weight::from_ref_time(56_380_000 as u64) // Standard Error: 1_000 - .saturating_add((113_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(113_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:2 w:2) // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - (31_852_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(31_852_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:1000 w:1) @@ -106,13 +106,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. fn new_session(r: u32, c: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 2_076_000 - .saturating_add((10_780_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(Weight::from_ref_time(10_780_000 as u64).saturating_mul(r as u64)) // Standard Error: 2_076_000 - .saturating_add((55_238_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) + .saturating_add(Weight::from_ref_time(55_238_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs index 9a6bd8b4b3..10bd872e7b 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs @@ -48,22 +48,22 @@ pub struct WeightInfo(PhantomData); impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_threshold_1(z: u32, ) -> Weight { - (18_001_000 as Weight) + Weight::from_ref_time(18_001_000 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { - (35_223_000 as Weight) + Weight::from_ref_time(35_223_000 as u64) // Standard Error: 0 - .saturating_add((118_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -71,38 +71,38 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (39_275_000 as Weight) + Weight::from_ref_time(39_275_000 as u64) // Standard Error: 1_000 - .saturating_add((92_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(92_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (24_703_000 as Weight) + Weight::from_ref_time(24_703_000 as u64) // Standard Error: 1_000 - .saturating_add((96_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(96_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (38_375_000 as Weight) + Weight::from_ref_time(38_375_000 as u64) // Standard Error: 1_000 - .saturating_add((100_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(100_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -110,53 +110,53 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (46_964_000 as Weight) + Weight::from_ref_time(46_964_000 as u64) // Standard Error: 1_000 - .saturating_add((143_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(143_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32, ) -> Weight { - (34_450_000 as Weight) + Weight::from_ref_time(34_450_000 as u64) // Standard Error: 2_000 - .saturating_add((117_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(117_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_approve(s: u32, ) -> Weight { - (22_051_000 as Weight) + Weight::from_ref_time(22_051_000 as u64) // Standard Error: 0 - .saturating_add((117_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(117_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_complete(s: u32, ) -> Weight { - (69_763_000 as Weight) + Weight::from_ref_time(69_763_000 as u64) // Standard Error: 1_000 - .saturating_add((162_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(162_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn cancel_as_multi(s: u32, ) -> Weight { - (53_182_000 as Weight) + Weight::from_ref_time(53_182_000 as u64) // Standard Error: 1_000 - .saturating_add((129_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(129_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs index d764987b4b..55b51e8c7c 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs @@ -49,10 +49,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { - (18_075_000 as Weight) + Weight::from_ref_time(18_075_000 as u64) // Standard Error: 2_000 - .saturating_add((92_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(Weight::from_ref_time(92_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -60,39 +60,39 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn proxy_announced(a: u32, p: u32, ) -> Weight { - (35_722_000 as Weight) + Weight::from_ref_time(35_722_000 as u64) // Standard Error: 2_000 - .saturating_add((180_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(180_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((85_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(85_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn remove_announcement(a: u32, p: u32, ) -> Weight { - (25_193_000 as Weight) + Weight::from_ref_time(25_193_000 as u64) // Standard Error: 1_000 - .saturating_add((185_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(185_000 as u64).saturating_mul(a as u64)) // Standard Error: 1_000 - .saturating_add((23_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(23_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn reject_announcement(a: u32, p: u32, ) -> Weight { - (25_123_000 as Weight) + Weight::from_ref_time(25_123_000 as u64) // Standard Error: 1_000 - .saturating_add((190_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(190_000 as u64).saturating_mul(a as u64)) // Standard Error: 1_000 - .saturating_add((21_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(21_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -100,58 +100,58 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn announce(a: u32, p: u32, ) -> Weight { - (32_582_000 as Weight) + Weight::from_ref_time(32_582_000 as u64) // Standard Error: 2_000 - .saturating_add((200_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(200_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((93_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(93_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { - (28_173_000 as Weight) + Weight::from_ref_time(28_173_000 as u64) // Standard Error: 3_000 - .saturating_add((112_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(112_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { - (28_247_000 as Weight) + Weight::from_ref_time(28_247_000 as u64) // Standard Error: 3_000 - .saturating_add((118_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { - (23_821_000 as Weight) + Weight::from_ref_time(23_821_000 as u64) // Standard Error: 2_000 - .saturating_add((85_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(85_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn anonymous(p: u32, ) -> Weight { - (31_472_000 as Weight) + Weight::from_ref_time(31_472_000 as u64) // Standard Error: 2_000 - .saturating_add((21_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(21_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[0, 30]`. fn kill_anonymous(p: u32, ) -> Weight { - (24_620_000 as Weight) + Weight::from_ref_time(24_620_000 as u64) // Standard Error: 2_000 - .saturating_add((85_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(85_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_session.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_session.rs index 973fd7d4dc..172660abd7 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_session.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_session.rs @@ -49,15 +49,15 @@ impl pallet_session::WeightInfo for WeightInfo { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:1 w:1) fn set_keys() -> Weight { - (16_555_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(16_555_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:1) fn purge_keys() -> Weight { - (13_554_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_554_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs index c2757b04d5..0ee1456f7c 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs @@ -48,11 +48,11 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) fn set() -> Weight { - (6_818_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_818_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn on_finalize() -> Weight { - (2_431_000 as Weight) + Weight::from_ref_time(2_431_000 as u64) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs index ea3943cc73..133f267e94 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs @@ -53,17 +53,17 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn create() -> Weight { - (28_358_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(28_358_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques NextCollectionId (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_create() -> Weight { - (17_824_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(17_824_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:1 w:0) @@ -77,191 +77,191 @@ impl pallet_uniques::WeightInfo for WeightInfo { /// The range of component `m` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. fn destroy(n: u32, m: u32, a: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 17_000 - .saturating_add((10_592_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(Weight::from_ref_time(10_592_000 as u64).saturating_mul(n as u64)) // Standard Error: 17_000 - .saturating_add((1_658_000 as Weight).saturating_mul(m as Weight)) + .saturating_add(Weight::from_ref_time(1_658_000 as u64).saturating_mul(m as u64)) // Standard Error: 17_000 - .saturating_add((1_593_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(m as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(Weight::from_ref_time(1_593_000 as u64).saturating_mul(a as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(n as u64))) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(n as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(m as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(a as u64))) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques CollectionMaxSupply (r:1 w:0) // Storage: Uniques Account (r:0 w:1) fn mint() -> Weight { - (36_742_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(36_742_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:1) // Storage: Uniques ItemPriceOf (r:0 w:1) fn burn() -> Weight { - (37_124_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(37_124_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:2) // Storage: Uniques ItemPriceOf (r:0 w:1) fn transfer() -> Weight { - (28_961_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(28_961_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:100 w:100) /// The range of component `i` is `[0, 5000]`. fn redeposit(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 15_000 - .saturating_add((12_880_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(12_880_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(i as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn freeze() -> Weight { - (21_658_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_658_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn thaw() -> Weight { - (21_980_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_980_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) fn freeze_collection() -> Weight { - (17_123_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_123_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) fn thaw_collection() -> Weight { - (17_398_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_398_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques OwnershipAcceptance (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:2) fn transfer_ownership() -> Weight { - (25_473_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(25_473_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:1) fn set_team() -> Weight { - (17_970_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_970_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_item_status() -> Weight { - (20_781_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_781_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn set_attribute() -> Weight { - (42_652_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(42_652_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn clear_attribute() -> Weight { - (41_166_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(41_166_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn set_metadata() -> Weight { - (35_471_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(35_471_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn clear_metadata() -> Weight { - (35_110_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(35_110_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn set_collection_metadata() -> Weight { - (33_536_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(33_536_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn clear_collection_metadata() -> Weight { - (31_913_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_913_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn approve_transfer() -> Weight { - (23_536_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(23_536_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn cancel_approval() -> Weight { - (23_748_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(23_748_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques OwnershipAcceptance (r:1 w:1) fn set_accept_ownership() -> Weight { - (20_712_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_712_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques CollectionMaxSupply (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn set_collection_max_supply() -> Weight { - (20_245_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_245_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:0) // Storage: Uniques ItemPriceOf (r:0 w:1) fn set_price() -> Weight { - (20_065_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_065_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques ItemPriceOf (r:1 w:1) // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Account (r:0 w:2) fn buy_item() -> Weight { - (40_638_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(40_638_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs index 2df9b89848..83244ffaca 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs @@ -48,26 +48,26 @@ pub struct WeightInfo(PhantomData); impl pallet_utility::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn batch(c: u32, ) -> Weight { - (22_923_000 as Weight) + Weight::from_ref_time(22_923_000 as u64) // Standard Error: 1_000 - .saturating_add((3_526_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_526_000 as u64).saturating_mul(c as u64)) } fn as_derivative() -> Weight { - (5_220_000 as Weight) + Weight::from_ref_time(5_220_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn batch_all(c: u32, ) -> Weight { - (20_953_000 as Weight) + Weight::from_ref_time(20_953_000 as u64) // Standard Error: 2_000 - .saturating_add((3_698_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_698_000 as u64).saturating_mul(c as u64)) } fn dispatch_as() -> Weight { - (12_087_000 as Weight) + Weight::from_ref_time(12_087_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn force_batch(c: u32, ) -> Weight { - (10_076_000 as Weight) + Weight::from_ref_time(10_076_000 as u64) // Standard Error: 2_000 - .saturating_add((3_546_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_546_000 as u64).saturating_mul(c as u64)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/paritydb_weights.rs b/parachains/runtimes/assets/statemine/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachains/runtimes/assets/statemine/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/assets/statemine/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/assets/statemine/src/weights/rocksdb_weights.rs b/parachains/runtimes/assets/statemine/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachains/runtimes/assets/statemine/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/assets/statemine/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs new file mode 100644 index 0000000000..7972667cf0 --- /dev/null +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs @@ -0,0 +1,188 @@ +// 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 . + +mod pallet_xcm_benchmarks_fungible; +mod pallet_xcm_benchmarks_generic; + +use crate::Runtime; +use frame_support::weights::Weight; +use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; +use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; +use sp_std::{cmp, prelude::*}; +use xcm::{ + latest::{prelude::*, Weight as XCMWeight}, + DoubleEncoded, +}; + +trait WeighMultiAssets { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight; +} + +const MAX_ASSETS: u32 = 100; + +impl WeighMultiAssets for MultiAssetFilter { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { + let weight = match self { + Self::Definite(assets) => + weight.saturating_mul(assets.inner().into_iter().count() as u64), + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), + }; + weight.ref_time() + } +} + +impl WeighMultiAssets for MultiAssets { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { + weight.saturating_mul(self.inner().into_iter().count() as u64).ref_time() + } +} + +pub struct StatemineXcmWeight(core::marker::PhantomData); +impl XcmWeightInfo for StatemineXcmWeight { + fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) + } + // Currently there is no trusted reserve + fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { + u64::MAX + } + fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) + } + fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight { + XcmGeneric::::query_response().ref_time() + } + fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::transfer_asset()) + } + fn transfer_reserve_asset( + assets: &MultiAssets, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::transfer_reserve_asset()) + } + fn transact( + _origin_type: &OriginKind, + _require_weight_at_most: &u64, + _call: &DoubleEncoded, + ) -> XCMWeight { + XcmGeneric::::transact().ref_time() + } + fn hrmp_new_channel_open_request( + _sender: &u32, + _max_message_size: &u32, + _max_capacity: &u32, + ) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn hrmp_channel_accepted(_recipient: &u32) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn clear_origin() -> XCMWeight { + XcmGeneric::::clear_origin().ref_time() + } + fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { + XcmGeneric::::descend_origin().ref_time() + } + fn report_error( + _query_id: &QueryId, + _dest: &MultiLocation, + _max_response_weight: &u64, + ) -> XCMWeight { + XcmGeneric::::report_error().ref_time() + } + + fn deposit_asset( + assets: &MultiAssetFilter, + _max_assets: &u32, + _dest: &MultiLocation, + ) -> XCMWeight { + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); + cmp::min(hardcoded_weight, weight) + } + fn deposit_reserve_asset( + assets: &MultiAssetFilter, + _max_assets: &u32, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::deposit_reserve_asset()) + } + fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight { + Weight::MAX.ref_time() + } + fn initiate_reserve_withdraw( + assets: &MultiAssetFilter, + _reserve: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) + } + fn initiate_teleport( + assets: &MultiAssetFilter, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + cmp::min(hardcoded_weight, weight) + } + fn query_holding( + _query_id: &u64, + _dest: &MultiLocation, + _assets: &MultiAssetFilter, + _max_response_weight: &u64, + ) -> XCMWeight { + XcmGeneric::::query_holding().ref_time() + } + fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { + XcmGeneric::::buy_execution().ref_time() + } + fn refund_surplus() -> XCMWeight { + XcmGeneric::::refund_surplus().ref_time() + } + fn set_error_handler(_xcm: &Xcm) -> XCMWeight { + XcmGeneric::::set_error_handler().ref_time() + } + fn set_appendix(_xcm: &Xcm) -> XCMWeight { + XcmGeneric::::set_appendix().ref_time() + } + fn clear_error() -> XCMWeight { + XcmGeneric::::clear_error().ref_time() + } + fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { + XcmGeneric::::claim_asset().ref_time() + } + fn trap(_code: &u64) -> XCMWeight { + XcmGeneric::::trap().ref_time() + } + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> XCMWeight { + XcmGeneric::::subscribe_version().ref_time() + } + fn unsubscribe_version() -> XCMWeight { + XcmGeneric::::unsubscribe_version().ref_time() + } +} 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 new file mode 100644 index 0000000000..85bf47886a --- /dev/null +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -0,0 +1,107 @@ +// 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 . + + +//! Autogenerated weights for `pallet_xcm_benchmarks::fungible` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// /home/benchbot/cargo_target_dir/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_xcm_benchmarks::fungible +// --chain=statemine-dev +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --header=./file_header.txt +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `pallet_xcm_benchmarks::fungible`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + // Storage: System Account (r:1 w:1) + pub(crate) fn withdraw_asset() -> Weight { + Weight::from_ref_time(29_190_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:2 w:2) + pub(crate) fn transfer_asset() -> Weight { + Weight::from_ref_time(34_102_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:2 w:2) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn transfer_reserve_asset() -> Weight { + Weight::from_ref_time(49_386_000 as u64) + .saturating_add(T::DbWeight::get().reads(8 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + } + pub(crate) fn receive_teleported_asset() -> Weight { + Weight::from_ref_time(4_937_000 as u64) + } + // Storage: System Account (r:1 w:1) + pub(crate) fn deposit_asset() -> Weight { + Weight::from_ref_time(30_853_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn deposit_reserve_asset() -> Weight { + Weight::from_ref_time(45_866_000 as u64) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn initiate_teleport() -> Weight { + Weight::from_ref_time(23_964_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} 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 new file mode 100644 index 0000000000..6a9f36b768 --- /dev/null +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -0,0 +1,137 @@ +// 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 . + + +//! Autogenerated weights for `pallet_xcm_benchmarks::generic` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// /home/benchbot/cargo_target_dir/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_xcm_benchmarks::generic +// --chain=statemine-dev +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --header=./file_header.txt +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `pallet_xcm_benchmarks::generic`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn query_holding() -> Weight { + Weight::from_ref_time(694_466_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn buy_execution() -> Weight { + Weight::from_ref_time(7_095_000 as u64) + } + // Storage: PolkadotXcm Queries (r:1 w:0) + pub(crate) fn query_response() -> Weight { + Weight::from_ref_time(13_270_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + } + pub(crate) fn transact() -> Weight { + Weight::from_ref_time(16_375_000 as u64) + } + pub(crate) fn refund_surplus() -> Weight { + Weight::from_ref_time(7_319_000 as u64) + } + pub(crate) fn set_error_handler() -> Weight { + Weight::from_ref_time(3_515_000 as u64) + } + pub(crate) fn set_appendix() -> Weight { + Weight::from_ref_time(3_501_000 as u64) + } + pub(crate) fn clear_error() -> Weight { + Weight::from_ref_time(3_459_000 as u64) + } + pub(crate) fn descend_origin() -> Weight { + Weight::from_ref_time(4_319_000 as u64) + } + pub(crate) fn clear_origin() -> Weight { + Weight::from_ref_time(3_511_000 as u64) + } + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn report_error() -> Weight { + Weight::from_ref_time(13_284_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: PolkadotXcm AssetTraps (r:1 w:1) + pub(crate) fn claim_asset() -> Weight { + Weight::from_ref_time(7_985_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + pub(crate) fn trap() -> Weight { + Weight::from_ref_time(3_515_000 as u64) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn subscribe_version() -> Weight { + Weight::from_ref_time(16_657_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) + pub(crate) fn unsubscribe_version() -> Weight { + Weight::from_ref_time(5_622_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn initiate_reserve_withdraw() -> Weight { + Weight::from_ref_time(878_786_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index f79eca94b3..ccf96219c4 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -14,13 +14,12 @@ // limitations under the License. use super::{ - AccountId, AssetId, Assets, Authorship, Balance, Balances, Call, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId, Assets, Authorship, Balance, Balances, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Everything, Nothing, PalletInfoAccess}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use parachains_common::{ @@ -39,13 +38,14 @@ use xcm_builder::{ IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, + WeightInfoBounds, }; use xcm_executor::{traits::JustTry, XcmExecutor}; parameter_types! { pub const KsmLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = Here.into_location(); pub AssetsPalletLocation: MultiLocation = @@ -110,26 +110,24 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { - // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; pub XcmAssetFeesReceiver: Option = Authorship::author(); @@ -162,7 +160,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -173,7 +171,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemineXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = ( UsingComponents>, cumulus_primitives_utility::TakeFirstAssetTrader< @@ -213,7 +215,7 @@ impl xcm_executor::Config for XcmConfig { /// Converts a local signed origin into an XCM multilocation. /// Forms the basis for local origins sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -225,21 +227,26 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemineXcmWeight, + RuntimeCall, + MaxInstructions, + >; + type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; @@ -250,6 +257,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/statemine/tests/tests.rs index c99debbced..974f89ec1e 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/statemine/tests/tests.rs @@ -1,6 +1,8 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; use frame_support::{ - assert_noop, assert_ok, traits::PalletInfo, weights::WeightToFee as WeightToFeeT, + assert_noop, assert_ok, + traits::PalletInfo, + weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AuraId}; pub use statemine_runtime::{ @@ -49,7 +51,7 @@ fn test_asset_xcm_trader() { let bought = 4_000_000_000u64; // lets calculate amount needed - let amount_needed = WeightToFee::weight_to_fee(&bought); + let amount_needed = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); let asset_multilocation = MultiLocation::new( 0, @@ -130,7 +132,7 @@ fn test_asset_xcm_trader_with_refund() { ); // lets calculate amount needed - let amount_bought = WeightToFee::weight_to_fee(&bought); + let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into(); @@ -144,7 +146,8 @@ fn test_asset_xcm_trader_with_refund() { let weight_used = bought / 2; // Make sure refurnd works. - let amount_refunded = WeightToFee::weight_to_fee(&(bought - weight_used)); + let amount_refunded = + WeightToFee::weight_to_fee(&Weight::from_ref_time(bought - weight_used)); assert_eq!( trader.refund_weight(bought - weight_used), @@ -155,7 +158,7 @@ fn test_asset_xcm_trader_with_refund() { drop(trader); // We only should have paid for half of the bought weight - let fees_paid = WeightToFee::weight_to_fee(&weight_used); + let fees_paid = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight_used)); assert_eq!( Assets::balance(1, AccountId::from(ALICE)), @@ -207,7 +210,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { ), ); - let amount_bought = WeightToFee::weight_to_fee(&bought); + let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); assert!( amount_bought < ExistentialDeposit::get(), @@ -267,7 +270,7 @@ fn test_that_buying_ed_refund_does_not_refund() { ), ); - let amount_bought = WeightToFee::weight_to_fee(&bought); + let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); assert!( amount_bought < ExistentialDeposit::get(), diff --git a/parachains/runtimes/assets/statemint/Cargo.toml b/parachains/runtimes/assets/statemint/Cargo.toml index c1f469a4f9..9b5e58c86a 100644 --- a/parachains/runtimes/assets/statemint/Cargo.toml +++ b/parachains/runtimes/assets/statemint/Cargo.toml @@ -10,7 +10,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.17", default-features = false } serde = { version = "1.0.144", optional = true, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } smallvec = "1.9.0" # Substrate @@ -71,6 +71,7 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default- pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } [dev-dependencies] hex-literal = "0.3.4" @@ -85,7 +86,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -100,10 +101,32 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-asset-tx-payment/try-runtime", + "pallet-assets/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-multisig/try-runtime", + "pallet-proxy/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-uniques/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] std = [ "codec/std", diff --git a/parachains/runtimes/assets/statemint/src/constants.rs b/parachains/runtimes/assets/statemint/src/constants.rs index 17624fded9..ef3a545d15 100644 --- a/parachains/runtimes/assets/statemint/src/constants.rs +++ b/parachains/runtimes/assets/statemint/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { // in Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: // in Statemint, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 69a05f97e1..151259f839 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -75,9 +75,11 @@ use sp_version::RuntimeVersion; use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{AsEnsureOriginWithArg, EitherOfDiverse, InstanceFilter}, - weights::{ConstantMultiplier, DispatchClass, Weight}, + weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; use frame_system::{ @@ -115,10 +117,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemint"), impl_name: create_runtime_str!("statemint"), authoring_version: 1, - spec_version: 9230, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 7, + transaction_version: 8, state_version: 0, }; @@ -159,15 +161,15 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = Version; @@ -215,7 +217,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -231,7 +233,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -257,7 +259,7 @@ pub type AssetsForceOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -282,8 +284,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -292,8 +294,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -345,65 +347,75 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, Call::Balances { .. } | Call::Assets { .. } | Call::Uniques { .. }), + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances { .. } | + RuntimeCall::Assets { .. } | + RuntimeCall::Uniques { .. } + ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Assets => { matches!( c, - Call::Assets { .. } | - Call::Utility { .. } | Call::Multisig { .. } | - Call::Uniques { .. } + RuntimeCall::Assets { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( c, - Call::Assets(pallet_assets::Call::create { .. }) | - Call::Assets(pallet_assets::Call::destroy { .. }) | - Call::Assets(pallet_assets::Call::transfer_ownership { .. }) | - Call::Assets(pallet_assets::Call::set_team { .. }) | - Call::Assets(pallet_assets::Call::set_metadata { .. }) | - Call::Assets(pallet_assets::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::create { .. }) | - Call::Uniques(pallet_uniques::Call::destroy { .. }) | - Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | - Call::Uniques(pallet_uniques::Call::set_team { .. }) | - Call::Uniques(pallet_uniques::Call::set_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::create { .. }) | + RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) | + RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) | + RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::AssetManager => matches!( c, - Call::Assets(pallet_assets::Call::mint { .. }) | - Call::Assets(pallet_assets::Call::burn { .. }) | - Call::Assets(pallet_assets::Call::freeze { .. }) | - Call::Assets(pallet_assets::Call::thaw { .. }) | - Call::Assets(pallet_assets::Call::freeze_asset { .. }) | - Call::Assets(pallet_assets::Call::thaw_asset { .. }) | - Call::Uniques(pallet_uniques::Call::mint { .. }) | - Call::Uniques(pallet_uniques::Call::burn { .. }) | - Call::Uniques(pallet_uniques::Call::freeze { .. }) | - Call::Uniques(pallet_uniques::Call::thaw { .. }) | - Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) | - Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::mint { .. }) | + RuntimeCall::Assets(pallet_assets::Call::burn { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -422,8 +434,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -437,12 +449,12 @@ impl pallet_proxy::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -459,7 +471,7 @@ impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -473,7 +485,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -485,7 +497,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -517,7 +529,7 @@ pub type CollatorSelectionUpdateOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -533,7 +545,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -553,7 +565,7 @@ parameter_types! { } impl pallet_uniques::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type CollectionId = u32; type ItemId = u32; type Currency = Balances; @@ -638,9 +650,10 @@ pub type SignedExtra = ( pallet_asset_tx_payment::ChargeAssetTxPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -668,6 +681,10 @@ mod benches { [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] + // XCM + // NOTE: Make sure you point to the individual modules below. + [pallet_xcm_benchmarks::fungible, XcmBalances] + [pallet_xcm_benchmarks::generic, XcmGeneric] ); } @@ -772,17 +789,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -803,8 +820,15 @@ impl_runtime_apis! { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::statemint", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } @@ -814,11 +838,18 @@ impl_runtime_apis! { Vec, Vec, ) { + use frame_benchmarking::{Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + // This is defined once again in dispatch_benchmark, because list_benchmarks! + // and add_benchmarks! are macros exported by define_benchmarks! macros and those types + // are referenced in that call. + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; + let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -829,7 +860,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; use frame_system_benchmarking::Pallet as SystemBench; impl frame_system_benchmarking::Config for Runtime {} @@ -837,6 +868,94 @@ impl_runtime_apis! { use cumulus_pallet_session_benchmarking::Pallet as SessionBench; impl cumulus_pallet_session_benchmarking::Config for Runtime {} + use xcm::latest::prelude::*; + use xcm_config::DotLocation; + use pallet_xcm_benchmarks::asset_instance_from; + + impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = xcm_config::XcmConfig; + type AccountIdConverter = xcm_config::LocationToAccountId; + fn valid_destination() -> Result { + Ok(DotLocation::get()) + } + fn worst_case_holding() -> MultiAssets { + // A mix of fungible, non-fungible, and concrete assets. + const HOLDING_FUNGIBLES: u32 = 100; + const HOLDING_NON_FUNGIBLES: u32 = 100; + let fungibles_amount: u128 = 100; + let mut assets = (0..HOLDING_FUNGIBLES) + .map(|i| { + MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: Fungible(fungibles_amount * i as u128), + } + .into() + }) + .chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) })) + .chain((0..HOLDING_NON_FUNGIBLES).map(|i| MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: NonFungible(asset_instance_from(i)), + })) + .collect::>(); + + assets.push(MultiAsset{ + id: Concrete(DotLocation::get()), + fun: Fungible(1_000_000 * UNITS), + }); + assets.into() + } + } + + parameter_types! { + pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some(( + DotLocation::get(), + MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(DotLocation::get()) }, + )); + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; + pub const CheckedAccount: Option = None; + } + + impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; + + type CheckedAccount = CheckedAccount; + type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; + + fn get_multi_asset() -> MultiAsset { + MultiAsset { + id: Concrete(DotLocation::get()), + fun: Fungible(1 * UNITS), + } + } + } + + impl pallet_xcm_benchmarks::generic::Config for Runtime { + type RuntimeCall = RuntimeCall; + + fn worst_case_response() -> (u64, Response) { + (0u64, Response::Version(Default::default())) + } + + fn transact_origin() -> Result { + Ok(DotLocation::get()) + } + + fn subscribe_origin() -> Result { + Ok(DotLocation::get()) + } + + fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { + let origin = DotLocation::get(); + let assets: MultiAssets = (Concrete(DotLocation::get()), 1_000 * UNITS).into(); + let ticket = MultiLocation { parents: 0, interior: Here }; + Ok((origin, ticket, assets)) + } + } + + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; + let whitelist: Vec = vec![ // Block Number hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), @@ -848,13 +967,14 @@ impl_runtime_apis! { hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), // System Events hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + //TODO: use from relay_well_known_keys::ACTIVE_CONFIG + hex_literal::hex!("06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385").to_vec().into(), ]; let mut batches = Vec::::new(); let params = (&config, &whitelist); add_benchmarks!(params, batches); - if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/block_weights.rs b/parachains/runtimes/assets/statemint/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachains/runtimes/assets/statemint/src/weights/block_weights.rs +++ b/parachains/runtimes/assets/statemint/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs index a51fb710ea..40fa7ad460 100644 --- a/parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs @@ -48,14 +48,14 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (5_192_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_192_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (5_363_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_363_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/extrinsic_weights.rs b/parachains/runtimes/assets/statemint/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachains/runtimes/assets/statemint/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/assets/statemint/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/assets/statemint/src/weights/frame_system.rs b/parachains/runtimes/assets/statemint/src/weights/frame_system.rs index 794cdbe1b6..a1c577d6d9 100644 --- a/parachains/runtimes/assets/statemint/src/weights/frame_system.rs +++ b/parachains/runtimes/assets/statemint/src/weights/frame_system.rs @@ -48,43 +48,43 @@ pub struct WeightInfo(PhantomData); impl frame_system::WeightInfo for WeightInfo { /// The range of component `b` is `[0, 3932160]`. fn remark(_b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (5_446_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(5_446_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn set_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((626_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(626_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn kill_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((515_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(515_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `p` is `[1, 1000]`. fn kill_prefix(p: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((1_052_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + .saturating_add(Weight::from_ref_time(1_052_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/mod.rs b/parachains/runtimes/assets/statemint/src/weights/mod.rs index bfe3c7bba5..080584f2cf 100644 --- a/parachains/runtimes/assets/statemint/src/weights/mod.rs +++ b/parachains/runtimes/assets/statemint/src/weights/mod.rs @@ -13,6 +13,7 @@ pub mod pallet_uniques; pub mod pallet_utility; pub mod paritydb_weights; pub mod rocksdb_weights; +pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; pub use extrinsic_weights::constants::ExtrinsicBaseWeight; diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs index 4aea74e75c..f0c0031253 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs @@ -48,15 +48,15 @@ pub struct WeightInfo(PhantomData); impl pallet_assets::WeightInfo for WeightInfo { // Storage: Assets Asset (r:1 w:1) fn create() -> Weight { - (26_226_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(26_226_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn force_create() -> Weight { - (15_357_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(15_357_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:5002 w:5001) @@ -67,171 +67,171 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 5000]`. /// The range of component `a` is `[0, 500]`. fn destroy(c: u32, s: u32, a: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 45_000 - .saturating_add((15_904_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(15_904_000 as u64).saturating_mul(c as u64)) // Standard Error: 45_000 - .saturating_add((18_803_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(18_803_000 as u64).saturating_mul(s as u64)) // Standard Error: 450_000 - .saturating_add((17_017_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(Weight::from_ref_time(17_017_000 as u64).saturating_mul(a as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(a as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(a as u64))) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn mint() -> Weight { - (29_616_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(29_616_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn burn() -> Weight { - (33_496_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(33_496_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (46_790_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(46_790_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (39_769_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(39_769_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (47_200_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(47_200_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn freeze() -> Weight { - (20_873_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_873_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn thaw() -> Weight { - (21_228_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_228_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn freeze_asset() -> Weight { - (17_685_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_685_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn thaw_asset() -> Weight { - (17_542_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_542_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Metadata (r:1 w:0) fn transfer_ownership() -> Weight { - (18_639_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_639_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn set_team() -> Weight { - (17_135_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_135_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. fn set_metadata(n: u32, s: u32, ) -> Weight { - (31_324_000 as Weight) + Weight::from_ref_time(31_324_000 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(n as u64)) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn clear_metadata() -> Weight { - (31_340_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_340_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. fn force_set_metadata(_n: u32, s: u32, ) -> Weight { - (18_756_000 as Weight) + Weight::from_ref_time(18_756_000 as u64) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn force_clear_metadata() -> Weight { - (31_427_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_427_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn force_asset_status() -> Weight { - (16_930_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_930_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn approve_transfer() -> Weight { - (34_492_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_492_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Approvals (r:1 w:1) // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_approved() -> Weight { - (60_098_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(60_098_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn cancel_approval() -> Weight { - (35_630_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(35_630_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn force_cancel_approval() -> Weight { - (37_399_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(37_399_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs index 66e621a74a..87359fbd4e 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs @@ -48,44 +48,44 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (41_006_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(41_006_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (31_329_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_329_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (21_075_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_075_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (24_413_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_413_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (41_434_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(41_434_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (37_653_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(37_653_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (18_701_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_701_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs index ceb6344319..d4e2c46ecb 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs @@ -50,21 +50,21 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - (8_587_000 as Weight) + Weight::from_ref_time(8_587_000 as u64) // Standard Error: 3_000 - .saturating_add((3_304_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(3_304_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - (9_027_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_027_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - (9_244_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_244_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection DesiredCandidates (r:1 w:0) @@ -74,29 +74,29 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[1, 1000]`. fn register_as_candidate(c: u32, ) -> Weight { - (60_984_000 as Weight) + Weight::from_ref_time(60_984_000 as u64) // Standard Error: 1_000 - .saturating_add((89_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(89_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[6, 1000]`. fn leave_intent(c: u32, ) -> Weight { - (49_046_000 as Weight) + Weight::from_ref_time(49_046_000 as u64) // Standard Error: 1_000 - .saturating_add((118_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:2 w:2) // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - (32_269_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(32_269_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:1000 w:1) @@ -106,13 +106,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. fn new_session(r: u32, c: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_992_000 - .saturating_add((10_521_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(Weight::from_ref_time(10_521_000 as u64).saturating_mul(r as u64)) // Standard Error: 1_992_000 - .saturating_add((53_162_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) + .saturating_add(Weight::from_ref_time(53_162_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs index cd0c8b42a2..1f543e1340 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs @@ -48,22 +48,22 @@ pub struct WeightInfo(PhantomData); impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_threshold_1(z: u32, ) -> Weight { - (17_175_000 as Weight) + Weight::from_ref_time(17_175_000 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { - (35_937_000 as Weight) + Weight::from_ref_time(35_937_000 as u64) // Standard Error: 0 - .saturating_add((97_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(97_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -71,38 +71,38 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (37_468_000 as Weight) + Weight::from_ref_time(37_468_000 as u64) // Standard Error: 1_000 - .saturating_add((89_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(89_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (25_557_000 as Weight) + Weight::from_ref_time(25_557_000 as u64) // Standard Error: 1_000 - .saturating_add((83_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(83_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (38_127_000 as Weight) + Weight::from_ref_time(38_127_000 as u64) // Standard Error: 1_000 - .saturating_add((88_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -110,53 +110,53 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (47_383_000 as Weight) + Weight::from_ref_time(47_383_000 as u64) // Standard Error: 1_000 - .saturating_add((127_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(127_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32, ) -> Weight { - (33_472_000 as Weight) + Weight::from_ref_time(33_472_000 as u64) // Standard Error: 1_000 - .saturating_add((102_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(102_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_approve(s: u32, ) -> Weight { - (21_612_000 as Weight) + Weight::from_ref_time(21_612_000 as u64) // Standard Error: 1_000 - .saturating_add((119_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(119_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_complete(s: u32, ) -> Weight { - (68_168_000 as Weight) + Weight::from_ref_time(68_168_000 as u64) // Standard Error: 1_000 - .saturating_add((157_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(157_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn cancel_as_multi(s: u32, ) -> Weight { - (52_748_000 as Weight) + Weight::from_ref_time(52_748_000 as u64) // Standard Error: 1_000 - .saturating_add((117_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(117_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs index 1b968ae885..1f07febb57 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs @@ -49,10 +49,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { - (17_582_000 as Weight) + Weight::from_ref_time(17_582_000 as u64) // Standard Error: 2_000 - .saturating_add((77_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -60,39 +60,39 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn proxy_announced(a: u32, p: u32, ) -> Weight { - (34_603_000 as Weight) + Weight::from_ref_time(34_603_000 as u64) // Standard Error: 2_000 - .saturating_add((169_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(169_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((87_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(87_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn remove_announcement(a: u32, p: u32, ) -> Weight { - (24_496_000 as Weight) + Weight::from_ref_time(24_496_000 as u64) // Standard Error: 1_000 - .saturating_add((179_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(179_000 as u64).saturating_mul(a as u64)) // Standard Error: 1_000 - .saturating_add((25_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(25_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn reject_announcement(a: u32, p: u32, ) -> Weight { - (24_237_000 as Weight) + Weight::from_ref_time(24_237_000 as u64) // Standard Error: 1_000 - .saturating_add((181_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(181_000 as u64).saturating_mul(a as u64)) // Standard Error: 1_000 - .saturating_add((29_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(29_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -100,58 +100,58 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn announce(a: u32, p: u32, ) -> Weight { - (32_065_000 as Weight) + Weight::from_ref_time(32_065_000 as u64) // Standard Error: 1_000 - .saturating_add((166_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(166_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((91_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { - (27_168_000 as Weight) + Weight::from_ref_time(27_168_000 as u64) // Standard Error: 2_000 - .saturating_add((117_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(117_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { - (27_233_000 as Weight) + Weight::from_ref_time(27_233_000 as u64) // Standard Error: 2_000 - .saturating_add((121_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(121_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { - (23_010_000 as Weight) + Weight::from_ref_time(23_010_000 as u64) // Standard Error: 2_000 - .saturating_add((95_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(95_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn anonymous(p: u32, ) -> Weight { - (30_378_000 as Weight) + Weight::from_ref_time(30_378_000 as u64) // Standard Error: 2_000 - .saturating_add((16_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(16_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[0, 30]`. fn kill_anonymous(p: u32, ) -> Weight { - (23_977_000 as Weight) + Weight::from_ref_time(23_977_000 as u64) // Standard Error: 2_000 - .saturating_add((76_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_session.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_session.rs index 5f5a8eea98..2271b8622b 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_session.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_session.rs @@ -49,15 +49,15 @@ impl pallet_session::WeightInfo for WeightInfo { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:1 w:1) fn set_keys() -> Weight { - (16_170_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(16_170_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:1) fn purge_keys() -> Weight { - (13_246_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_246_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs index ffb8799414..37330043a2 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs @@ -48,11 +48,11 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) fn set() -> Weight { - (6_737_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_737_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn on_finalize() -> Weight { - (2_329_000 as Weight) + Weight::from_ref_time(2_329_000 as u64) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs index ed9e2b98f8..c50d6c653b 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs @@ -53,17 +53,17 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn create() -> Weight { - (27_424_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(27_424_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques NextCollectionId (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_create() -> Weight { - (17_098_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(17_098_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:1 w:0) @@ -77,191 +77,191 @@ impl pallet_uniques::WeightInfo for WeightInfo { /// The range of component `m` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. fn destroy(n: u32, m: u32, a: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 18_000 - .saturating_add((10_919_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(Weight::from_ref_time(10_919_000 as u64).saturating_mul(n as u64)) // Standard Error: 18_000 - .saturating_add((1_679_000 as Weight).saturating_mul(m as Weight)) + .saturating_add(Weight::from_ref_time(1_679_000 as u64).saturating_mul(m as u64)) // Standard Error: 18_000 - .saturating_add((1_463_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(m as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(Weight::from_ref_time(1_463_000 as u64).saturating_mul(a as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(n as u64))) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(n as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(m as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(a as u64))) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques CollectionMaxSupply (r:1 w:0) // Storage: Uniques Account (r:0 w:1) fn mint() -> Weight { - (36_329_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(36_329_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:1) // Storage: Uniques ItemPriceOf (r:0 w:1) fn burn() -> Weight { - (36_746_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(36_746_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:2) // Storage: Uniques ItemPriceOf (r:0 w:1) fn transfer() -> Weight { - (28_916_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(28_916_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:100 w:100) /// The range of component `i` is `[0, 5000]`. fn redeposit(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 15_000 - .saturating_add((12_745_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(12_745_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(i as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn freeze() -> Weight { - (21_813_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_813_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn thaw() -> Weight { - (22_088_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(22_088_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) fn freeze_collection() -> Weight { - (17_184_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_184_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) fn thaw_collection() -> Weight { - (17_311_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_311_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques OwnershipAcceptance (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:2) fn transfer_ownership() -> Weight { - (25_174_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(25_174_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:1) fn set_team() -> Weight { - (17_879_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_879_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_item_status() -> Weight { - (20_491_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_491_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn set_attribute() -> Weight { - (42_444_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(42_444_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn clear_attribute() -> Weight { - (41_217_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(41_217_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn set_metadata() -> Weight { - (34_559_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_559_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn clear_metadata() -> Weight { - (34_863_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_863_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn set_collection_metadata() -> Weight { - (33_199_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(33_199_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn clear_collection_metadata() -> Weight { - (31_472_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_472_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn approve_transfer() -> Weight { - (23_618_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(23_618_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn cancel_approval() -> Weight { - (23_507_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(23_507_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques OwnershipAcceptance (r:1 w:1) fn set_accept_ownership() -> Weight { - (21_120_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_120_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques CollectionMaxSupply (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn set_collection_max_supply() -> Weight { - (20_664_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_664_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:0) // Storage: Uniques ItemPriceOf (r:0 w:1) fn set_price() -> Weight { - (19_938_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(19_938_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques ItemPriceOf (r:1 w:1) // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Account (r:0 w:2) fn buy_item() -> Weight { - (39_254_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(39_254_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs index e1bade9386..9c6fece01a 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs @@ -48,26 +48,26 @@ pub struct WeightInfo(PhantomData); impl pallet_utility::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn batch(c: u32, ) -> Weight { - (30_959_000 as Weight) + Weight::from_ref_time(30_959_000 as u64) // Standard Error: 6_000 - .saturating_add((3_220_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_220_000 as u64).saturating_mul(c as u64)) } fn as_derivative() -> Weight { - (4_732_000 as Weight) + Weight::from_ref_time(4_732_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn batch_all(c: u32, ) -> Weight { - (16_465_000 as Weight) + Weight::from_ref_time(16_465_000 as u64) // Standard Error: 2_000 - .saturating_add((3_364_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_364_000 as u64).saturating_mul(c as u64)) } fn dispatch_as() -> Weight { - (11_903_000 as Weight) + Weight::from_ref_time(11_903_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn force_batch(c: u32, ) -> Weight { - (22_621_000 as Weight) + Weight::from_ref_time(22_621_000 as u64) // Standard Error: 1_000 - .saturating_add((3_147_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_147_000 as u64).saturating_mul(c as u64)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/paritydb_weights.rs b/parachains/runtimes/assets/statemint/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachains/runtimes/assets/statemint/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/assets/statemint/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/assets/statemint/src/weights/rocksdb_weights.rs b/parachains/runtimes/assets/statemint/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachains/runtimes/assets/statemint/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/assets/statemint/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs new file mode 100644 index 0000000000..1a0ffcdb22 --- /dev/null +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs @@ -0,0 +1,188 @@ +// 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 . + +mod pallet_xcm_benchmarks_fungible; +mod pallet_xcm_benchmarks_generic; + +use crate::Runtime; +use frame_support::weights::Weight; +use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; +use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; +use sp_std::{cmp, prelude::*}; +use xcm::{ + latest::{prelude::*, Weight as XCMWeight}, + DoubleEncoded, +}; + +trait WeighMultiAssets { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight; +} + +const MAX_ASSETS: u32 = 100; + +impl WeighMultiAssets for MultiAssetFilter { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { + let weight = match self { + Self::Definite(assets) => + weight.saturating_mul(assets.inner().into_iter().count() as u64), + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), + }; + weight.ref_time() + } +} + +impl WeighMultiAssets for MultiAssets { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { + weight.saturating_mul(self.inner().into_iter().count() as u64).ref_time() + } +} + +pub struct StatemintXcmWeight(core::marker::PhantomData); +impl XcmWeightInfo for StatemintXcmWeight { + fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) + } + // Currently there is no trusted reserve + fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { + u64::MAX + } + fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) + } + fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight { + XcmGeneric::::query_response().ref_time() + } + fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::transfer_asset()) + } + fn transfer_reserve_asset( + assets: &MultiAssets, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::transfer_reserve_asset()) + } + fn transact( + _origin_type: &OriginKind, + _require_weight_at_most: &u64, + _call: &DoubleEncoded, + ) -> XCMWeight { + XcmGeneric::::transact().ref_time() + } + fn hrmp_new_channel_open_request( + _sender: &u32, + _max_message_size: &u32, + _max_capacity: &u32, + ) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn hrmp_channel_accepted(_recipient: &u32) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn clear_origin() -> XCMWeight { + XcmGeneric::::clear_origin().ref_time() + } + fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { + XcmGeneric::::descend_origin().ref_time() + } + fn report_error( + _query_id: &QueryId, + _dest: &MultiLocation, + _max_response_weight: &u64, + ) -> XCMWeight { + XcmGeneric::::report_error().ref_time() + } + + fn deposit_asset( + assets: &MultiAssetFilter, + _max_assets: &u32, + _dest: &MultiLocation, + ) -> XCMWeight { + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); + cmp::min(hardcoded_weight, weight) + } + fn deposit_reserve_asset( + assets: &MultiAssetFilter, + _max_assets: &u32, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::deposit_reserve_asset()) + } + fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight { + Weight::MAX.ref_time() + } + fn initiate_reserve_withdraw( + assets: &MultiAssetFilter, + _reserve: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) + } + fn initiate_teleport( + assets: &MultiAssetFilter, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + cmp::min(hardcoded_weight, weight) + } + fn query_holding( + _query_id: &u64, + _dest: &MultiLocation, + _assets: &MultiAssetFilter, + _max_response_weight: &u64, + ) -> XCMWeight { + XcmGeneric::::query_holding().ref_time() + } + fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { + XcmGeneric::::buy_execution().ref_time() + } + fn refund_surplus() -> XCMWeight { + XcmGeneric::::refund_surplus().ref_time() + } + fn set_error_handler(_xcm: &Xcm) -> XCMWeight { + XcmGeneric::::set_error_handler().ref_time() + } + fn set_appendix(_xcm: &Xcm) -> XCMWeight { + XcmGeneric::::set_appendix().ref_time() + } + fn clear_error() -> XCMWeight { + XcmGeneric::::clear_error().ref_time() + } + fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { + XcmGeneric::::claim_asset().ref_time() + } + fn trap(_code: &u64) -> XCMWeight { + XcmGeneric::::trap().ref_time() + } + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> XCMWeight { + XcmGeneric::::subscribe_version().ref_time() + } + fn unsubscribe_version() -> XCMWeight { + XcmGeneric::::unsubscribe_version().ref_time() + } +} 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 new file mode 100644 index 0000000000..e7d6c954dc --- /dev/null +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -0,0 +1,108 @@ +// 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 . + + +//! Autogenerated weights for `pallet_xcm_benchmarks::fungible` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! 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: +// /home/benchbot/cargo_target_dir/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_xcm_benchmarks::fungible +// --chain=statemint-dev +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --header=./file_header.txt +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `pallet_xcm_benchmarks::fungible`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + // Storage: System Account (r:1 w:1) + pub(crate) fn withdraw_asset() -> Weight { + Weight::from_ref_time(34_002_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:2 w:2) + pub(crate) fn transfer_asset() -> Weight { + Weight::from_ref_time(38_285_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:2 w:2) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn transfer_reserve_asset() -> Weight { + Weight::from_ref_time(55_068_000 as u64) + .saturating_add(T::DbWeight::get().reads(8 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + } + pub(crate) fn receive_teleported_asset() -> Weight { + Weight::from_ref_time(7_796_000 as u64) + } + // Storage: System Account (r:1 w:1) + pub(crate) fn deposit_asset() -> Weight { + Weight::from_ref_time(35_092_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn deposit_reserve_asset() -> Weight { + Weight::from_ref_time(50_590_000 as u64) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn initiate_teleport() -> Weight { + Weight::from_ref_time(27_220_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} 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 new file mode 100644 index 0000000000..7af8b8b280 --- /dev/null +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -0,0 +1,138 @@ +// 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 . + + +//! Autogenerated weights for `pallet_xcm_benchmarks::generic` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! 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: +// /home/benchbot/cargo_target_dir/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_xcm_benchmarks::generic +// --chain=statemint-dev +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --header=./file_header.txt +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `pallet_xcm_benchmarks::generic`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn query_holding() -> Weight { + Weight::from_ref_time(682_639_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn buy_execution() -> Weight { + Weight::from_ref_time(9_272_000 as u64) + } + // Storage: PolkadotXcm Queries (r:1 w:0) + pub(crate) fn query_response() -> Weight { + Weight::from_ref_time(17_084_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + } + pub(crate) fn transact() -> Weight { + Weight::from_ref_time(20_265_000 as u64) + } + pub(crate) fn refund_surplus() -> Weight { + Weight::from_ref_time(9_422_000 as u64) + } + pub(crate) fn set_error_handler() -> Weight { + Weight::from_ref_time(5_545_000 as u64) + } + pub(crate) fn set_appendix() -> Weight { + Weight::from_ref_time(5_450_000 as u64) + } + pub(crate) fn clear_error() -> Weight { + Weight::from_ref_time(5_519_000 as u64) + } + pub(crate) fn descend_origin() -> Weight { + Weight::from_ref_time(6_398_000 as u64) + } + pub(crate) fn clear_origin() -> Weight { + Weight::from_ref_time(5_498_000 as u64) + } + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn report_error() -> Weight { + Weight::from_ref_time(15_784_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: PolkadotXcm AssetTraps (r:1 w:1) + pub(crate) fn claim_asset() -> Weight { + Weight::from_ref_time(11_861_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + pub(crate) fn trap() -> Weight { + Weight::from_ref_time(5_462_000 as u64) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn subscribe_version() -> Weight { + Weight::from_ref_time(18_997_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) + pub(crate) fn unsubscribe_version() -> Weight { + Weight::from_ref_time(8_684_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn initiate_reserve_withdraw() -> Weight { + Weight::from_ref_time(883_121_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index ce6fd6c29b..3daa00b4f3 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -14,13 +14,12 @@ // limitations under the License. use super::{ - AccountId, AssetId, Assets, Authorship, Balance, Balances, Call, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId, Assets, Authorship, Balance, Balances, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Everything, Nothing, PalletInfoAccess}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use parachains_common::{ @@ -36,13 +35,14 @@ use xcm_builder::{ IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, + WeightInfoBounds, }; use xcm_executor::{traits::JustTry, XcmExecutor}; parameter_types! { pub const DotLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const Local: MultiLocation = MultiLocation::here(); pub AssetsPalletLocation: MultiLocation = @@ -107,26 +107,24 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { - // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; pub XcmAssetFeesReceiver: Option = Authorship::author(); @@ -159,7 +157,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -170,7 +168,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of DOT type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -189,7 +191,7 @@ impl xcm_executor::Config for XcmConfig { /// Converts a local signed origin into an XCM multilocation. /// Forms the basis for local origins sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -201,21 +203,25 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; @@ -226,6 +232,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/statemint/tests/tests.rs index 518936210f..77cb45c1cc 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/statemint/tests/tests.rs @@ -1,6 +1,8 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; use frame_support::{ - assert_noop, assert_ok, traits::PalletInfo, weights::WeightToFee as WeightToFeeT, + assert_noop, assert_ok, + traits::PalletInfo, + weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, StatemintAuraId as AuraId}; pub use statemint_runtime::{ @@ -44,7 +46,7 @@ fn test_asset_xcm_trader_does_not_work_in_statemine() { let bought = 400_000_000_000u64; // lets calculate amount needed - let amount_needed = WeightToFee::weight_to_fee(&bought); + let amount_needed = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); let asset_multilocation = MultiLocation::new( 0, diff --git a/parachains/runtimes/assets/test-utils/src/lib.rs b/parachains/runtimes/assets/test-utils/src/lib.rs index f37465e5bd..fb4750bae9 100644 --- a/parachains/runtimes/assets/test-utils/src/lib.rs +++ b/parachains/runtimes/assets/test-utils/src/lib.rs @@ -96,7 +96,7 @@ pub struct RuntimeHelper(PhantomData); impl RuntimeHelper where AccountIdOf: - Into<<::Origin as OriginTrait>::AccountId>, + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, { pub fn run_to_block(n: u32, author: Option) { while frame_system::Pallet::::block_number() < n.into() { @@ -122,13 +122,13 @@ where } } - pub fn root_origin() -> ::Origin { - ::Origin::root() + pub fn root_origin() -> ::RuntimeOrigin { + ::RuntimeOrigin::root() } pub fn origin_of( account_id: AccountIdOf, - ) -> ::Origin { - ::Origin::signed(account_id.into()) + ) -> ::RuntimeOrigin { + ::RuntimeOrigin::signed(account_id.into()) } } diff --git a/parachains/runtimes/assets/westmint/Cargo.toml b/parachains/runtimes/assets/westmint/Cargo.toml index 477e414d95..0add127f40 100644 --- a/parachains/runtimes/assets/westmint/Cargo.toml +++ b/parachains/runtimes/assets/westmint/Cargo.toml @@ -9,7 +9,7 @@ description = "Westend variant of Statemint parachain runtime" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } smallvec = "1.9.0" @@ -71,6 +71,7 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default- pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } [dev-dependencies] hex-literal = "0.3.4" @@ -85,7 +86,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -100,10 +101,32 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-asset-tx-payment/try-runtime", + "pallet-assets/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-multisig/try-runtime", + "pallet-proxy/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-uniques/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] std = [ "codec/std", diff --git a/parachains/runtimes/assets/westmint/src/constants.rs b/parachains/runtimes/assets/westmint/src/constants.rs index 032ed5c1f4..8a94ad2ad9 100644 --- a/parachains/runtimes/assets/westmint/src/constants.rs +++ b/parachains/runtimes/assets/westmint/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { // in Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: // in Statemint, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 8a7953a6a3..1f1d86e1e7 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -46,9 +46,11 @@ use sp_version::RuntimeVersion; use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{AsEnsureOriginWithArg, InstanceFilter}, - weights::{ConstantMultiplier, DispatchClass, Weight}, + weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; use frame_system::{ @@ -83,10 +85,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("westmint"), impl_name: create_runtime_str!("westmint"), authoring_version: 1, - spec_version: 9230, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 7, + transaction_version: 8, state_version: 0, }; @@ -127,15 +129,15 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = Version; @@ -183,7 +185,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -199,7 +201,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -222,7 +224,7 @@ parameter_types! { pub type AssetsForceOrigin = EnsureRoot; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -247,8 +249,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -257,8 +259,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -310,65 +312,75 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, Call::Balances { .. } | Call::Assets { .. } | Call::Uniques { .. }), + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances { .. } | + RuntimeCall::Assets { .. } | + RuntimeCall::Uniques { .. } + ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Assets => { matches!( c, - Call::Assets { .. } | - Call::Utility { .. } | Call::Multisig { .. } | - Call::Uniques { .. } + RuntimeCall::Assets { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( c, - Call::Assets(pallet_assets::Call::create { .. }) | - Call::Assets(pallet_assets::Call::destroy { .. }) | - Call::Assets(pallet_assets::Call::transfer_ownership { .. }) | - Call::Assets(pallet_assets::Call::set_team { .. }) | - Call::Assets(pallet_assets::Call::set_metadata { .. }) | - Call::Assets(pallet_assets::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::create { .. }) | - Call::Uniques(pallet_uniques::Call::destroy { .. }) | - Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | - Call::Uniques(pallet_uniques::Call::set_team { .. }) | - Call::Uniques(pallet_uniques::Call::set_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::create { .. }) | + RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) | + RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) | + RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::AssetManager => matches!( c, - Call::Assets(pallet_assets::Call::mint { .. }) | - Call::Assets(pallet_assets::Call::burn { .. }) | - Call::Assets(pallet_assets::Call::freeze { .. }) | - Call::Assets(pallet_assets::Call::thaw { .. }) | - Call::Assets(pallet_assets::Call::freeze_asset { .. }) | - Call::Assets(pallet_assets::Call::thaw_asset { .. }) | - Call::Uniques(pallet_uniques::Call::mint { .. }) | - Call::Uniques(pallet_uniques::Call::burn { .. }) | - Call::Uniques(pallet_uniques::Call::freeze { .. }) | - Call::Uniques(pallet_uniques::Call::thaw { .. }) | - Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) | - Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::mint { .. }) | + RuntimeCall::Assets(pallet_assets::Call::burn { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -387,8 +399,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -402,12 +414,12 @@ impl pallet_proxy::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -423,7 +435,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -435,7 +447,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -447,7 +459,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -477,7 +489,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -493,7 +505,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -513,7 +525,7 @@ parameter_types! { } impl pallet_uniques::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type CollectionId = u32; type ItemId = u32; type Currency = Balances; @@ -598,9 +610,10 @@ pub type SignedExtra = ( pallet_asset_tx_payment::ChargeAssetTxPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -629,6 +642,10 @@ mod benches { [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] + // XCM + // NOTE: Make sure you point to the individual modules below. + [pallet_xcm_benchmarks::fungible, XcmBalances] + [pallet_xcm_benchmarks::generic, XcmGeneric] ); } @@ -733,17 +750,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -764,8 +781,15 @@ impl_runtime_apis! { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::westmint", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } @@ -780,6 +804,12 @@ impl_runtime_apis! { use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + // This is defined once again in dispatch_benchmark, because list_benchmarks! + // and add_benchmarks! are macros exported by define_benchmarks! macros and those types + // are referenced in that call. + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; + let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -790,7 +820,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; use frame_system_benchmarking::Pallet as SystemBench; impl frame_system_benchmarking::Config for Runtime {} @@ -798,6 +828,95 @@ impl_runtime_apis! { use cumulus_pallet_session_benchmarking::Pallet as SessionBench; impl cumulus_pallet_session_benchmarking::Config for Runtime {} + use xcm::latest::prelude::*; + use xcm_config::WestendLocation; + use pallet_xcm_benchmarks::asset_instance_from; + + impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = xcm_config::XcmConfig; + type AccountIdConverter = xcm_config::LocationToAccountId; + fn valid_destination() -> Result { + Ok(WestendLocation::get()) + } + fn worst_case_holding() -> MultiAssets { + // A mix of fungible, non-fungible, and concrete assets. + const HOLDING_FUNGIBLES: u32 = 100; + const HOLDING_NON_FUNGIBLES: u32 = 100; + let fungibles_amount: u128 = 100; + let mut assets = (0..HOLDING_FUNGIBLES) + .map(|i| { + MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: Fungible(fungibles_amount * i as u128), + } + .into() + }) + .chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) })) + .chain((0..HOLDING_NON_FUNGIBLES).map(|i| MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: NonFungible(asset_instance_from(i)), + })) + .collect::>(); + + assets.push(MultiAsset{ + id: Concrete(WestendLocation::get()), + fun: Fungible(1_000_000 * UNITS), + }); + assets.into() + } + } + + parameter_types! { + pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some(( + WestendLocation::get(), + MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WestendLocation::get()) }, + )); + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; + pub const CheckedAccount: Option = None; + + } + + impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; + + type CheckedAccount = CheckedAccount; + type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; + + fn get_multi_asset() -> MultiAsset { + MultiAsset { + id: Concrete(WestendLocation::get()), + fun: Fungible(1 * UNITS), + } + } + } + + impl pallet_xcm_benchmarks::generic::Config for Runtime { + type RuntimeCall = RuntimeCall; + + fn worst_case_response() -> (u64, Response) { + (0u64, Response::Version(Default::default())) + } + + fn transact_origin() -> Result { + Ok(WestendLocation::get()) + } + + fn subscribe_origin() -> Result { + Ok(WestendLocation::get()) + } + + fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { + let origin = WestendLocation::get(); + let assets: MultiAssets = (Concrete(WestendLocation::get()), 1_000 * UNITS).into(); + let ticket = MultiLocation { parents: 0, interior: Here }; + Ok((origin, ticket, assets)) + } + } + + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; + let whitelist: Vec = vec![ // Block Number hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), @@ -809,13 +928,14 @@ impl_runtime_apis! { hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), // System Events hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + //TODO: use from relay_well_known_keys::ACTIVE_CONFIG + hex_literal::hex!("06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385").to_vec().into(), ]; let mut batches = Vec::::new(); let params = (&config, &whitelist); add_benchmarks!(params, batches); - if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/block_weights.rs b/parachains/runtimes/assets/westmint/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachains/runtimes/assets/westmint/src/weights/block_weights.rs +++ b/parachains/runtimes/assets/westmint/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs index 1fff43c333..4df6a114f9 100644 --- a/parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs @@ -48,14 +48,14 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (5_463_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_463_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (5_221_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_221_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/extrinsic_weights.rs b/parachains/runtimes/assets/westmint/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachains/runtimes/assets/westmint/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/assets/westmint/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/assets/westmint/src/weights/frame_system.rs b/parachains/runtimes/assets/westmint/src/weights/frame_system.rs index 1c3947980e..f1cc1a39d9 100644 --- a/parachains/runtimes/assets/westmint/src/weights/frame_system.rs +++ b/parachains/runtimes/assets/westmint/src/weights/frame_system.rs @@ -48,43 +48,43 @@ pub struct WeightInfo(PhantomData); impl frame_system::WeightInfo for WeightInfo { /// The range of component `b` is `[0, 3932160]`. fn remark(_b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (5_726_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(5_726_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn set_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((616_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(616_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn kill_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((519_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(519_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `p` is `[1, 1000]`. fn kill_prefix(p: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((1_067_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + .saturating_add(Weight::from_ref_time(1_067_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/mod.rs b/parachains/runtimes/assets/westmint/src/weights/mod.rs index bfe3c7bba5..080584f2cf 100644 --- a/parachains/runtimes/assets/westmint/src/weights/mod.rs +++ b/parachains/runtimes/assets/westmint/src/weights/mod.rs @@ -13,6 +13,7 @@ pub mod pallet_uniques; pub mod pallet_utility; pub mod paritydb_weights; pub mod rocksdb_weights; +pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; pub use extrinsic_weights::constants::ExtrinsicBaseWeight; diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs index ea6cfd174d..5a9324262b 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs @@ -48,15 +48,15 @@ pub struct WeightInfo(PhantomData); impl pallet_assets::WeightInfo for WeightInfo { // Storage: Assets Asset (r:1 w:1) fn create() -> Weight { - (25_905_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(25_905_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn force_create() -> Weight { - (14_977_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(14_977_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:5002 w:5001) @@ -67,169 +67,169 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 5000]`. /// The range of component `a` is `[0, 500]`. fn destroy(c: u32, s: u32, a: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 46_000 - .saturating_add((16_133_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(16_133_000 as u64).saturating_mul(c as u64)) // Standard Error: 46_000 - .saturating_add((18_915_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(18_915_000 as u64).saturating_mul(s as u64)) // Standard Error: 464_000 - .saturating_add((16_795_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(Weight::from_ref_time(16_795_000 as u64).saturating_mul(a as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(a as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(a as u64))) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn mint() -> Weight { - (29_903_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(29_903_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn burn() -> Weight { - (34_384_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_384_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (48_218_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(48_218_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (40_558_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(40_558_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (48_330_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(48_330_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn freeze() -> Weight { - (21_218_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_218_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn thaw() -> Weight { - (21_227_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_227_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn freeze_asset() -> Weight { - (17_906_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_906_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn thaw_asset() -> Weight { - (17_669_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_669_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Metadata (r:1 w:0) fn transfer_ownership() -> Weight { - (18_756_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_756_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn set_team() -> Weight { - (17_203_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_203_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. fn set_metadata(_n: u32, s: u32, ) -> Weight { - (31_757_000 as Weight) + Weight::from_ref_time(31_757_000 as u64) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn clear_metadata() -> Weight { - (31_669_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_669_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. fn force_set_metadata(_n: u32, s: u32, ) -> Weight { - (18_566_000 as Weight) + Weight::from_ref_time(18_566_000 as u64) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn force_clear_metadata() -> Weight { - (31_467_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_467_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) fn force_asset_status() -> Weight { - (16_275_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_275_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn approve_transfer() -> Weight { - (34_436_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_436_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Approvals (r:1 w:1) // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_approved() -> Weight { - (60_445_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(60_445_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn cancel_approval() -> Weight { - (35_819_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(35_819_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn force_cancel_approval() -> Weight { - (36_535_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(36_535_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs index 14aa8f1ca7..6953a52f21 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs @@ -48,44 +48,44 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (40_330_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(40_330_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (30_938_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(30_938_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (20_284_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_284_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (24_018_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_018_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (40_970_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(40_970_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (36_243_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(36_243_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (18_374_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_374_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs index 244ba48e35..ba0d3b311a 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs @@ -50,21 +50,21 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - (6_669_000 as Weight) + Weight::from_ref_time(6_669_000 as u64) // Standard Error: 3_000 - .saturating_add((3_218_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(3_218_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - (8_348_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_348_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - (8_592_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_592_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection DesiredCandidates (r:1 w:0) @@ -74,29 +74,29 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[1, 1000]`. fn register_as_candidate(c: u32, ) -> Weight { - (55_542_000 as Weight) + Weight::from_ref_time(55_542_000 as u64) // Standard Error: 1_000 - .saturating_add((92_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(92_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[2, 1000]`. fn leave_intent(c: u32, ) -> Weight { - (52_080_000 as Weight) + Weight::from_ref_time(52_080_000 as u64) // Standard Error: 1_000 - .saturating_add((109_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(109_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:2 w:2) // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - (31_546_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(31_546_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:1000 w:1) @@ -106,13 +106,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. fn new_session(r: u32, c: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_895_000 - .saturating_add((9_941_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(Weight::from_ref_time(9_941_000 as u64).saturating_mul(r as u64)) // Standard Error: 1_895_000 - .saturating_add((50_628_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) + .saturating_add(Weight::from_ref_time(50_628_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs index cc762c4624..7944583640 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs @@ -48,22 +48,22 @@ pub struct WeightInfo(PhantomData); impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_threshold_1(z: u32, ) -> Weight { - (17_854_000 as Weight) + Weight::from_ref_time(17_854_000 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { - (36_613_000 as Weight) + Weight::from_ref_time(36_613_000 as u64) // Standard Error: 1_000 - .saturating_add((96_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(96_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -71,38 +71,38 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (40_039_000 as Weight) + Weight::from_ref_time(40_039_000 as u64) // Standard Error: 1_000 - .saturating_add((72_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(72_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (26_059_000 as Weight) + Weight::from_ref_time(26_059_000 as u64) // Standard Error: 1_000 - .saturating_add((82_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (38_292_000 as Weight) + Weight::from_ref_time(38_292_000 as u64) // Standard Error: 1_000 - .saturating_add((90_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(90_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -110,53 +110,53 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (47_468_000 as Weight) + Weight::from_ref_time(47_468_000 as u64) // Standard Error: 1_000 - .saturating_add((129_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(129_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32, ) -> Weight { - (33_492_000 as Weight) + Weight::from_ref_time(33_492_000 as u64) // Standard Error: 1_000 - .saturating_add((110_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(110_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_approve(s: u32, ) -> Weight { - (22_147_000 as Weight) + Weight::from_ref_time(22_147_000 as u64) // Standard Error: 0 - .saturating_add((113_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(113_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_complete(s: u32, ) -> Weight { - (66_106_000 as Weight) + Weight::from_ref_time(66_106_000 as u64) // Standard Error: 1_000 - .saturating_add((161_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn cancel_as_multi(s: u32, ) -> Weight { - (52_566_000 as Weight) + Weight::from_ref_time(52_566_000 as u64) // Standard Error: 1_000 - .saturating_add((117_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(117_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs index 8ec439c9ae..fc72d28e91 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs @@ -49,10 +49,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { - (18_084_000 as Weight) + Weight::from_ref_time(18_084_000 as u64) // Standard Error: 2_000 - .saturating_add((83_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(Weight::from_ref_time(83_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -60,39 +60,39 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn proxy_announced(a: u32, p: u32, ) -> Weight { - (35_619_000 as Weight) + Weight::from_ref_time(35_619_000 as u64) // Standard Error: 2_000 - .saturating_add((172_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(172_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((89_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(89_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn remove_announcement(a: u32, p: u32, ) -> Weight { - (24_774_000 as Weight) + Weight::from_ref_time(24_774_000 as u64) // Standard Error: 2_000 - .saturating_add((190_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(190_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((33_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(33_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn reject_announcement(a: u32, p: u32, ) -> Weight { - (25_855_000 as Weight) + Weight::from_ref_time(25_855_000 as u64) // Standard Error: 1_000 - .saturating_add((160_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(160_000 as u64).saturating_mul(a as u64)) // Standard Error: 1_000 - .saturating_add((15_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(15_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -100,58 +100,58 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn announce(a: u32, p: u32, ) -> Weight { - (32_874_000 as Weight) + Weight::from_ref_time(32_874_000 as u64) // Standard Error: 2_000 - .saturating_add((172_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(172_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((97_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(97_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { - (28_312_000 as Weight) + Weight::from_ref_time(28_312_000 as u64) // Standard Error: 4_000 - .saturating_add((105_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { - (28_197_000 as Weight) + Weight::from_ref_time(28_197_000 as u64) // Standard Error: 4_000 - .saturating_add((121_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(121_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { - (23_659_000 as Weight) + Weight::from_ref_time(23_659_000 as u64) // Standard Error: 8_000 - .saturating_add((106_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(106_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn anonymous(p: u32, ) -> Weight { - (31_575_000 as Weight) + Weight::from_ref_time(31_575_000 as u64) // Standard Error: 2_000 - .saturating_add((35_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(35_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[0, 30]`. fn kill_anonymous(p: u32, ) -> Weight { - (24_640_000 as Weight) + Weight::from_ref_time(24_640_000 as u64) // Standard Error: 2_000 - .saturating_add((80_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(80_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_session.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_session.rs index 949e1c64ef..020535b5a3 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_session.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_session.rs @@ -49,15 +49,15 @@ impl pallet_session::WeightInfo for WeightInfo { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:1 w:1) fn set_keys() -> Weight { - (16_457_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(16_457_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:1) fn purge_keys() -> Weight { - (13_585_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_585_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs index 296a565fcb..749d60095d 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs @@ -48,11 +48,11 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) fn set() -> Weight { - (6_762_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_762_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn on_finalize() -> Weight { - (2_387_000 as Weight) + Weight::from_ref_time(2_387_000 as u64) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs index fd90132bf0..ebc8c3e49c 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs @@ -53,17 +53,17 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn create() -> Weight { - (27_462_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(27_462_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques NextCollectionId (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_create() -> Weight { - (16_480_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(16_480_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:1 w:0) @@ -77,191 +77,191 @@ impl pallet_uniques::WeightInfo for WeightInfo { /// The range of component `m` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. fn destroy(n: u32, m: u32, a: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 18_000 - .saturating_add((10_956_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(Weight::from_ref_time(10_956_000 as u64).saturating_mul(n as u64)) // Standard Error: 18_000 - .saturating_add((1_654_000 as Weight).saturating_mul(m as Weight)) + .saturating_add(Weight::from_ref_time(1_654_000 as u64).saturating_mul(m as u64)) // Standard Error: 18_000 - .saturating_add((1_572_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(m as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(Weight::from_ref_time(1_572_000 as u64).saturating_mul(a as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(n as u64))) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(n as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(m as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(a as u64))) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques CollectionMaxSupply (r:1 w:0) // Storage: Uniques Account (r:0 w:1) fn mint() -> Weight { - (36_074_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(36_074_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:1) // Storage: Uniques ItemPriceOf (r:0 w:1) fn burn() -> Weight { - (37_583_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(37_583_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:2) // Storage: Uniques ItemPriceOf (r:0 w:1) fn transfer() -> Weight { - (28_134_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(28_134_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Asset (r:100 w:100) /// The range of component `i` is `[0, 5000]`. fn redeposit(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 16_000 - .saturating_add((12_715_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(12_715_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(i as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn freeze() -> Weight { - (21_019_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_019_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn thaw() -> Weight { - (21_907_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(21_907_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) fn freeze_collection() -> Weight { - (16_894_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_894_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) fn thaw_collection() -> Weight { - (16_650_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_650_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques OwnershipAcceptance (r:1 w:1) // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:2) fn transfer_ownership() -> Weight { - (25_095_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(25_095_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Uniques Class (r:1 w:1) fn set_team() -> Weight { - (17_428_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_428_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_item_status() -> Weight { - (20_018_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_018_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn set_attribute() -> Weight { - (41_955_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(41_955_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn clear_attribute() -> Weight { - (40_201_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(40_201_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn set_metadata() -> Weight { - (33_630_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(33_630_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn clear_metadata() -> Weight { - (34_054_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(34_054_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn set_collection_metadata() -> Weight { - (33_283_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(33_283_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn clear_collection_metadata() -> Weight { - (31_298_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_298_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn approve_transfer() -> Weight { - (22_430_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(22_430_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn cancel_approval() -> Weight { - (23_005_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(23_005_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques OwnershipAcceptance (r:1 w:1) fn set_accept_ownership() -> Weight { - (20_468_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_468_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques CollectionMaxSupply (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn set_collection_max_supply() -> Weight { - (19_948_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(19_948_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:0) // Storage: Uniques ItemPriceOf (r:0 w:1) fn set_price() -> Weight { - (19_487_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(19_487_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques ItemPriceOf (r:1 w:1) // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Account (r:0 w:2) fn buy_item() -> Weight { - (39_973_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(39_973_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs index d8b3e0e1f3..dc441f1e89 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs @@ -48,26 +48,26 @@ pub struct WeightInfo(PhantomData); impl pallet_utility::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn batch(c: u32, ) -> Weight { - (14_433_000 as Weight) + Weight::from_ref_time(14_433_000 as u64) // Standard Error: 2_000 - .saturating_add((3_315_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_315_000 as u64).saturating_mul(c as u64)) } fn as_derivative() -> Weight { - (5_234_000 as Weight) + Weight::from_ref_time(5_234_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn batch_all(c: u32, ) -> Weight { - (16_023_000 as Weight) + Weight::from_ref_time(16_023_000 as u64) // Standard Error: 2_000 - .saturating_add((3_466_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_466_000 as u64).saturating_mul(c as u64)) } fn dispatch_as() -> Weight { - (12_588_000 as Weight) + Weight::from_ref_time(12_588_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn force_batch(c: u32, ) -> Weight { - (16_094_000 as Weight) + Weight::from_ref_time(16_094_000 as u64) // Standard Error: 2_000 - .saturating_add((3_280_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_280_000 as u64).saturating_mul(c as u64)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/paritydb_weights.rs b/parachains/runtimes/assets/westmint/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachains/runtimes/assets/westmint/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/assets/westmint/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/assets/westmint/src/weights/rocksdb_weights.rs b/parachains/runtimes/assets/westmint/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachains/runtimes/assets/westmint/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/assets/westmint/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs new file mode 100644 index 0000000000..5f6bf034fd --- /dev/null +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs @@ -0,0 +1,188 @@ +// 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 . + +mod pallet_xcm_benchmarks_fungible; +mod pallet_xcm_benchmarks_generic; + +use crate::Runtime; +use frame_support::weights::Weight; +use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; +use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; +use sp_std::{cmp, prelude::*}; +use xcm::{ + latest::{prelude::*, Weight as XCMWeight}, + DoubleEncoded, +}; + +trait WeighMultiAssets { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight; +} + +const MAX_ASSETS: u32 = 100; + +impl WeighMultiAssets for MultiAssetFilter { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { + let weight = match self { + Self::Definite(assets) => + weight.saturating_mul(assets.inner().into_iter().count() as u64), + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), + }; + weight.ref_time() + } +} + +impl WeighMultiAssets for MultiAssets { + fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { + weight.saturating_mul(self.inner().into_iter().count() as u64).ref_time() + } +} + +pub struct WestmintXcmWeight(core::marker::PhantomData); +impl XcmWeightInfo for WestmintXcmWeight { + fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) + } + // Currently there is no trusted reserve + fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { + u64::MAX + } + fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) + } + fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight { + XcmGeneric::::query_response().ref_time() + } + fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::transfer_asset()) + } + fn transfer_reserve_asset( + assets: &MultiAssets, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::transfer_reserve_asset()) + } + fn transact( + _origin_type: &OriginKind, + _require_weight_at_most: &u64, + _call: &DoubleEncoded, + ) -> XCMWeight { + XcmGeneric::::transact().ref_time() + } + fn hrmp_new_channel_open_request( + _sender: &u32, + _max_message_size: &u32, + _max_capacity: &u32, + ) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn hrmp_channel_accepted(_recipient: &u32) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> XCMWeight { + // XCM Executor does not currently support HRMP channel operations + Weight::MAX.ref_time() + } + fn clear_origin() -> XCMWeight { + XcmGeneric::::clear_origin().ref_time() + } + fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { + XcmGeneric::::descend_origin().ref_time() + } + fn report_error( + _query_id: &QueryId, + _dest: &MultiLocation, + _max_response_weight: &u64, + ) -> XCMWeight { + XcmGeneric::::report_error().ref_time() + } + + fn deposit_asset( + assets: &MultiAssetFilter, + _max_assets: &u32, + _dest: &MultiLocation, + ) -> XCMWeight { + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); + cmp::min(hardcoded_weight, weight) + } + fn deposit_reserve_asset( + assets: &MultiAssetFilter, + _max_assets: &u32, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmFungibleWeight::::deposit_reserve_asset()) + } + fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight { + Weight::MAX.ref_time() + } + fn initiate_reserve_withdraw( + assets: &MultiAssetFilter, + _reserve: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) + } + fn initiate_teleport( + assets: &MultiAssetFilter, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> XCMWeight { + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + cmp::min(hardcoded_weight, weight) + } + fn query_holding( + _query_id: &u64, + _dest: &MultiLocation, + _assets: &MultiAssetFilter, + _max_response_weight: &u64, + ) -> XCMWeight { + XcmGeneric::::query_holding().ref_time() + } + fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { + XcmGeneric::::buy_execution().ref_time() + } + fn refund_surplus() -> XCMWeight { + XcmGeneric::::refund_surplus().ref_time() + } + fn set_error_handler(_xcm: &Xcm) -> XCMWeight { + XcmGeneric::::set_error_handler().ref_time() + } + fn set_appendix(_xcm: &Xcm) -> XCMWeight { + XcmGeneric::::set_appendix().ref_time() + } + fn clear_error() -> XCMWeight { + XcmGeneric::::clear_error().ref_time() + } + fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { + XcmGeneric::::claim_asset().ref_time() + } + fn trap(_code: &u64) -> XCMWeight { + XcmGeneric::::trap().ref_time() + } + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> XCMWeight { + XcmGeneric::::subscribe_version().ref_time() + } + fn unsubscribe_version() -> XCMWeight { + XcmGeneric::::unsubscribe_version().ref_time() + } +} 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 new file mode 100644 index 0000000000..e5c63a23e4 --- /dev/null +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -0,0 +1,107 @@ +// 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 . + + +//! Autogenerated weights for `pallet_xcm_benchmarks::fungible` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 + +// Executed Command: +// /home/benchbot/cargo_target_dir/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_xcm_benchmarks::fungible +// --chain=westmint-dev +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --header=./file_header.txt +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `pallet_xcm_benchmarks::fungible`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + // Storage: System Account (r:1 w:1) + pub(crate) fn withdraw_asset() -> Weight { + Weight::from_ref_time(28_725_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:2 w:2) + pub(crate) fn transfer_asset() -> Weight { + Weight::from_ref_time(33_865_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:2 w:2) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn transfer_reserve_asset() -> Weight { + Weight::from_ref_time(48_839_000 as u64) + .saturating_add(T::DbWeight::get().reads(8 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + } + pub(crate) fn receive_teleported_asset() -> Weight { + Weight::from_ref_time(4_849_000 as u64) + } + // Storage: System Account (r:1 w:1) + pub(crate) fn deposit_asset() -> Weight { + Weight::from_ref_time(29_778_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn deposit_reserve_asset() -> Weight { + Weight::from_ref_time(45_355_000 as u64) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn initiate_teleport() -> Weight { + Weight::from_ref_time(23_451_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} 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 new file mode 100644 index 0000000000..80aff062d2 --- /dev/null +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -0,0 +1,137 @@ +// 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 . + + +//! Autogenerated weights for `pallet_xcm_benchmarks::generic` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 + +// Executed Command: +// /home/benchbot/cargo_target_dir/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_xcm_benchmarks::generic +// --chain=westmint-dev +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --header=./file_header.txt +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `pallet_xcm_benchmarks::generic`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn query_holding() -> Weight { + Weight::from_ref_time(676_316_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn buy_execution() -> Weight { + Weight::from_ref_time(7_030_000 as u64) + } + // Storage: PolkadotXcm Queries (r:1 w:0) + pub(crate) fn query_response() -> Weight { + Weight::from_ref_time(12_574_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + } + pub(crate) fn transact() -> Weight { + Weight::from_ref_time(15_764_000 as u64) + } + pub(crate) fn refund_surplus() -> Weight { + Weight::from_ref_time(7_200_000 as u64) + } + pub(crate) fn set_error_handler() -> Weight { + Weight::from_ref_time(3_310_000 as u64) + } + pub(crate) fn set_appendix() -> Weight { + Weight::from_ref_time(3_260_000 as u64) + } + pub(crate) fn clear_error() -> Weight { + Weight::from_ref_time(3_277_000 as u64) + } + pub(crate) fn descend_origin() -> Weight { + Weight::from_ref_time(3_913_000 as u64) + } + pub(crate) fn clear_origin() -> Weight { + Weight::from_ref_time(3_354_000 as u64) + } + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn report_error() -> Weight { + Weight::from_ref_time(13_028_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: PolkadotXcm AssetTraps (r:1 w:1) + pub(crate) fn claim_asset() -> Weight { + Weight::from_ref_time(7_739_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + pub(crate) fn trap() -> Weight { + Weight::from_ref_time(3_351_000 as u64) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn subscribe_version() -> Weight { + Weight::from_ref_time(16_051_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) + pub(crate) fn unsubscribe_version() -> Weight { + Weight::from_ref_time(5_477_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn initiate_reserve_withdraw() -> Weight { + Weight::from_ref_time(874_435_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index 3d5f6f9b80..a46cbfa2e5 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -14,13 +14,12 @@ // limitations under the License. use super::{ - AccountId, AssetId, Assets, Authorship, Balance, Balances, Call, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId, Assets, Authorship, Balance, Balances, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Everything, Nothing, PalletInfoAccess}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use parachains_common::{ @@ -39,13 +38,14 @@ use xcm_builder::{ IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, + WeightInfoBounds, }; use xcm_executor::{traits::JustTry, XcmExecutor}; parameter_types! { pub const WestendLocation: MultiLocation = MultiLocation::parent(); pub RelayNetwork: NetworkId = NetworkId::Westend; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const Local: MultiLocation = Here.into_location(); pub AssetsPalletLocation: MultiLocation = @@ -110,26 +110,24 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { - // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; pub XcmAssetFeesReceiver: Option = Authorship::author(); @@ -158,7 +156,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -169,7 +167,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of WND type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::WestmintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = ( UsingComponents>, cumulus_primitives_utility::TakeFirstAssetTrader< @@ -208,7 +210,7 @@ impl xcm_executor::Config for XcmConfig { } /// Local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -220,18 +222,22 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::WestmintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; @@ -242,6 +248,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index a967c85add..1bd8f7c5ec 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -1,6 +1,8 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; use frame_support::{ - assert_noop, assert_ok, traits::PalletInfo, weights::WeightToFee as WeightToFeeT, + assert_noop, assert_ok, + traits::PalletInfo, + weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AuraId}; pub use westmint_runtime::{ @@ -50,7 +52,7 @@ fn test_asset_xcm_trader() { let bought = 4_000_000_000u64; // lets calculate amount needed - let amount_needed = WeightToFee::weight_to_fee(&bought); + let amount_needed = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); let asset_multilocation = MultiLocation::new( 0, @@ -130,7 +132,7 @@ fn test_asset_xcm_trader_with_refund() { ); // lets calculate amount needed - let amount_bought = WeightToFee::weight_to_fee(&bought); + let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into(); @@ -144,7 +146,8 @@ fn test_asset_xcm_trader_with_refund() { let weight_used = bought / 2; // Make sure refurnd works. - let amount_refunded = WeightToFee::weight_to_fee(&(bought - weight_used)); + let amount_refunded = + WeightToFee::weight_to_fee(&Weight::from_ref_time(bought - weight_used)); assert_eq!( trader.refund_weight(bought - weight_used), @@ -155,7 +158,7 @@ fn test_asset_xcm_trader_with_refund() { drop(trader); // We only should have paid for half of the bought weight - let fees_paid = WeightToFee::weight_to_fee(&weight_used); + let fees_paid = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight_used)); assert_eq!( Assets::balance(1, AccountId::from(ALICE)), @@ -207,7 +210,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { ), ); - let amount_bought = WeightToFee::weight_to_fee(&bought); + let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); assert!( amount_bought < ExistentialDeposit::get(), @@ -266,7 +269,7 @@ fn test_that_buying_ed_refund_does_not_refund() { ), ); - let amount_bought = WeightToFee::weight_to_fee(&bought); + let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought)); assert!( amount_bought < ExistentialDeposit::get(), diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index f8d7453c96..c6e7005477 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -10,7 +10,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.17", default-features = false } serde = { version = "1.0.144", optional = true, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } smallvec = "1.6.1" # Substrate @@ -83,7 +83,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-alliance/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -100,8 +100,29 @@ runtime-benchmarks = [ "cumulus-pallet-xcmp-queue/runtime-benchmarks", ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-alliance/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collective/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-multisig/try-runtime", + "pallet-proxy/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] std = [ "codec/std", diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index 38853ae7e9..cc41d5c637 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -71,7 +71,7 @@ pub mod fee { // in Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: // in a parachain, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs index 34656f46e1..5cbc6f0194 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs @@ -20,7 +20,7 @@ use frame_support::{ weights::Weight, }; use pallet_alliance::{ProposalIndex, ProposalProvider}; -use sp_std::{boxed::Box, marker::PhantomData}; +use sp_std::{marker::PhantomData, prelude::*}; use xcm::latest::{Fungibility, Junction, Parent}; type AccountIdOf = ::AccountId; @@ -52,7 +52,7 @@ where T: pallet_xcm::Config + frame_system::Config + pallet_alliance::Config, [u8; 32]: From>, BalanceOf: Into, - <::Origin as OriginTrait>::AccountId: From>, + <::RuntimeOrigin as OriginTrait>::AccountId: From>, { fn on_unbalanced(amount: NegativeImbalanceOf) { let temp_account: AccountIdOf = TempAcc::get(); @@ -62,7 +62,7 @@ where >::resolve_creating(&temp_account, amount); let result = pallet_xcm::Pallet::::teleport_assets( - ::Origin::signed(temp_account.into()), + ::RuntimeOrigin::signed(temp_account.into()), Box::new(Parent.into()), Box::new( Junction::AccountId32 { network: None, id: treasury_acc.into() } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 07a5239872..868ae10d3d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -61,9 +61,11 @@ use sp_version::RuntimeVersion; use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{ConstU16, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, - weights::{ConstantMultiplier, DispatchClass, Weight}, + weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; use frame_system::{ @@ -100,7 +102,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("collectives"), impl_name: create_runtime_str!("collectives"), authoring_version: 1, - spec_version: 102, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0, @@ -152,15 +154,15 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = Version; @@ -200,7 +202,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -215,7 +217,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -232,8 +234,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -242,8 +244,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -289,25 +291,29 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => !matches!(c, Call::Balances { .. }), + ProxyType::NonTransfer => !matches!(c, RuntimeCall::Balances { .. }), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Alliance => matches!( c, - Call::AllianceMotion { .. } | - Call::Alliance { .. } | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::AllianceMotion { .. } | + RuntimeCall::Alliance { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -323,8 +329,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -338,12 +344,12 @@ impl pallet_proxy::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -359,7 +365,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -371,7 +377,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -380,7 +386,7 @@ pub const PERIOD: u32 = 6 * HOURS; pub const OFFSET: u32 = 0; impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -409,7 +415,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -424,18 +430,19 @@ impl pallet_collator_selection::Config for Runtime { type WeightInfo = weights::pallet_collator_selection::WeightInfo; } -parameter_types! { - pub const AllianceMotionDuration: BlockNumber = 5 * DAYS; +pub const ALLIANCE_MOTION_DURATION: BlockNumber = 5 * DAYS; +parameter_types! { + pub const AllianceMotionDuration: BlockNumber = ALLIANCE_MOTION_DURATION; } pub const ALLIANCE_MAX_PROPOSALS: u32 = 100; pub const ALLIANCE_MAX_MEMBERS: u32 = 100; type AllianceCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = AllianceMotionDuration; type MaxProposals = ConstU32; type MaxMembers = ConstU32; @@ -452,11 +459,14 @@ parameter_types! { // account used to temporarily deposit slashed imbalance before teleporting pub SlashedImbalanceAccId: AccountId = constants::account::SLASHED_IMBALANCE_ACC_ID.into(); pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); + // The number of blocks a member must wait between giving a retirement notice and retiring. + // Supposed to be greater than time required to `kick_member` with alliance motion. + pub const AllianceRetirementPeriod: BlockNumber = (90 * DAYS) + ALLIANCE_MOTION_DURATION; } impl pallet_alliance::Config for Runtime { - type Event = Event; - type Proposal = Call; + type RuntimeEvent = RuntimeEvent; + type Proposal = RuntimeCall; type AdminOrigin = RootOrAllianceTwoThirdsMajority; type MembershipManager = RootOrAllianceTwoThirdsMajority; type AnnouncementOrigin = RootOrAllianceTwoThirdsMajority; @@ -464,6 +474,7 @@ impl pallet_alliance::Config for Runtime { type Slashed = ToParentTreasury; type InitializeMembers = AllianceMotion; type MembershipChanged = AllianceMotion; + type RetirementPeriod = AllianceRetirementPeriod; type IdentityVerifier = (); // Don't block accounts on identity criteria type ProposalProvider = AllianceProposalProvider; type MaxProposals = ConstU32; @@ -540,9 +551,10 @@ pub type SignedExtra = ( frame_system::CheckWeight, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -550,8 +562,13 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, + Migrations, >; +// All migrations executed on runtime upgrade as a nested tuple of types implementing `OnRuntimeUpgrade`. +// Included migrations must be idempotent. +type Migrations = (pallet_alliance::migration::Migration,); + #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; @@ -688,8 +705,15 @@ impl_runtime_apis! { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::collectives-polkadot", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs index affda8a291..a1a6c309ae 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs @@ -48,14 +48,14 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (5_294_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_294_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (5_180_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_180_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs index 69a9db7d68..bd1bec8095 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs @@ -48,43 +48,43 @@ pub struct WeightInfo(PhantomData); impl frame_system::WeightInfo for WeightInfo { /// The range of component `b` is `[0, 3932160]`. fn remark(_b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (5_069_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(5_069_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn set_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((624_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(624_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `i` is `[1, 1000]`. fn kill_storage(i: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_000 - .saturating_add((530_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(Weight::from_ref_time(530_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) /// The range of component `p` is `[1, 1000]`. fn kill_prefix(p: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 2_000 - .saturating_add((1_059_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + .saturating_add(Weight::from_ref_time(1_059_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs index bfa9e3e35b..e7528d5c3d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs @@ -56,24 +56,24 @@ impl pallet_alliance::WeightInfo for WeightInfo { /// The range of component `y` is `[0, 90]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(_b: u32, _x: u32, _y: u32, p: u32, ) -> Weight { - (53_023_000 as Weight) + Weight::from_ref_time(53_023_000 as u64) // Standard Error: 2_000 - .saturating_add((132_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(132_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Alliance Members (r:2 w:0) // Storage: AllianceMotion Voting (r:1 w:1) /// The range of component `x` is `[3, 10]`. /// The range of component `y` is `[2, 90]`. fn vote(x: u32, y: u32, ) -> Weight { - (33_003_000 as Weight) + Weight::from_ref_time(33_003_000 as u64) // Standard Error: 106_000 - .saturating_add((312_000 as Weight).saturating_mul(x as Weight)) + .saturating_add(Weight::from_ref_time(312_000 as u64).saturating_mul(x as u64)) // Standard Error: 4_000 - .saturating_add((82_000 as Weight).saturating_mul(y as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(y as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Alliance Members (r:1 w:0) // Storage: AllianceMotion ProposalOf (r:1 w:1) @@ -81,11 +81,11 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Storage: AllianceMotion Voting (r:0 w:1) /// The range of component `p` is `[1, 100]`. fn veto(p: u32, ) -> Weight { - (27_289_000 as Weight) + Weight::from_ref_time(27_289_000 as u64) // Standard Error: 1_000 - .saturating_add((131_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(131_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Alliance Members (r:1 w:0) // Storage: AllianceMotion Voting (r:1 w:1) @@ -96,15 +96,15 @@ impl pallet_alliance::WeightInfo for WeightInfo { /// The range of component `y` is `[2, 90]`. /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(x: u32, y: u32, p: u32, ) -> Weight { - (31_884_000 as Weight) + Weight::from_ref_time(31_884_000 as u64) // Standard Error: 72_000 - .saturating_add((358_000 as Weight).saturating_mul(x as Weight)) + .saturating_add(Weight::from_ref_time(358_000 as u64).saturating_mul(x as u64)) // Standard Error: 3_000 - .saturating_add((109_000 as Weight).saturating_mul(y as Weight)) + .saturating_add(Weight::from_ref_time(109_000 as u64).saturating_mul(y as u64)) // Standard Error: 2_000 - .saturating_add((109_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(109_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Alliance Members (r:1 w:0) // Storage: AllianceMotion Voting (r:1 w:1) @@ -116,17 +116,17 @@ impl pallet_alliance::WeightInfo for WeightInfo { /// The range of component `y` is `[2, 90]`. /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, x: u32, y: u32, p: u32, ) -> Weight { - (43_205_000 as Weight) + Weight::from_ref_time(43_205_000 as u64) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) // Standard Error: 73_000 - .saturating_add((123_000 as Weight).saturating_mul(x as Weight)) + .saturating_add(Weight::from_ref_time(123_000 as u64).saturating_mul(x as u64)) // Standard Error: 2_000 - .saturating_add((91_000 as Weight).saturating_mul(y as Weight)) + .saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(y as u64)) // Standard Error: 2_000 - .saturating_add((114_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(114_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Alliance Members (r:1 w:0) // Storage: AllianceMotion Voting (r:1 w:1) @@ -139,15 +139,15 @@ impl pallet_alliance::WeightInfo for WeightInfo { /// The range of component `y` is `[2, 90]`. /// The range of component `p` is `[1, 100]`. fn close_disapproved(x: u32, y: u32, p: u32, ) -> Weight { - (49_769_000 as Weight) + Weight::from_ref_time(49_769_000 as u64) // Standard Error: 69_000 - .saturating_add((352_000 as Weight).saturating_mul(x as Weight)) + .saturating_add(Weight::from_ref_time(352_000 as u64).saturating_mul(x as u64)) // Standard Error: 2_000 - .saturating_add((81_000 as Weight).saturating_mul(y as Weight)) + .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(y as u64)) // Standard Error: 2_000 - .saturating_add((100_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(100_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Alliance Members (r:1 w:0) // Storage: AllianceMotion Voting (r:1 w:1) @@ -160,15 +160,15 @@ impl pallet_alliance::WeightInfo for WeightInfo { /// The range of component `y` is `[2, 90]`. /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, _x: u32, y: u32, p: u32, ) -> Weight { - (40_901_000 as Weight) + Weight::from_ref_time(40_901_000 as u64) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) // Standard Error: 2_000 - .saturating_add((79_000 as Weight).saturating_mul(y as Weight)) + .saturating_add(Weight::from_ref_time(79_000 as u64).saturating_mul(y as u64)) // Standard Error: 2_000 - .saturating_add((102_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(102_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Alliance Members (r:3 w:3) // Storage: AllianceMotion Members (r:1 w:1) @@ -176,55 +176,55 @@ impl pallet_alliance::WeightInfo for WeightInfo { /// The range of component `y` is `[0, 90]`. /// The range of component `z` is `[0, 100]`. fn init_members(_x: u32, y: u32, z: u32, ) -> Weight { - (39_647_000 as Weight) + Weight::from_ref_time(39_647_000 as u64) // Standard Error: 2_000 - .saturating_add((123_000 as Weight).saturating_mul(y as Weight)) + .saturating_add(Weight::from_ref_time(123_000 as u64).saturating_mul(y as u64)) // Standard Error: 2_000 - .saturating_add((116_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(116_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Alliance Rule (r:0 w:1) fn set_rule() -> Weight { - (14_689_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(14_689_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Alliance Announcements (r:1 w:1) fn announce() -> Weight { - (15_988_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(15_988_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Alliance Announcements (r:1 w:1) fn remove_announcement() -> Weight { - (16_823_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_823_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Alliance UnscrupulousAccounts (r:1 w:0) // Storage: Alliance Members (r:4 w:1) // Storage: System Account (r:1 w:1) // Storage: Alliance DepositOf (r:0 w:1) fn join_alliance() -> Weight { - (46_340_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(46_340_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Alliance Members (r:4 w:1) // Storage: Alliance UnscrupulousAccounts (r:1 w:0) fn nominate_ally() -> Weight { - (36_225_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(36_225_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Alliance Members (r:3 w:2) // Storage: AllianceMotion Proposals (r:1 w:0) // Storage: AllianceMotion Members (r:0 w:1) // Storage: AllianceMotion Prime (r:0 w:1) fn elevate_ally() -> Weight { - (30_236_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(30_236_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Alliance UpForKicking (r:1 w:0) // Storage: Alliance Members (r:3 w:1) @@ -234,9 +234,9 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Storage: AllianceMotion Members (r:0 w:1) // Storage: AllianceMotion Prime (r:0 w:1) fn retire() -> Weight { - (44_311_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(44_311_000 as u64) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Alliance Members (r:3 w:1) // Storage: AllianceMotion Proposals (r:1 w:0) @@ -246,34 +246,34 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Storage: AllianceMotion Prime (r:0 w:1) // Storage: Alliance UpForKicking (r:0 w:1) fn kick_member() -> Weight { - (46_112_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(46_112_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Alliance UnscrupulousAccounts (r:1 w:1) // Storage: Alliance UnscrupulousWebsites (r:1 w:1) /// The range of component `n` is `[1, 100]`. /// The range of component `l` is `[1, 255]`. fn add_unscrupulous_items(n: u32, l: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 2_000 - .saturating_add((1_300_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(Weight::from_ref_time(1_300_000 as u64).saturating_mul(n as u64)) // Standard Error: 1_000 - .saturating_add((125_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(125_000 as u64).saturating_mul(l as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Alliance UnscrupulousAccounts (r:1 w:1) // Storage: Alliance UnscrupulousWebsites (r:1 w:1) /// The range of component `n` is `[1, 100]`. /// The range of component `l` is `[1, 255]`. fn remove_unscrupulous_items(n: u32, l: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 197_000 - .saturating_add((34_156_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(Weight::from_ref_time(34_156_000 as u64).saturating_mul(n as u64)) // Standard Error: 87_000 - .saturating_add((7_042_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(7_042_000 as u64).saturating_mul(l as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs index 6d97bd946e..a7d82a458a 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs @@ -48,44 +48,44 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (39_576_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(39_576_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (30_212_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(30_212_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (19_428_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(19_428_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (22_526_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(22_526_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (38_737_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(38_737_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (35_648_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(35_648_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (17_197_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_197_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs index 9213c294ce..560a843801 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs @@ -50,21 +50,21 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - (7_128_000 as Weight) + Weight::from_ref_time(7_128_000 as u64) // Standard Error: 4_000 - .saturating_add((3_105_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(3_105_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - (7_922_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(7_922_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - (8_226_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_226_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection DesiredCandidates (r:1 w:0) @@ -74,29 +74,29 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[1, 1000]`. fn register_as_candidate(c: u32, ) -> Weight { - (56_086_000 as Weight) + Weight::from_ref_time(56_086_000 as u64) // Standard Error: 1_000 - .saturating_add((93_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(93_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[6, 1000]`. fn leave_intent(c: u32, ) -> Weight { - (58_436_000 as Weight) + Weight::from_ref_time(58_436_000 as u64) // Standard Error: 1_000 - .saturating_add((102_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(102_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:2 w:2) // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - (29_654_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(29_654_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:1000 w:1) @@ -106,13 +106,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. fn new_session(r: u32, c: u32, ) -> Weight { - (0 as Weight) + Weight::from_ref_time(0 as u64) // Standard Error: 1_911_000 - .saturating_add((9_907_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(Weight::from_ref_time(9_907_000 as u64).saturating_mul(r as u64)) // Standard Error: 1_911_000 - .saturating_add((50_916_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) + .saturating_add(Weight::from_ref_time(50_916_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs index 57cee1a56c..2c14a8c971 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs @@ -48,22 +48,22 @@ pub struct WeightInfo(PhantomData); impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_threshold_1(z: u32, ) -> Weight { - (17_905_000 as Weight) + Weight::from_ref_time(17_905_000 as u64) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { - (34_787_000 as Weight) + Weight::from_ref_time(34_787_000 as u64) // Standard Error: 0 - .saturating_add((105_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -71,38 +71,38 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (38_845_000 as Weight) + Weight::from_ref_time(38_845_000 as u64) // Standard Error: 1_000 - .saturating_add((75_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (25_600_000 as Weight) + Weight::from_ref_time(25_600_000 as u64) // Standard Error: 1_000 - .saturating_add((76_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (36_944_000 as Weight) + Weight::from_ref_time(36_944_000 as u64) // Standard Error: 1_000 - .saturating_add((95_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(95_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) @@ -110,53 +110,53 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (46_014_000 as Weight) + Weight::from_ref_time(46_014_000 as u64) // Standard Error: 1_000 - .saturating_add((126_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(Weight::from_ref_time(126_000 as u64).saturating_mul(s as u64)) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32, ) -> Weight { - (31_616_000 as Weight) + Weight::from_ref_time(31_616_000 as u64) // Standard Error: 1_000 - .saturating_add((117_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(117_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_approve(s: u32, ) -> Weight { - (20_862_000 as Weight) + Weight::from_ref_time(20_862_000 as u64) // Standard Error: 0 - .saturating_add((109_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(109_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_complete(s: u32, ) -> Weight { - (64_311_000 as Weight) + Weight::from_ref_time(64_311_000 as u64) // Standard Error: 1_000 - .saturating_add((164_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(164_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn cancel_as_multi(s: u32, ) -> Weight { - (51_181_000 as Weight) + Weight::from_ref_time(51_181_000 as u64) // Standard Error: 2_000 - .saturating_add((110_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(110_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs index cfad3df2b9..eb316a0864 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs @@ -49,10 +49,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { - (16_628_000 as Weight) + Weight::from_ref_time(16_628_000 as u64) // Standard Error: 2_000 - .saturating_add((90_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(Weight::from_ref_time(90_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -60,39 +60,39 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn proxy_announced(a: u32, p: u32, ) -> Weight { - (33_846_000 as Weight) + Weight::from_ref_time(33_846_000 as u64) // Standard Error: 2_000 - .saturating_add((175_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(175_000 as u64).saturating_mul(a as u64)) // Standard Error: 3_000 - .saturating_add((88_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn remove_announcement(a: u32, p: u32, ) -> Weight { - (23_633_000 as Weight) + Weight::from_ref_time(23_633_000 as u64) // Standard Error: 2_000 - .saturating_add((184_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(184_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((29_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(29_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn reject_announcement(a: u32, p: u32, ) -> Weight { - (24_121_000 as Weight) + Weight::from_ref_time(24_121_000 as u64) // Standard Error: 2_000 - .saturating_add((177_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(177_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((15_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(15_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) @@ -100,58 +100,58 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. fn announce(a: u32, p: u32, ) -> Weight { - (31_509_000 as Weight) + Weight::from_ref_time(31_509_000 as u64) // Standard Error: 2_000 - .saturating_add((172_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(Weight::from_ref_time(172_000 as u64).saturating_mul(a as u64)) // Standard Error: 2_000 - .saturating_add((86_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(86_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { - (26_168_000 as Weight) + Weight::from_ref_time(26_168_000 as u64) // Standard Error: 4_000 - .saturating_add((127_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(127_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { - (26_306_000 as Weight) + Weight::from_ref_time(26_306_000 as u64) // Standard Error: 2_000 - .saturating_add((131_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(131_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { - (22_287_000 as Weight) + Weight::from_ref_time(22_287_000 as u64) // Standard Error: 3_000 - .saturating_add((85_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(85_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[1, 31]`. fn anonymous(p: u32, ) -> Weight { - (29_260_000 as Weight) + Weight::from_ref_time(29_260_000 as u64) // Standard Error: 2_000 - .saturating_add((38_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(38_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) /// The range of component `p` is `[0, 30]`. fn kill_anonymous(p: u32, ) -> Weight { - (23_012_000 as Weight) + Weight::from_ref_time(23_012_000 as u64) // Standard Error: 2_000 - .saturating_add((97_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(97_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs index 14b53f1e6e..9d8a97c13d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs @@ -49,15 +49,15 @@ impl pallet_session::WeightInfo for WeightInfo { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:1 w:1) fn set_keys() -> Weight { - (15_802_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(15_802_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:1) fn purge_keys() -> Weight { - (12_925_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(12_925_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs index 08a237a62c..ec3ef62a08 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs @@ -48,11 +48,11 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) fn set() -> Weight { - (6_170_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_170_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn on_finalize() -> Weight { - (2_177_000 as Weight) + Weight::from_ref_time(2_177_000 as u64) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs index 3cf818490b..3d1301e838 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs @@ -48,26 +48,26 @@ pub struct WeightInfo(PhantomData); impl pallet_utility::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn batch(c: u32, ) -> Weight { - (13_398_000 as Weight) + Weight::from_ref_time(13_398_000 as u64) // Standard Error: 2_000 - .saturating_add((3_159_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_159_000 as u64).saturating_mul(c as u64)) } fn as_derivative() -> Weight { - (4_668_000 as Weight) + Weight::from_ref_time(4_668_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn batch_all(c: u32, ) -> Weight { - (10_742_000 as Weight) + Weight::from_ref_time(10_742_000 as u64) // Standard Error: 2_000 - .saturating_add((3_375_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_375_000 as u64).saturating_mul(c as u64)) } fn dispatch_as() -> Weight { - (11_022_000 as Weight) + Weight::from_ref_time(11_022_000 as u64) } /// The range of component `c` is `[0, 1000]`. fn force_batch(c: u32, ) -> Weight { - (14_280_000 as Weight) + Weight::from_ref_time(14_280_000 as u64) // Standard Error: 2_000 - .saturating_add((3_150_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(3_150_000 as u64).saturating_mul(c as u64)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index fd6a29476f..e3e4e93d5d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -14,18 +14,17 @@ // limitations under the License. use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Everything, Nothing}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use parachains_common::{ impls::ToStakingPot, - xcm_config::{DenyReserveTransferToRelayChain, DenyThenTry}, + xcm_config::{ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry}, }; use polkadot_parachain::primitives::Sibling; use xcm::latest::prelude::*; @@ -42,7 +41,7 @@ use xcm_executor::XcmExecutor; parameter_types! { pub const DotLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = Here.into_location(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); @@ -81,26 +80,26 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -134,17 +133,18 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; // Collectives does not recognize a reserve location for any asset. Users must teleport DOT // where allowed (e.g. with the Relay Chain). type IsReserve = (); - type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of DOT + /// Only allow teleportation of DOT. + type IsTeleporter = ConcreteNativeAssetFrom; type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -163,7 +163,7 @@ impl xcm_executor::Config for XcmConfig { /// Converts a local signed origin into an XCM multilocation. /// Forms the basis for local origins sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -175,21 +175,21 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // ... but disallow generic XCM execution. As a result only teleports are allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; @@ -200,6 +200,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/parachains/runtimes/contracts/contracts-rococo/Cargo.toml b/parachains/runtimes/contracts/contracts-rococo/Cargo.toml index 513d31f331..5c277c2b0e 100644 --- a/parachains/runtimes/contracts/contracts-rococo/Cargo.toml +++ b/parachains/runtimes/contracts/contracts-rococo/Cargo.toml @@ -14,7 +14,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } smallvec = "1.9.0" @@ -147,7 +147,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", @@ -162,6 +162,26 @@ runtime-benchmarks = [ ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-contracts/try-runtime", + "pallet-multisig/try-runtime", + "pallet-randomness-collective-flip/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] diff --git a/parachains/runtimes/contracts/contracts-rococo/src/constants.rs b/parachains/runtimes/contracts/contracts-rococo/src/constants.rs index fabc09d017..6dccf0089c 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/constants.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { // in Kusama, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: // in Statemine, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, diff --git a/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs b/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs index 47d8369d80..db59f92527 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs @@ -1,14 +1,13 @@ use crate::{ - constants::currency::deposit, Balance, Balances, Call, Event, RandomnessCollectiveFlip, - Runtime, RuntimeBlockWeights, Timestamp, + constants::currency::deposit, Balance, Balances, RandomnessCollectiveFlip, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, Timestamp, }; use frame_support::{ parameter_types, - traits::{ConstU32, Nothing, OnRuntimeUpgrade}, + traits::{ConstU32, Nothing}, weights::Weight, }; use pallet_contracts::{ - migration, weights::{SubstrateWeight, WeightInfo}, Config, DefaultAddressGenerator, DefaultContractAccessWeight, Frame, Schedule, }; @@ -26,9 +25,9 @@ parameter_types! { RuntimeBlockWeights::get().max_block; // The weight needed for decoding the queue should be less or equal than a fifth // of the overall weight dedicated to the lazy deletion. - pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / ( - ::WeightInfo::on_initialize_per_queue_item(1) - - ::WeightInfo::on_initialize_per_queue_item(0) + pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get().ref_time() / ( + ::WeightInfo::on_initialize_per_queue_item(1).ref_time() - + ::WeightInfo::on_initialize_per_queue_item(0).ref_time() )) / 5) as u32; pub MySchedule: Schedule = Default::default(); } @@ -37,8 +36,8 @@ impl Config for Runtime { type Time = Timestamp; type Randomness = RandomnessCollectiveFlip; type Currency = Balances; - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; /// The safest default is to allow no calls at all. /// /// Runtimes should whitelist dispatchables that are allowed to be called from contracts @@ -58,13 +57,5 @@ impl Config for Runtime { type AddressGenerator = DefaultAddressGenerator; type ContractAccessWeight = DefaultContractAccessWeight; type MaxCodeLen = ConstU32<{ 128 * 1024 }>; - type RelaxedMaxCodeLen = ConstU32<{ 256 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; } - -pub struct Migrations; -impl OnRuntimeUpgrade for Migrations { - fn on_runtime_upgrade() -> Weight { - migration::migrate::() - } -} diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 7b9ae48d50..1769c20dc8 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -47,9 +47,11 @@ use sp_version::RuntimeVersion; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Everything}, - weights::{ConstantMultiplier, DispatchClass}, + weights::{ConstantMultiplier, Weight}, PalletId, }; use frame_system::limits::{BlockLength, BlockWeights}; @@ -64,9 +66,6 @@ use xcm_config::CollatorSelectionUpdateOrigin; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -#[cfg(feature = "try-runtime")] -use frame_support::weights::Weight; - // Polkadot imports use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; @@ -92,9 +91,10 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -102,7 +102,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - contracts::Migrations, + pallet_contracts::Migration, >; impl_opaque_keys! { @@ -116,7 +116,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("contracts-rococo"), impl_name: create_runtime_str!("contracts-rococo"), authoring_version: 1, - spec_version: 9230, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -159,15 +159,15 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = Version; @@ -201,7 +201,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128; type AccountStore = System; @@ -211,7 +211,7 @@ impl pallet_balances::Config for Runtime { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -229,8 +229,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -239,21 +239,26 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = pallet_utility::weights::SubstrateWeight; } +parameter_types! { + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); +} + impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ConstU64<{ MAXIMUM_BLOCK_WEIGHT / 4 }>; + type ReservedDmpWeight = ReservedDmpWeight; type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ConstU64<{ MAXIMUM_BLOCK_WEIGHT / 4 }>; + type ReservedXcmpWeight = ReservedXcmpWeight; type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; } @@ -269,7 +274,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -293,7 +298,7 @@ parameter_types! { } impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -309,8 +314,8 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -477,17 +482,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -515,7 +520,7 @@ impl pallet_contracts_rpc_runtime_api::ContractsApi Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::contracts", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs b/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs b/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs b/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs b/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index 8b30214daf..a2bd6284f5 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -14,13 +14,12 @@ // limitations under the License. use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, traits::{ConstU32, EitherOfDiverse, Everything, Nothing}, - weights::Weight, }; use frame_system::EnsureRoot; use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; @@ -40,7 +39,7 @@ use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: Option = None; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const Local: MultiLocation = Here.into_location(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); @@ -86,26 +85,26 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; } @@ -136,7 +135,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -144,7 +143,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; @@ -162,7 +161,7 @@ impl xcm_executor::Config for XcmConfig { /// Converts a local signed origin into an XCM multilocation. /// Forms the basis for local origins sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -174,21 +173,21 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; @@ -199,12 +198,12 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -219,7 +218,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } diff --git a/parachains/runtimes/starters/seedling/Cargo.toml b/parachains/runtimes/starters/seedling/Cargo.toml index 430ef29a1f..952294f8c3 100644 --- a/parachains/runtimes/starters/seedling/Cargo.toml +++ b/parachains/runtimes/starters/seedling/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } -scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } # Substrate diff --git a/parachains/runtimes/starters/seedling/src/lib.rs b/parachains/runtimes/starters/seedling/src/lib.rs index 3ba5fb8f75..d35d96f674 100644 --- a/parachains/runtimes/starters/seedling/src/lib.rs +++ b/parachains/runtimes/starters/seedling/src/lib.rs @@ -43,11 +43,13 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{IsInVec, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, IdentityFee, Weight, + IdentityFee, Weight, }, StorageValue, }; @@ -63,7 +65,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("seedling"), impl_name: create_runtime_str!("seedling"), authoring_version: 1, - spec_version: 9230, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -83,7 +85,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for .5 seconds of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); parameter_types! { pub const BlockHashCount: BlockNumber = 250; @@ -114,7 +116,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -128,9 +130,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -151,16 +153,16 @@ impl frame_system::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_solo_to_para::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = cumulus_pallet_solo_to_para::Pallet; type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = (); @@ -216,9 +218,10 @@ pub type SignedExtra = ( cumulus_pallet_solo_to_para::CheckSudo, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/parachains/runtimes/starters/shell/Cargo.toml b/parachains/runtimes/starters/shell/Cargo.toml index 6a351cb5c2..87ebd609ea 100644 --- a/parachains/runtimes/starters/shell/Cargo.toml +++ b/parachains/runtimes/starters/shell/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } # Substrate diff --git a/parachains/runtimes/starters/shell/src/lib.rs b/parachains/runtimes/starters/shell/src/lib.rs index 05570ed83d..f75a734c94 100644 --- a/parachains/runtimes/starters/shell/src/lib.rs +++ b/parachains/runtimes/starters/shell/src/lib.rs @@ -50,11 +50,13 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::{Everything, IsInVec, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, IdentityFee, Weight, + IdentityFee, Weight, }, StorageValue, }; @@ -90,7 +92,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for .5 seconds of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); parameter_types! { pub const BlockHashCount: BlockNumber = 250; @@ -122,7 +124,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -136,9 +138,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -160,11 +162,11 @@ impl frame_system::Config for Runtime { parameter_types! { // We do anything the parent chain tells us in this runtime. - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 2; + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(2); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = (); @@ -200,7 +202,7 @@ pub struct DisallowSigned; impl sp_runtime::traits::SignedExtension for DisallowSigned { const IDENTIFIER: &'static str = "DisallowSigned"; type AccountId = AccountId; - type Call = Call; + type Call = RuntimeCall; type AdditionalSigned = (); type Pre = (); fn additional_signed( @@ -248,9 +250,10 @@ pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = DisallowSigned; /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/parachains/runtimes/starters/shell/src/xcm_config.rs b/parachains/runtimes/starters/shell/src/xcm_config.rs index af846f7181..51f774f6d6 100644 --- a/parachains/runtimes/starters/shell/src/xcm_config.rs +++ b/parachains/runtimes/starters/shell/src/xcm_config.rs @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{AccountId, Call, Event, Origin, ParachainInfo, Runtime}; -use frame_support::{match_types, parameter_types, traits::Nothing, weights::Weight}; +use super::{AccountId, ParachainInfo, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin}; +use frame_support::{match_types, parameter_types, traits::Nothing}; use xcm::latest::prelude::*; use xcm_builder::{ AllowUnpaidExecutionFrom, FixedWeightBounds, ParentAsSuperuser, ParentIsPreset, @@ -34,10 +34,10 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, Origin>, + SovereignSignedViaLocation, RuntimeOrigin>, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, ); match_types! { @@ -46,14 +46,14 @@ match_types! { parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = (); // sending XCM not supported type AssetTransactor = (); // balances not supported type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -61,7 +61,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); // balances not supported type UniversalLocation = UniversalLocation; type Barrier = AllowUnpaidExecutionFrom; - type Weigher = FixedWeightBounds; // balances not supported + type Weigher = FixedWeightBounds; // balances not supported type Trader = (); // balances not supported type ResponseHandler = (); // Don't handle responses for now. type AssetTrap = (); // don't trap for now @@ -78,6 +78,6 @@ impl xcm_executor::Config for XcmConfig { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = xcm_executor::XcmExecutor; } diff --git a/parachains/runtimes/testing/penpal/Cargo.toml b/parachains/runtimes/testing/penpal/Cargo.toml index 168de41700..b38addb9b3 100644 --- a/parachains/runtimes/testing/penpal/Cargo.toml +++ b/parachains/runtimes/testing/penpal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "penpal-runtime" -version = "0.1.0" +version = "0.9.27" authors = ["Anonymous"] description = "A parachain for communication back and forth with XCM of assets and uniques." license = "Unlicense" @@ -18,7 +18,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.3.4", optional = true } log = { version = "0.4.16", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } smallvec = "1.9.0" @@ -134,7 +134,7 @@ runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", @@ -147,6 +147,24 @@ runtime-benchmarks = [ ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", + "frame-system/try-runtime", "frame-try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-assets/try-runtime", + "pallet-asset-tx-payment/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index 4842cc6a75..f848b32ece 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -32,11 +32,13 @@ pub mod xcm_config; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::Everything, weights::{ - constants::WEIGHT_PER_SECOND, ConstantMultiplier, DispatchClass, Weight, - WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, + constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, }, PalletId, }; @@ -117,10 +119,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -148,7 +151,7 @@ impl WeightToFeePolynomial for WeightToFee { // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT: // in our template, we map to 1/10 of that, or 1/10 MILLIUNIT let p = MILLIUNIT / 10; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, @@ -186,7 +189,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("penpal-parachain"), impl_name: create_runtime_str!("penpal-parachain"), authoring_version: 1, - spec_version: 1, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -227,7 +230,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 0.5 of a second of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] @@ -271,7 +274,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -285,9 +288,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -351,7 +354,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -367,7 +370,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; @@ -389,7 +392,7 @@ parameter_types! { // EnsureOneOf, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -406,12 +409,12 @@ impl pallet_assets::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -427,7 +430,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -439,7 +442,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -451,7 +454,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -483,7 +486,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -499,7 +502,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -508,8 +511,8 @@ impl pallet_asset_tx_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -669,17 +672,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -695,13 +698,20 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { - log::info!("try-runtime::on_runtime_upgrade parachain-template."); + log::info!("try-runtime::on_runtime_upgrade penpal."); let weight = Executive::try_runtime_upgrade().unwrap(); (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::penpal", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } diff --git a/parachains/runtimes/testing/penpal/src/weights/block_weights.rs b/parachains/runtimes/testing/penpal/src/weights/block_weights.rs index 4db90f0c02..c004307336 100644 --- a/parachains/runtimes/testing/penpal/src/weights/block_weights.rs +++ b/parachains/runtimes/testing/penpal/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs b/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs index 158ba99c6a..3ce6b73d58 100644 --- a/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs b/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs index 843823c1bf..dca7d34831 100644 --- a/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights /// are available for brave runtime engineers who may want to try this out as default. pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs b/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs index 05e06b0eab..87867ebfe1 100644 --- a/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout /// the runtime. pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index 31b5cc7848..6d96e59d3b 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -22,8 +22,9 @@ //! with statemine as the reserve. At present no derivative tokens are minted on receipt of a //! ReserveAssetTransferDeposited message but that will but the intension will be to support this soon. use super::{ - AccountId, AssetId as AssetIdPalletAssets, Assets, Balance, Balances, Call, Event, Origin, - ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId as AssetIdPalletAssets, Assets, Balance, Balances, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, + XcmpQueue, }; use core::marker::PhantomData; use frame_support::{ @@ -32,14 +33,13 @@ use frame_support::{ fungibles::{self, Balanced, CreditOf}, ConstU32, Contains, ContainsPair, Everything, Get, Nothing, }, - weights::Weight, }; use pallet_asset_tx_payment::HandleCredit; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use sp_runtime::traits::Zero; -use xcm::latest::prelude::*; +use xcm::latest::{prelude::*, Weight as XCMWeight}; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, @@ -56,7 +56,7 @@ use xcm_executor::{ parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: Option = None; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); } @@ -118,23 +118,23 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -162,11 +162,11 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, message: &mut [Instruction], - max_weight: Weight, - weight_credit: &mut Weight, + max_weight: XCMWeight, + weight_credit: &mut XCMWeight, ) -> Result<(), ()> { Deny::should_execute(origin, message, max_weight, weight_credit)?; Allow::should_execute(origin, message, max_weight, weight_credit) @@ -176,11 +176,11 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, message: &mut [Instruction], - _max_weight: Weight, - _weight_credit: &mut Weight, + _max_weight: XCMWeight, + _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { if message.iter().any(|inst| { matches!( @@ -321,7 +321,7 @@ pub type Reserves = (NativeAsset, AssetsFrom); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -330,7 +330,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -348,7 +348,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -360,20 +360,20 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default @@ -386,6 +386,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/parachains/runtimes/testing/rococo-parachain/Cargo.toml b/parachains/runtimes/testing/rococo-parachain/Cargo.toml index 2904940f34..ad77957c46 100644 --- a/parachains/runtimes/testing/rococo-parachain/Cargo.toml +++ b/parachains/runtimes/testing/rococo-parachain/Cargo.toml @@ -8,7 +8,7 @@ description = "Simple runtime used by the rococo parachain(s)" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } # Substrate diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 94948ddc5c..7e81edaec3 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -39,11 +39,13 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, match_types, parameter_types, + construct_runtime, + dispatch::DispatchClass, + match_types, parameter_types, traits::{EitherOfDiverse, Everything, IsInVec, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - ConstantMultiplier, DispatchClass, IdentityFee, Weight, + ConstantMultiplier, IdentityFee, Weight, }, StorageValue, }; @@ -95,7 +97,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("test-parachain"), impl_name: create_runtime_str!("test-parachain"), authoring_version: 1, - spec_version: 9230, + spec_version: 9290, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -133,7 +135,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for .5 seconds of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); parameter_types! { pub const BlockHashCount: BlockNumber = 250; @@ -165,7 +167,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -179,9 +181,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -226,7 +228,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -241,7 +243,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; @@ -250,17 +252,17 @@ impl pallet_transaction_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -278,7 +280,7 @@ impl cumulus_pallet_aura_ext::Config for Runtime {} parameter_types! { pub const RocLocation: MultiLocation = MultiLocation::parent(); pub const RococoNetwork: NetworkId = NetworkId::Polkadot; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); } @@ -340,26 +342,26 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; // One ROC buys 1 second of weight. pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), ROC); pub const MaxInstructions: u32 = 100; @@ -400,7 +402,7 @@ pub type Reserves = (NativeAsset, AssetsFrom); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -409,7 +411,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of ROC type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents, RocLocation, AccountId, Balances, ()>; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; @@ -426,7 +428,7 @@ impl xcm_executor::Config for XcmConfig { } /// Local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -438,18 +440,18 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; @@ -460,12 +462,12 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = (); @@ -477,15 +479,15 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } impl cumulus_ping::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; } @@ -505,7 +507,7 @@ pub type AdminOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = u64; type AssetId = AssetId; type Currency = Balances; @@ -589,9 +591,10 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -713,17 +716,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index 9822b10224..2febe33aea 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -8,9 +8,9 @@ description = "Runs a polkadot parachain node which could be a collator." [dependencies] async-trait = "0.1.57" -clap = { version = "3.2.17", features = ["derive", "deprecated"] } +clap = { version = "3.2.22", features = ["derive", "deprecated"] } codec = { package = "parity-scale-codec", version = "3.0.0" } -futures = "0.3.23" +futures = "0.3.24" hex-literal = "0.3.4" log = "0.4.17" serde = { version = "1.0.144", features = ["derive"] } @@ -94,7 +94,7 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate" assert_cmd = "2.0" nix = "0.25" tempfile = "3.3.0" -tokio = { version = "1.19.2", features = ["macros", "time", "parking_lot"] } +tokio = { version = "1.21.1", features = ["macros", "time", "parking_lot"] } wait-timeout = "0.2" # purge_chain_works works with rococo-local and needs to allow this polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master", features = ["rococo-native"] } diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index 18050c037b..0c3fbe6702 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -572,6 +572,15 @@ pub fn run() -> Result<()> { BenchmarkCmd::Block(cmd) => runner.sync_run(|config| { construct_benchmark_partials!(config, |partials| cmd.run(partials.client)) }), + #[cfg(not(feature = "runtime-benchmarks"))] + BenchmarkCmd::Storage(_) => + return Err(sc_cli::Error::Input( + "Compile with --features=runtime-benchmarks \ + to enable storage benchmarks." + .into(), + ) + .into()), + #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| { construct_benchmark_partials!(config, |partials| { let db = partials.backend.expose_db(); @@ -781,7 +790,7 @@ impl CliConfiguration for RelayChainCli { fn base_path(&self) -> Result> { Ok(self .shared_params() - .base_path() + .base_path()? .or_else(|| self.base_path.clone().map(Into::into))) } diff --git a/polkadot-parachain/src/service.rs b/polkadot-parachain/src/service.rs index ae03e400b0..2bdeed82b1 100644 --- a/polkadot-parachain/src/service.rs +++ b/polkadot-parachain/src/service.rs @@ -710,7 +710,6 @@ pub fn rococo_parachain_build_import_queue( _, _, _, - _, >(cumulus_client_consensus_aura::ImportQueueParams { block_import: client.clone(), client, @@ -726,7 +725,6 @@ pub fn rococo_parachain_build_import_queue( Ok((timestamp, slot)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::AlwaysCanAuthor, spawner: &task_manager.spawn_essential_handle(), telemetry, }) @@ -1086,26 +1084,23 @@ where let aura_verifier = move || { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client2).unwrap(); - Box::new( - cumulus_client_consensus_aura::build_verifier::<::Pair, _, _, _>( - cumulus_client_consensus_aura::BuildVerifierParams { - client: client2.clone(), - create_inherent_data_providers: move |_, _| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + Box::new(cumulus_client_consensus_aura::build_verifier::<::Pair, _, _>( + cumulus_client_consensus_aura::BuildVerifierParams { + client: client2.clone(), + create_inherent_data_providers: move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); - Ok((timestamp, slot)) - }, - can_author_with: sp_consensus::AlwaysCanAuthor, - telemetry: telemetry_handle, + Ok((timestamp, slot)) }, - ), - ) as Box<_> + telemetry: telemetry_handle, + }, + )) as Box<_> }; let relay_chain_verifier = @@ -1530,7 +1525,6 @@ pub fn contracts_rococo_build_import_queue( _, _, _, - _, >(cumulus_client_consensus_aura::ImportQueueParams { block_import: client.clone(), client, @@ -1546,7 +1540,6 @@ pub fn contracts_rococo_build_import_queue( Ok((timestamp, slot)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::AlwaysCanAuthor, spawner: &task_manager.spawn_essential_handle(), telemetry, }) diff --git a/polkadot-parachain/tests/benchmark_storage_works.rs b/polkadot-parachain/tests/benchmark_storage_works.rs index df3c7fe919..916d65c0a1 100644 --- a/polkadot-parachain/tests/benchmark_storage_works.rs +++ b/polkadot-parachain/tests/benchmark_storage_works.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "runtime-benchmarks")] + use assert_cmd::cargo::cargo_bin; use std::{ path::Path, diff --git a/polkadot-parachain/tests/common.rs b/polkadot-parachain/tests/common.rs index 7b9dffae38..1d3d710c83 100644 --- a/polkadot-parachain/tests/common.rs +++ b/polkadot-parachain/tests/common.rs @@ -117,6 +117,7 @@ pub fn find_ws_url_from_output(read: impl Read + Send) -> (String, String) { line.expect("failed to obtain next line from stdout for WS address discovery"); data.push_str(&line); + data.push_str("\n"); // does the line contain our port (we expect this specific output from substrate). let sock_addr = match line.split_once("Running JSON-RPC WS server: addr=") { @@ -126,7 +127,10 @@ pub fn find_ws_url_from_output(read: impl Read + Send) -> (String, String) { Some(format!("ws://{}", sock_addr)) }) - .expect("We should get a WebSocket address"); + .unwrap_or_else(|| { + eprintln!("Output:\n{}", data); + panic!("We should get a WebSocket address") + }); (ws_url, data) } diff --git a/polkadot-parachain/tests/purge_chain_works.rs b/polkadot-parachain/tests/purge_chain_works.rs index acde3faa50..34a51dcff8 100644 --- a/polkadot-parachain/tests/purge_chain_works.rs +++ b/polkadot-parachain/tests/purge_chain_works.rs @@ -28,8 +28,9 @@ async fn purge_chain_works() { // Check that both databases are deleted let base_dir = tempdir().expect("could not create a temp dir"); + let base_dir_path = format!("{}/polkadot", base_dir.path().display()); - let args = &["--", "--dev"]; + let args = &["--", "--dev", "-d", &base_dir_path]; common::run_node_for_a_while(base_dir.path(), args, SIGINT).await; diff --git a/primitives/parachain-inherent/Cargo.toml b/primitives/parachain-inherent/Cargo.toml index e3fc81dec0..ebe971a116 100644 --- a/primitives/parachain-inherent/Cargo.toml +++ b/primitives/parachain-inherent/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } tracing = { version = "0.1.36", optional = true } # Substrate diff --git a/primitives/parachain-inherent/src/mock.rs b/primitives/parachain-inherent/src/mock.rs index e69b0a8091..e4ca16414c 100644 --- a/primitives/parachain-inherent/src/mock.rs +++ b/primitives/parachain-inherent/src/mock.rs @@ -42,7 +42,7 @@ use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; /// in addition to the messages themselves, you must provide some information about /// your parachain's configuration in order to mock the MQC heads properly. /// See [`MockXcmConfig`] for more information -pub struct MockValidationDataInherentDataProvider { +pub struct MockValidationDataInherentDataProvider { /// The current block number of the local block chain (the parachain) pub current_para_block: u32, /// The relay block in which this parachain appeared to start. This will be the relay block @@ -51,6 +51,11 @@ pub struct MockValidationDataInherentDataProvider { /// The number of relay blocks that elapses between each parablock. Probably set this to 1 or 2 /// to simulate optimistic or realistic relay chain behavior. pub relay_blocks_per_para_block: u32, + /// Number of parachain blocks per relay chain epoch + /// Mock epoch is computed by dividing `current_para_block` by this value. + pub para_blocks_per_relay_epoch: u32, + /// Function to mock BABE one epoch ago randomness + pub relay_randomness_config: R, /// XCM messages and associated configuration information. pub xcm_config: MockXcmConfig, /// Inbound downward XCM messages to be injected into the block. @@ -59,6 +64,20 @@ pub struct MockValidationDataInherentDataProvider { pub raw_horizontal_messages: Vec<(ParaId, Vec)>, } +pub trait GenerateRandomness { + fn generate_randomness(&self, input: I) -> relay_chain::Hash; +} + +impl GenerateRandomness for () { + /// Default implementation uses relay epoch as randomness value + /// A more seemingly random implementation may hash the relay epoch instead + fn generate_randomness(&self, input: u64) -> relay_chain::Hash { + let mut mock_randomness: [u8; 32] = [0u8; 32]; + mock_randomness[..8].copy_from_slice(&input.to_be_bytes()); + mock_randomness.into() + } +} + /// Parameters for how the Mock inherent data provider should inject XCM messages. /// In addition to the messages themselves, some information about the parachain's /// configuration is also required so that the MQC heads can be read out of the @@ -130,7 +149,9 @@ impl MockXcmConfig { } #[async_trait::async_trait] -impl InherentDataProvider for MockValidationDataInherentDataProvider { +impl> InherentDataProvider + for MockValidationDataInherentDataProvider +{ fn provide_inherent_data( &self, inherent_data: &mut InherentData, @@ -178,6 +199,17 @@ impl InherentDataProvider for MockValidationDataInherentDataProvider { sproof_builder.upsert_inbound_channel(*para_id).mqc_head = Some(channel_mqc.head()); } + // Epoch is set equal to current para block / blocks per epoch + sproof_builder.current_epoch = if self.para_blocks_per_relay_epoch == 0 { + // do not divide by 0 => set epoch to para block number + self.current_para_block.into() + } else { + (self.current_para_block / self.para_blocks_per_relay_epoch).into() + }; + // Randomness is set by randomness generator + sproof_builder.randomness = + self.relay_randomness_config.generate_randomness(self.current_para_block.into()); + let (relay_parent_storage_root, proof) = sproof_builder.into_state_root_and_proof(); inherent_data.put_data( diff --git a/primitives/timestamp/Cargo.toml b/primitives/timestamp/Cargo.toml index 23d0f5a7db..8841402988 100644 --- a/primitives/timestamp/Cargo.toml +++ b/primitives/timestamp/Cargo.toml @@ -7,7 +7,7 @@ description = "Provides timestamp related functionality for parachains." [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } -futures = "0.3.23" +futures = "0.3.24" # Substrate sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/primitives/utility/src/lib.rs b/primitives/utility/src/lib.rs index 2c19674bc7..1e93aa7d79 100644 --- a/primitives/utility/src/lib.rs +++ b/primitives/utility/src/lib.rs @@ -31,7 +31,10 @@ use frame_support::{ use polkadot_runtime_common::xcm_sender::ConstantPrice; use sp_runtime::{traits::Saturating, SaturatedConversion}; use sp_std::{marker::PhantomData, prelude::*}; -use xcm::{latest::prelude::*, WrapVersion}; +use xcm::{ + latest::{prelude::*, Weight as XCMWeight}, + WrapVersion, +}; use xcm_builder::TakeRevenue; use xcm_executor::traits::{MatchesFungibles, TransactAsset, WeightTrader}; @@ -147,7 +150,7 @@ impl< // If everything goes well, we charge. fn buy_weight( &mut self, - weight: Weight, + weight: XCMWeight, payment: xcm_executor::Assets, ) -> Result { log::trace!(target: "xcm::weight", "TakeFirstAssetTrader::buy_weight weight: {:?}, payment: {:?}", weight, payment); @@ -157,6 +160,8 @@ impl< return Err(XcmError::NotWithdrawable) } + let weight = Weight::from_ref_time(weight); + // We take the very first multiasset from payment let multiassets: MultiAssets = payment.clone().into(); @@ -197,14 +202,14 @@ impl< Ok(unused) } - fn refund_weight(&mut self, weight: Weight) -> Option { + fn refund_weight(&mut self, weight: XCMWeight) -> Option { log::trace!(target: "xcm::weight", "TakeFirstAssetTrader::refund_weight weight: {:?}", weight); if let Some(AssetTraderRefunder { mut weight_outstanding, outstanding_concrete_asset: MultiAsset { id, fun }, }) = self.0.clone() { - let weight = weight.min(weight_outstanding); + let weight = Weight::from_ref_time(weight).min(weight_outstanding); // Get the local asset id in which we can refund fees let (local_asset_id, outstanding_balance) = diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index ff87c643a0..6ac63e9ab3 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -22,6 +22,8 @@ if [[ $runtimeName == "statemint" ]] || [[ $runtimeName == "statemine" ]] || [[ pallet_uniques cumulus_pallet_xcmp_queue frame_system + pallet_xcm_benchmarks::generic + pallet_xcm_benchmarks::fungible ) elif [[ $runtimeName == "collectives-polkadot" ]]; then pallets=( @@ -44,6 +46,11 @@ fi for pallet in ${pallets[@]} do + # a little hack for xcm benchmarks + output_file="${pallet//::/_}" + if [[ "$pallet" == *"xcm"* ]]; then + output_file="xcm/$output_file" + fi $artifactsDir/polkadot-parachain benchmark pallet \ --chain=$benchmarkRuntimeName \ --execution=wasm \ @@ -53,7 +60,6 @@ do --steps=$steps \ --repeat=$repeat \ --json \ - --header=./file_header.txt \ - --output=$benchmarkOutput >> $artifactsDir/${pallet}_benchmark.json - + --header=./file_header.txt \ + --output="${benchmarkOutput}/${output_file}.rs" >> $artifactsDir/${pallet}_benchmark.json done diff --git a/scripts/ci/changelog/bin/changelog b/scripts/ci/changelog/bin/changelog index 97d10dff94..1f3de939d0 100755 --- a/scripts/ci/changelog/bin/changelog +++ b/scripts/ci/changelog/bin/changelog @@ -76,7 +76,7 @@ else logger.debug("Re-using:#{substrate_data}") end -POLKADOT_COLLECTIVES_DIGEST = ENV['SHELL_DIGEST'] || 'digests/polkadot-collectives-srtool-digest.json' +POLKADOT_COLLECTIVES_DIGEST = ENV['COLLECTIVES_POLKADOT_DIGEST'] || 'digests/polkadot-collectives-srtool-digest.json' SHELL_DIGEST = ENV['SHELL_DIGEST'] || 'digests/shell-srtool-digest.json' WESTMINT_DIGEST = ENV['WESTMINT_DIGEST'] || 'digests/westmint-srtool-digest.json' STATEMINE_DIGEST = ENV['STATEMINE_DIGEST'] || 'digests/statemine-srtool-digest.json' @@ -124,8 +124,8 @@ else { name: "statemine", data: $srtool_statemine[0] }, { name: "statemint", data: $srtool_statemint[0] }, { name: "rococo", data: $srtool_rococo_parachain[0] }, - { name: "contracts", data: $srtool_contracts_rococo[0] } - { name: "polkadot-collectives", data: $srtool_polkadot_collectives[0] }, + { name: "contracts", data: $srtool_contracts_rococo[0] }, + { name: "polkadot-collectives", data: $srtool_polkadot_collectives[0] } ] }\' > context.json', cumulus_data, substrate_data, diff --git a/templates/xcm-bench-template.hbs b/templates/xcm-bench-template.hbs new file mode 100644 index 0000000000..3c9deb4460 --- /dev/null +++ b/templates/xcm-bench-template.hbs @@ -0,0 +1,68 @@ +// 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 . + + +//! 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}}` +//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` +//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} + +// Executed Command: +{{#each args as |arg|}} +// {{arg}} +{{/each}} + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for `{{pallet}}`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + {{#each benchmarks as |benchmark|}} + {{#each benchmark.comments as |comment|}} + // {{comment}} + {{/each}} + pub(crate) 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) + {{#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)) + {{/each}} + {{#if (ne benchmark.base_reads "0")}} + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) + {{/if}} + {{#each benchmark.component_reads as |cr|}} + .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) + {{/each}} + {{#if (ne benchmark.base_writes "0")}} + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) + {{/if}} + {{#each benchmark.component_writes as |cw|}} + .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) + {{/each}} + } + {{/each}} +} diff --git a/test/client/src/lib.rs b/test/client/src/lib.rs index 2bac18a78a..813cafd62f 100644 --- a/test/client/src/lib.rs +++ b/test/client/src/lib.rs @@ -19,7 +19,7 @@ mod block_builder; use codec::{Decode, Encode}; use runtime::{ - Balance, Block, BlockHashCount, Call, GenesisConfig, Runtime, Signature, SignedExtra, + Balance, Block, BlockHashCount, GenesisConfig, Runtime, RuntimeCall, Signature, SignedExtra, SignedPayload, UncheckedExtrinsic, VERSION, }; use sc_executor::{WasmExecutionMethod, WasmExecutor}; @@ -122,7 +122,7 @@ fn genesis_config() -> GenesisConfig { pub fn generate_extrinsic( client: &Client, origin: sp_keyring::AccountKeyring, - function: impl Into, + function: impl Into, ) -> UncheckedExtrinsic { let current_block_hash = client.info().best_hash; let current_block = client.info().best_number.saturated_into(); @@ -165,8 +165,10 @@ pub fn transfer( dest: sp_keyring::AccountKeyring, value: Balance, ) -> UncheckedExtrinsic { - let function = - Call::Balances(pallet_balances::Call::transfer { dest: dest.public().into(), value }); + let function = RuntimeCall::Balances(pallet_balances::Call::transfer { + dest: dest.public().into(), + value, + }); generate_extrinsic(client, origin, function) } diff --git a/test/relay-sproof-builder/src/lib.rs b/test/relay-sproof-builder/src/lib.rs index 1faa37a147..5c2a1a1063 100644 --- a/test/relay-sproof-builder/src/lib.rs +++ b/test/relay-sproof-builder/src/lib.rs @@ -44,6 +44,7 @@ pub struct RelayStateSproofBuilder { pub hrmp_channels: BTreeMap, pub current_slot: relay_chain::v2::Slot, pub current_epoch: u64, + pub randomness: relay_chain::Hash, } impl Default for RelayStateSproofBuilder { @@ -69,6 +70,7 @@ impl Default for RelayStateSproofBuilder { hrmp_channels: BTreeMap::new(), current_slot: 0.into(), current_epoch: 0u64, + randomness: relay_chain::Hash::default(), } } } @@ -156,6 +158,10 @@ impl RelayStateSproofBuilder { insert(relay_chain::well_known_keys::hrmp_channels(channel), metadata.encode()); } insert(relay_chain::well_known_keys::EPOCH_INDEX.to_vec(), self.current_epoch.encode()); + insert( + relay_chain::well_known_keys::ONE_EPOCH_AGO_RANDOMNESS.to_vec(), + self.randomness.encode(), + ); insert(relay_chain::well_known_keys::CURRENT_SLOT.to_vec(), self.current_slot.encode()); } diff --git a/test/runtime/Cargo.toml b/test/runtime/Cargo.toml index 42b78f935a..6842412e18 100644 --- a/test/runtime/Cargo.toml +++ b/test/runtime/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } serde = { version = "1.0.144", optional = true, features = ["derive"] } # Substrate diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index b6567887cd..ea1800f076 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -45,11 +45,13 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, + dispatch::DispatchClass, + parameter_types, traits::Randomness, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - ConstantMultiplier, DispatchClass, IdentityFee, Weight, + ConstantMultiplier, IdentityFee, Weight, }, StorageValue, }; @@ -138,7 +140,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for .5 seconds of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); parameter_types! { pub const BlockHashCount: BlockNumber = 250; @@ -170,7 +172,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = IdentityLookup; /// The index type for storing how many extrinsics an account has signed. @@ -184,9 +186,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -229,7 +231,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -244,7 +246,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; @@ -253,13 +255,13 @@ impl pallet_transaction_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_parachain_system::Config for Runtime { type SelfParaId = ParachainId; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type OutboundXcmpMessageSource = (); type DmpMessageHandler = (); @@ -328,9 +330,10 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -341,15 +344,14 @@ pub type Executive = frame_executive::Executive< TestOnRuntimeUpgrade, >; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; pub struct TestOnRuntimeUpgrade; impl OnRuntimeUpgrade for TestOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { assert_eq!(sp_io::storage::get(TEST_RUNTIME_UPGRADE_KEY), Some(vec![1, 2, 3, 4].into())); - - 1 + Weight::from_ref_time(1) } } diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 26c9401d31..1a652e96ab 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -10,15 +10,15 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.57" -clap = { version = "3.2.17", features = ["derive", "deprecated"] } +clap = { version = "3.2.22", features = ["derive", "deprecated"] } codec = { package = "parity-scale-codec", version = "3.0.0" } -criterion = { version = "0.3.6", features = [ "async_tokio" ] } +criterion = { version = "0.4.0", features = [ "async_tokio" ] } jsonrpsee = { version = "0.15.1", features = ["server"] } rand = "0.8.5" serde = { version = "1.0.144", features = ["derive"] } -tokio = { version = "1.19.2", features = ["macros"] } +tokio = { version = "1.21.1", features = ["macros"] } tracing = "0.1.36" -url = "2.2.2" +url = "2.3.1" # Substrate frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -72,7 +72,7 @@ cumulus-test-relay-validation-worker-provider = { path = "../relay-validation-wo cumulus-test-runtime = { path = "../runtime" } [dev-dependencies] -futures = "0.3.23" +futures = "0.3.24" portpicker = "0.1.1" # Polkadot dependencies diff --git a/test/service/src/cli.rs b/test/service/src/cli.rs index 4306516087..40b6379885 100644 --- a/test/service/src/cli.rs +++ b/test/service/src/cli.rs @@ -137,7 +137,7 @@ impl CliConfiguration for RelayChainCli { fn base_path(&self) -> CliResult> { Ok(self .shared_params() - .base_path() + .base_path()? .or_else(|| self.base_path.clone().map(Into::into))) } diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index 9132983e3e..53a04d47e6 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -28,6 +28,7 @@ use std::{ }; use url::Url; +use crate::runtime::Weight; use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_common::{ParachainCandidate, ParachainConsensus}; use cumulus_client_network::BlockAnnounceValidator; @@ -607,7 +608,7 @@ pub fn node_config( is_collator: bool, ) -> Result { let base_path = BasePath::new_temp_dir()?; - let root = base_path.path().to_path_buf(); + let root = base_path.path().join(format!("cumulus_test_service_{}", key.to_string())); let role = if is_collator { Role::Authority } else { Role::Full }; let key_seed = key.to_seed(); let mut spec = Box::new(chain_spec::get_chain_spec(para_id)); @@ -704,7 +705,7 @@ impl TestNode { /// Send an extrinsic to this node. pub async fn send_extrinsic( &self, - function: impl Into, + function: impl Into, caller: Sr25519Keyring, ) -> Result { let extrinsic = construct_extrinsic(&*self.client, function, caller.pair(), Some(0)); @@ -717,7 +718,10 @@ impl TestNode { let call = frame_system::Call::set_code { code: validation }; self.send_extrinsic( - runtime::SudoCall::sudo_unchecked_weight { call: Box::new(call.into()), weight: 1_000 }, + runtime::SudoCall::sudo_unchecked_weight { + call: Box::new(call.into()), + weight: Weight::from_ref_time(1_000), + }, Sr25519Keyring::Alice, ) .await @@ -737,7 +741,7 @@ pub fn fetch_nonce(client: &Client, account: sp_core::sr25519::Public) -> u32 { /// Construct an extrinsic that can be applied to the test runtime. pub fn construct_extrinsic( client: &Client, - function: impl Into, + function: impl Into, caller: sp_core::sr25519::Pair, nonce: Option, ) -> runtime::UncheckedExtrinsic {