diff --git a/.github/pr-custom-review.yml b/.github/pr-custom-review.yml index b833d3a01aa..fc26ee677f0 100644 --- a/.github/pr-custom-review.yml +++ b/.github/pr-custom-review.yml @@ -6,7 +6,7 @@ action-review-team: ci rules: - name: Runtime files check_type: changed_files - condition: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$ + condition: ^parachains/runtimes/assets/(asset-hub-kusama|asset-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$ all_distinct: - min_approvals: 1 teams: @@ -20,7 +20,7 @@ rules: condition: include: .* # excluding files from 'Runtime files' and 'CI files' rules and `Bridges subtree files` - exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.* + exclude: ^parachains/runtimes/assets/(asset-hub-kusama|asset-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.* min_approvals: 2 teams: - core-devs diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c67f5bb97ad..ba7739f25c2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: protoc --version - name: Checkout repository - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Rust versions run: rustup show diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml index 498e42527e3..7571c51116b 100644 --- a/.github/workflows/fmt-check.yml +++ b/.github/workflows/fmt-check.yml @@ -16,7 +16,7 @@ jobs: container: image: paritytech/ci-linux:production steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Cargo fmt run: cargo +nightly fmt --all -- --check diff --git a/.github/workflows/release-01_branch-check.yml b/.github/workflows/release-01_branch-check.yml index c6237b40ceb..afcd4580f17 100644 --- a/.github/workflows/release-01_branch-check.yml +++ b/.github/workflows/release-01_branch-check.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 diff --git a/.github/workflows/release-10_rc-automation.yml b/.github/workflows/release-10_rc-automation.yml index d0c669a5885..377d3830104 100644 --- a/.github/workflows/release-10_rc-automation.yml +++ b/.github/workflows/release-10_rc-automation.yml @@ -17,7 +17,7 @@ jobs: pre-releases: true steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 - id: compute_tag @@ -27,7 +27,7 @@ jobs: # Get last rc tag if exists, else set it to {version}-rc1 version=${GITHUB_REF#refs/heads/release-} echo "$version" - echo "::set-output name=version::$version" + echo "version=$version" >> $GITHUB_OUTPUT git tag -l last_rc=$(git tag -l "$version-rc*" | sort -V | tail -n 1) if [ -n "$last_rc" ]; then @@ -35,11 +35,11 @@ jobs: echo $suffix ((suffix++)) echo $suffix - echo "::set-output name=new_tag::$version-rc$suffix" - echo "::set-output name=first_rc::false" + echo "new_tag=$version-rc$suffix" >> $GITHUB_OUTPUT + echo "first_rc=false" >> $GITHUB_OUTPUT else - echo "::set-output name=new_tag::$version-rc1" - echo "::set-output name=first_rc::true" + echo "new_tag=$version-rc1" >> $GITHUB_OUTPUT + echo "first_rc=true" >> $GITHUB_OUTPUT fi - name: Apply new tag 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 5a7d695ec98..f821e39dd33 100644 --- a/.github/workflows/release-20_extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/release-20_extrinsic-ordering-check-from-bin.yml @@ -14,7 +14,7 @@ on: required: true chain: description: The name of the chain under test. Usually, you would pass a local chain - default: statemine-local + default: asset-hub-kusama-local required: true jobs: @@ -29,7 +29,7 @@ jobs: REF_URL: ${{github.event.inputs.reference_url}} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Fetch binary run: | diff --git a/.github/workflows/release-21_extrinsic-ordering-check-from-two.yml b/.github/workflows/release-21_extrinsic-ordering-check-from-two.yml index 7fde56ef1b2..93c0050ff6f 100644 --- a/.github/workflows/release-21_extrinsic-ordering-check-from-two.yml +++ b/.github/workflows/release-21_extrinsic-ordering-check-from-two.yml @@ -28,21 +28,21 @@ jobs: fail-fast: false matrix: include: - - runtime: statemine - local: statemine-local + - runtime: asset-hub-kusama + local: asset-hub-kusama-local + relay: kusama-local + - runtime: asset-hub-polkadot + local: asset-hub-polkadot-local relay: polkadot-local - - runtime: statemint - local: statemint-local - relay: polkadot-local - - runtime: westmint - local: westmint-local + - runtime: asset-hub-westend + local: asset-hub-westend-local relay: polkadot-local - runtime: contracts-rococo local: contracts-rococo-local relay: polkadot-local steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Create tmp dir run: | diff --git a/.github/workflows/release-30_create-draft.yml b/.github/workflows/release-30_create-draft.yml index c4bb546dc78..8ad63ff46cd 100644 --- a/.github/workflows/release-30_create-draft.yml +++ b/.github/workflows/release-30_create-draft.yml @@ -34,8 +34,8 @@ jobs: steps: - id: get-rust-versions run: | - echo "::set-output name=stable::$(rustc +stable --version)" - echo "::set-output name=nightly::$(rustc +nightly --version)" + echo "stable=$(rustc +stable --version)" >> $GITHUB_OUTPUT + echo "nightly=$(rustc +nightly --version)" >> $GITHUB_OUTPUT # We do not skip the entire job for client builds (although we don't need it) # because it is a dep of the next job. However we skip the time consuming steps. @@ -45,11 +45,11 @@ jobs: matrix: include: - category: assets - runtime: statemine + runtime: asset-hub-kusama - category: assets - runtime: statemint + runtime: asset-hub-polkadot - category: assets - runtime: westmint + runtime: asset-hub-westend - category: bridge-hubs runtime: bridge-hub-polkadot - category: bridge-hubs @@ -68,7 +68,7 @@ jobs: runtime: rococo-parachain steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: ref: ${{ github.event.inputs.ref2 }} @@ -120,13 +120,13 @@ jobs: asset_upload_url: ${{ steps.create-release.outputs.upload_url }} steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 path: cumulus ref: ${{ github.event.inputs.ref2 }} - - uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0 + - uses: ruby/setup-ruby@bc1dd263b68cb5626dbb55d5c89777d79372c484 # v1.151.0 with: ruby-version: 3.0.0 @@ -223,11 +223,11 @@ jobs: matrix: include: - category: assets - runtime: statemine + runtime: asset-hub-kusama - category: assets - runtime: statemint + runtime: asset-hub-polkadot - category: assets - runtime: westmint + runtime: asset-hub-westend - category: bridge-hubs runtime: bridge-hub-polkadot - category: bridge-hubs @@ -246,14 +246,14 @@ jobs: runtime: rococo-parachain steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: ref: ${{ github.event.inputs.ref2 }} - name: Download artifacts uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - - uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0 + - uses: ruby/setup-ruby@bc1dd263b68cb5626dbb55d5c89777d79372c484 # v1.151.0 with: ruby-version: 3.0.0 @@ -267,7 +267,7 @@ jobs: ls "$RUNTIME_DIR/${{ matrix.category }}/${{ matrix.runtime }}" runtime_ver=$(ruby script.rb) echo "Found version: >$runtime_ver<" - echo "::set-output name=runtime_ver::$runtime_ver" + echo "runtime_ver=$runtime_ver" >> $GITHUB_OUTPUT - name: Fix runtime name id: fix-runtime-path diff --git a/.github/workflows/release-50_docker-manual.yml b/.github/workflows/release-50_docker-manual.yml index b4b2964cbe9..e48d7c8faab 100644 --- a/.github/workflows/release-50_docker-manual.yml +++ b/.github/workflows/release-50_docker-manual.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: ref: ${{ github.event.release.tag_name }} @@ -91,7 +91,7 @@ jobs: ./docker/scripts/build-injected-image.sh - name: Login to Dockerhub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 + uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/release-50_docker.yml b/.github/workflows/release-50_docker.yml index a2051071ffe..9a1db1a04ac 100644 --- a/.github/workflows/release-50_docker.yml +++ b/.github/workflows/release-50_docker.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: ref: ${{ github.event.release.tag_name }} @@ -90,7 +90,7 @@ jobs: ./docker/scripts/build-injected-image.sh - name: Login to Dockerhub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 + uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 3ac4ff8be55..6941a79a013 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -32,11 +32,11 @@ jobs: matrix: include: - category: assets - runtime: statemine + runtime: asset-hub-kusama - category: assets - runtime: statemint + runtime: asset-hub-polkadot - category: assets - runtime: westmint + runtime: asset-hub-westend - category: bridge-hubs runtime: bridge-hub-polkadot - category: bridge-hubs @@ -54,7 +54,7 @@ jobs: - category: testing runtime: rococo-parachain steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 diff --git a/Cargo.lock b/Cargo.lock index 1b3bfd30455..f70cf63c8e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -373,6 +373,300 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "asset-hub-kusama-integration-tests" +version = "1.0.0" +dependencies = [ + "asset-hub-kusama-runtime", + "frame-support", + "frame-system", + "integration-tests-common", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "penpal-runtime", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime", + "polkadot-runtime-parachains", + "sp-core", + "sp-runtime", + "sp-weights", + "xcm", + "xcm-emulator", + "xcm-executor", +] + +[[package]] +name = "asset-hub-kusama-runtime" +version = "0.9.420" +dependencies = [ + "asset-test-utils", + "assets-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "kusama-runtime-constants", + "log", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-bridge-transfer", + "pallet-bridge-transfer-primitives", + "pallet-collator-selection", + "pallet-multisig", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-session", + "pallet-state-trie-migration", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "asset-hub-polkadot-integration-tests" +version = "1.0.0" +dependencies = [ + "asset-hub-polkadot-runtime", + "frame-support", + "frame-system", + "integration-tests-common", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "penpal-runtime", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime", + "polkadot-runtime-parachains", + "sp-core", + "sp-runtime", + "sp-weights", + "xcm", + "xcm-emulator", + "xcm-executor", +] + +[[package]] +name = "asset-hub-polkadot-runtime" +version = "0.9.420" +dependencies = [ + "asset-test-utils", + "assets-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-bridge-transfer", + "pallet-bridge-transfer-primitives", + "pallet-collator-selection", + "pallet-multisig", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "asset-hub-westend-integration-tests" +version = "1.0.0" +dependencies = [ + "asset-hub-westend-runtime", + "frame-support", + "frame-system", + "integration-tests-common", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "penpal-runtime", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime", + "polkadot-runtime-parachains", + "sp-core", + "sp-runtime", + "sp-weights", + "westend-runtime", + "xcm", + "xcm-emulator", + "xcm-executor", +] + +[[package]] +name = "asset-hub-westend-runtime" +version = "0.9.420" +dependencies = [ + "asset-test-utils", + "assets-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-bridge-transfer", + "pallet-bridge-transfer-primitives", + "pallet-collator-selection", + "pallet-multisig", + "pallet-nft-fractionalization", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "westend-runtime-constants", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "asset-test-utils" version = "1.0.0" @@ -390,6 +684,7 @@ dependencies = [ "pallet-assets", "pallet-balances", "pallet-bridge-transfer", + "pallet-bridge-transfer-primitives", "pallet-collator-selection", "pallet-session", "pallet-xcm", @@ -421,6 +716,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", + "sp-runtime", "sp-std", "substrate-wasm-builder", "xcm", @@ -475,7 +771,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -486,7 +782,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -588,7 +884,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hash-db", "log", @@ -621,7 +917,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -744,9 +1040,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bounded-collections" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a071c348a5ef6da1d3a87166b408170b46002382b1dda83992b5c2208cefb370" +checksum = "07fbd1d11282a1eb134d3c3b7cf8ce213b5161c6e5f73fb1b98618482c606b64" dependencies = [ "log", "parity-scale-codec", @@ -1545,9 +1841,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.0" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +checksum = "ca8f255e4b8027970e78db75e78831229c9815fdbfa67eb1a1b777a62e24b4a0" dependencies = [ "clap_builder", "clap_derive", @@ -1556,9 +1852,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.0" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +checksum = "acd4f3c17c83b0ba34ffbc4f8bbd74f079413f747f84a6f89292f138057e36ab" dependencies = [ "anstream", "anstyle 1.0.0", @@ -1569,14 +1865,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1607,6 +1903,35 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "collectives-polkadot-it" +version = "0.1.0" +dependencies = [ + "asset-hub-polkadot-runtime", + "collectives-polkadot-runtime", + "cumulus-pallet-xcmp-queue", + "frame-support", + "frame-system", + "integration-tests-common", + "pallet-assets", + "pallet-balances", + "pallet-core-fellowship", + "pallet-salary", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime", + "polkadot-runtime-parachains", + "sp-core", + "sp-runtime", + "sp-weights", + "xcm", + "xcm-emulator", + "xcm-executor", +] + [[package]] name = "collectives-polkadot-runtime" version = "1.0.0" @@ -1635,11 +1960,13 @@ dependencies = [ "pallet-balances", "pallet-collator-selection", "pallet-collective", + "pallet-core-fellowship", "pallet-multisig", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", "pallet-referenda", + "pallet-salary", "pallet-scheduler", "pallet-session", "pallet-timestamp", @@ -1704,15 +2031,21 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comfy-table" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121d8a5b0346092c18a4b2fd6f620d7a06f0eb7ac0a45860939a0884bc579c56" +checksum = "f9e1f7e5d046697d34b593bdba8ee31f4649366e452a2ccabb3baf3511e503d1" dependencies = [ "strum", "strum_macros", "unicode-width", ] +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "concurrent-queue" version = "1.2.2" @@ -2507,7 +2840,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2839,6 +3172,7 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "pallet-balances", + "pallet-glutton", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", @@ -2870,17 +3204,22 @@ dependencies = [ "cumulus-client-consensus-relay-chain", "cumulus-client-pov-recovery", "cumulus-client-service", + "cumulus-pallet-parachain-system", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", + "cumulus-test-client", + "cumulus-test-relay-sproof-builder", "cumulus-test-relay-validation-worker-provider", "cumulus-test-runtime", "frame-system", "frame-system-rpc-runtime-api", "futures", "jsonrpsee", + "pallet-im-online", + "pallet-timestamp", "pallet-transaction-payment", "parachains-common", "parity-scale-codec", @@ -2892,12 +3231,16 @@ dependencies = [ "polkadot-test-service", "portpicker", "rand 0.8.5", + "rococo-parachain-runtime", "sc-basic-authorship", + "sc-block-builder", "sc-chain-spec", "sc-cli", "sc-client-api", "sc-consensus", "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", "sc-network", "sc-service", "sc-telemetry", @@ -2905,8 +3248,12 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "serde", + "sp-api", "sp-arithmetic", + "sp-authority-discovery", "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", "sp-core", "sp-io", "sp-keyring", @@ -2917,6 +3264,7 @@ dependencies = [ "sp-trie", "substrate-test-client", "substrate-test-utils", + "tempfile", "tokio", "tracing", "url", @@ -3275,6 +3623,33 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "docify" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18b972b74c30cbe838fc6a07665132ff94f257350e26fd01d80bc59ee7fcf129" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c93004d1011191c56df9e853dca42f2012e7488638bcd5078935f5ce43e06cf3" +dependencies = [ + "common-path", + "derive-syn-parse", + "lazy_static", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "syn 2.0.18", + "termcolor", + "walkdir", +] + [[package]] name = "downcast" version = "0.11.0" @@ -3463,7 +3838,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -3474,7 +3849,7 @@ checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -3522,13 +3897,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3620,19 +3995,6 @@ dependencies = [ "quote", ] -[[package]] -name = "expander" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" -dependencies = [ - "blake2", - "fs-err", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "expander" version = "2.0.0" @@ -3643,7 +4005,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -3814,16 +4176,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -3837,7 +4199,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-support-procedural", @@ -3862,7 +4224,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "array-bytes 4.2.0", @@ -3909,18 +4271,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3937,7 +4299,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -3966,7 +4328,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-recursion", "futures", @@ -3987,7 +4349,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bitflags", "environmental", @@ -3996,6 +4358,7 @@ dependencies = [ "impl-trait-for-tuples", "k256", "log", + "macro_magic", "once_cell", "parity-scale-codec", "paste", @@ -4021,45 +4384,46 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", "itertools", + "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "cfg-if", "frame-support", @@ -4078,7 +4442,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -4093,7 +4457,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "sp-api", @@ -4102,7 +4466,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "parity-scale-codec", @@ -4140,9 +4504,9 @@ dependencies = [ [[package]] name = "fs_extra" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "funty" @@ -4222,7 +4586,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -4395,6 +4759,7 @@ dependencies = [ "frame-support", "frame-system", "frame-system-benchmarking", + "frame-system-rpc-runtime-api", "frame-try-runtime", "pallet-glutton", "pallet-sudo", @@ -4721,10 +5086,25 @@ dependencies = [ "rustls 0.20.7", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.2", "webpki-roots", ] +[[package]] +name = "hyper-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +dependencies = [ + "http", + "hyper", + "log", + "rustls 0.21.1", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.24.1", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -4744,9 +5124,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -4876,6 +5256,9 @@ dependencies = [ name = "integration-tests-common" version = "1.0.0" dependencies = [ + "asset-hub-kusama-runtime", + "asset-hub-polkadot-runtime", + "asset-hub-westend-runtime", "bridge-hub-kusama-runtime", "bridge-hub-polkadot-runtime", "collectives-polkadot-runtime", @@ -4906,8 +5289,8 @@ dependencies = [ "sp-core", "sp-runtime", "sp-weights", - "statemine-runtime", - "statemint-runtime", + "westend-runtime", + "westend-runtime-constants", "xcm", "xcm-emulator", "xcm-executor", @@ -4940,12 +5323,13 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.2" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi 0.3.1", "libc", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -4979,8 +5363,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", - "io-lifetimes 1.0.2", - "rustix 0.37.3", + "io-lifetimes 1.0.11", + "rustix 0.37.19", "windows-sys 0.48.0", ] @@ -5053,7 +5437,7 @@ dependencies = [ "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.2", "tokio-util", "tracing", "webpki-roots", @@ -5095,7 +5479,7 @@ checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" dependencies = [ "async-trait", "hyper", - "hyper-rustls", + "hyper-rustls 0.23.0", "jsonrpsee-core", "jsonrpsee-types", "rustc-hash", @@ -5188,8 +5572,8 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kusama-runtime" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "frame-benchmarking", @@ -5287,8 +5671,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-support", "polkadot-primitives", @@ -5346,9 +5730,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libloading" @@ -5918,9 +6302,9 @@ checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" [[package]] name = "linux-raw-sys" -version = "0.3.0" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" @@ -5933,12 +6317,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "lru" @@ -6005,6 +6386,53 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_magic" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2d6d7fe4741b5621cf7c8048e472933877c7ea870cbf1420da55ea9f3bb08c" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "macro_magic_core" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3005604258419767cacc5989c2dd75263f8b33773dd680734f598eb88baf5370" +dependencies = [ + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de6267819c9042df1a9e62ca279e5a34254ad5dfdcb13ff988f560d75576e8b4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "macro_magic_macros" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc7176ac15ab2ed7f335e2398f729b9562dae0c233705bc1e1e3acd8452d403d" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.18", +] + [[package]] name = "maplit" version = "1.0.2" @@ -6187,7 +6615,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "log", @@ -6206,7 +6634,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "anyhow", "jsonrpsee", @@ -6710,7 +7138,7 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "frame-benchmarking", @@ -6731,7 +7159,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6749,7 +7177,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6764,7 +7192,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -6780,7 +7208,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -6796,7 +7224,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -6810,7 +7238,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6834,7 +7262,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6854,7 +7282,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6869,7 +7297,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -6888,7 +7316,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "binary-merkle-tree", @@ -6912,7 +7340,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7026,6 +7454,7 @@ dependencies = [ "frame-system-benchmarking", "log", "pallet-balances", + "pallet-bridge-transfer-primitives", "parity-scale-codec", "polkadot-parachain", "scale-info", @@ -7037,10 +7466,20 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-bridge-transfer-primitives" +version = "0.1.0" +dependencies = [ + "frame-support", + "sp-std", + "xcm", + "xcm-builder", +] + [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7084,7 +7523,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7101,7 +7540,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bitflags", "environmental", @@ -7130,8 +7569,8 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bitflags", "parity-scale-codec", @@ -7144,17 +7583,17 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7168,10 +7607,28 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-core-fellowship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7189,7 +7646,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7212,7 +7669,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7225,7 +7682,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7243,8 +7700,9 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ + "docify", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -7261,7 +7719,7 @@ dependencies = [ [[package]] name = "pallet-glutton" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "blake2", "frame-benchmarking", @@ -7279,7 +7737,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7302,7 +7760,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7318,7 +7776,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7338,7 +7796,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7355,7 +7813,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -7369,7 +7827,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7386,7 +7844,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "7.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7405,7 +7863,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7422,7 +7880,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7438,7 +7896,7 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7455,7 +7913,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7473,7 +7931,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "pallet-nfts", @@ -7484,7 +7942,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7500,7 +7958,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -7517,7 +7975,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7537,7 +7995,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -7548,7 +8006,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -7565,7 +8023,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7604,7 +8062,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7621,7 +8079,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7636,7 +8094,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7654,7 +8112,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7669,7 +8127,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7685,10 +8143,28 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-salary" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7705,7 +8181,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -7726,7 +8202,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7742,7 +8218,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -7756,7 +8232,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7779,18 +8255,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "log", "sp-arithmetic", @@ -7799,7 +8275,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "sp-api", @@ -7808,7 +8284,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7825,7 +8301,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7840,7 +8316,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7858,7 +8334,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7877,7 +8353,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-system", @@ -7893,7 +8369,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -7909,7 +8385,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -7921,7 +8397,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7938,7 +8414,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7953,7 +8429,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7969,7 +8445,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7984,7 +8460,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7998,8 +8474,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8019,8 +8495,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-benchmarking", "frame-support", @@ -8479,9 +8955,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -8636,8 +9112,8 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "polkadot-node-jaeger", @@ -8652,8 +9128,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -8666,8 +9142,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "derive_more", "fatality", @@ -8689,8 +9165,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "fatality", "futures", @@ -8710,8 +9186,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "clap", "frame-benchmarking-cli", @@ -8740,8 +9216,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "frame-benchmarking", @@ -8783,8 +9259,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "always-assert", "bitvec", @@ -8805,8 +9281,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "parity-scale-codec", "scale-info", @@ -8817,8 +9293,8 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "derive_more", "fatality", @@ -8842,8 +9318,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -8856,8 +9332,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "futures-timer", @@ -8876,8 +9352,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "always-assert", "async-trait", @@ -8899,8 +9375,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "parity-scale-codec", @@ -8917,8 +9393,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "derive_more", @@ -8946,8 +9422,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "futures", @@ -8967,8 +9443,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "fatality", @@ -8986,8 +9462,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9001,8 +9477,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "futures", @@ -9021,8 +9497,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "polkadot-node-metrics", @@ -9036,8 +9512,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "futures-timer", @@ -9053,8 +9529,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "fatality", "futures", @@ -9072,8 +9548,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "futures", @@ -9089,8 +9565,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "fatality", @@ -9107,8 +9583,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "always-assert", "futures", @@ -9138,8 +9614,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "polkadot-node-primitives", @@ -9154,8 +9630,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "cpu-time", "futures", @@ -9163,9 +9639,12 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", + "sc-executor", "sc-executor-common", "sc-executor-wasmtime", "sp-core", + "sp-externalities", + "sp-io", "sp-tracing", "substrate-build-script-utils", "tokio", @@ -9174,8 +9653,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-execute-worker" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "cpu-time", "futures", @@ -9184,12 +9663,7 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "rayon", - "sc-executor", - "sc-executor-common", - "sc-executor-wasmtime", "sp-core", - "sp-externalities", - "sp-io", "sp-maybe-compressed-blob", "sp-tracing", "tikv-jemalloc-ctl", @@ -9199,8 +9673,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-prepare-worker" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "libc", @@ -9222,8 +9696,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "futures", "lru 0.9.0", @@ -9237,8 +9711,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "lazy_static", "log", @@ -9255,8 +9729,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bs58", "futures", @@ -9274,8 +9748,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-channel", "async-trait", @@ -9297,8 +9771,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bounded-vec", "futures", @@ -9319,8 +9793,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9329,8 +9803,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "futures", @@ -9347,8 +9821,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "derive_more", @@ -9370,8 +9844,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "derive_more", @@ -9403,8 +9877,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "futures", @@ -9426,8 +9900,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bounded-collections", "derive_more", @@ -9446,6 +9920,9 @@ name = "polkadot-parachain-bin" version = "0.9.420" dependencies = [ "assert_cmd", + "asset-hub-kusama-runtime", + "asset-hub-polkadot-runtime", + "asset-hub-westend-runtime", "async-trait", "bridge-hub-kusama-runtime", "bridge-hub-polkadot-runtime", @@ -9510,8 +9987,6 @@ dependencies = [ "sp-session", "sp-timestamp", "sp-transaction-pool", - "statemine-runtime", - "statemint-runtime", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -9520,14 +9995,13 @@ dependencies = [ "tokio", "try-runtime-cli", "wait-timeout", - "westmint-runtime", "xcm", ] [[package]] name = "polkadot-performance-test" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -9544,8 +10018,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -9570,8 +10044,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9602,8 +10076,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "frame-benchmarking", @@ -9697,8 +10171,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "frame-benchmarking", @@ -9743,8 +10217,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-support", "polkadot-primitives", @@ -9757,8 +10231,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bs58", "parity-scale-codec", @@ -9769,8 +10243,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitflags", "bitvec", @@ -9814,8 +10288,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "async-trait", "frame-benchmarking-cli", @@ -9924,8 +10398,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -9945,8 +10419,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -9955,8 +10429,8 @@ dependencies = [ [[package]] name = "polkadot-test-client" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "parity-scale-codec", "polkadot-node-subsystem", @@ -9980,8 +10454,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "frame-election-provider-support", @@ -10041,8 +10515,8 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-benchmarking", "frame-system", @@ -10209,7 +10683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058" dependencies = [ "proc-macro2", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -10284,14 +10758,14 @@ checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -10821,8 +11295,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -10908,8 +11382,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-support", "polkadot-primitives", @@ -11037,7 +11511,7 @@ checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" dependencies = [ "bitflags", "errno 0.2.8", - "io-lifetimes 1.0.2", + "io-lifetimes 1.0.11", "libc", "linux-raw-sys 0.1.3", "windows-sys 0.42.0", @@ -11045,16 +11519,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.3" +version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ "bitflags", - "errno 0.3.0", - "io-lifetimes 1.0.2", + "errno 0.3.1", + "io-lifetimes 1.0.11", "libc", - "linux-raw-sys 0.3.0", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", ] [[package]] @@ -11082,6 +11556,18 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-native-certs" version = "0.6.1" @@ -11103,6 +11589,16 @@ dependencies = [ "base64 0.13.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.12" @@ -11156,7 +11652,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "log", "sp-core", @@ -11167,7 +11663,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", @@ -11196,7 +11692,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "futures-timer", @@ -11219,7 +11715,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -11234,7 +11730,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -11253,18 +11749,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "chrono", @@ -11304,7 +11800,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "fnv", "futures", @@ -11331,7 +11827,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hash-db", "kvdb", @@ -11357,7 +11853,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", @@ -11382,7 +11878,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", @@ -11411,7 +11907,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "fork-tree", @@ -11447,7 +11943,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "jsonrpsee", @@ -11469,7 +11965,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -11505,7 +12001,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "jsonrpsee", @@ -11524,7 +12020,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11537,7 +12033,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ahash 0.8.2", "array-bytes 4.2.0", @@ -11577,7 +12073,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "finality-grandpa", "futures", @@ -11597,7 +12093,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", @@ -11620,7 +12116,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "lru 0.10.0", "parity-scale-codec", @@ -11642,7 +12138,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -11654,7 +12150,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "anyhow", "cfg-if", @@ -11672,7 +12168,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ansi_term", "futures", @@ -11688,7 +12184,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "parking_lot 0.12.1", @@ -11702,7 +12198,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -11721,13 +12217,13 @@ dependencies = [ "mockall", "parity-scale-codec", "parking_lot 0.12.1", + "partial_sort", "pin-project", "rand 0.8.5", "sc-block-builder", "sc-client-api", "sc-consensus", "sc-network-common", - "sc-peerset", "sc-utils", "serde", "serde_json", @@ -11741,13 +12237,14 @@ dependencies = [ "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", + "wasm-timer", "zeroize", ] [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-channel", "cid", @@ -11768,7 +12265,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -11780,7 +12277,6 @@ dependencies = [ "parity-scale-codec", "prost-build", "sc-consensus", - "sc-peerset", "sc-utils", "serde", "smallvec", @@ -11796,7 +12292,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ahash 0.8.2", "futures", @@ -11806,7 +12302,6 @@ dependencies = [ "lru 0.10.0", "sc-network", "sc-network-common", - "sc-peerset", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -11815,7 +12310,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -11828,7 +12323,6 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", - "sc-peerset", "sp-blockchain", "sp-core", "sp-runtime", @@ -11838,7 +12332,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -11857,7 +12351,6 @@ dependencies = [ "sc-consensus", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "smallvec", "sp-arithmetic", @@ -11873,7 +12366,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "futures", @@ -11882,7 +12375,6 @@ dependencies = [ "parity-scale-codec", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "sp-consensus", "sp-runtime", @@ -11892,7 +12384,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "bytes", @@ -11900,7 +12392,7 @@ dependencies = [ "futures", "futures-timer", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.0", "libp2p", "num_cpus", "once_cell", @@ -11910,7 +12402,6 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "sp-api", "sp-core", @@ -11920,26 +12411,10 @@ dependencies = [ "tracing", ] -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" -dependencies = [ - "futures", - "libp2p-identity", - "log", - "parking_lot 0.12.1", - "partial_sort", - "sc-utils", - "serde_json", - "sp-arithmetic", - "wasm-timer", -] - [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -11948,7 +12423,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "jsonrpsee", @@ -11979,7 +12454,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11998,7 +12473,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "http", "jsonrpsee", @@ -12013,7 +12488,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "futures", @@ -12039,7 +12514,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "directories", @@ -12105,7 +12580,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "log", "parity-scale-codec", @@ -12116,7 +12591,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "clap", "fs4", @@ -12132,7 +12607,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12151,7 +12626,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "libc", @@ -12170,7 +12645,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "chrono", "futures", @@ -12189,7 +12664,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ansi_term", "atty", @@ -12220,25 +12695,24 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", "futures-timer", "linked-hash-map", "log", - "num-traits", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", @@ -12258,13 +12732,15 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", "log", + "parity-scale-codec", "serde", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] @@ -12272,7 +12748,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-channel", "futures", @@ -12535,9 +13011,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ "serde_derive", ] @@ -12553,13 +13029,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -12761,8 +13237,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "enumn", "parity-scale-codec", @@ -13009,7 +13485,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hash-db", "log", @@ -13029,21 +13505,21 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "blake2", - "expander 1.0.0", + "expander 2.0.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "sp-application-crypto" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13055,8 +13531,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "16.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "integer-sqrt", "num-traits", @@ -13070,7 +13546,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13083,7 +13559,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "sp-api", @@ -13095,7 +13571,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "log", @@ -13113,7 +13589,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures", @@ -13128,7 +13604,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "parity-scale-codec", @@ -13146,7 +13622,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "parity-scale-codec", @@ -13167,7 +13643,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13186,7 +13662,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "finality-grandpa", "log", @@ -13204,7 +13680,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13215,8 +13691,8 @@ dependencies = [ [[package]] name = "sp-core" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "21.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "bitflags", @@ -13259,8 +13735,8 @@ dependencies = [ [[package]] name = "sp-core-hashing" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "blake2b_simd", "byteorder", @@ -13273,19 +13749,19 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -13293,18 +13769,18 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "sp-externalities" -version = "0.14.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "0.19.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "environmental", "parity-scale-codec", @@ -13315,7 +13791,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13329,8 +13805,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bytes", "ed25519", @@ -13355,8 +13831,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "lazy_static", "sp-core", @@ -13366,8 +13842,8 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.14.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "0.27.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "parity-scale-codec", @@ -13381,7 +13857,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "thiserror", "zstd 0.12.3+zstd.1.5.2", @@ -13390,7 +13866,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -13401,7 +13877,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13419,7 +13895,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13433,7 +13909,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "sp-api", "sp-core", @@ -13442,8 +13918,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "backtrace", "lazy_static", @@ -13453,7 +13929,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "rustc-hash", "serde", @@ -13462,8 +13938,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "either", "hash256-std-hasher", @@ -13484,8 +13960,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "17.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13502,20 +13978,20 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "11.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13529,7 +14005,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13541,8 +14017,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.14.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "0.28.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hash-db", "log", @@ -13562,7 +14038,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "log", "parity-scale-codec", @@ -13579,13 +14055,13 @@ dependencies = [ [[package]] name = "sp-std" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" [[package]] name = "sp-storage" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13598,7 +14074,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "futures-timer", @@ -13612,8 +14088,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "10.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "sp-std", @@ -13625,7 +14101,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "sp-api", "sp-runtime", @@ -13634,7 +14110,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "log", @@ -13649,8 +14125,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ahash 0.8.2", "hash-db", @@ -13672,8 +14148,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13682,329 +14158,136 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std", - "sp-version-proc-macro", - "thiserror", -] - -[[package]] -name = "sp-version-proc-macro" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" -dependencies = [ - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "sp-wasm-interface" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std", - "wasmtime", -] - -[[package]] -name = "sp-weights" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" - -[[package]] -name = "spinners" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" -dependencies = [ - "lazy_static", - "maplit", - "strum", -] - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.0", -] - -[[package]] -name = "spki" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0445c905640145c7ea8c1993555957f65e7c46d0535b91ba501bc9bfc85522f" -dependencies = [ - "base64ct", - "der 0.7.1", -] - -[[package]] -name = "ss58-registry" -version = "1.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a9821878e1f13aba383aa40a86fb1b33c7265774ec91e32563cb1dd1577496" -dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", -] - -[[package]] -name = "ssz-rs" -version = "0.8.0" -source = "git+https://github.com/ralexstokes/ssz-rs?rev=d18af912abacbf84219be37ab3b42a9abcf10d2a#d18af912abacbf84219be37ab3b42a9abcf10d2a" -dependencies = [ - "bitvec", - "num-bigint", - "sha2 0.9.8", - "ssz-rs-derive", - "thiserror", -] - -[[package]] -name = "ssz-rs-derive" -version = "0.8.0" -source = "git+https://github.com/ralexstokes/ssz-rs?rev=d18af912abacbf84219be37ab3b42a9abcf10d2a#d18af912abacbf84219be37ab3b42a9abcf10d2a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "statemine-it" -version = "1.0.0" -dependencies = [ - "frame-support", - "frame-system", - "integration-tests-common", - "pallet-assets", - "pallet-balances", - "pallet-xcm", - "parachains-common", - "parity-scale-codec", - "penpal-runtime", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-runtime", - "polkadot-runtime-parachains", - "sp-core", - "sp-runtime", - "sp-weights", - "statemine-runtime", - "xcm", - "xcm-emulator", - "xcm-executor", -] - -[[package]] -name = "statemine-runtime" -version = "2.0.0" -dependencies = [ - "asset-test-utils", - "assets-common", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal 0.4.1", - "kusama-runtime-constants", - "log", - "pallet-asset-tx-payment", - "pallet-assets", - "pallet-aura", - "pallet-authorship", - "pallet-balances", - "pallet-bridge-transfer", - "pallet-collator-selection", - "pallet-multisig", - "pallet-nfts", - "pallet-nfts-runtime-api", - "pallet-proxy", - "pallet-session", - "pallet-state-trie-migration", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-uniques", - "pallet-utility", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parachain-info", - "parachains-common", - "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-runtime-common", - "scale-info", - "smallvec", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-io", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std", - "sp-transaction-pool", - "sp-version", - "sp-weights", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "statemint-it" -version = "1.0.0" -dependencies = [ - "frame-support", - "frame-system", - "integration-tests-common", - "pallet-assets", - "pallet-balances", - "pallet-xcm", - "parachains-common", - "parity-scale-codec", - "penpal-runtime", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-runtime", - "polkadot-runtime-parachains", - "sp-core", - "sp-runtime", - "sp-weights", - "statemint-runtime", - "xcm", - "xcm-emulator", - "xcm-executor", + "sp-std", + "sp-version-proc-macro", + "thiserror", ] [[package]] -name = "statemint-runtime" -version = "1.0.0" +name = "sp-version-proc-macro" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ - "asset-test-utils", - "assets-common", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal 0.4.1", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "sp-wasm-interface" +version = "14.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", "log", - "pallet-asset-tx-payment", - "pallet-assets", - "pallet-aura", - "pallet-authorship", - "pallet-balances", - "pallet-collator-selection", - "pallet-multisig", - "pallet-nfts", - "pallet-nfts-runtime-api", - "pallet-proxy", - "pallet-session", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-uniques", - "pallet-utility", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parachain-info", - "parachains-common", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-runtime-common", - "polkadot-runtime-constants", + "sp-std", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "20.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" +dependencies = [ + "parity-scale-codec", "scale-info", + "serde", "smallvec", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", + "sp-arithmetic", "sp-core", - "sp-inherents", - "sp-offchain", - "sp-runtime", - "sp-session", + "sp-debug-derive", "sp-std", - "sp-transaction-pool", - "sp-version", - "sp-weights", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" + +[[package]] +name = "spinners" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" +dependencies = [ + "lazy_static", + "maplit", + "strum", +] + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.0", +] + +[[package]] +name = "spki" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0445c905640145c7ea8c1993555957f65e7c46d0535b91ba501bc9bfc85522f" +dependencies = [ + "base64ct", + "der 0.7.1", +] + +[[package]] +name = "ss58-registry" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a9821878e1f13aba383aa40a86fb1b33c7265774ec91e32563cb1dd1577496" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "ssz-rs" +version = "0.8.0" +source = "git+https://github.com/ralexstokes/ssz-rs?rev=d18af912abacbf84219be37ab3b42a9abcf10d2a#d18af912abacbf84219be37ab3b42a9abcf10d2a" +dependencies = [ + "bitvec", + "num-bigint", + "sha2 0.9.8", + "ssz-rs-derive", + "thiserror", +] + +[[package]] +name = "ssz-rs-derive" +version = "0.8.0" +source = "git+https://github.com/ralexstokes/ssz-rs?rev=d18af912abacbf84219be37ab3b42a9abcf10d2a#d18af912abacbf84219be37ab3b42a9abcf10d2a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -14127,7 +14410,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "platforms", ] @@ -14135,7 +14418,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -14154,7 +14437,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hyper", "log", @@ -14166,7 +14449,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "jsonrpsee", @@ -14179,7 +14462,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "jsonrpsee", "log", @@ -14198,7 +14481,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -14224,7 +14507,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "futures", "substrate-test-utils-derive", @@ -14234,18 +14517,18 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ansi_term", "build-helper", @@ -14288,9 +14571,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -14344,15 +14627,16 @@ checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" [[package]] name = "tempfile" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ + "autocfg", "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.3", - "windows-sys 0.45.0", + "rustix 0.37.19", + "windows-sys 0.48.0", ] [[package]] @@ -14372,8 +14656,8 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-runtime-constants" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-support", "polkadot-primitives", @@ -14401,7 +14685,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -14556,9 +14840,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.28.1" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", @@ -14581,7 +14865,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -14606,6 +14890,16 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.1", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.9" @@ -14763,8 +15057,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -14774,14 +15068,14 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "expander 2.0.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -14905,7 +15199,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#2bc071f33da268ae218f2f376e7aa1dbf397ec76" +source = "git+https://github.com/paritytech/substrate?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "clap", @@ -14990,9 +15284,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "uint" -version = "0.9.1" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", @@ -15002,9 +15296,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -15014,9 +15308,9 @@ checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -15063,12 +15357,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] @@ -15819,8 +16113,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bitvec", "frame-benchmarking", @@ -15912,8 +16206,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-support", "polkadot-primitives", @@ -15924,76 +16218,6 @@ dependencies = [ "sp-weights", ] -[[package]] -name = "westmint-runtime" -version = "1.0.0" -dependencies = [ - "asset-test-utils", - "assets-common", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal 0.4.1", - "log", - "pallet-asset-tx-payment", - "pallet-assets", - "pallet-aura", - "pallet-authorship", - "pallet-balances", - "pallet-bridge-transfer", - "pallet-collator-selection", - "pallet-multisig", - "pallet-nft-fractionalization", - "pallet-nfts", - "pallet-nfts-runtime-api", - "pallet-proxy", - "pallet-session", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-uniques", - "pallet-utility", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parachain-info", - "parachains-common", - "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-runtime-common", - "scale-info", - "smallvec", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std", - "sp-transaction-pool", - "sp-version", - "substrate-wasm-builder", - "westend-runtime-constants", - "xcm", - "xcm-builder", - "xcm-executor", -] - [[package]] name = "which" version = "4.2.2" @@ -16416,8 +16640,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "bounded-collections", "derivative", @@ -16432,8 +16656,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "frame-support", "frame-system", @@ -16487,8 +16711,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "environmental", "frame-benchmarking", @@ -16507,13 +16731,13 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.41" -source = "git+https://github.com/paritytech/polkadot?branch=master#710419524ece26228f70562147f704eacd00e3af" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=master#b6b74fdf546c14bf9ac93c03916abda9ee33a52f" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 26c916777ba..d5b3b9c2aa9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,9 +43,9 @@ members = [ "parachains/runtimes/starters/shell", "parachains/runtimes/starters/seedling", "parachains/runtimes/assets/common", - "parachains/runtimes/assets/statemint", - "parachains/runtimes/assets/statemine", - "parachains/runtimes/assets/westmint", + "parachains/runtimes/assets/asset-hub-polkadot", + "parachains/runtimes/assets/asset-hub-kusama", + "parachains/runtimes/assets/asset-hub-westend", "parachains/runtimes/bridge-hubs/bridge-hub-rococo", "parachains/runtimes/bridge-hubs/bridge-hub-kusama", "parachains/runtimes/bridge-hubs/bridge-hub-polkadot", @@ -54,8 +54,10 @@ members = [ "parachains/runtimes/glutton/glutton-kusama", "parachains/runtimes/testing/penpal", "parachains/integration-tests/emulated/common", - "parachains/integration-tests/emulated/assets/statemine", - "parachains/integration-tests/emulated/assets/statemint", + "parachains/integration-tests/emulated/assets/asset-hub-kusama", + "parachains/integration-tests/emulated/assets/asset-hub-polkadot", + "parachains/integration-tests/emulated/assets/asset-hub-westend", + "parachains/integration-tests/emulated/collectives/collectives-polkadot", "test/client", "test/relay-sproof-builder", "test/relay-validation-worker-provider", @@ -72,4 +74,3 @@ opt-level = 3 inherits = "release" lto = true codegen-units = 1 - diff --git a/README.md b/README.md index fe6836e03ae..b9ebebfe3a7 100644 --- a/README.md +++ b/README.md @@ -167,16 +167,14 @@ cargo build --release --bin polkadot-parachain ![image](https://user-images.githubusercontent.com/2915325/99548884-1be13580-2987-11eb-9a8b-20be658d34f9.png) -## Statemint 🪙 +## Asset Hub 🪙 -This repository also contains the Statemint runtime (as well as the canary runtime Statemine and the -test runtime Westmint). -Statemint is a system parachain providing an asset store for the Polkadot ecosystem. +This repository also contains the Asset Hub runtimes. Asset Hub is a system parachain providing an +asset store for the Polkadot ecosystem. ### Build & Launch a Node -To run a Statemine or Westmint node (Statemint is not deployed, yet) you will need to compile the -`polkadot-parachain` binary: +To run an Asset Hub node, you will need to compile the `polkadot-parachain` binary: ```bash cargo build --release --locked --bin polkadot-parachain @@ -185,7 +183,7 @@ cargo build --release --locked --bin polkadot-parachain Once the executable is built, launch the parachain node via: ```bash -CHAIN=westmint # or statemine +CHAIN=asset-hub-westend # or asset-hub-kusama ./target/release/polkadot-parachain --chain $CHAIN ``` @@ -244,7 +242,7 @@ Once the executable is built, launch collators for each parachain (repeat once e ### Parachains -* [Statemint](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-statemint-rpc.polkadot.io#/explorer) +* [Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-statemint-rpc.polkadot.io#/explorer) * [Contracts on Rococo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/explorer) * [RILT](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.kilt.io#/explorer) diff --git a/bridges/bin/runtime-common/Cargo.toml b/bridges/bin/runtime-common/Cargo.toml index 5f42048d8d3..119673935eb 100644 --- a/bridges/bin/runtime-common/Cargo.toml +++ b/bridges/bin/runtime-common/Cargo.toml @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } hash-db = { version = "0.16.0", default-features = false } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } static_assertions = { version = "1.1", optional = true } diff --git a/bridges/docs/polkadot-kusama-bridge-overview.md b/bridges/docs/polkadot-kusama-bridge-overview.md index 9f407b6ba00..b469720f65b 100644 --- a/bridges/docs/polkadot-kusama-bridge-overview.md +++ b/bridges/docs/polkadot-kusama-bridge-overview.md @@ -24,9 +24,9 @@ You won't be able to directly use bridge hub transactions to send XCM messages o to use other parachains transactions, which will use HRMP to deliver messages to the Bridge Hub. The Bridge Hub will just queue these messages in its outbound lane, which is dedicated to deliver messages between two parachains. -Our first planned bridge will connect the Polkadot' Statemint and Kusama' Statemine. Bridge between those two -parachains would allow Statemint accounts to hold wrapped KSM tokens and Statemine accounts to hold wrapped DOT -tokens. +Our first planned bridge will connect the Polkadot and Kusama Asset Hubs. A bridge between those two +parachains would allow Asset Hub Polkadot accounts to hold wrapped KSM tokens and Asset Hub Kusama +accounts to hold wrapped DOT tokens. For that bridge (pair of parachains under different consensus systems) we'll be using the lane 00000000. Later, when other parachains will join the bridge, they will be using other lanes for their messages. @@ -93,13 +93,13 @@ Obviously, there should be someone who is paying relayer rewards. We want bridge can't use fees for rewards. Instead, the parachains using the bridge, use sovereign accounts on both sides of the bridge to cover relayer rewards. -Bridged Parachains will have sovereign accounts at bridge hubs. For example, the Statemine (Kusama Parachain) will -have an account at the Polkadot Bridge Hub. The Statemint (Polkadot Parachain) will have an account at the Kusama +Bridged Parachains will have sovereign accounts at bridge hubs. For example, the Kusama Asset Hub will +have an account at the Polkadot Bridge Hub. The Polkadot Asset Hub will have an account at the Kusama Bridge Hub. The sovereign accounts are used as a source of funds when the relayer is calling the `pallet_bridge_relayers::claim_rewards`. Since messages lane is only used by the pair of parachains, there's no collision between different bridges. E.g. -Statemine will only reward relayers that are delivering messages from Statemine. The Statemine sovereign account +Kusama Asset Hub will only reward relayers that are delivering messages from Kusama Asset Hub. The Kusama Asset Hub sovereign account is not used to cover rewards of bridging with some other Polkadot Parachain. ### Multiple Relayers and Rewards diff --git a/bridges/docs/polkadot-kusama-bridge.html b/bridges/docs/polkadot-kusama-bridge.html index dcbae0e7b17..bf248adb571 100644 --- a/bridges/docs/polkadot-kusama-bridge.html +++ b/bridges/docs/polkadot-kusama-bridge.html @@ -16,7 +16,7 @@

Polkadot <> Kusama Bridge

In our architecture, the lane that is used to relay messages over the bridge is determined by - the XCM source and destinations. So e.g. bridge between Statemint and Statemine (and opposite direction) + the XCM source and destinations. So e.g. bridge between Asset Hubs Polkadot and Kusama (and opposite direction) will use the lane 00000000, bridge between some other Polkadot Parachain and some other Kusama Parachain will use the lane 00000001 and so on.

@@ -24,29 +24,29 @@

Polkadot <> Kusama Bridge

flowchart LR subgraph Polkadot Consensus polkadot(((Polkadot))) - statemint(((Statemint))) + asset_hub_polkadot(((Polkadot Asset Hub))) polkadot_bh(((Polkadot Bridge Hub))) - polkadot---statemint + polkadot---asset_hub_polkadot polkadot---polkadot_bh - statemint-->|Send Message Using HRMP|polkadot_bh + asset_hub_polkadot-->|Send Message Using HRMP|polkadot_bh - polkadot_bh-->|Send Message Using HRMP|statemint - statemint-->|Dispatch the Message|statemint + polkadot_bh-->|Send Message Using HRMP|asset_hub_polkadot + asset_hub_polkadot-->|Dispatch the Message|asset_hub_polkadot end subgraph Kusama Consensus kusama_bh(((Kusama Bridge Hub))) - statemine(((Statemine))) + asset_hub_kusama(((Kusama Asset Hub))) kusama(((Kusama))) - kusama---statemine + kusama---asset_hub_kusama kusama---kusama_bh - kusama_bh-->|Send Message Using HRMP|statemine - statemine-->|Dispatch the Message|statemine + kusama_bh-->|Send Message Using HRMP|asset_hub_kusama + asset_hub_kusama-->|Dispatch the Message|asset_hub_kusama - statemine-->|Send Message Using HRMP|kusama_bh + asset_hub_kusama-->|Send Message Using HRMP|kusama_bh end polkadot_bh<===>|Message is relayed to the Bridged Chain using lane 00000000|kusama_bh diff --git a/bridges/modules/grandpa/Cargo.toml b/bridges/modules/grandpa/Cargo.toml index ea8d00b8860..64731a9ced4 100644 --- a/bridges/modules/grandpa/Cargo.toml +++ b/bridges/modules/grandpa/Cargo.toml @@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } finality-grandpa = { version = "0.16.2", default-features = false } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } # Bridge Dependencies @@ -22,8 +22,8 @@ bp-header-chain = { path = "../../primitives/header-chain", default-features = f frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/bridges/modules/messages/Cargo.toml b/bridges/modules/messages/Cargo.toml index 52fdea1df00..6349eb64b17 100644 --- a/bridges/modules/messages/Cargo.toml +++ b/bridges/modules/messages/Cargo.toml @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } num-traits = { version = "0.2", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } diff --git a/bridges/modules/messages/README.md b/bridges/modules/messages/README.md index b717db6ad62..b5250d0dca0 100644 --- a/bridges/modules/messages/README.md +++ b/bridges/modules/messages/README.md @@ -33,8 +33,8 @@ is the runtime developer who defines what message lane and message mean for this In our [Kusama<>Polkadot bridge](../../docs/polkadot-kusama-bridge-overview.md) we are using lane as a channel of communication between two parachains of different relay chains. For example, lane -`[0, 0, 0, 0]` is used for Statemint <> Statemine communications. Other lanes may be used to bridge -another parachains. +`[0, 0, 0, 0]` is used for Polkadot <> Kusama Asset Hub communications. Other lanes may be used to +bridge other parachains. ## Message Workflow diff --git a/bridges/modules/parachains/Cargo.toml b/bridges/modules/parachains/Cargo.toml index 147111fd4ce..30c646a6e69 100644 --- a/bridges/modules/parachains/Cargo.toml +++ b/bridges/modules/parachains/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } # Bridge Dependencies diff --git a/bridges/modules/relayers/Cargo.toml b/bridges/modules/relayers/Cargo.toml index 2a504b0e090..d39bb3b7911 100644 --- a/bridges/modules/relayers/Cargo.toml +++ b/bridges/modules/relayers/Cargo.toml @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } # Bridge dependencies diff --git a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs index 4c9f9e20468..78a98a42a66 100644 --- a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs @@ -53,7 +53,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// This is a copy-paste from the cumulus repo's `parachains-common` crate. const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TIME_PER_SECOND, 0) .saturating_div(2) - .set_proof_size(polkadot_primitives::v4::MAX_POV_SIZE as u64); + .set_proof_size(polkadot_primitives::MAX_POV_SIZE as u64); /// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by /// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic. diff --git a/bridges/primitives/header-chain/Cargo.toml b/bridges/primitives/header-chain/Cargo.toml index e0349ebc9b9..32f81315537 100644 --- a/bridges/primitives/header-chain/Cargo.toml +++ b/bridges/primitives/header-chain/Cargo.toml @@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } finality-grandpa = { version = "0.16.2", default-features = false } scale-info = { version = "2.6.0", default-features = false, features = ["derive"] } -serde = { version = "1.0", optional = true } +serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } # Bridge dependencies @@ -19,9 +19,9 @@ bp-runtime = { path = "../runtime", default-features = false } # Substrate Dependencies frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } [dev-dependencies] diff --git a/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs index 5b278454728..cf08a936234 100644 --- a/bridges/primitives/header-chain/src/lib.rs +++ b/bridges/primitives/header-chain/src/lib.rs @@ -27,7 +27,6 @@ use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen}; use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug}; use frame_support::PalletError; use scale_info::TypeInfo; -#[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_consensus_grandpa::{AuthorityList, ConsensusLog, SetId, GRANDPA_ENGINE_ID}; use sp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug}; @@ -110,8 +109,9 @@ impl AuthoritySet { /// Data required for initializing the GRANDPA bridge pallet. /// /// The bridge needs to know where to start its sync from, and this provides that initial context. -#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, Clone, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive( + Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, Clone, TypeInfo, Serialize, Deserialize, +)] pub struct InitializationData { /// The header from which we should start syncing. pub header: Box, diff --git a/bridges/primitives/messages/Cargo.toml b/bridges/primitives/messages/Cargo.toml index cb35b4ae65b..cc439a55ae2 100644 --- a/bridges/primitives/messages/Cargo.toml +++ b/bridges/primitives/messages/Cargo.toml @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "bit-vec"] } scale-info = { version = "2.6.0", default-features = false, features = ["bit-vec", "derive"] } -serde = { version = "1.0", optional = true, features = ["derive"] } +serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } # Bridge dependencies @@ -34,7 +34,7 @@ std = [ "codec/std", "frame-support/std", "scale-info/std", - "serde", + "serde/std", "sp-core/std", "sp-std/std" ] diff --git a/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs index 8f6c9466109..3df039d7eb8 100644 --- a/bridges/primitives/messages/src/lib.rs +++ b/bridges/primitives/messages/src/lib.rs @@ -39,8 +39,19 @@ pub mod storage_keys; pub mod target_chain; /// Messages pallet operating mode. -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[derive( + Encode, + Decode, + Clone, + Copy, + PartialEq, + Eq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + serde::Serialize, + serde::Deserialize, +)] pub enum MessagesOperatingMode { /// Basic operating mode (Normal/Halted) Basic(BasicOperatingMode), diff --git a/bridges/primitives/runtime/Cargo.toml b/bridges/primitives/runtime/Cargo.toml index 694ff4e1aa6..3e6a30a061c 100644 --- a/bridges/primitives/runtime/Cargo.toml +++ b/bridges/primitives/runtime/Cargo.toml @@ -11,8 +11,8 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features = hash-db = { version = "0.16.0", default-features = false } impl-trait-for-tuples = "0.2.2" num-traits = { version = "0.2", default-features = false } -scale-info = { version = "2.6.0", default-features = false, features = ["derive"] } -serde = { version = "1.0", optional = true, features = ["derive"] } +scale-info = { version = "2.6.0", default-features = false, features = ["derive", "serde"] } +serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } # Substrate Dependencies @@ -20,7 +20,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "mas frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -38,7 +38,7 @@ std = [ "hash-db/std", "num-traits/std", "scale-info/std", - "serde", + "serde/std", "sp-core/std", "sp-io/std", "sp-runtime/std", diff --git a/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs index 1922a2eb160..1ce1b7a0eed 100644 --- a/bridges/primitives/runtime/src/lib.rs +++ b/bridges/primitives/runtime/src/lib.rs @@ -76,8 +76,8 @@ pub const KUSAMA_CHAIN_ID: ChainId = *b"ksma"; /// Westend chain id. pub const WESTEND_CHAIN_ID: ChainId = *b"wend"; -/// Westend chain id. -pub const WESTMINT_CHAIN_ID: ChainId = *b"wmnt"; +/// AssetHubWestend chain id. +pub const ASSET_HUB_WESTEND_CHAIN_ID: ChainId = *b"ahwe"; /// Rococo chain id. pub const ROCOCO_CHAIN_ID: ChainId = *b"roco"; @@ -373,8 +373,19 @@ pub trait OperatingMode: Send + Copy + Debug + FullCodec { } /// Basic operating modes for a bridges module (Normal/Halted). -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[derive( + Encode, + Decode, + Clone, + Copy, + PartialEq, + Eq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + serde::Serialize, + serde::Deserialize, +)] pub enum BasicOperatingMode { /// Normal mode, when all operations are allowed. Normal, diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 6ba04507266..23021820a83 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -clap = { version = "4.3.0", features = ["derive"] } +clap = { version = "4.3.3", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } -url = "2.3.1" +url = "2.4.0" # Substrate sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 02b36320062..9b5f9e4f1de 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -10,7 +10,7 @@ async-trait = "0.1.68" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } dyn-clone = "1.0.11" futures = "0.3.28" -log = "0.4.17" +log = "0.4.19" tracing = "0.1.37" # Substrate diff --git a/client/consensus/common/src/level_monitor.rs b/client/consensus/common/src/level_monitor.rs index ebdfaaf26ca..8a6bbef62f3 100644 --- a/client/consensus/common/src/level_monitor.rs +++ b/client/consensus/common/src/level_monitor.rs @@ -362,14 +362,18 @@ where /// Add a new imported block information to the monitor. pub fn block_imported(&mut self, number: NumberFor, hash: Block::Hash) { - self.import_counter += One::one(); - self.freshness.insert(hash, self.import_counter); - self.levels.entry(number).or_default().insert(hash); - - // Do cleanup once in a while, we are allowed to have some obsolete information. let finalized_num = self.backend.blockchain().info().finalized_number; + + if number > finalized_num { + // Only blocks above the last finalized block should be added to the monitor + self.import_counter += One::one(); + self.freshness.insert(hash, self.import_counter); + self.levels.entry(number).or_default().insert(hash); + } + let delta: u32 = finalized_num.saturating_sub(self.lowest_level).unique_saturated_into(); if delta >= CLEANUP_THRESHOLD { + // Do cleanup once in a while, we are allowed to have some obsolete information. for i in 0..delta { let number = self.lowest_level + i.unique_saturated_into(); self.levels.remove(&number).map(|level| { @@ -378,7 +382,6 @@ where }) }); } - self.lowest_level = finalized_num; } } diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index b74829e191f..f3ef4a3023a 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -147,6 +147,13 @@ where let hash = params.post_hash(); let number = *params.header.number(); + if params.with_state() { + // Force imported state finality. + // Required for warp sync. We assume that preconditions have been + // checked properly and we are importing a finalized block with state. + params.finalized = true; + } + // Best block is determined by the relay chain, or if we are doing the initial sync // we import all blocks as new best. params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom( diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index 68b6054cb70..f8915beb82e 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -31,8 +31,8 @@ cumulus-relay-chain-interface = { path = "../relay-chain-interface" } [dev-dependencies] portpicker = "0.1.1" -tokio = { version = "1.28.1", features = ["macros"] } -url = "2.3.1" +tokio = { version = "1.28.2", features = ["macros"] } +url = "2.4.0" # 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 e5034da396e..62922176e25 100644 --- a/client/pov-recovery/Cargo.toml +++ b/client/pov-recovery/Cargo.toml @@ -31,7 +31,7 @@ cumulus-relay-chain-interface = {path = "../relay-chain-interface"} async-trait = "0.1.68" [dev-dependencies] -tokio = { version = "1.28.1", features = ["macros"] } +tokio = { version = "1.28.2", features = ["macros"] } portpicker = "0.1.1" # Cumulus diff --git a/client/relay-chain-minimal-node/Cargo.toml b/client/relay-chain-minimal-node/Cargo.toml index 866408b2cbb..c9efb6d5e52 100644 --- a/client/relay-chain-minimal-node/Cargo.toml +++ b/client/relay-chain-minimal-node/Cargo.toml @@ -42,4 +42,4 @@ lru = "0.9" tracing = "0.1.37" async-trait = "0.1.68" futures = "0.3.28" -tokio = { version = "1.28.1", features = ["macros"] } +tokio = { version = "1.28.2", features = ["macros"] } diff --git a/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs b/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs index 10b48296bff..afe174202c5 100644 --- a/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs +++ b/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs @@ -21,7 +21,7 @@ use cumulus_relay_chain_rpc_interface::RelayChainRpcClient; use futures::{Stream, StreamExt}; use polkadot_core_primitives::{Block, BlockNumber, Hash, Header}; use polkadot_overseer::RuntimeApiSubsystemClient; -use polkadot_primitives::vstaging; +use polkadot_primitives::slashing; use sc_authority_discovery::{AuthorityDiscovery, Error as AuthorityDiscoveryError}; use sp_api::{ApiError, RuntimeApiInfo}; @@ -308,7 +308,7 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { Vec<( polkadot_primitives::SessionIndex, polkadot_primitives::CandidateHash, - vstaging::slashing::PendingSlashes, + slashing::PendingSlashes, )>, ApiError, > { @@ -319,15 +319,15 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { &self, at: Hash, validator_id: polkadot_primitives::ValidatorId, - ) -> Result, ApiError> { + ) -> Result, ApiError> { Ok(self.rpc_client.parachain_host_key_ownership_proof(at, validator_id).await?) } async fn submit_report_dispute_lost( &self, at: Hash, - dispute_proof: vstaging::slashing::DisputeProof, - key_ownership_proof: vstaging::slashing::OpaqueKeyOwnershipProof, + dispute_proof: slashing::DisputeProof, + key_ownership_proof: slashing::OpaqueKeyOwnershipProof, ) -> Result, ApiError> { Ok(self .rpc_client diff --git a/client/relay-chain-rpc-interface/Cargo.toml b/client/relay-chain-rpc-interface/Cargo.toml index a3a5629e4e1..91294b3971a 100644 --- a/client/relay-chain-rpc-interface/Cargo.toml +++ b/client/relay-chain-rpc-interface/Cargo.toml @@ -21,7 +21,7 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio = { version = "1.28.1", features = ["sync"] } +tokio = { version = "1.28.2", features = ["sync"] } futures = "0.3.28" futures-timer = "3.0.2" @@ -29,7 +29,7 @@ parity-scale-codec = "3.5.0" jsonrpsee = { version = "0.16.2", features = ["ws-client"] } tracing = "0.1.37" async-trait = "0.1.68" -url = "2.3.1" +url = "2.4.0" serde_json = "1.0.96" -serde = "1.0.163" +serde = "1.0.164" lru = "0.9.0" diff --git a/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs b/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs index e03525226bc..803a27d00f6 100644 --- a/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs +++ b/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs @@ -161,7 +161,9 @@ impl ReconnectingWsClient { } } -/// Worker that should be used in combination with [`RelayChainRpcClient`]. Must be polled to distribute header notifications to listeners. +/// Worker that should be used in combination with [`crate::RelayChainRpcClient`]. +/// +/// Must be polled to distribute header notifications to listeners. struct ReconnectingWebsocketWorker { ws_urls: Vec, /// Communication channel with the RPC client diff --git a/client/relay-chain-rpc-interface/src/rpc_client.rs b/client/relay-chain-rpc-interface/src/rpc_client.rs index 70c64eeeffc..a352269104f 100644 --- a/client/relay-chain-rpc-interface/src/rpc_client.rs +++ b/client/relay-chain-rpc-interface/src/rpc_client.rs @@ -30,7 +30,7 @@ use sp_storage::StorageKey; use cumulus_primitives_core::{ relay_chain::{ - vstaging, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, + slashing, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash as RelayHash, Header as RelayHeader, InboundHrmpMessage, OccupiedCoreAssumption, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode, @@ -334,10 +334,7 @@ impl RelayChainRpcClient { pub async fn parachain_host_unapplied_slashes( &self, at: RelayHash, - ) -> Result< - Vec<(SessionIndex, CandidateHash, vstaging::slashing::PendingSlashes)>, - RelayChainError, - > { + ) -> Result, RelayChainError> { self.call_remote_runtime_function("ParachainHost_unapplied_slashes", at, None::<()>) .await } @@ -349,7 +346,7 @@ impl RelayChainRpcClient { &self, at: RelayHash, validator_id: ValidatorId, - ) -> Result, RelayChainError> { + ) -> Result, RelayChainError> { self.call_remote_runtime_function( "ParachainHost_key_ownership_proof", at, @@ -365,8 +362,8 @@ impl RelayChainRpcClient { pub async fn parachain_host_submit_report_dispute_lost( &self, at: RelayHash, - dispute_proof: vstaging::slashing::DisputeProof, - key_ownership_proof: vstaging::slashing::OpaqueKeyOwnershipProof, + dispute_proof: slashing::DisputeProof, + key_ownership_proof: slashing::OpaqueKeyOwnershipProof, ) -> Result, RelayChainError> { self.call_remote_runtime_function( "ParachainHost_submit_report_dispute_lost", diff --git a/docs/release.md b/docs/release.md index 9c0a6acc0e9..b04c4e844c4 100644 --- a/docs/release.md +++ b/docs/release.md @@ -37,8 +37,8 @@ performed during the release process. ### Burn In -Ensure that Parity DevOps has run the new release on Westmint and Statemine collators for 12h prior to publishing the -release. +Ensure that Parity DevOps has run the new release on Westend and Kusama Asset Hub collators for 12h +prior to publishing the release. ### Build Artifacts @@ -84,15 +84,15 @@ To verify the order has not changed, manually start the following [Github Action To run it, in the _Run Workflow_ dropdown: 1. **Use workflow from**: to ignore, leave `master` as default 2. **The WebSocket url of the reference node**: - - Statemint: `wss://statemint-rpc.polkadot.io` - - Statemine: `wss://statemine-rpc.polkadot.io` - - Westmint: `wss://westmint-rpc.polkadot.io` + - Asset Hub Polkadot: `wss://statemint-rpc.polkadot.io` + - Asset Hub Kusama: `wss://statemine-rpc.polkadot.io` + - Asset Hub Westend: `wss://westmint-rpc.polkadot.io` 3. **A url to a Linux binary for the node containing the runtime to test**: Paste the URL of the latest release-candidate binary from the draft-release on Github. The binary has to previously be uploaded to S3 (Github url link to the binary is constantly changing) - E.g: https://releases.parity.io/cumulus/v0.9.270-rc3/polkadot-parachain 4. **The name of the chain under test. Usually, you would pass a local chain**: - - Statemint: `statemint-local` - - Statemine: `statemine-local` - - Westmint: `westmint-local` + - Asset Hub Polkadot: `asset-hub-polkadot-local` + - Asset Hub Kusama: `asset-hub-kusama-local` + - Asset Hub Westend: `asset-hub-westend-local` 5. Click **Run workflow** When the workflow is done, click on it and download the zip artifact, inside you'll find an `output.txt` file. The things to look for in the output are lines like: @@ -114,7 +114,7 @@ The Benchmarks can now be started from the CI. First find the CI pipeline from [ ### Integration Tests Until https://github.com/paritytech/ci_cd/issues/499 is done, tests will have to be run manually. -1. Go to https://github.com/paritytech/parachains-integration-tests and checkout to the release branch. +1. Go to https://github.com/paritytech/parachains-integration-tests and check out the release branch. E.g. https://github.com/paritytech/parachains-integration-tests/tree/release-v9270-v0.9.27 for `release-parachains-v0.9.270` 2. Clone `release-parachains-` branch from Cumulus @@ -126,5 +126,5 @@ In case the branch does not exists (it is a manual process): cherry pick parityt 6. `cargo build --release --features fast-runtime` 7. Copy `./target/polkadot` into `./bin` (in Cumulus) 8. Run the tests: - - Statemint: `yarn zombienet-test -c ./examples/statemint/config.toml -t ./examples/statemint` - - Statemine: `yarn zombienet-test -c ./examples/statemine/config.toml -t ./examples/statemine` + - Asset Hub Polkadot: `yarn zombienet-test -c ./examples/statemint/config.toml -t ./examples/statemint` + - Asset Hub Kusama: `yarn zombienet-test -c ./examples/statemine/config.toml -t ./examples/statemine` diff --git a/pallets/collator-selection/Cargo.toml b/pallets/collator-selection/Cargo.toml index f3bec9567cd..7f6da7abfc4 100644 --- a/pallets/collator-selection/Cargo.toml +++ b/pallets/collator-selection/Cargo.toml @@ -13,7 +13,7 @@ version = "3.0.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", 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.7.0", default-features = false, features = ["derive"] } diff --git a/pallets/collator-selection/src/benchmarking.rs b/pallets/collator-selection/src/benchmarking.rs index 63c9561e7dd..2e363fd6042 100644 --- a/pallets/collator-selection/src/benchmarking.rs +++ b/pallets/collator-selection/src/benchmarking.rs @@ -168,7 +168,7 @@ benchmarks! { } set_desired_candidates { - let max: u32 = 999; + let max: u32 = T::MaxCandidates::get(); let origin = T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; }: { diff --git a/pallets/collator-selection/src/lib.rs b/pallets/collator-selection/src/lib.rs index daccc4ce93c..b6a9e109a11 100644 --- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -81,7 +81,6 @@ pub mod pallet { use core::ops::Div; use frame_support::{ dispatch::{DispatchClass, DispatchResultWithPostInfo}, - inherent::Vec, pallet_prelude::*, sp_runtime::{ traits::{AccountIdConversion, CheckedSub, Saturating, Zero}, @@ -97,6 +96,7 @@ pub mod pallet { use pallet_session::SessionManager; use sp_runtime::traits::Convert; use sp_staking::SessionIndex; + use sp_std::vec::Vec; /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index d7b9c2bf74d..361ea3c47bd 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -17,7 +17,7 @@ use super::*; use crate as collator_selection; use frame_support::{ ord_parameter_types, parameter_types, - traits::{ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration}, + traits::{ConstBool, ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration}, PalletId, }; use frame_system as system; @@ -128,6 +128,7 @@ impl pallet_aura::Config for Test { type AuthorityId = sp_consensus_aura::sr25519::AuthorityId; type MaxAuthorities = ConstU32<100_000>; type DisabledValidators = (); + type AllowMultipleBlocksPerSlot = ConstBool; } sp_runtime::impl_opaque_keys! { diff --git a/pallets/dmp-queue/Cargo.toml b/pallets/dmp-queue/Cargo.toml index c2e914cf282..ce182df2e4f 100644 --- a/pallets/dmp-queue/Cargo.toml +++ b/pallets/dmp-queue/Cargo.toml @@ -6,7 +6,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 } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } # Substrate diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index 2c4a8002a85..120df9ce9a4 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -140,10 +140,6 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - migration::migrate_to_latest::() - } - fn on_idle(_now: T::BlockNumber, max_weight: Weight) -> Weight { // on_idle processes additional messages with any remaining block weight. Self::service_queue(max_weight) diff --git a/pallets/dmp-queue/src/migration.rs b/pallets/dmp-queue/src/migration.rs index 5e1d357e142..b2323f6a60f 100644 --- a/pallets/dmp-queue/src/migration.rs +++ b/pallets/dmp-queue/src/migration.rs @@ -19,31 +19,34 @@ use crate::{Config, Configuration, Overweight, Pallet, DEFAULT_POV_SIZE}; use frame_support::{ pallet_prelude::*, - traits::StorageVersion, + traits::{OnRuntimeUpgrade, StorageVersion}, weights::{constants::WEIGHT_REF_TIME_PER_MILLIS, Weight}, }; /// The current storage version. -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); +pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); -/// Migrates the pallet storage to the most recent version, checking and setting the -/// `StorageVersion`. -pub fn migrate_to_latest() -> Weight { - let mut weight = T::DbWeight::get().reads(1); +/// Migrates the pallet storage to the most recent version. +pub struct Migration(PhantomData); - if StorageVersion::get::>() == 0 { - weight.saturating_accrue(migrate_to_v1::()); - StorageVersion::new(1).put::>(); - weight.saturating_accrue(T::DbWeight::get().writes(1)); - } +impl OnRuntimeUpgrade for Migration { + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads(1); - if StorageVersion::get::>() == 1 { - weight.saturating_accrue(migrate_to_v2::()); - StorageVersion::new(2).put::>(); - weight.saturating_accrue(T::DbWeight::get().writes(1)); - } + if StorageVersion::get::>() == 0 { + weight.saturating_accrue(migrate_to_v1::()); + StorageVersion::new(1).put::>(); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + } - weight + if StorageVersion::get::>() == 1 { + weight.saturating_accrue(migrate_to_v2::()); + StorageVersion::new(2).put::>(); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + } + + weight + } } mod v0 { diff --git a/pallets/parachain-system/Cargo.toml b/pallets/parachain-system/Cargo.toml index 23db13bca7c..fbe2bde74d6 100644 --- a/pallets/parachain-system/Cargo.toml +++ b/pallets/parachain-system/Cargo.toml @@ -10,7 +10,7 @@ bytes = { version = "1.4.0", default-features = false } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } environmental = { version = "1.1.4", default-features = false } impl-trait-for-tuples = "0.2.1" -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } # Substrate diff --git a/pallets/parachain-system/proc-macro/Cargo.toml b/pallets/parachain-system/proc-macro/Cargo.toml index 5caf7cb7b3b..b0883135324 100644 --- a/pallets/parachain-system/proc-macro/Cargo.toml +++ b/pallets/parachain-system/proc-macro/Cargo.toml @@ -9,8 +9,8 @@ description = "Proc macros provided by the parachain-system pallet" proc-macro = true [dependencies] -syn = "2.0.15" -proc-macro2 = "1.0.59" +syn = "2.0.18" +proc-macro2 = "1.0.60" quote = "1.0.28" proc-macro-crate = "1.3.1" diff --git a/pallets/parachain-system/src/lib.rs b/pallets/parachain-system/src/lib.rs index 5f7e1501570..4ef1c511012 100644 --- a/pallets/parachain-system/src/lib.rs +++ b/pallets/parachain-system/src/lib.rs @@ -57,7 +57,7 @@ use sp_runtime::{ use sp_std::{cmp, collections::btree_map::BTreeMap, prelude::*}; use xcm::latest::XcmHash; -mod migration; +pub mod migration; mod relay_state_snapshot; #[macro_use] pub mod validate_block; @@ -197,10 +197,6 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - migration::on_runtime_upgrade::() - } - fn on_finalize(_: T::BlockNumber) { >::kill(); >::kill(); @@ -553,10 +549,8 @@ pub mod pallet { /// In case of a scheduled upgrade, this storage field contains the validation code to be applied. /// - /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][well_known_keys::CODE] + /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][sp_core::storage::well_known_keys::CODE] /// which will result the next block process with the new validation code. This concludes the upgrade process. - /// - /// [well_known_keys::CODE]: sp_core::storage::well_known_keys::CODE #[pallet::storage] #[pallet::getter(fn new_validation_function)] pub(super) type PendingValidationCode = StorageValue<_, Vec, ValueQuery>; @@ -694,7 +688,7 @@ pub mod pallet { /// A custom head data that should be returned as result of `validate_block`. /// - /// See [`Pallet::set_custom_validation_head_data`] for more information. + /// See `Pallet::set_custom_validation_head_data` for more information. #[pallet::storage] pub(super) type CustomValidationHeadData = StorageValue<_, Vec, OptionQuery>; @@ -874,7 +868,7 @@ impl Pallet { /// Process all inbound horizontal messages relayed by the collator. /// - /// This is similar to [`process_inbound_downward_messages`], but works on multiple inbound + /// This is similar to `Pallet::process_inbound_downward_messages`, but works on multiple inbound /// channels. /// /// **Panics** if either any of horizontal messages submitted by the collator was sent from diff --git a/pallets/parachain-system/src/migration.rs b/pallets/parachain-system/src/migration.rs index e3d1e11a51b..17dce3a11a9 100644 --- a/pallets/parachain-system/src/migration.rs +++ b/pallets/parachain-system/src/migration.rs @@ -16,32 +16,37 @@ use crate::{Config, Pallet, ReservedDmpWeightOverride, ReservedXcmpWeightOverride}; use frame_support::{ - traits::{Get, StorageVersion}, + pallet_prelude::*, + traits::{Get, OnRuntimeUpgrade, StorageVersion}, weights::Weight, }; /// The current storage version. pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); -/// Call this during the next runtime upgrade for this module. -pub fn on_runtime_upgrade() -> Weight { - let mut weight: Weight = T::DbWeight::get().reads(2); +/// Migrates the pallet storage to the most recent version. +pub struct Migration(PhantomData); - if StorageVersion::get::>() == 0 { - weight = weight - .saturating_add(v1::migrate::()) - .saturating_add(T::DbWeight::get().writes(1)); - StorageVersion::new(1).put::>(); - } +impl OnRuntimeUpgrade for Migration { + fn on_runtime_upgrade() -> Weight { + let mut weight: Weight = T::DbWeight::get().reads(2); - if StorageVersion::get::>() == 1 { - weight = weight - .saturating_add(v2::migrate::()) - .saturating_add(T::DbWeight::get().writes(1)); - STORAGE_VERSION.put::>(); - } + if StorageVersion::get::>() == 0 { + weight = weight + .saturating_add(v1::migrate::()) + .saturating_add(T::DbWeight::get().writes(1)); + StorageVersion::new(1).put::>(); + } - weight + if StorageVersion::get::>() == 1 { + weight = weight + .saturating_add(v2::migrate::()) + .saturating_add(T::DbWeight::get().writes(1)); + StorageVersion::new(2).put::>(); + } + + weight + } } /// V2: Migrate to 2D weights for ReservedXcmpWeightOverride and ReservedDmpWeightOverride. diff --git a/pallets/session-benchmarking/Cargo.toml b/pallets/session-benchmarking/Cargo.toml index 111cbb85ee6..6bc7d845d70 100644 --- a/pallets/session-benchmarking/Cargo.toml +++ b/pallets/session-benchmarking/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" homepage = "https://substrate.io" repository = "https://github.com/paritytech/cumulus/" -description = "FRAME sessions pallet benchmarking for statemint" +description = "FRAME sessions pallet benchmarking" readme = "README.md" [package.metadata.docs.rs] diff --git a/pallets/xcmp-queue/Cargo.toml b/pallets/xcmp-queue/Cargo.toml index 2238469f05a..4c7142b7a3d 100644 --- a/pallets/xcmp-queue/Cargo.toml +++ b/pallets/xcmp-queue/Cargo.toml @@ -6,7 +6,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 } +log = { version = "0.4.19", default-features = false } rand_chacha = { version = "0.3.0", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index 93c9100f520..12ee6dae25a 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -115,10 +115,6 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - migration::migrate_to_latest::() - } - fn on_idle(_now: T::BlockNumber, max_weight: Weight) -> Weight { // on_idle processes additional messages with any remaining block weight. Self::service_xcmp_queue(max_weight) diff --git a/pallets/xcmp-queue/src/migration.rs b/pallets/xcmp-queue/src/migration.rs index fd1301b9491..bda54620cd9 100644 --- a/pallets/xcmp-queue/src/migration.rs +++ b/pallets/xcmp-queue/src/migration.rs @@ -19,31 +19,34 @@ use crate::{Config, Overweight, Pallet, QueueConfig, DEFAULT_POV_SIZE}; use frame_support::{ pallet_prelude::*, - traits::StorageVersion, + traits::{OnRuntimeUpgrade, StorageVersion}, weights::{constants::WEIGHT_REF_TIME_PER_MILLIS, Weight}, }; /// The current storage version. -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); +pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); -/// Migrates the pallet storage to the most recent version, checking and setting the -/// `StorageVersion`. -pub fn migrate_to_latest() -> Weight { - let mut weight = T::DbWeight::get().reads(1); +/// Migrates the pallet storage to the most recent version. +pub struct Migration(PhantomData); - if StorageVersion::get::>() == 1 { - weight.saturating_accrue(migrate_to_v2::()); - StorageVersion::new(2).put::>(); - weight.saturating_accrue(T::DbWeight::get().writes(1)); - } +impl OnRuntimeUpgrade for Migration { + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads(1); - if StorageVersion::get::>() == 2 { - weight.saturating_accrue(migrate_to_v3::()); - StorageVersion::new(3).put::>(); - weight.saturating_accrue(T::DbWeight::get().writes(1)); - } + if StorageVersion::get::>() == 1 { + weight.saturating_accrue(migrate_to_v2::()); + StorageVersion::new(2).put::>(); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + } - weight + if StorageVersion::get::>() == 2 { + weight.saturating_accrue(migrate_to_v3::()); + StorageVersion::new(3).put::>(); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + } + + weight + } } mod v1 { diff --git a/pallets/xcmp-queue/src/mock.rs b/pallets/xcmp-queue/src/mock.rs index 873ab463cc9..d06da91bee3 100644 --- a/pallets/xcmp-queue/src/mock.rs +++ b/pallets/xcmp-queue/src/mock.rs @@ -168,6 +168,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } pub type XcmRouter = ( diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index d45f915bad6..0debc5966b4 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -10,10 +10,10 @@ edition = "2021" build = "build.rs" [dependencies] -clap = { version = "4.3.0", features = ["derive"] } -log = "0.4.17" +clap = { version = "4.3.3", features = ["derive"] } +log = "0.4.19" codec = { package = "parity-scale-codec", version = "3.0.0" } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.164", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } # Local @@ -72,7 +72,6 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate" [features] default = [] runtime-benchmarks = [ - "try-runtime-cli/try-runtime", "parachain-template-runtime/runtime-benchmarks", "polkadot-cli/runtime-benchmarks", ] diff --git a/parachain-template/pallets/template/Cargo.toml b/parachain-template/pallets/template/Cargo.toml index f47d82c9798..1ccdc6622ba 100644 --- a/parachain-template/pallets/template/Cargo.toml +++ b/parachain-template/pallets/template/Cargo.toml @@ -21,7 +21,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", default-featu frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } [dev-dependencies] -serde = { version = "1.0.132" } +serde = { version = "1.0.163" } # Substrate sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/parachain-template/runtime/Cargo.toml b/parachain-template/runtime/Cargo.toml index 7894ea2176e..6177e435472 100644 --- a/parachain-template/runtime/Cargo.toml +++ b/parachain-template/runtime/Cargo.toml @@ -17,7 +17,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1", optional = true } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index b87445826a1..b2d4ea9f7dd 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -29,7 +29,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, + traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -422,6 +422,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { diff --git a/parachain-template/runtime/src/xcm_config.rs b/parachain-template/runtime/src/xcm_config.rs index 9eea16068d0..ff996d4dde3 100644 --- a/parachain-template/runtime/src/xcm_config.rs +++ b/parachain-template/runtime/src/xcm_config.rs @@ -135,6 +135,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } /// No local origins on this chain are allowed to dispatch XCM sends/executions. diff --git a/parachains/chain-specs/statemine_genesis_values.json b/parachains/chain-specs/asset-hub-kusama-genesis-values.json similarity index 100% rename from parachains/chain-specs/statemine_genesis_values.json rename to parachains/chain-specs/asset-hub-kusama-genesis-values.json diff --git a/parachains/chain-specs/statemine_genesis.json b/parachains/chain-specs/asset-hub-kusama-genesis.json similarity index 99% rename from parachains/chain-specs/statemine_genesis.json rename to parachains/chain-specs/asset-hub-kusama-genesis.json index 8b0dee2f8cf..d6eeb567c25 100644 --- a/parachains/chain-specs/statemine_genesis.json +++ b/parachains/chain-specs/asset-hub-kusama-genesis.json @@ -1,6 +1,6 @@ { - "name": "Statemine", - "id": "statemine", + "name": "Kusama Asset Hub", + "id": "asset-hub-kusama", "chainType": "Live", "bootNodes": [ "/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWHGksh2JFMaW8AkZvyhVpmiXUJnCQbngExTLMdq753ZQR" diff --git a/parachains/chain-specs/statemine.json b/parachains/chain-specs/asset-hub-kusama.json similarity index 99% rename from parachains/chain-specs/statemine.json rename to parachains/chain-specs/asset-hub-kusama.json index bf296a173b9..ccbe8f0326c 100644 --- a/parachains/chain-specs/statemine.json +++ b/parachains/chain-specs/asset-hub-kusama.json @@ -1,6 +1,6 @@ { - "name": "Statemine", - "id": "statemine", + "name": "Kusama Asset Hub", + "id": "asset-hub-kusama", "chainType": "Live", "bootNodes": [ "/ip4/34.77.217.152/tcp/30334/p2p/12D3KooWF63ZxKtZMYs5247WQA8fcTiGJb2osXykc31cmjwNLwem", diff --git a/parachains/chain-specs/statemint_genesis_values.json b/parachains/chain-specs/asset-hub-polkadot-genesis-values.json similarity index 100% rename from parachains/chain-specs/statemint_genesis_values.json rename to parachains/chain-specs/asset-hub-polkadot-genesis-values.json diff --git a/parachains/chain-specs/statemint_genesis_values.scale b/parachains/chain-specs/asset-hub-polkadot-genesis-values.scale similarity index 100% rename from parachains/chain-specs/statemint_genesis_values.scale rename to parachains/chain-specs/asset-hub-polkadot-genesis-values.scale diff --git a/parachains/chain-specs/statemint_genesis.json b/parachains/chain-specs/asset-hub-polkadot-genesis.json similarity index 99% rename from parachains/chain-specs/statemint_genesis.json rename to parachains/chain-specs/asset-hub-polkadot-genesis.json index 2763994949e..fff9bbe1ea1 100644 --- a/parachains/chain-specs/statemint_genesis.json +++ b/parachains/chain-specs/asset-hub-polkadot-genesis.json @@ -1,6 +1,6 @@ { - "name": "Statemint", - "id": "statemint", + "name": "Polkadot Asset Hub", + "id": "asset-hub-polkadot", "chainType": "Live", "bootNodes": [ "/ip4/34.65.251.121/tcp/30334/p2p/12D3KooWG3GrM6XKMM4gp3cvemdwUvu96ziYoJmqmetLZBXE8bSa", diff --git a/parachains/chain-specs/statemint.json b/parachains/chain-specs/asset-hub-polkadot.json similarity index 99% rename from parachains/chain-specs/statemint.json rename to parachains/chain-specs/asset-hub-polkadot.json index 61ca655af6c..5c18f90f70a 100644 --- a/parachains/chain-specs/statemint.json +++ b/parachains/chain-specs/asset-hub-polkadot.json @@ -1,6 +1,6 @@ { - "name": "Statemint", - "id": "statemint", + "name": "Polkadot Asset Hub", + "id": "asset-hub-polkadot", "chainType": "Live", "bootNodes": [ "/ip4/34.65.251.121/tcp/30334/p2p/12D3KooWG3GrM6XKMM4gp3cvemdwUvu96ziYoJmqmetLZBXE8bSa", diff --git a/parachains/chain-specs/rockmine.json b/parachains/chain-specs/asset-hub-rococo.json similarity index 99% rename from parachains/chain-specs/rockmine.json rename to parachains/chain-specs/asset-hub-rococo.json index d774da8744a..1a9e63a1cb8 100644 --- a/parachains/chain-specs/rockmine.json +++ b/parachains/chain-specs/asset-hub-rococo.json @@ -1,6 +1,6 @@ { - "name": "Rockmine", - "id": "statemine-rococo", + "name": "Rococo Asset Hub", + "id": "asset-hub-rococo", "chainType": "Live", "bootNodes": [ "/dns/rococo-rockmine-collator-node-0.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWRrZMndHAopzao34uGsN7srjS3gh9nAjTGKLSyJeU31Lg", diff --git a/parachains/chain-specs/westmint_genesis_values.json b/parachains/chain-specs/asset-hub-westend-genesis-values.json similarity index 100% rename from parachains/chain-specs/westmint_genesis_values.json rename to parachains/chain-specs/asset-hub-westend-genesis-values.json diff --git a/parachains/chain-specs/westmint_genesis.json b/parachains/chain-specs/asset-hub-westend-genesis.json similarity index 99% rename from parachains/chain-specs/westmint_genesis.json rename to parachains/chain-specs/asset-hub-westend-genesis.json index ffd30fbe2de..09d07277c41 100644 --- a/parachains/chain-specs/westmint_genesis.json +++ b/parachains/chain-specs/asset-hub-westend-genesis.json @@ -1,6 +1,6 @@ { - "name": "Westmint", - "id": "westmint", + "name": "Westend Asset Hub", + "id": "asset-hub-westend", "chainType": "Live", "bootNodes": [ "/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWQWfQ6EBNgik1sW5by9vYagzrdsohc6NafeGPU4upnLRp" diff --git a/parachains/chain-specs/westmint.json b/parachains/chain-specs/asset-hub-westend.json similarity index 99% rename from parachains/chain-specs/westmint.json rename to parachains/chain-specs/asset-hub-westend.json index 17d768e58d7..14aaea348e9 100644 --- a/parachains/chain-specs/westmint.json +++ b/parachains/chain-specs/asset-hub-westend.json @@ -1,6 +1,6 @@ { - "name": "Westmint", - "id": "westmint", + "name": "Westend Asset Hub", + "id": "asset-hub-westend", "chainType": "Live", "bootNodes": [ "/dns/westend-westmint-collator-node-0.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWJaAfPyiye7ZQBuHengTJJoMrcaz7Jj1UzHiKdNxA1Nkd", diff --git a/parachains/chain-specs/shell-statemint-head-data b/parachains/chain-specs/shell-head-data similarity index 100% rename from parachains/chain-specs/shell-statemint-head-data rename to parachains/chain-specs/shell-head-data diff --git a/parachains/chain-specs/shell-statemint.json b/parachains/chain-specs/shell.json similarity index 100% rename from parachains/chain-specs/shell-statemint.json rename to parachains/chain-specs/shell.json diff --git a/parachains/common/src/lib.rs b/parachains/common/src/lib.rs index 8ac464ea077..46a8af0fb2e 100644 --- a/parachains/common/src/lib.rs +++ b/parachains/common/src/lib.rs @@ -54,12 +54,12 @@ mod types { // Aura consensus authority. pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; - // Aura consensus authority used by Statemint. + // Aura consensus authority used by Asset Hub Polkadot. // // Because of registering the authorities with an ed25519 key before switching from Shell - // to Statemint, we were required to deploy a hotfix that changed Statemint to ed22519. - // In the future that may change again. - pub type StatemintAuraId = sp_consensus_aura::ed25519::AuthorityId; + // to Asset Hub Polkadot, we were required to deploy a hotfix that changed Asset Hub Polkadot's + // Aura keys to ed22519. In the future that may change again. + pub type AssetHubPolkadotAuraId = sp_consensus_aura::ed25519::AuthorityId; // Id used for identifying assets. pub type AssetIdForTrustBackedAssets = u32; diff --git a/parachains/integration-tests/e2e/assets/statemine/0_xcm/0_init.yml b/parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/0_init.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemine/0_xcm/0_init.yml rename to parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/0_init.yml diff --git a/parachains/integration-tests/e2e/assets/statemine/0_xcm/1_dmp.yml b/parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/1_dmp.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemine/0_xcm/1_dmp.yml rename to parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/1_dmp.yml diff --git a/parachains/integration-tests/e2e/assets/statemine/0_xcm/2_ump.yml b/parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/2_ump.yml similarity index 97% rename from parachains/integration-tests/e2e/assets/statemine/0_xcm/2_ump.yml rename to parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/2_ump.yml index 3cdb9547c35..9b885cb33e9 100644 --- a/parachains/integration-tests/e2e/assets/statemine/0_xcm/2_ump.yml +++ b/parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/2_ump.yml @@ -97,10 +97,10 @@ tests: - name: polkadotXcm.Attempted threshold: *weight_threshold result: [{ Complete: { refTime: '539,494,000', proofSize: '7,133' }}] - - name: ump.ExecutedUpward + - name: messageQueue.Processed chain: *relay_chain threshold: *weight_threshold - result: [{ Complete: { refTime: '298,716,000', proofSize: 0 }}] + result: { origin: { Ump: { Para: '1,000' } }, weightUsed: { refTime: '298,716,000', proofSize: '0' }, success: true } - queries: balance_ap_sender_after: chain: *assets_parachain diff --git a/parachains/integration-tests/e2e/assets/statemine/0_xcm/3_force_hrmp-open-channels.yml b/parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/3_force_hrmp-open-channels.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemine/0_xcm/3_force_hrmp-open-channels.yml rename to parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/3_force_hrmp-open-channels.yml diff --git a/parachains/integration-tests/e2e/assets/statemine/0_xcm/4_hrmp.yml b/parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/4_hrmp.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemine/0_xcm/4_hrmp.yml rename to parachains/integration-tests/e2e/assets/asset-hub-kusama/0_xcm/4_hrmp.yml diff --git a/parachains/integration-tests/e2e/assets/statemine/config.toml b/parachains/integration-tests/e2e/assets/asset-hub-kusama/config.toml similarity index 97% rename from parachains/integration-tests/e2e/assets/statemine/config.toml rename to parachains/integration-tests/e2e/assets/asset-hub-kusama/config.toml index 57c8f37e24b..1ec06b3fa10 100644 --- a/parachains/integration-tests/e2e/assets/statemine/config.toml +++ b/parachains/integration-tests/e2e/assets/asset-hub-kusama/config.toml @@ -26,7 +26,7 @@ chain = "kusama-local" [[parachains]] id = 1000 -chain = "statemine-local" +chain = "asset-hub-kusama-local" cumulus_based = true [[parachains.collators]] diff --git a/parachains/integration-tests/e2e/assets/statemint/0_xcm/0_init.yml b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/0_init.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemint/0_xcm/0_init.yml rename to parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/0_init.yml diff --git a/parachains/integration-tests/e2e/assets/statemint/0_xcm/1_dmp.yml b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/1_dmp.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemint/0_xcm/1_dmp.yml rename to parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/1_dmp.yml diff --git a/parachains/integration-tests/e2e/assets/statemint/0_xcm/2_ump.yml b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/2_ump.yml similarity index 97% rename from parachains/integration-tests/e2e/assets/statemint/0_xcm/2_ump.yml rename to parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/2_ump.yml index 4bdeceb765c..2e38756aeef 100644 --- a/parachains/integration-tests/e2e/assets/statemint/0_xcm/2_ump.yml +++ b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/2_ump.yml @@ -98,10 +98,10 @@ tests: - name: polkadotXcm.Attempted threshold: *weight_threshold result: [{ Complete: { refTime: '533,283,000', proofSize: '7,096' }}] - - name: ump.ExecutedUpward + - name: messageQueue.Processed chain: *relay_chain threshold: *weight_threshold - result: [{ Complete: { refTime: '4,000,000,000', proofSize: 0 }}] + result: { origin: { Ump: { Para: '1,000' } }, weightUsed: { refTime: '4,000,000,000', proofSize: '0' }, success: true } - queries: balance_ap_sender_after: chain: *assets_parachain diff --git a/parachains/integration-tests/e2e/assets/statemint/0_xcm/3_force_hrmp-open-channels.yml b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/3_force_hrmp-open-channels.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemint/0_xcm/3_force_hrmp-open-channels.yml rename to parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/3_force_hrmp-open-channels.yml diff --git a/parachains/integration-tests/e2e/assets/statemint/0_xcm/4_hrmp.yml b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/4_hrmp.yml similarity index 100% rename from parachains/integration-tests/e2e/assets/statemint/0_xcm/4_hrmp.yml rename to parachains/integration-tests/e2e/assets/asset-hub-polkadot/0_xcm/4_hrmp.yml diff --git a/parachains/integration-tests/e2e/assets/statemint/config.toml b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/config.toml similarity index 97% rename from parachains/integration-tests/e2e/assets/statemint/config.toml rename to parachains/integration-tests/e2e/assets/asset-hub-polkadot/config.toml index 2e68734e09f..da53cd0ad4f 100644 --- a/parachains/integration-tests/e2e/assets/statemint/config.toml +++ b/parachains/integration-tests/e2e/assets/asset-hub-polkadot/config.toml @@ -26,7 +26,7 @@ chain = "polkadot-local" [[parachains]] id = 1000 -chain = "statemint-local" +chain = "asset-hub-polkadot-local" cumulus_based = true [[parachains.collators]] diff --git a/parachains/integration-tests/e2e/collectives/collectives-polkadot/0_xcm/1_teleport.yml b/parachains/integration-tests/e2e/collectives/collectives-polkadot/0_xcm/1_teleport.yml index 2cd1fa68168..1171aa50da5 100644 --- a/parachains/integration-tests/e2e/collectives/collectives-polkadot/0_xcm/1_teleport.yml +++ b/parachains/integration-tests/e2e/collectives/collectives-polkadot/0_xcm/1_teleport.yml @@ -130,10 +130,10 @@ tests: - name: balances.Withdraw chain: *relay_chain result: { who: *checking_account, amount: 10000000000000 } # amount received and withdrawn from registry account - - name: ump.ExecutedUpward + - name: messageQueue.Processed chain: *relay_chain threshold: *weight_threshold - result: [{ Complete: { refTime: '4,000,000,000', proofSize: 0 }}] + result: { origin: { Ump: { Para: '1,001' } }, weightUsed: { refTime: '4,000,000,000', proofSize: '0' }, success: true } - queries: balance_rc_alice_3: chain: *relay_chain diff --git a/parachains/integration-tests/emulated/assets/statemint/Cargo.toml b/parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml similarity index 90% rename from parachains/integration-tests/emulated/assets/statemint/Cargo.toml rename to parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml index 8c6077b67e4..a25e2116873 100644 --- a/parachains/integration-tests/emulated/assets/statemint/Cargo.toml +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "statemint-it" +name = "asset-hub-kusama-integration-tests" version = "1.0.0" authors = ["Parity Technologies "] edition = "2021" -description = "Statemint parachain runtime integration tests with xcm-emulator" +description = "Asset Hub Kusama runtime integration tests with xcm-emulator" [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } @@ -29,7 +29,7 @@ pallet-xcm = { default-features = false, git = "https://github.com/paritytech/po # Cumulus parachains-common = { path = "../../../../common" } penpal-runtime = { path = "../../../../runtimes/testing/penpal" } -statemint-runtime = { path = "../../../../runtimes/assets/statemint" } +asset-hub-kusama-runtime = { path = "../../../../runtimes/assets/asset-hub-kusama" } # Local xcm-emulator = { default-features = false, path = "../../../../../xcm/xcm-emulator" } diff --git a/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs new file mode 100644 index 00000000000..596d5893809 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs @@ -0,0 +1,46 @@ +// Copyright 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 . + +pub use codec::Encode; +pub use frame_support::{ + assert_ok, instances::Instance1, pallet_prelude::Weight, traits::fungibles::Inspect, +}; +pub use integration_tests_common::{ + constants::{ + accounts::{ALICE, BOB}, + kusama::ED as KUSAMA_ED, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + }, + AccountId, AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, + BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot, BHPolkadotPallet, + BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet, CollectivesReceiver, + CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver, KusamaSender, + PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot, PenpalPolkadotReceiver, + PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet, PolkadotReceiver, + PolkadotSender, +}; +pub use polkadot_core_primitives::InboundDownwardMessage; +pub use xcm::{ + prelude::*, + v3::{Error, NetworkId::Kusama as KusamaId}, +}; +pub use xcm_emulator::{ + assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, + Parachain as Para, RelayChain as Relay, TestExt, +}; + +#[cfg(test)] +mod tests; diff --git a/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs new file mode 100644 index 00000000000..44861d2a872 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs @@ -0,0 +1,19 @@ +// Copyright 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 reserve_transfer; +mod teleport; +mod transact; diff --git a/parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs similarity index 59% rename from parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs rename to parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs index bbf272572ac..e1107ebb565 100644 --- a/parachains/integration-tests/emulated/assets/statemine/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs @@ -1,3 +1,19 @@ +// Copyright 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 . + use crate::*; #[test] @@ -5,13 +21,14 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { // Init tests variables let amount = KUSAMA_ED * 1000; let relay_sender_balance_before = Kusama::account_data_of(KusamaSender::get()).free; - let para_receiver_balance_before = Statemine::account_data_of(StatemineReceiver::get()).free; + let para_receiver_balance_before = + AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free; let origin = ::RuntimeOrigin::signed(KusamaSender::get()); let assets_para_destination: VersionedMultiLocation = - Kusama::child_location_of(Statemine::para_id()).into(); + Kusama::child_location_of(AssetHubKusama::para_id()).into(); let beneficiary: VersionedMultiLocation = - AccountId32 { network: None, id: StatemineReceiver::get().into() }.into(); + AccountId32 { network: None, id: AssetHubKusamaReceiver::get().into() }.into(); let native_assets: VersionedMultiAssets = (Here, amount).into(); let fee_asset_item = 0; let weight_limit = WeightLimit::Unlimited; @@ -40,11 +57,11 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { }); // Receive XCM message in Assets Parachain - Statemine::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - Statemine, + AssetHubKusama, vec![ RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward { outcome: Outcome::Incomplete(_, Error::UntrustedReserveLocation), @@ -56,7 +73,8 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { // Check if balances are updated accordingly in Relay Chain and Assets Parachain let relay_sender_balance_after = Kusama::account_data_of(KusamaSender::get()).free; - let para_sender_balance_after = Statemine::account_data_of(StatemineReceiver::get()).free; + let para_sender_balance_after = + AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free; assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after); assert_eq!(para_sender_balance_after, para_receiver_balance_before); diff --git a/parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs similarity index 55% rename from parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs rename to parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs index cbb07e4592e..16c0db907c3 100644 --- a/parachains/integration-tests/emulated/assets/statemine/src/tests/teleport.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs @@ -1,3 +1,19 @@ +// Copyright 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 . + use crate::*; #[test] @@ -5,13 +21,14 @@ fn teleport_native_assets_from_relay_to_assets_para() { // Init tests variables let amount = KUSAMA_ED * 1000; let relay_sender_balance_before = Kusama::account_data_of(KusamaSender::get()).free; - let para_receiver_balance_before = Statemine::account_data_of(StatemineReceiver::get()).free; + let para_receiver_balance_before = + AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free; let origin = ::RuntimeOrigin::signed(KusamaSender::get()); let assets_para_destination: VersionedMultiLocation = - Kusama::child_location_of(Statemine::para_id()).into(); + Kusama::child_location_of(AssetHubKusama::para_id()).into(); let beneficiary: VersionedMultiLocation = - AccountId32 { network: None, id: StatemineReceiver::get().into() }.into(); + AccountId32 { network: None, id: AssetHubKusamaReceiver::get().into() }.into(); let native_assets: VersionedMultiAssets = (Here, amount).into(); let fee_asset_item = 0; let weight_limit = WeightLimit::Unlimited; @@ -40,14 +57,14 @@ fn teleport_native_assets_from_relay_to_assets_para() { }); // Receive XCM message in Assets Parachain - Statemine::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - Statemine, + AssetHubKusama, vec![ RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => { - who: *who == StatemineReceiver::get().into(), + who: *who == AssetHubKusamaReceiver::get().into(), }, ] ); @@ -55,7 +72,8 @@ fn teleport_native_assets_from_relay_to_assets_para() { // Check if balances are updated accordingly in Relay Chain and Assets Parachain let relay_sender_balance_after = Kusama::account_data_of(KusamaSender::get()).free; - let para_sender_balance_after = Statemine::account_data_of(StatemineReceiver::get()).free; + let para_sender_balance_after = + AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free; assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after); assert!(para_sender_balance_after > para_receiver_balance_before); diff --git a/parachains/integration-tests/emulated/assets/statemine/src/tests/transact.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/transact.rs similarity index 53% rename from parachains/integration-tests/emulated/assets/statemine/src/tests/transact.rs rename to parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/transact.rs index 144c8cc9f21..65264c25203 100644 --- a/parachains/integration-tests/emulated/assets/statemine/src/tests/transact.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/transact.rs @@ -1,3 +1,19 @@ +// Copyright 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 . + use crate::*; #[test] @@ -6,14 +22,14 @@ fn transact_sudo_from_relay_to_assets_para() { // Call to be executed in Assets Parachain const ASSET_ID: u32 = 1; - let call = ::RuntimeCall::Assets(pallet_assets::Call::< - ::Runtime, + let call = ::RuntimeCall::Assets(pallet_assets::Call::< + ::Runtime, Instance1, >::force_create { id: ASSET_ID.into(), is_sufficient: true, min_balance: 1000, - owner: StatemineSender::get().into(), + owner: AssetHubKusamaSender::get().into(), }) .encode() .into(); @@ -21,7 +37,7 @@ fn transact_sudo_from_relay_to_assets_para() { // XcmPallet send arguments let sudo_origin = ::RuntimeOrigin::root(); let assets_para_destination: VersionedMultiLocation = - Kusama::child_location_of(Statemine::para_id()).into(); + Kusama::child_location_of(AssetHubKusama::para_id()).into(); let weight_limit = WeightLimit::Unlimited; let require_weight_at_most = Weight::from_parts(1000000000, 200000); @@ -52,7 +68,7 @@ fn transact_sudo_from_relay_to_assets_para() { }); // Receive XCM message in Assets Parachain - Statemine::execute_with(|| { - assert!(::Assets::asset_exists(ASSET_ID)); + AssetHubKusama::execute_with(|| { + assert!(::Assets::asset_exists(ASSET_ID)); }); } diff --git a/parachains/integration-tests/emulated/assets/statemine/Cargo.toml b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml similarity index 90% rename from parachains/integration-tests/emulated/assets/statemine/Cargo.toml rename to parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml index 42ed5ac0605..b518257b1a5 100644 --- a/parachains/integration-tests/emulated/assets/statemine/Cargo.toml +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "statemine-it" +name = "asset-hub-polkadot-integration-tests" version = "1.0.0" authors = ["Parity Technologies "] edition = "2021" -description = "Statemine parachain runtime integration tests with xcm-emulator" +description = "Asset Hub Polkadot runtime integration tests with xcm-emulator" [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } @@ -29,7 +29,7 @@ pallet-xcm = { default-features = false, git = "https://github.com/paritytech/po # Cumulus parachains-common = { path = "../../../../common" } penpal-runtime = { path = "../../../../runtimes/testing/penpal" } -statemine-runtime = { path = "../../../../runtimes/assets/statemine" } +asset-hub-polkadot-runtime = { path = "../../../../runtimes/assets/asset-hub-polkadot" } # Local xcm-emulator = { default-features = false, path = "../../../../../xcm/xcm-emulator" } diff --git a/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs new file mode 100644 index 00000000000..02296fa996e --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs @@ -0,0 +1,50 @@ +// Copyright 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 . + +pub use codec::Encode; +pub use frame_support::{ + assert_ok, instances::Instance1, pallet_prelude::Weight, traits::fungibles::Inspect, +}; +pub use integration_tests_common::{ + constants::{ + accounts::{ALICE, BOB}, + polkadot::ED as POLKADOT_ED, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + }, + AccountId, AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, + AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender, + BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot, BHPolkadotPallet, + BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet, CollectivesReceiver, + CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver, KusamaSender, + PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot, PenpalPolkadotReceiver, + PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet, PolkadotReceiver, + PolkadotSender, +}; +pub use polkadot_core_primitives::InboundDownwardMessage; +pub use xcm::{ + prelude::*, + v3::{ + Error, + NetworkId::{Kusama as KusamaId, Polkadot as PolkadotId}, + }, +}; +pub use xcm_emulator::{ + assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, + Parachain as Para, RelayChain as Relay, TestExt, +}; + +#[cfg(test)] +mod tests; diff --git a/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs new file mode 100644 index 00000000000..44861d2a872 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs @@ -0,0 +1,19 @@ +// Copyright 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 reserve_transfer; +mod teleport; +mod transact; diff --git a/parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs similarity index 59% rename from parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs rename to parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs index b69222670b1..a880bc43b2b 100644 --- a/parachains/integration-tests/emulated/assets/statemint/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs @@ -1,3 +1,19 @@ +// Copyright 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 . + use crate::*; #[test] @@ -5,13 +21,14 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { // Init tests variables let amount = POLKADOT_ED * 1000; let relay_sender_balance_before = Polkadot::account_data_of(PolkadotSender::get()).free; - let para_receiver_balance_before = Statemint::account_data_of(StatemintReceiver::get()).free; + let para_receiver_balance_before = + AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free; let origin = ::RuntimeOrigin::signed(PolkadotSender::get()); let assets_para_destination: VersionedMultiLocation = - Polkadot::child_location_of(Statemint::para_id()).into(); + Polkadot::child_location_of(AssetHubPolkadot::para_id()).into(); let beneficiary: VersionedMultiLocation = - AccountId32 { network: None, id: StatemintReceiver::get().into() }.into(); + AccountId32 { network: None, id: AssetHubPolkadotReceiver::get().into() }.into(); let native_assets: VersionedMultiAssets = (Here, amount).into(); let fee_asset_item = 0; let weight_limit = WeightLimit::Unlimited; @@ -40,11 +57,11 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { }); // Receive XCM message in Assets Parachain - Statemint::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - Statemint, + AssetHubPolkadot, vec![ RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward { outcome: Outcome::Incomplete(_, Error::UntrustedReserveLocation), @@ -56,7 +73,8 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { // Check if balances are updated accordingly in Relay Chain and Assets Parachain let relay_sender_balance_after = Polkadot::account_data_of(PolkadotSender::get()).free; - let para_sender_balance_after = Statemint::account_data_of(StatemintReceiver::get()).free; + let para_sender_balance_after = + AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free; assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after); assert_eq!(para_sender_balance_after, para_receiver_balance_before); diff --git a/parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs similarity index 55% rename from parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs rename to parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs index 19aa5fe1f9e..6b799096054 100644 --- a/parachains/integration-tests/emulated/assets/statemint/src/tests/teleport.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -1,3 +1,19 @@ +// Copyright 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 . + use crate::*; #[test] @@ -5,13 +21,14 @@ fn teleport_native_assets_from_relay_to_assets_para() { // Init tests variables let amount = POLKADOT_ED * 1000; let relay_sender_balance_before = Polkadot::account_data_of(PolkadotSender::get()).free; - let para_receiver_balance_before = Statemint::account_data_of(StatemintReceiver::get()).free; + let para_receiver_balance_before = + AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free; let origin = ::RuntimeOrigin::signed(PolkadotSender::get()); let assets_para_destination: VersionedMultiLocation = - Polkadot::child_location_of(Statemint::para_id()).into(); + Polkadot::child_location_of(AssetHubPolkadot::para_id()).into(); let beneficiary: VersionedMultiLocation = - AccountId32 { network: None, id: StatemintReceiver::get().into() }.into(); + AccountId32 { network: None, id: AssetHubPolkadotReceiver::get().into() }.into(); let native_assets: VersionedMultiAssets = (Here, amount).into(); let fee_asset_item = 0; let weight_limit = WeightLimit::Unlimited; @@ -38,14 +55,14 @@ fn teleport_native_assets_from_relay_to_assets_para() { }); // Receive XCM message in Assets Parachain - Statemint::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - Statemint, + AssetHubPolkadot, vec![ RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => { - who: *who == StatemintReceiver::get().into(), + who: *who == AssetHubPolkadotReceiver::get().into(), }, ] ); @@ -53,7 +70,8 @@ fn teleport_native_assets_from_relay_to_assets_para() { // Check if balances are updated accordingly in Relay Chain and Assets Parachain let relay_sender_balance_after = Polkadot::account_data_of(PolkadotSender::get()).free; - let para_sender_balance_after = Statemint::account_data_of(StatemintReceiver::get()).free; + let para_sender_balance_after = + AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free; assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after); assert!(para_sender_balance_after > para_receiver_balance_before); diff --git a/parachains/integration-tests/emulated/assets/statemint/src/tests/transact.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/transact.rs similarity index 53% rename from parachains/integration-tests/emulated/assets/statemint/src/tests/transact.rs rename to parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/transact.rs index 9220d914e47..dc2f1e87d4b 100644 --- a/parachains/integration-tests/emulated/assets/statemint/src/tests/transact.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/transact.rs @@ -1,3 +1,19 @@ +// Copyright 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 . + use crate::*; #[test] @@ -6,14 +22,14 @@ fn transact_sudo_from_relay_to_assets_para() { // Call to be executed in Assets Parachain const ASSET_ID: u32 = 1; - let call = ::RuntimeCall::Assets(pallet_assets::Call::< - ::Runtime, + let call = ::RuntimeCall::Assets(pallet_assets::Call::< + ::Runtime, Instance1, >::force_create { id: ASSET_ID.into(), is_sufficient: true, min_balance: 1000, - owner: StatemintSender::get().into(), + owner: AssetHubPolkadotSender::get().into(), }) .encode() .into(); @@ -21,7 +37,7 @@ fn transact_sudo_from_relay_to_assets_para() { // XcmPallet send arguments let sudo_origin = ::RuntimeOrigin::root(); let assets_para_destination: VersionedMultiLocation = - Polkadot::child_location_of(Statemint::para_id()).into(); + Polkadot::child_location_of(AssetHubPolkadot::para_id()).into(); let weight_limit = WeightLimit::Unlimited; let require_weight_at_most = Weight::from_parts(1000000000, 200000); @@ -52,7 +68,7 @@ fn transact_sudo_from_relay_to_assets_para() { }); // Receive XCM message in Assets Parachain - Statemint::execute_with(|| { - assert!(::Assets::asset_exists(ASSET_ID)); + AssetHubPolkadot::execute_with(|| { + assert!(::Assets::asset_exists(ASSET_ID)); }); } diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml b/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml new file mode 100644 index 00000000000..c216a84191f --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "asset-hub-westend-integration-tests" +version = "1.0.0" +authors = ["Parity Technologies "] +edition = "2021" +description = "Asset Hub Westend runtime integration tests with xcm-emulator" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } + +# Substrate +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" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +sp-weights = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-assets = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } + +# Polkadot +polkadot-core-primitives = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +polkadot-parachain = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "master" } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "master" } +westend-runtime = { git = "https://github.com/paritytech/polkadot", branch = "master" } +xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +xcm-executor = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +pallet-xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } + +# Cumulus +parachains-common = { path = "../../../../common" } +penpal-runtime = { path = "../../../../runtimes/testing/penpal" } +asset-hub-westend-runtime = { path = "../../../../runtimes/assets/asset-hub-westend" } + +# Local +xcm-emulator = { default-features = false, path = "../../../../../xcm/xcm-emulator" } +integration-tests-common = { default-features = false, path = "../../common" } diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs new file mode 100644 index 00000000000..68a5ccfaa0c --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs @@ -0,0 +1,45 @@ +// Copyright 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 . + +pub use codec::Encode; +pub use frame_support::{ + assert_ok, instances::Instance1, pallet_prelude::Weight, traits::fungibles::Inspect, +}; +pub use integration_tests_common::{ + constants::{ + accounts::{ALICE, BOB}, + polkadot::ED as POLKADOT_ED, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + }, + AccountId, AssetHubWestend, AssetHubWestendPallet, AssetHubWestendReceiver, + AssetHubWestendSender, Collectives, CollectivesPallet, CollectivesReceiver, CollectivesSender, + PenpalWestend, Westend, WestendPallet, WestendReceiver, WestendSender, +}; +pub use polkadot_core_primitives::InboundDownwardMessage; +pub use xcm::{ + prelude::*, + v3::{ + Error, + NetworkId::{Kusama as KusamaId, Polkadot as PolkadotId}, + }, +}; +pub use xcm_emulator::{ + assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, + Parachain as Para, RelayChain as Relay, TestExt, +}; + +#[cfg(test)] +mod tests; diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs new file mode 100644 index 00000000000..44861d2a872 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs @@ -0,0 +1,19 @@ +// Copyright 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 reserve_transfer; +mod teleport; +mod transact; diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs new file mode 100644 index 00000000000..8a0191a6fe6 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs @@ -0,0 +1,81 @@ +// Copyright 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 . + +use crate::*; + +#[test] +fn reserve_transfer_native_asset_from_relay_to_assets() { + // Init tests variables + let amount = POLKADOT_ED * 1000; + let relay_sender_balance_before = Westend::account_data_of(WestendSender::get()).free; + let para_receiver_balance_before = + AssetHubWestend::account_data_of(AssetHubWestendReceiver::get()).free; + + let origin = ::RuntimeOrigin::signed(WestendSender::get()); + let assets_para_destination: VersionedMultiLocation = + Westend::child_location_of(AssetHubWestend::para_id()).into(); + let beneficiary: VersionedMultiLocation = + AccountId32 { network: None, id: AssetHubWestendReceiver::get().into() }.into(); + let native_assets: VersionedMultiAssets = (Here, amount).into(); + let fee_asset_item = 0; + let weight_limit = WeightLimit::Unlimited; + + // Send XCM message from Relay Chain + Westend::execute_with(|| { + assert_ok!(::XcmPallet::limited_reserve_transfer_assets( + origin, + bx!(assets_para_destination), + bx!(beneficiary), + bx!(native_assets), + fee_asset_item, + weight_limit, + )); + + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + Westend, + vec![ + RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) }) => { + weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(731_495_000, 0), *weight), + }, + ] + ); + }); + + // Receive XCM message in Assets Parachain + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward { + outcome: Outcome::Incomplete(_, Error::UntrustedReserveLocation), + .. + }) => {}, + ] + ); + }); + + // Check if balances are updated accordingly in Relay Chain and Assets Parachain + let relay_sender_balance_after = Westend::account_data_of(WestendSender::get()).free; + let para_sender_balance_after = + AssetHubWestend::account_data_of(AssetHubWestendReceiver::get()).free; + + assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after); + assert_eq!(para_sender_balance_after, para_receiver_balance_before); +} diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs new file mode 100644 index 00000000000..c8a57933b05 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs @@ -0,0 +1,78 @@ +// Copyright 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 . + +use crate::*; + +#[test] +fn teleport_native_assets_from_relay_to_assets_para() { + // Init tests variables + let amount = POLKADOT_ED * 1000; + let relay_sender_balance_before = Westend::account_data_of(WestendSender::get()).free; + let para_receiver_balance_before = + AssetHubWestend::account_data_of(AssetHubWestendReceiver::get()).free; + + let origin = ::RuntimeOrigin::signed(WestendSender::get()); + let assets_para_destination: VersionedMultiLocation = + Westend::child_location_of(AssetHubWestend::para_id()).into(); + let beneficiary: VersionedMultiLocation = + AccountId32 { network: None, id: AssetHubWestendReceiver::get().into() }.into(); + let native_assets: VersionedMultiAssets = (Here, amount).into(); + let fee_asset_item = 0; + let weight_limit = WeightLimit::Unlimited; + + // Send XCM message from Relay Chain + Westend::execute_with(|| { + assert_ok!(::XcmPallet::limited_teleport_assets( + origin, + bx!(assets_para_destination), + bx!(beneficiary), + bx!(native_assets), + fee_asset_item, + weight_limit, + )); + + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + Westend, + vec![ + RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } }) => {}, + ] + ); + }); + + // Receive XCM message in Assets Parachain + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => { + who: *who == AssetHubWestendReceiver::get().into(), + }, + ] + ); + }); + + // Check if balances are updated accordingly in Relay Chain and Assets Parachain + let relay_sender_balance_after = Westend::account_data_of(WestendSender::get()).free; + let para_sender_balance_after = + AssetHubWestend::account_data_of(AssetHubWestendReceiver::get()).free; + + assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after); + assert!(para_sender_balance_after > para_receiver_balance_before); +} diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/transact.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/transact.rs new file mode 100644 index 00000000000..e71a9174848 --- /dev/null +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/transact.rs @@ -0,0 +1,74 @@ +// Copyright 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 . + +use crate::*; + +#[test] +fn transact_sudo_from_relay_to_assets_para() { + // Init tests variables + // Call to be executed in Assets Parachain + const ASSET_ID: u32 = 1; + + let call = ::RuntimeCall::Assets(pallet_assets::Call::< + ::Runtime, + Instance1, + >::force_create { + id: ASSET_ID.into(), + is_sufficient: true, + min_balance: 1000, + owner: AssetHubWestendSender::get().into(), + }) + .encode() + .into(); + + // XcmPallet send arguments + let sudo_origin = ::RuntimeOrigin::root(); + let assets_para_destination: VersionedMultiLocation = + Westend::child_location_of(AssetHubWestend::para_id()).into(); + + let weight_limit = WeightLimit::Unlimited; + let require_weight_at_most = Weight::from_parts(1000000000, 200000); + let origin_kind = OriginKind::Superuser; + let check_origin = None; + + let xcm = VersionedXcm::from(Xcm(vec![ + UnpaidExecution { weight_limit, check_origin }, + Transact { require_weight_at_most, origin_kind, call }, + ])); + + // Send XCM message from Relay Chain + Westend::execute_with(|| { + assert_ok!(::XcmPallet::send( + sudo_origin, + bx!(assets_para_destination), + bx!(xcm), + )); + + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + Westend, + vec![ + RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, + ] + ); + }); + + // Receive XCM message in Assets Parachain + AssetHubWestend::execute_with(|| { + assert!(::Assets::asset_exists(ASSET_ID)); + }); +} diff --git a/parachains/integration-tests/emulated/assets/statemine/src/lib.rs b/parachains/integration-tests/emulated/assets/statemine/src/lib.rs deleted file mode 100644 index 7616a871b84..00000000000 --- a/parachains/integration-tests/emulated/assets/statemine/src/lib.rs +++ /dev/null @@ -1,30 +0,0 @@ -pub use codec::Encode; -pub use frame_support::{ - assert_ok, instances::Instance1, pallet_prelude::Weight, traits::fungibles::Inspect, -}; -pub use integration_tests_common::{ - constants::{ - accounts::{ALICE, BOB}, - kusama::ED as KUSAMA_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, - }, - AccountId, BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot, - BHPolkadotPallet, BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet, - CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver, - KusamaSender, PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot, - PenpalPolkadotReceiver, PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet, - PolkadotReceiver, PolkadotSender, Statemine, StateminePallet, StatemineReceiver, - StatemineSender, -}; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use xcm::{ - prelude::*, - v3::{Error, NetworkId::Kusama as KusamaId}, -}; -pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - Parachain as Para, RelayChain as Relay, TestExt, -}; - -#[cfg(test)] -mod tests; diff --git a/parachains/integration-tests/emulated/assets/statemine/src/tests/mod.rs b/parachains/integration-tests/emulated/assets/statemine/src/tests/mod.rs deleted file mode 100644 index 996f9fd0aae..00000000000 --- a/parachains/integration-tests/emulated/assets/statemine/src/tests/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod reserve_transfer; -mod teleport; -mod transact; diff --git a/parachains/integration-tests/emulated/assets/statemint/src/lib.rs b/parachains/integration-tests/emulated/assets/statemint/src/lib.rs deleted file mode 100644 index f7ca680a800..00000000000 --- a/parachains/integration-tests/emulated/assets/statemint/src/lib.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub use codec::Encode; -pub use frame_support::{ - assert_ok, instances::Instance1, pallet_prelude::Weight, traits::fungibles::Inspect, -}; -pub use integration_tests_common::{ - constants::{ - accounts::{ALICE, BOB}, - polkadot::ED as POLKADOT_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, - }, - AccountId, BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot, - BHPolkadotPallet, BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet, - CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver, - KusamaSender, PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot, - PenpalPolkadotReceiver, PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet, - PolkadotReceiver, PolkadotSender, Statemine, StateminePallet, StatemineReceiver, - StatemineSender, Statemint, StatemintPallet, StatemintReceiver, StatemintSender, -}; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use xcm::{ - prelude::*, - v3::{ - Error, - NetworkId::{Kusama as KusamaId, Polkadot as PolkadotId}, - }, -}; -pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - Parachain as Para, RelayChain as Relay, TestExt, -}; - -#[cfg(test)] -mod tests; diff --git a/parachains/integration-tests/emulated/assets/statemint/src/tests/mod.rs b/parachains/integration-tests/emulated/assets/statemint/src/tests/mod.rs deleted file mode 100644 index 996f9fd0aae..00000000000 --- a/parachains/integration-tests/emulated/assets/statemint/src/tests/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod reserve_transfer; -mod teleport; -mod transact; diff --git a/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml b/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml new file mode 100644 index 00000000000..b836994e5f8 --- /dev/null +++ b/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "collectives-polkadot-it" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" +description = "Polkadot Collectives parachain runtime integration tests based on xcm-emulator" + +[dev-dependencies] +codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } + +# Substrate +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" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +sp-weights = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-assets = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-core-fellowship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-salary = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } + +# Polkadot +polkadot-core-primitives = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +polkadot-parachain = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "master" } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "master" } +xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +xcm-executor = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } +pallet-xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } + +# Cumulus +parachains-common = { path = "../../../../common" } +cumulus-pallet-xcmp-queue = { default-features = false, path = "../../../../../pallets/xcmp-queue" } +collectives-polkadot-runtime = { path = "../../../../runtimes/collectives/collectives-polkadot" } +asset-hub-polkadot-runtime = { path = "../../../../runtimes/assets/asset-hub-polkadot" } + +# Local +xcm-emulator = { default-features = false, path = "../../../../../xcm/xcm-emulator" } +integration-tests-common = { default-features = false, path = "../../common" } diff --git a/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs b/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs new file mode 100644 index 00000000000..d83ddfffd99 --- /dev/null +++ b/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs @@ -0,0 +1,30 @@ +// Copyright 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 . + +//! Collectives Parachain integration tests based on xcm-emulator. + +#![cfg(test)] + +pub use frame_support::assert_ok; +pub use integration_tests_common::{ + constants::accounts::ALICE, AccountId, AssetHubPolkadot as AssetHub, + AssetHubPolkadotPallet as AssetHubPallet, Collectives, CollectivesPallet, Polkadot, + PolkadotMockNet, +}; +pub use xcm::prelude::*; +pub use xcm_emulator::{assert_expected_events, Parachain}; + +mod tests; diff --git a/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs b/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs new file mode 100644 index 00000000000..233fd67083d --- /dev/null +++ b/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs @@ -0,0 +1,77 @@ +// Copyright 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 . + +//! Integration tests concerning the Fellowship. + +use crate::*; +use collectives_polkadot_runtime::fellowship::FellowshipSalaryPaymaster; +use frame_support::traits::{ + fungibles::{Create, Mutate}, + tokens::Pay, +}; +use sp_core::crypto::Ss58Codec; +use xcm_emulator::TestExt; + +#[test] +fn pay_salary() { + let asset_id: u32 = 1984; + let pay_from: AccountId = + ::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS") + .unwrap(); + let pay_to = Polkadot::account_id_of(ALICE); + let pay_amount = 9000; + + AssetHub::execute_with(|| { + type AssetHubAssets = ::Assets; + + assert_ok!(>::create( + asset_id, + pay_to.clone(), + true, + pay_amount / 2 + )); + assert_ok!(>::mint_into(asset_id, &pay_from, pay_amount * 2)); + }); + + Collectives::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount)); + assert_expected_events!( + Collectives, + vec![ + RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {}, + ] + ); + }); + + AssetHub::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + AssetHub, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => { + asset_id: id == &asset_id, + from: from == &pay_from, + to: to == &pay_to, + amount: amount == &pay_amount, + }, + RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {}, + ] + ); + }); +} diff --git a/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs b/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs new file mode 100644 index 00000000000..1ede78b5979 --- /dev/null +++ b/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs @@ -0,0 +1,17 @@ +// Copyright 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 fellowship; diff --git a/parachains/integration-tests/emulated/common/Cargo.toml b/parachains/integration-tests/emulated/common/Cargo.toml index a13ceac2cff..340ca874993 100644 --- a/parachains/integration-tests/emulated/common/Cargo.toml +++ b/parachains/integration-tests/emulated/common/Cargo.toml @@ -32,6 +32,8 @@ polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "m polkadot-runtime-constants = { git = "https://github.com/paritytech/polkadot", branch = "master" } kusama-runtime = { git = "https://github.com/paritytech/polkadot", branch = "master" } kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot", branch = "master" } +westend-runtime = { git = "https://github.com/paritytech/polkadot", branch = "master" } +westend-runtime-constants = { git = "https://github.com/paritytech/polkadot", branch = "master" } xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } xcm-executor = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } pallet-xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "master" } @@ -41,8 +43,9 @@ parachains-common = { path = "../../../common" } parachain-info = { path = "../../../pallets/parachain-info" } cumulus-primitives-core = { path = "../../../../primitives/core" } penpal-runtime = { path = "../../../runtimes/testing/penpal" } -statemint-runtime = { path = "../../../runtimes/assets/statemint" } -statemine-runtime = { path = "../../../runtimes/assets/statemine" } +asset-hub-polkadot-runtime = { path = "../../../runtimes/assets/asset-hub-polkadot" } +asset-hub-kusama-runtime = { path = "../../../runtimes/assets/asset-hub-kusama" } +asset-hub-westend-runtime = { path = "../../../runtimes/assets/asset-hub-westend" } collectives-polkadot-runtime = { path = "../../../runtimes/collectives/collectives-polkadot" } bridge-hub-kusama-runtime = { path = "../../../runtimes/bridge-hubs/bridge-hub-kusama" } bridge-hub-polkadot-runtime = { path = "../../../runtimes/bridge-hubs/bridge-hub-polkadot" } @@ -51,4 +54,6 @@ xcm-emulator = { default-features = false, path = "../../../../xcm/xcm-emulator" [features] runtime-benchmarks = [ "kusama-runtime/runtime-benchmarks", + "polkadot-runtime/runtime-benchmarks", + "westend-runtime/runtime-benchmarks", ] diff --git a/parachains/integration-tests/emulated/common/src/constants.rs b/parachains/integration-tests/emulated/common/src/constants.rs index 694137fe094..cd4d321457e 100644 --- a/parachains/integration-tests/emulated/common/src/constants.rs +++ b/parachains/integration-tests/emulated/common/src/constants.rs @@ -1,6 +1,6 @@ use grandpa::AuthorityId as GrandpaId; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -pub use parachains_common::{AccountId, AuraId, Balance, BlockNumber, StatemintAuraId}; +pub use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber}; use polkadot_primitives::{AssignmentId, ValidatorId}; pub use polkadot_runtime_parachains::configuration::HostConfiguration; use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy; @@ -71,15 +71,15 @@ pub mod accounts { pub mod collators { use super::*; - pub fn invulnerables_statemint() -> Vec<(AccountId, StatemintAuraId)> { + pub fn invulnerables_asset_hub_polkadot() -> Vec<(AccountId, AssetHubPolkadotAuraId)> { vec![ ( get_account_id_from_seed::("Alice"), - get_from_seed::("Alice"), + get_from_seed::("Alice"), ), ( get_account_id_from_seed::("Bob"), - get_from_seed::("Bob"), + get_from_seed::("Bob"), ), ] } @@ -209,6 +209,102 @@ pub mod polkadot { } } +pub mod westend { + use super::*; + use westend_runtime_constants::currency::UNITS as WND; + pub const ED: Balance = westend_runtime_constants::currency::EXISTENTIAL_DEPOSIT; + const ENDOWMENT: u128 = 1_000_000 * WND; + const STASH: u128 = 100 * WND; + + pub fn get_host_config() -> HostConfiguration { + HostConfiguration { + max_upward_queue_count: 10, + max_upward_queue_size: 51200, + max_upward_message_size: 51200, + max_upward_message_num_per_candidate: 10, + max_downward_message_size: 51200, + ..Default::default() + } + } + + fn session_keys( + babe: BabeId, + grandpa: GrandpaId, + im_online: ImOnlineId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, + ) -> westend_runtime::SessionKeys { + westend_runtime::SessionKeys { + babe, + grandpa, + im_online, + para_validator, + para_assignment, + authority_discovery, + } + } + + pub fn genesis() -> Storage { + let genesis_config = westend_runtime::GenesisConfig { + system: westend_runtime::SystemConfig { + code: westend_runtime::WASM_BINARY.unwrap().to_vec(), + }, + balances: westend_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ENDOWMENT)) + .collect(), + }, + session: westend_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + westend::session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + ), + ) + }) + .collect::>(), + }, + staking: westend_runtime::StakingConfig { + validator_count: validators::initial_authorities().len() as u32, + minimum_validator_count: 1, + stakers: validators::initial_authorities() + .iter() + .map(|x| { + (x.0.clone(), x.1.clone(), STASH, westend_runtime::StakerStatus::Validator) + }) + .collect(), + invulnerables: validators::initial_authorities() + .iter() + .map(|x| x.0.clone()) + .collect(), + force_era: pallet_staking::Forcing::ForceNone, + slash_reward_fraction: Perbill::from_percent(10), + ..Default::default() + }, + babe: westend_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(westend_runtime::BABE_GENESIS_EPOCH_CONFIG), + }, + configuration: westend_runtime::ConfigurationConfig { config: get_host_config() }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() + } +} + // Kusama pub mod kusama { use super::*; @@ -305,29 +401,87 @@ pub mod kusama { } } -// Statemint -pub mod statemint { +// Asset Hub Polkadot +pub mod asset_hub_polkadot { + use super::*; + pub const PARA_ID: u32 = 1000; + pub const ED: Balance = asset_hub_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = asset_hub_polkadot_runtime::GenesisConfig { + system: asset_hub_polkadot_runtime::SystemConfig { + code: asset_hub_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + }, + balances: asset_hub_polkadot_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096)) + .collect(), + }, + parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + }, + collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables_asset_hub_polkadot() + .iter() + .cloned() + .map(|(acc, _)| acc) + .collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: asset_hub_polkadot_runtime::SessionConfig { + keys: collators::invulnerables_asset_hub_polkadot() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + asset_hub_polkadot_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + aura: Default::default(), + aura_ext: Default::default(), + parachain_system: Default::default(), + polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + }; + + genesis_config.build_storage().unwrap() + } +} + +// Asset Hub Westend +pub mod asset_hub_westend { use super::*; pub const PARA_ID: u32 = 1000; - pub const ED: Balance = statemint_runtime::constants::currency::EXISTENTIAL_DEPOSIT; + pub const ED: Balance = asset_hub_westend_runtime::constants::currency::EXISTENTIAL_DEPOSIT; pub fn genesis() -> Storage { - let genesis_config = statemint_runtime::GenesisConfig { - system: statemint_runtime::SystemConfig { - code: statemint_runtime::WASM_BINARY + let genesis_config = asset_hub_westend_runtime::GenesisConfig { + system: asset_hub_westend_runtime::SystemConfig { + code: asset_hub_westend_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), }, - balances: statemint_runtime::BalancesConfig { + balances: asset_hub_westend_runtime::BalancesConfig { balances: accounts::init_balances() .iter() .cloned() .map(|k| (k, ED * 4096)) .collect(), }, - parachain_info: statemint_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into() }, - collator_selection: statemint_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables_statemint() + parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + }, + collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables() .iter() .cloned() .map(|(acc, _)| acc) @@ -335,14 +489,14 @@ pub mod statemint { candidacy_bond: ED * 16, ..Default::default() }, - session: statemint_runtime::SessionConfig { - keys: collators::invulnerables_statemint() + session: asset_hub_westend_runtime::SessionConfig { + keys: collators::invulnerables() .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - statemint_runtime::SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + asset_hub_westend_runtime::SessionKeys { aura }, // session keys ) }) .collect(), @@ -350,7 +504,7 @@ pub mod statemint { aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), - polkadot_xcm: statemint_runtime::PolkadotXcmConfig { + polkadot_xcm: asset_hub_westend_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, }; @@ -359,28 +513,30 @@ pub mod statemint { } } -// Statemint -pub mod statemine { +// Asset Hub Kusama +pub mod asset_hub_kusama { use super::*; pub const PARA_ID: u32 = 1000; - pub const ED: Balance = statemine_runtime::constants::currency::EXISTENTIAL_DEPOSIT; + pub const ED: Balance = asset_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT; pub fn genesis() -> Storage { - let genesis_config = statemine_runtime::GenesisConfig { - system: statemine_runtime::SystemConfig { - code: statemine_runtime::WASM_BINARY + let genesis_config = asset_hub_kusama_runtime::GenesisConfig { + system: asset_hub_kusama_runtime::SystemConfig { + code: asset_hub_kusama_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), }, - balances: statemine_runtime::BalancesConfig { + balances: asset_hub_kusama_runtime::BalancesConfig { balances: accounts::init_balances() .iter() .cloned() .map(|k| (k, ED * 4096)) .collect(), }, - parachain_info: statemine_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into() }, - collator_selection: statemine_runtime::CollatorSelectionConfig { + parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + }, + collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() .iter() .cloned() @@ -389,14 +545,14 @@ pub mod statemine { candidacy_bond: ED * 16, ..Default::default() }, - session: statemine_runtime::SessionConfig { + session: asset_hub_kusama_runtime::SessionConfig { keys: collators::invulnerables() .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - statemine_runtime::SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + asset_hub_kusama_runtime::SessionKeys { aura }, // session keys ) }) .collect(), @@ -404,7 +560,7 @@ pub mod statemine { aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), - polkadot_xcm: statemine_runtime::PolkadotXcmConfig { + polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, }; diff --git a/parachains/integration-tests/emulated/common/src/lib.rs b/parachains/integration-tests/emulated/common/src/lib.rs index 49e919b5de9..2b2af134a51 100644 --- a/parachains/integration-tests/emulated/common/src/lib.rs +++ b/parachains/integration-tests/emulated/common/src/lib.rs @@ -2,20 +2,41 @@ pub mod constants; pub use constants::{ accounts::{ALICE, BOB}, - bridge_hub_kusama, bridge_hub_polkadot, collectives, kusama, penpal, polkadot, statemine, - statemint, + asset_hub_kusama, asset_hub_polkadot, asset_hub_westend, bridge_hub_kusama, + bridge_hub_polkadot, collectives, kusama, penpal, polkadot, westend, }; use frame_support::{parameter_types, sp_io, sp_tracing}; -pub use parachains_common::{AccountId, AuraId, Balance, BlockNumber, StatemintAuraId}; +pub use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber}; pub use sp_core::{sr25519, storage::Storage, Get}; use xcm::prelude::*; use xcm_emulator::{ decl_test_networks, decl_test_parachains, decl_test_relay_chains, Parachain, RelayChain, TestExt, }; -use xcm_executor::traits::Convert; +use xcm_executor::traits::ConvertLocation; decl_test_relay_chains! { + #[api_version(5)] + pub struct Westend { + genesis = westend::genesis(), + on_init = (), + runtime = { + Runtime: westend_runtime::Runtime, + RuntimeOrigin: westend_runtime::RuntimeOrigin, + RuntimeCall: westend_runtime::RuntimeCall, + RuntimeEvent: westend_runtime::RuntimeEvent, + MessageQueue: westend_runtime::MessageQueue, + XcmConfig: westend_runtime::xcm_config::XcmConfig, + SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf, + System: westend_runtime::System, + Balances: westend_runtime::Balances, + }, + pallets_extra = { + XcmPallet: westend_runtime::XcmPallet, + Sudo: westend_runtime::Sudo, + } + }, + #[api_version(5)] pub struct Polkadot { genesis = polkadot::genesis(), on_init = (), @@ -34,6 +55,7 @@ decl_test_relay_chains! { XcmPallet: polkadot_runtime::XcmPallet, } }, + #[api_version(5)] pub struct Kusama { genesis = kusama::genesis(), on_init = (), @@ -55,26 +77,49 @@ decl_test_relay_chains! { } decl_test_parachains! { + // Westend + pub struct AssetHubWestend { + genesis = asset_hub_westend::genesis(), + on_init = (), + runtime = { + Runtime: asset_hub_westend_runtime::Runtime, + RuntimeOrigin: asset_hub_westend_runtime::RuntimeOrigin, + RuntimeCall: asset_hub_westend_runtime::RuntimeCall, + RuntimeEvent: asset_hub_westend_runtime::RuntimeEvent, + XcmpMessageHandler: asset_hub_westend_runtime::XcmpQueue, + DmpMessageHandler: asset_hub_westend_runtime::DmpQueue, + LocationToAccountId: asset_hub_westend_runtime::xcm_config::LocationToAccountId, + System: asset_hub_westend_runtime::System, + Balances: asset_hub_westend_runtime::Balances, + ParachainSystem: asset_hub_westend_runtime::ParachainSystem, + ParachainInfo: asset_hub_westend_runtime::ParachainInfo, + }, + pallets_extra = { + PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm, + Assets: asset_hub_westend_runtime::Assets, + ForeignAssets: asset_hub_westend_runtime::ForeignAssets, + } + }, // Polkadot - pub struct Statemint { - genesis = statemint::genesis(), + pub struct AssetHubPolkadot { + genesis = asset_hub_polkadot::genesis(), on_init = (), runtime = { - Runtime: statemint_runtime::Runtime, - RuntimeOrigin: statemint_runtime::RuntimeOrigin, - RuntimeCall: statemint_runtime::RuntimeCall, - RuntimeEvent: statemint_runtime::RuntimeEvent, - XcmpMessageHandler: statemint_runtime::XcmpQueue, - DmpMessageHandler: statemint_runtime::DmpQueue, - LocationToAccountId: statemint_runtime::xcm_config::LocationToAccountId, - System: statemint_runtime::System, - Balances: statemint_runtime::Balances, - ParachainSystem: statemint_runtime::ParachainSystem, - ParachainInfo: statemint_runtime::ParachainInfo, + Runtime: asset_hub_polkadot_runtime::Runtime, + RuntimeOrigin: asset_hub_polkadot_runtime::RuntimeOrigin, + RuntimeCall: asset_hub_polkadot_runtime::RuntimeCall, + RuntimeEvent: asset_hub_polkadot_runtime::RuntimeEvent, + XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue, + DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue, + LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId, + System: asset_hub_polkadot_runtime::System, + Balances: asset_hub_polkadot_runtime::Balances, + ParachainSystem: asset_hub_polkadot_runtime::ParachainSystem, + ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo, }, pallets_extra = { - PolkadotXcm: statemint_runtime::PolkadotXcm, - Assets: statemint_runtime::Assets, + PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm, + Assets: asset_hub_polkadot_runtime::Assets, } }, pub struct PenpalPolkadot { @@ -98,27 +143,49 @@ decl_test_parachains! { Assets: penpal_runtime::Assets, } }, + pub struct PenpalWestend { + genesis = penpal::genesis(penpal::PARA_ID), + on_init = (), + runtime = { + Runtime: penpal_runtime::Runtime, + RuntimeOrigin: penpal_runtime::RuntimeOrigin, + RuntimeCall: penpal_runtime::RuntimeCall, + RuntimeEvent: penpal_runtime::RuntimeEvent, + XcmpMessageHandler: penpal_runtime::XcmpQueue, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + System: penpal_runtime::System, + Balances: penpal_runtime::Balances, + ParachainSystem: penpal_runtime::ParachainSystem, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets_extra = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + }, + // Kusama - pub struct Statemine { - genesis = statemine::genesis(), + pub struct AssetHubKusama { + genesis = asset_hub_kusama::genesis(), on_init = (), runtime = { - Runtime: statemine_runtime::Runtime, - RuntimeOrigin: statemine_runtime::RuntimeOrigin, - RuntimeCall: statemine_runtime::RuntimeCall, - RuntimeEvent: statemine_runtime::RuntimeEvent, - XcmpMessageHandler: statemine_runtime::XcmpQueue, - DmpMessageHandler: statemine_runtime::DmpQueue, - LocationToAccountId: statemine_runtime::xcm_config::LocationToAccountId, - System: statemine_runtime::System, - Balances: statemine_runtime::Balances, - ParachainSystem: statemine_runtime::ParachainSystem, - ParachainInfo: statemine_runtime::ParachainInfo, + Runtime: asset_hub_kusama_runtime::Runtime, + RuntimeOrigin: asset_hub_kusama_runtime::RuntimeOrigin, + RuntimeCall: asset_hub_kusama_runtime::RuntimeCall, + RuntimeEvent: asset_hub_kusama_runtime::RuntimeEvent, + XcmpMessageHandler: asset_hub_kusama_runtime::XcmpQueue, + DmpMessageHandler: asset_hub_kusama_runtime::DmpQueue, + LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId, + System: asset_hub_kusama_runtime::System, + Balances: asset_hub_kusama_runtime::Balances, + ParachainSystem: asset_hub_kusama_runtime::ParachainSystem, + ParachainInfo: asset_hub_kusama_runtime::ParachainInfo, }, pallets_extra = { - PolkadotXcm: statemine_runtime::PolkadotXcm, - Assets: statemine_runtime::Assets, - ForeignAssets: statemine_runtime::Assets, + PolkadotXcm: asset_hub_kusama_runtime::PolkadotXcm, + Assets: asset_hub_kusama_runtime::Assets, + ForeignAssets: asset_hub_kusama_runtime::Assets, } }, pub struct PenpalKusama { @@ -208,7 +275,7 @@ decl_test_networks! { pub struct PolkadotMockNet { relay_chain = Polkadot, parachains = vec![ - Statemint, + AssetHubPolkadot, PenpalPolkadot, Collectives, BHPolkadot, @@ -217,10 +284,17 @@ decl_test_networks! { pub struct KusamaMockNet { relay_chain = Kusama, parachains = vec![ - Statemine, + AssetHubKusama, PenpalKusama, BHKusama, ], + }, + pub struct WestendMockNet { + relay_chain = Westend, + parachains = vec![ + AssetHubWestend, + PenpalWestend, + ], } } @@ -231,18 +305,27 @@ parameter_types! { // Kusama pub KusamaSender: AccountId = Kusama::account_id_of(ALICE); pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB); - // Statemint - pub StatemintSender: AccountId = Statemint::account_id_of(ALICE); - pub StatemintReceiver: AccountId = Statemint::account_id_of(BOB); - // Statemine - pub StatemineSender: AccountId = Statemine::account_id_of(ALICE); - pub StatemineReceiver: AccountId = Statemine::account_id_of(BOB); + // Westend + pub WestendSender: AccountId = Westend::account_id_of(ALICE); + pub WestendReceiver: AccountId = Westend::account_id_of(BOB); + // Asset Hub Westend + pub AssetHubWestendSender: AccountId = AssetHubWestend::account_id_of(ALICE); + pub AssetHubWestendReceiver: AccountId = AssetHubWestend::account_id_of(BOB); + // Asset Hub Polkadot + pub AssetHubPolkadotSender: AccountId = AssetHubPolkadot::account_id_of(ALICE); + pub AssetHubPolkadotReceiver: AccountId = AssetHubPolkadot::account_id_of(BOB); + // Asset Hub Kusama + pub AssetHubKusamaSender: AccountId = AssetHubKusama::account_id_of(ALICE); + pub AssetHubKusamaReceiver: AccountId = AssetHubKusama::account_id_of(BOB); // Penpal Polkadot pub PenpalPolkadotSender: AccountId = PenpalPolkadot::account_id_of(ALICE); pub PenpalPolkadotReceiver: AccountId = PenpalPolkadot::account_id_of(BOB); // Penpal Kusama pub PenpalKusamaSender: AccountId = PenpalKusama::account_id_of(ALICE); pub PenpalKusamaReceiver: AccountId = PenpalKusama::account_id_of(BOB); + // Penpal Westend + pub PenpalWestendSender: AccountId = PenpalWestend::account_id_of(ALICE); + pub PenpalWestendReceiver: AccountId = PenpalWestend::account_id_of(BOB); // Collectives pub CollectivesSender: AccountId = Collectives::account_id_of(ALICE); pub CollectivesReceiver: AccountId = Collectives::account_id_of(BOB); diff --git a/parachains/pallets/bridge-transfer/Cargo.toml b/parachains/pallets/bridge-transfer/Cargo.toml index 505949daa50..b4e47e472ba 100644 --- a/parachains/pallets/bridge-transfer/Cargo.toml +++ b/parachains/pallets/bridge-transfer/Cargo.toml @@ -27,6 +27,9 @@ xcm = { git = "https://github.com/paritytech/polkadot", default-features = false xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +# Cumulus +pallet-bridge-transfer-primitives = { path = "./primitives", default-features = false } + [dev-dependencies] sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -39,6 +42,7 @@ std = [ "codec/std", "log/std", "scale-info/std", + "pallet-bridge-transfer-primitives/std", "sp-std/std", "sp-runtime/std", "frame-support/std", diff --git a/parachains/pallets/bridge-transfer/primitives/Cargo.toml b/parachains/pallets/bridge-transfer/primitives/Cargo.toml new file mode 100644 index 00000000000..2ac8cf450e2 --- /dev/null +++ b/parachains/pallets/bridge-transfer/primitives/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "pallet-bridge-transfer-primitives" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" +license = "Apache-2.0" +homepage = "https://docs.substrate.io/" +repository = "https://github.com/paritytech/cumulus/" +description = "Pallet with primitives for message transfer through bridges" + +[dependencies] + +# Substrate +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } + +# Polkadot +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } + +[features] +default = ["std"] +std = [ + "sp-std/std", + "frame-support/std", + "xcm/std", + "xcm-builder/std", +] diff --git a/parachains/pallets/bridge-transfer/primitives/src/asset_filter.rs b/parachains/pallets/bridge-transfer/primitives/src/asset_filter.rs new file mode 100644 index 00000000000..d59cb2a9f26 --- /dev/null +++ b/parachains/pallets/bridge-transfer/primitives/src/asset_filter.rs @@ -0,0 +1,72 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Primitives for matching asset `MultiLocation`. + +use xcm::prelude::*; + +/// Trait for matching asset location +pub trait MatchAssetLocation { + fn matches(&self, location: &MultiLocation) -> bool; +} + +/// Simple asset location filter +#[derive(Debug)] +pub enum AssetFilter { + ByMultiLocation(MultiLocationFilter), +} + +impl MatchAssetLocation for AssetFilter { + fn matches(&self, asset_location: &MultiLocation) -> bool { + match self { + AssetFilter::ByMultiLocation(by_location) => by_location.matches(asset_location), + } + } +} + +#[derive(Debug, Default)] +pub struct MultiLocationFilter { + /// Requested location equals to `MultiLocation` + pub equals_any: sp_std::vec::Vec, + /// Requested location starts with `MultiLocation` + pub starts_with_any: sp_std::vec::Vec, +} + +impl MultiLocationFilter { + pub fn add_equals(mut self, filter: MultiLocation) -> Self { + self.equals_any.push(filter); + self + } + pub fn add_starts_with(mut self, filter: MultiLocation) -> Self { + self.starts_with_any.push(filter); + self + } +} + +impl MatchAssetLocation for MultiLocationFilter { + fn matches(&self, location: &MultiLocation) -> bool { + for filter in &self.equals_any { + if location.eq(filter) { + return true + } + } + for filter in &self.starts_with_any { + if location.starts_with(filter) { + return true + } + } + false + } +} diff --git a/parachains/pallets/bridge-transfer/primitives/src/config.rs b/parachains/pallets/bridge-transfer/primitives/src/config.rs new file mode 100644 index 00000000000..eac3bcbc7e6 --- /dev/null +++ b/parachains/pallets/bridge-transfer/primitives/src/config.rs @@ -0,0 +1,121 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Primitives for easier configuration. + +use crate::{ + AssetFilter, EnsureReachableDestination, MaybePaidLocation, ReachableDestination, + ReachableDestinationError, +}; +use frame_support::{ + traits::{ConstU32, Get}, + BoundedBTreeMap, +}; +use xcm::prelude::*; +use xcm_builder::ExporterFor; + +/// Configuration represents bridge to target location with possible asset filtering +#[derive(Debug)] +pub struct BridgeConfig { + /// Location, which is able to bridge XCM messages to bridged network + pub bridge_location: MaybePaidLocation, + /// Contains target destination on bridged network. E.g.: MultiLocation of Statemine/t on different consensus + its configuration + pub allowed_target_locations: sp_std::vec::Vec<(MaybePaidLocation, Option)>, +} + +impl BridgeConfig { + pub fn new(bridge_location: MaybePaidLocation) -> Self { + Self { bridge_location, allowed_target_locations: Default::default() } + } + + pub fn add_target_location( + mut self, + target_location: MaybePaidLocation, + asset_filter: Option, + ) -> Self { + self.allowed_target_locations.push((target_location, asset_filter)); + self + } + + pub fn allowed_target_location_for( + &self, + destination: &MultiLocation, + ) -> Option<(&MaybePaidLocation, &Option)> { + for (allowed_target_location, asset_filter) in &self.allowed_target_locations { + if destination.starts_with(&allowed_target_location.location) || + destination.eq(&allowed_target_location.location) + { + return Some((allowed_target_location, asset_filter)) + } + } + None + } +} + +/// Type represents all "stored" `BridgeConfig`s. +pub type BridgesConfig = BoundedBTreeMap>; + +/// Builder for creating `BridgesConfig`. +#[derive(Default)] +pub struct BridgesConfigBuilder { + configs: BoundedBTreeMap>, +} +impl BridgesConfigBuilder { + pub fn add_or_panic(mut self, network_id: NetworkId, bridge_config: BridgeConfig) -> Self { + self.configs.try_insert(network_id, bridge_config).expect("check bounds"); + self + } + + pub fn build(self) -> BoundedBTreeMap> { + self.configs + } +} + +/// Adapter for accessing `BridgesConfig`. +pub struct BridgesConfigAdapter(sp_std::marker::PhantomData); + +/// Adapter implementation of `ExporterFor` for `BridgesConfig` +impl> ExporterFor for BridgesConfigAdapter { + fn exporter_for( + network: &NetworkId, + _remote_location: &InteriorMultiLocation, + _message: &Xcm<()>, + ) -> Option<(MultiLocation, Option)> { + Bridges::get().get(network).map(|config| { + (config.bridge_location.location, config.bridge_location.maybe_fee.clone()) + }) + } +} + +/// Adapter implementation of `EnsureReachableDestination` for `BridgesConfig` +impl> EnsureReachableDestination for BridgesConfigAdapter { + fn ensure_destination( + remote_network: NetworkId, + remote_destination: MultiLocation, + ) -> Result { + if let Some(config) = Bridges::get().get(&remote_network) { + if let Some((allowed_target_location, _)) = + config.allowed_target_location_for(&remote_destination) + { + return Ok(ReachableDestination { + bridge: config.bridge_location.clone(), + target: allowed_target_location.clone(), + target_destination: remote_destination, + }) + } + } + Err(ReachableDestinationError::UnsupportedDestination) + } +} diff --git a/parachains/pallets/bridge-transfer/primitives/src/lib.rs b/parachains/pallets/bridge-transfer/primitives/src/lib.rs new file mode 100644 index 00000000000..9f01f25d416 --- /dev/null +++ b/parachains/pallets/bridge-transfer/primitives/src/lib.rs @@ -0,0 +1,64 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Primitives for bridge transfer pallet. + +// Ensure we're `no_std` when compiling for Wasm. +#![cfg_attr(not(feature = "std"), no_std)] + +use xcm::prelude::*; + +mod asset_filter; +pub use asset_filter::*; + +mod config; +pub use config::*; + +/// Represents some `MultiLocation` with information if we need to pay fees or not. +#[derive(Clone, Debug, PartialEq)] +pub struct MaybePaidLocation { + pub location: MultiLocation, + pub maybe_fee: Option, +} + +/// Represents ensured/verified reachable destination. +#[derive(Clone, Debug)] +#[cfg_attr(feature = "std", derive(PartialEq))] +pub struct ReachableDestination { + /// Bridge location + pub bridge: MaybePaidLocation, + /// Target location (e.g. remote parachain in different consensus) + pub target: MaybePaidLocation, + /// Destination on target (e.g. account on remote parachain in different consensus) + pub target_destination: MultiLocation, +} + +/// Ensures if `remote_destination` is reachable for requested `remote_network`. +pub trait EnsureReachableDestination { + fn ensure_destination( + remote_network: NetworkId, + remote_destination: MultiLocation, + ) -> Result; +} + +/// Error type for [EnsureReachableDestination] +#[derive(Debug)] +pub enum ReachableDestinationError { + UnsupportedDestination, + UnsupportedXcmVersion, +} + +/// Reserve location as `MultiLocation` with `AssetFilter` +pub type ReserveLocation = (MultiLocation, AssetFilter); diff --git a/parachains/pallets/bridge-transfer/src/benchmarking.rs b/parachains/pallets/bridge-transfer/src/benchmarking.rs index 08a9672fe4d..10ca3d94f4e 100644 --- a/parachains/pallets/bridge-transfer/src/benchmarking.rs +++ b/parachains/pallets/bridge-transfer/src/benchmarking.rs @@ -17,79 +17,50 @@ //! `BridgeTransfer` pallet benchmarks. -use crate::{ - AllowedExporters, AllowedReserveLocations, AllowedUniversalAliases, BenchmarkHelper, Call, - Config, Event, Pallet, PingMessageBuilder, -}; +use crate::{BenchmarkHelper, Call, Config, Event, Pallet}; use frame_benchmarking::{benchmarks, BenchmarkError}; use frame_support::{ - ensure, + assert_ok, ensure, traits::{EnsureOrigin, Get}, }; use sp_std::prelude::*; use xcm::prelude::*; -#[cfg(feature = "runtime-benchmarks")] -impl Pallet { - #[cfg(feature = "runtime-benchmarks")] - pub fn insert_universal_alias_for_benchmarks((location, junction): (MultiLocation, Junction)) { - assert!(matches!( - AllowedUniversalAliases::::try_mutate(location, |junctions| junctions - .try_insert(junction)), - Ok(true) - )); - } -} - benchmarks! { transfer_asset_via_bridge { - let _ = T::TransferAssetOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let _ = T::AssetTransferOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; // every asset has its own configuration and ledger, so there's a performance dependency // (be sure to use "worst" of assets) - let max_assets_limit = T::MaxAssetsLimit::get(); + let max_assets_limit = T::AssetsLimit::get(); ensure!(max_assets_limit > 0, "MaxAssetsLimit not set up correctly."); - let (bridged_network, bridge_config) = T::BenchmarkHelper::bridge_config() - .ok_or(BenchmarkError::Stop("missing `bridge_config` data"))?; - let (origin, assets, destination) = T::BenchmarkHelper::prepare_asset_transfer() - .ok_or(BenchmarkError::Stop("missing `prepare_asset_transfer` data"))?; + + // get desired remote destination + let desired_bridged_location = T::BenchmarkHelper::desired_bridged_location() + .ok_or(BenchmarkError::Stop("missing `desired_bridged_location` data"))?; + + // resolve expected reserve account + let assumed_reserve_account = Pallet::::resolve_reserve_account(&desired_bridged_location.1); + + // prepare all requirements + let (origin, assets, destination) = T::BenchmarkHelper::prepare_asset_transfer_for( + desired_bridged_location.clone(), + assumed_reserve_account, + ).ok_or(BenchmarkError::Stop("missing `prepare_asset_transfer` data"))?; + + // check assets let assets_count = match &assets { VersionedMultiAssets::V2(assets) => assets.len(), VersionedMultiAssets::V3(assets) => assets.len(), }; ensure!(assets_count == max_assets_limit as usize, "`assets` not set up correctly for worst case."); - AllowedExporters::::insert(bridged_network, bridge_config); - }: _(origin, Box::new(assets), Box::new(destination)) - verify { - // we don't care about message hash or sender cost here, just check that the transfer has been initiated - let actual_event = frame_system::Pallet::::events().pop().map(|r| r.event); - let expected_event: ::RuntimeEvent = Event::TransferInitiated { - message_id: Default::default(), - forwarded_message_id: Default::default(), - sender_cost: Default::default(), - }.into(); - assert!(matches!(actual_event, Some(expected_event))); - } - - ping_via_bridge { - let _ = T::TransferPingOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - - let (bridged_network, bridge_config) = T::BenchmarkHelper::bridge_config() - .ok_or(BenchmarkError::Stop("missing `bridge_config` data"))?; - AllowedExporters::::insert(bridged_network, bridge_config); - let (origin, destination) = T::BenchmarkHelper::prepare_ping_transfer() - .ok_or(BenchmarkError::Stop("missing `prepare_ping_transfer` data"))?; + // check destination if configuration is ok + assert_ok!(::ensure_destination( + desired_bridged_location.0, + destination.clone().try_into().map_err(|_|BenchmarkError::Stop("invalid configuration or data"))?)); - let origin_location = T::TransferPingOrigin::ensure_origin(origin.clone()).map_err(|_| BenchmarkError::Stop("invalid `origin`"), - )?; - let (_, _, destination_location) = Pallet::::ensure_remote_destination(destination.clone()).map_err(|_| - BenchmarkError::Stop("invalid `destination_location`"), - )?; - let _ = T::PingMessageBuilder::try_build(&origin_location, &bridged_network, &destination_location).ok_or( - BenchmarkError::Stop("invalid `PingMessageBuilder`"), - )?; - }: _(origin, Box::new(destination)) + }: _(origin, Box::new(assets), Box::new(destination)) verify { // we don't care about message hash or sender cost here, just check that the transfer has been initiated let actual_event = frame_system::Pallet::::events().pop().map(|r| r.event); @@ -101,101 +72,5 @@ benchmarks! { assert!(matches!(actual_event, Some(expected_event))); } - add_exporter_config { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let (bridged_network, bridge_config) = T::BenchmarkHelper::bridge_config() - .ok_or(BenchmarkError::Stop("missing `bridge_config` data"))?; - }: _(origin, bridged_network, Box::new(bridge_config.clone())) - verify { - assert_eq!(AllowedExporters::::get(bridged_network), Some(bridge_config)); - } - - remove_exporter_config { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let (bridged_network, bridge_config) = T::BenchmarkHelper::bridge_config() - .ok_or(BenchmarkError::Stop("missing `bridge_config` data"))?; - AllowedExporters::::insert(bridged_network, bridge_config); - }: _(origin, bridged_network) - verify { - assert_eq!(AllowedExporters::::get(bridged_network), None); - } - - update_exporter_config { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let (bridged_network, bridge_config) = T::BenchmarkHelper::bridge_config() - .ok_or(BenchmarkError::Stop("missing `bridge_config` data"))?; - AllowedExporters::::insert(bridged_network, bridge_config); - - let bridge_location_fee = None; - let target_location_fee = Some(xcm::VersionedMultiAsset::V3(MultiAsset { - id: Concrete(MultiLocation::parent()), - fun: Fungible(1_000_0000), - })); - }: _(origin, bridged_network, bridge_location_fee.clone().map(Box::new), target_location_fee.clone().map(Box::new)) - verify { - let exporter = AllowedExporters::::get(bridged_network).unwrap(); - assert_eq!(exporter.bridge_location_fee, bridge_location_fee.map(|fee| MultiAsset::try_from(fee).unwrap())); - assert_eq!(exporter.max_target_location_fee, target_location_fee.map(|fee| MultiAsset::try_from(fee).unwrap())); - } - - add_universal_alias { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let (location, junction) = match T::BenchmarkHelper::universal_alias() { - Some(alias) => alias, - None => match T::UniversalAliasesLimit::get() > 0_u32 { - true => return Err(BenchmarkError::Stop("missing `universal_alias` data")), - false => return Err(BenchmarkError::Weightless), - } - }; - }: _(origin, Box::new(location.clone()), junction) - verify { - assert!(AllowedUniversalAliases::::get(&location.try_as().unwrap()).contains(&junction)); - } - - remove_universal_alias { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let (location, junction) = match T::BenchmarkHelper::universal_alias() { - Some(alias) => alias, - None => match T::UniversalAliasesLimit::get() > 0_u32 { - true => return Err(BenchmarkError::Stop("missing `universal_alias` data")), - false => return Err(BenchmarkError::Weightless), - } - }; - Pallet::::insert_universal_alias_for_benchmarks((location.clone().try_into().unwrap(), junction)); - }: _(origin, Box::new(location.clone()), vec![junction.clone()]) - verify { - assert!(!AllowedUniversalAliases::::get(&location.try_as().unwrap()).contains(&junction)); - } - - add_reserve_location { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let location = match T::BenchmarkHelper::reserve_location() { - Some(location) => location, - None => match T::ReserveLocationsLimit::get() > 0_u32 { - true => return Err(BenchmarkError::Stop("missing `reserve_location` data")), - false => return Err(BenchmarkError::Weightless), - } - }; - }: _(origin, Box::new(location.clone())) - verify { - assert!(AllowedReserveLocations::::get().contains(&location.try_as().unwrap())); - } - - remove_reserve_location { - let origin = T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let location = match T::BenchmarkHelper::reserve_location() { - Some(location) => location, - None => match T::ReserveLocationsLimit::get() > 0_u32 { - true => return Err(BenchmarkError::Stop("missing `reserve_location` data")), - false => return Err(BenchmarkError::Weightless), - } - }; - let multilocation: MultiLocation = location.clone().try_into().unwrap(); - assert!(AllowedReserveLocations::::try_mutate(|locations| locations.try_insert(multilocation)).unwrap()); - }: _(origin, vec![location.clone()]) - verify { - assert!(!AllowedReserveLocations::::get().contains(&location.try_as().unwrap())); - } - impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::TestRuntime); } diff --git a/parachains/pallets/bridge-transfer/src/features.rs b/parachains/pallets/bridge-transfer/src/features.rs new file mode 100644 index 00000000000..14e52950bf3 --- /dev/null +++ b/parachains/pallets/bridge-transfer/src/features.rs @@ -0,0 +1,185 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::{ + types::{AssetTransferKind, ResolveAssetTransferKind}, + LOG_TARGET, +}; +use frame_support::traits::{ContainsPair, Get}; +use pallet_bridge_transfer_primitives::{BridgesConfig, MatchAssetLocation, ReserveLocation}; +use xcm::prelude::*; +use xcm_builder::ensure_is_remote; + +/// Adapter verifies if it is allowed to receive `MultiAsset` from `MultiLocation`. +/// +/// Note: `MultiLocation` has to be from different global consensus. +pub struct IsTrustedBridgedReserveLocationForConcreteAsset( + sp_std::marker::PhantomData<(UniversalLocation, Reserves)>, +); +impl< + UniversalLocation: Get, + Reserves: Get>, + > ContainsPair + for IsTrustedBridgedReserveLocationForConcreteAsset +{ + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + let universal_source = UniversalLocation::get(); + log::trace!( + target: "xcm::contains", + "IsTrustedBridgedReserveLocationForConcreteAsset asset: {:?}, origin: {:?}, universal_source: {:?}", + asset, origin, universal_source + ); + + // check remote origin + let _ = match ensure_is_remote(universal_source, *origin) { + Ok(devolved) => devolved, + Err(_) => { + log::trace!( + target: "xcm::contains", + "IsTrustedBridgedReserveLocationForConcreteAsset origin: {:?} is not remote to the universal_source: {:?}", + origin, universal_source + ); + return false + }, + }; + + // check asset location + let asset_location = match &asset.id { + Concrete(location) => location, + _ => return false, + }; + + // check asset according to the configured reserve locations + for (reserve_location, asset_filter) in Reserves::get() { + if origin.eq(&reserve_location) { + if asset_filter.matches(asset_location) { + return true + } + } + } + + false + } +} + +/// Adapter verifies if it is allowed to transfer out `MultiAsset` to the `MultiLocation`. +/// +/// Note: `MultiLocation` has to be from different global consensus. +pub struct IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation< + UniversalLocation, + Bridges, +>(sp_std::marker::PhantomData<(UniversalLocation, Bridges)>); +impl, Bridges: Get> + ContainsPair + for IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation +{ + fn contains(asset: &MultiAsset, to_location: &MultiLocation) -> bool { + let universal_source = UniversalLocation::get(); + log::trace!( + target: "xcm::contains", + "IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation asset: {:?}, to_location: {:?}, universal_source: {:?}", + asset, to_location, universal_source + ); + + // check remote origin + let (remote_network, _) = match ensure_is_remote(universal_source, *to_location) { + Ok(devolved) => devolved, + Err(_) => { + log::trace!( + target: "xcm::contains", + "IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation to_location: {:?} is not remote to the universal_source: {:?}", + to_location, universal_source + ); + return false + }, + }; + + // check asset location + let asset_location = match &asset.id { + Concrete(location) => location, + _ => return false, + }; + + // check asset according to the config + if let Some(config) = Bridges::get().get(&remote_network) { + if let Some((_, Some(asset_filter))) = config.allowed_target_location_for(&to_location) + { + return asset_filter.matches(asset_location) + } + } + + false + } +} + +/// Implementation of `ResolveTransferKind` which tries to resolve all kinds of transfer. +pub struct ConcreteAssetTransferKindResolver< + IsReserveLocationForAsset, + IsAllowedReserveBasedTransferForAsset, +>(sp_std::marker::PhantomData<(IsReserveLocationForAsset, IsAllowedReserveBasedTransferForAsset)>); + +impl< + IsReserveLocationForAsset: ContainsPair, + IsAllowedReserveBasedTransferForAsset: ContainsPair, + > ResolveAssetTransferKind + for ConcreteAssetTransferKindResolver< + IsReserveLocationForAsset, + IsAllowedReserveBasedTransferForAsset, + > +{ + fn resolve(asset: &MultiAsset, target_location: &MultiLocation) -> AssetTransferKind { + log::trace!( + target: LOG_TARGET, + "ConcreteAssetTransferKindResolver resolve asset: {:?}, target_location: {:?}", + asset, target_location + ); + + // accepts only Concrete + match &asset.id { + Concrete(_) => (), + _ => return AssetTransferKind::Unsupported, + }; + + // check if target_location is allowed for requested asset to be transferred there + let is_reserve_based_candidate = + IsAllowedReserveBasedTransferForAsset::contains(asset, target_location); + + // check if we are trying to transfer back reserve-deposited assets + // other words: if target_location is a known reserve location for asset + let is_withdraw_reserve_candidate = + IsReserveLocationForAsset::contains(asset, target_location); + + match (is_reserve_based_candidate, is_withdraw_reserve_candidate) { + (true, false) => AssetTransferKind::ReserveBased, + (false, true) => AssetTransferKind::WithdrawReserve, + (true, true) => { + log::warn!( + target: LOG_TARGET, + "ConcreteAssetTransferKindResolver invalid configuration of transfer kind resolve for asset: {:?} and target_location: {:?} - is_reserve_based_candidate/is_withdraw_reserve_candidate: {:?}/{:?}", + asset, target_location, is_reserve_based_candidate, is_withdraw_reserve_candidate + ); + AssetTransferKind::Unsupported + }, + (false, false) => { + log::trace!( + target: LOG_TARGET, + "ConcreteAssetTransferKindResolver unsupported transfer kind for asset: {:?} and target_location: {:?} - is_reserve_based_candidate/is_withdraw_reserve_candidate: {:?}/{:?}", + asset, target_location, is_reserve_based_candidate, is_withdraw_reserve_candidate + ); + AssetTransferKind::Unsupported + }, + } + } +} diff --git a/parachains/pallets/bridge-transfer/src/impls.rs b/parachains/pallets/bridge-transfer/src/impls.rs index 65b6adb1d79..9eb0e6cfcac 100644 --- a/parachains/pallets/bridge-transfer/src/impls.rs +++ b/parachains/pallets/bridge-transfer/src/impls.rs @@ -13,44 +13,252 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{Config, Pallet}; -use frame_support::traits::{Contains, ContainsPair}; +use crate::{ + types::{AssetTransferKind, ResolveAssetTransferKind}, + Config, Error, Event, Pallet, LOG_TARGET, +}; +use frame_support::{pallet_prelude::Get, transactional}; +use frame_system::unique; +use pallet_bridge_transfer_primitives::{ + EnsureReachableDestination, ReachableDestination, ReachableDestinationError, +}; +use sp_runtime::DispatchError; use xcm::prelude::*; -use xcm_builder::ExporterFor; - -/// `ExporterFor` implementation to check if we can transfer anything to `NetworkId` -impl ExporterFor for Pallet { - fn exporter_for( - network: &NetworkId, - _remote_location: &InteriorMultiLocation, - _message: &Xcm<()>, - ) -> Option<(MultiLocation, Option)> { - Self::allowed_exporters(network) - .map(|bridge_config| (bridge_config.bridge_location, bridge_config.bridge_location_fee)) +use xcm_builder::ensure_is_remote; +use xcm_executor::traits::TransactAsset; + +impl From for Error { + fn from(value: ReachableDestinationError) -> Self { + match value { + ReachableDestinationError::UnsupportedDestination => Error::::UnsupportedDestination, + ReachableDestinationError::UnsupportedXcmVersion => Error::::UnsupportedXcmVersion, + } } } -/// Verifies if we have `(MultiLocation, Junction)` in allowed universal aliases. -pub struct AllowedUniversalAliasesOf(sp_std::marker::PhantomData); -impl Contains<(MultiLocation, Junction)> for AllowedUniversalAliasesOf { - fn contains((location, junction): &(MultiLocation, Junction)) -> bool { - log::trace!(target: "xcm::contains", "AllowedUniversalAliasesOf location: {:?}, junction: {:?}", location, junction); - Pallet::::allowed_universal_aliases(location).contains(junction) +impl Pallet { + /// Validates destination and check if we support bridging to this remote global consensus + /// + /// Returns: correct remote location, where we should be able to bridge + pub(crate) fn ensure_reachable_remote_destination( + remote_destination: MultiLocation, + ) -> Result> { + let devolved = ensure_is_remote(T::UniversalLocation::get(), remote_destination) + .map_err(|_| Error::::UnsupportedDestination)?; + let (remote_network, _) = devolved; + + T::BridgedDestinationValidator::ensure_destination(remote_network, remote_destination) + .map_err(Into::into) } -} -/// Verifies if we can allow `(MultiAsset, MultiLocation)` as trusted reserve. -pub struct IsAllowedReserveOf(sp_std::marker::PhantomData<(T, F)>); -impl> ContainsPair - for IsAllowedReserveOf -{ - fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { - log::trace!(target: "xcm::contains", "IsAllowedReserveOf asset: {:?}, origin: {:?}", asset, origin); - // first check - if we have configured origin as trusted reserve location - if !Pallet::::allowed_reserve_locations().contains(origin) { - return false + /// Tries to initiate transfer assets over bridge. + #[transactional] + pub(crate) fn initiate_transfer_asset_via_bridge_in_transaction( + origin_location: MultiLocation, + destination: ReachableDestination, + assets: MultiAssets, + ) -> Result<(), DispatchError> { + // Resolve reserve account + let reserve_account = Self::resolve_reserve_account(&destination); + + // Target destination + let target_location = destination.target.location; + + // UniversalLocation as sovereign account location on target_location (as target_location sees UniversalLocation) + let universal_location_as_sovereign_account_on_target_location = + T::UniversalLocation::get() + .invert_target(&target_location) + .map_err(|_| Error::::InvalidTargetLocation)?; + + // Prepare some XcmContext + let xcm_context = XcmContext::with_message_id(unique(reserve_account)); + + // Resolve/iterate all assets and how to transfer them + let mut reserve_assets_deposited = xcm_executor::Assets::new(); + let mut reserved_assets_for_withdrawal = xcm_executor::Assets::new(); + for asset in assets.into_inner() { + // first we need to know what kind of transfer it is + match T::AssetTransferKindResolver::resolve(&asset, &target_location) { + AssetTransferKind::ReserveBased => + // Move asset to reserve account + T::AssetTransactor::transfer_asset( + &asset, + &origin_location, + &reserve_account, + &xcm_context, + ) + .and_then(|reserved_asset| { + Self::deposit_event(Event::ReserveAssetsDeposited { + from: origin_location, + to: reserve_account, + assets: reserved_asset.clone().into(), + }); + reserve_assets_deposited.subsume_assets(reserved_asset); + Ok(()) + }) + .map_err(|e| { + log::error!( + target: LOG_TARGET, + "AssetTransactor failed to reserve assets from origin_location: {:?} to reserve_account: {:?} for assets: {:?}, error: {:?}", + origin_location, + reserve_account, + asset, + e + ); + Error::::FailedToReserve + })?, + AssetTransferKind::WithdrawReserve => { + // Just withdraw/burn asset here + T::AssetTransactor::withdraw_asset( + &asset, + &origin_location, + Some(&xcm_context), + ) + .and_then(|withdrawn_asset| { + Self::deposit_event(Event::AssetsWithdrawn { + from: origin_location, + assets: withdrawn_asset.clone().into(), + }); + reserved_assets_for_withdrawal.subsume_assets(withdrawn_asset); + Ok(()) + }) + .map_err(|e| { + log::error!( + target: LOG_TARGET, + "AssetTransactor failed to withdraw assets from origin_location: {:?} for assets: {:?}, error: {:?}", + origin_location, + asset, + e + ); + Error::::FailedToWithdraw + })? + } + AssetTransferKind::Unsupported => return Err(Error::::UnsupportedAssetTransferKind.into()), + } + } + + // Prepare xcm msg for the other side. + + // Reanchor stuff - we need to convert local asset id/MultiLocation to format that could be understood by different consensus and from their point-of-view + reserve_assets_deposited.reanchor(&target_location, T::UniversalLocation::get(), None); + reserved_assets_for_withdrawal.reanchor( + &target_location, + T::UniversalLocation::get(), + None, + ); + let remote_destination_reanchored = destination.target_destination + .reanchored(&target_location, T::UniversalLocation::get()) + .map_err(|errored_dest| { + log::error!( + target: LOG_TARGET, + "Failed to reanchor remote_destination: {:?} for target_destination: {:?} and universal_location: {:?}", + errored_dest, + target_location, + T::UniversalLocation::get() + ); + Error::::InvalidRemoteDestination + })?; + + // prepare xcm message + // 1. buy execution (if needed) -> (we expect UniversalLocation's sovereign account should pay) + let (mut xcm_instructions, maybe_buy_execution) = match destination.target.maybe_fee { + Some(target_location_fee) => ( + sp_std::vec![ + WithdrawAsset(target_location_fee.clone().into()), + BuyExecution { fees: target_location_fee.clone(), weight_limit: Unlimited }, + ], + Some(target_location_fee), + ), + None => ( + sp_std::vec![UnpaidExecution { check_origin: None, weight_limit: Unlimited }], + None, + ), + }; + + // 2. add deposit reserved asset to destination account (if any) + if !reserve_assets_deposited.is_empty() { + xcm_instructions.extend(sp_std::vec![ + ReserveAssetDeposited(reserve_assets_deposited.clone().into()), + DepositAsset { + assets: MultiAssetFilter::from(MultiAssets::from(reserve_assets_deposited)), + beneficiary: remote_destination_reanchored + }, + ]); } - // second check - we need to pass additional `(asset, origin)` filter - F::contains(asset, origin) + + // 3. add withdraw/move reserve from sovereign account to destination (if any) + if !reserved_assets_for_withdrawal.is_empty() { + xcm_instructions.extend(sp_std::vec![ + // we expect here, that origin is a sovereign account which was used as **reserve account** + WithdrawAsset(reserved_assets_for_withdrawal.clone().into()), + DepositAsset { + assets: MultiAssetFilter::from(MultiAssets::from( + reserved_assets_for_withdrawal + )), + beneficiary: remote_destination_reanchored + }, + ]); + } + + // 4. add return unspent weight/asset back to the UniversalLocation's sovereign account on target + if let Some(target_location_fee) = maybe_buy_execution { + xcm_instructions.extend(sp_std::vec![ + RefundSurplus, + DepositAsset { + assets: MultiAssetFilter::from(MultiAssets::from(target_location_fee)), + beneficiary: universal_location_as_sovereign_account_on_target_location + }, + ]); + } + + Self::initiate_bridge_transfer( + target_location, + xcm_context.message_id, + xcm_instructions.into(), + ) + .map_err(Into::into) + } + + /// Tries to send xcm message over bridge + fn initiate_bridge_transfer( + dest: MultiLocation, + message_id: XcmHash, + mut xcm: Xcm<()>, + ) -> Result<(), Error> { + // append message_id + xcm.0.extend(sp_std::vec![SetTopic(message_id)]); + + log::info!( + target: LOG_TARGET, + "[T::BridgeXcmSender] send to bridge, dest: {:?}, xcm: {:?}, message_id: {:?}", + dest, + xcm, + message_id, + ); + + // call bridge + // TODO: check-parameter - should we handle `sender_cost` somehow ? + let (forwarded_message_id, sender_cost) = send_xcm::(dest, xcm) + .map_err(|e| { + log::error!( + target: LOG_TARGET, + "[T::BridgeXcmSender] SendError occurred, error: {:?}", + e + ); + Error::::BridgeCallError + })?; + + // just fire event + Self::deposit_event(Event::TransferInitiated { + message_id, + forwarded_message_id, + sender_cost, + }); + Ok(()) + } + + /// Resolve (sovereign) account which will be used as reserve account + pub(crate) fn resolve_reserve_account(destination: &ReachableDestination) -> MultiLocation { + destination.target.location } } diff --git a/parachains/pallets/bridge-transfer/src/lib.rs b/parachains/pallets/bridge-transfer/src/lib.rs index 4ad8ef11cbb..12a91faa44b 100644 --- a/parachains/pallets/bridge-transfer/src/lib.rs +++ b/parachains/pallets/bridge-transfer/src/lib.rs @@ -15,109 +15,40 @@ //! # Bridge Transfer Pallet //! -//! Module which could help with different transfers through bridges, -//! e.g. move assets between different global consensus... -//! -//! ## Overview -//! -//! Pallet supports configuration for two independent scenarios: -//! -//! ### Transfer out -//! -//! * see (Config for transfer out) in the code -//! * if you want to allow initiate bridge transfer from runtime, -//! actually pallet supports asset transfer and ping with dedicated extrinsics `transfer_asset_via_bridge` / `ping_via_bridge` -//! * e.g. for asset transfer with correct configuration it sends `ReserveAssetDeposited` over bridge, -//! you can configure bridge location and allowed target location with `AllowedExporters` -//! -//! ### Transfer in -//! -//! * see (Config for transfer in) in the code -//! * e.g. if you want to allow process xcm `UniversalOrigin` instruction, -//! you can configure "allowed universal aliases" here and then use it for `xcm_executor::Config`: -//! `type UniversalAliases = AllowedUniversalAliasesOf;` -//! * e.g. if you want to allow process xcm `ReserveAssetDeposited` instruction, -//! you can configure "allowed reserve locations" here and then use it for `xcm_executor::Config`: -//! ```nocompile -//! type IsReserve = IsAllowedReserveOf< -//! Runtime, -//! IsDifferentGlobalConsensusConcreteAsset, -//! >; -//! ``` -//! -//! Transfer in/out are independent so you can configure just to receive or just to send part. -//! All configuration is done by dedicated extrinsics under `AdminOrigin` so for example runtime can allow to change this configuration just by governance. +//! Module supports transfer assets over bridges between different consensus chain. +//! With fine-grained configuration you can control transferred assets (out/in) between different consensus chain. +//! "Transfer asset over bridge" recognize two kinds of transfer see `types::AssetTransferKind`. // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::{transactional, BoundedBTreeSet}; -use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; -use sp_std::boxed::Box; - pub use pallet::*; -use xcm::prelude::*; +pub use pallet_bridge_transfer_primitives::MaybePaidLocation; + +pub mod features; +mod impls; +mod types; +pub mod weights; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -pub mod impls; -pub mod weights; + +#[cfg(test)] +mod tests; /// The log target of this pallet. pub const LOG_TARGET: &str = "runtime::bridge-transfer"; -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] -pub struct BridgeConfig { - /// Contains location, which is able to bridge XCM messages to bridged network - pub bridge_location: MultiLocation, - /// Fee which could be needed to pay in `bridge_location` - /// `MultiAsset` is here from the point of view of `bridge_location`, e.g.: `MultiLocation::parent()` means relay chain token of `bridge_location` - pub bridge_location_fee: Option, - - /// Contains target destination on bridged network. E.g.: MultiLocation of Statemine/t on different consensus - // TODO:check-parameter - lets start with 1..1, maybe later we could extend this with BoundedVec - // TODO: bridged bridge-hub should have router for this - pub allowed_target_location: MultiLocation, - // TODO:check-parameter - can we store Option and then aviod using `Unlimited`? - /// If `None` then `UnpaidExecution` is used, else `Withdraw(target_location_fee)/BuyExecution(target_location_fee, Unlimited)` - /// `MultiAsset` is here from the point of view of `allowed_target_location`, e.g.: `MultiLocation::parent()` means relay chain token of `allowed_target_location` - pub max_target_location_fee: Option, -} - -/// Trait for constructing ping message. -pub trait PingMessageBuilder { - fn try_build( - local_origin: &MultiLocation, - network: &NetworkId, - remote_destination: &MultiLocation, - ) -> Option>; -} - -impl PingMessageBuilder for () { - fn try_build(_: &MultiLocation, _: &NetworkId, _: &MultiLocation) -> Option> { - None - } -} - -/// Builder creates xcm message just with `Trap` instruction. -pub struct UnpaidTrapMessageBuilder(sp_std::marker::PhantomData); -impl> PingMessageBuilder - for UnpaidTrapMessageBuilder -{ - fn try_build(_: &MultiLocation, _: &NetworkId, _: &MultiLocation) -> Option> { - Some(Xcm(sp_std::vec![Trap(TrapCode::get())])) - } -} - #[frame_support::pallet] pub mod pallet { pub use crate::weights::WeightInfo; - use super::*; + use crate::types::ResolveAssetTransferKind; use frame_support::pallet_prelude::*; - use frame_system::{pallet_prelude::*, unique}; + use frame_system::pallet_prelude::*; + use pallet_bridge_transfer_primitives::EnsureReachableDestination; + use sp_std::boxed::Box; + use xcm::prelude::*; use xcm_executor::traits::TransactAsset; #[pallet::pallet] @@ -126,50 +57,47 @@ pub mod pallet { /// Everything we need to run benchmarks. #[cfg(feature = "runtime-benchmarks")] pub trait BenchmarkHelper { - /// Returns proper bridge configuration, supported by the runtime. + /// Returns proper destination for NetworkId, supported by the runtime. /// /// We expect that the XCM environment (`BridgeXcmSender`) has everything enabled /// to support transfer to this destination **after** `prepare_asset_transfer` call. - fn bridge_config() -> Option<(NetworkId, BridgeConfig)> { - None - } + fn desired_bridged_location( + ) -> Option<(NetworkId, pallet_bridge_transfer_primitives::ReachableDestination)>; /// Prepare environment for assets transfer and return transfer origin and assets /// to transfer. After this function is called, we expect `transfer_asset_via_bridge` /// to succeed, so in proper environment, it should: /// - /// - deposit enough funds (fee from `bridge_config()` and transferred assets) to the sender account; + /// - deposit enough funds (fee from `desired_bridged_location()` and transferred assets) to the sender account; /// /// - ensure that the `BridgeXcmSender` is properly configured for the transfer; /// /// - be close to the worst possible scenario - i.e. if some account may need to be created during /// the assets transfer, it should be created. If there are multiple bridges, the "worst possible" /// (in terms of performance) bridge must be selected for the transfer. - fn prepare_asset_transfer( - ) -> Option<(RuntimeOrigin, VersionedMultiAssets, VersionedMultiLocation)> { - None - } - - /// Prepare environment for ping transfer and return transfer origin and assets - /// to transfer. After this function is called, we expect `ping_via_bridge` - /// to succeed, so in proper environment, it should: - /// - /// - deposit enough funds (fee from `bridge_config()`) to the sender account; - /// - /// - ensure that the `BridgeXcmSender` is properly configured for the transfer; - /// - /// - be close to the worst possible scenario - i.e. if some account may need to be created during - /// it should be created. If there are multiple bridges, the "worst possible" - /// (in terms of performance) bridge must be selected for the transfer. - fn prepare_ping_transfer() -> Option<(RuntimeOrigin, VersionedMultiLocation)> { - None - } + fn prepare_asset_transfer_for( + desired_bridged_location: ( + NetworkId, + pallet_bridge_transfer_primitives::ReachableDestination, + ), + assumed_reserve_account: MultiLocation, + ) -> Option<(RuntimeOrigin, VersionedMultiAssets, VersionedMultiLocation)>; + } - fn universal_alias() -> Option<(VersionedMultiLocation, Junction)> { + #[cfg(feature = "runtime-benchmarks")] + impl BenchmarkHelper for () { + fn desired_bridged_location( + ) -> Option<(NetworkId, pallet_bridge_transfer_primitives::ReachableDestination)> { None } - fn reserve_location() -> Option { + fn prepare_asset_transfer_for( + _desired_bridged_location: ( + NetworkId, + pallet_bridge_transfer_primitives::ReachableDestination, + ), + _assumed_reserve_account: MultiLocation, + ) -> Option<(RuntimeOrigin, VersionedMultiAssets, VersionedMultiLocation)> { None } } @@ -185,83 +113,42 @@ pub mod pallet { /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; - /// The configurable origin to allow bridges configuration management - type AdminOrigin: EnsureOrigin; - - /// Max allowed universal aliases per one `MultiLocation` - /// (Config for transfer in) - type UniversalAliasesLimit: Get; - /// Max allowed reserve locations - /// (Config for transfer in) - type ReserveLocationsLimit: Get; - /// How to withdraw and deposit an asset for reserve. /// (Config for transfer out) type AssetTransactor: TransactAsset; - /// XCM sender which sends messages to the BridgeHub - /// (Config for transfer out) - type BridgeXcmSender: SendXcm; + /// Transfer kind resolver for `asset` to `target_location`. + type AssetTransferKindResolver: ResolveAssetTransferKind; /// Required origin for asset transfer. If successful, it resolves to `MultiLocation`. /// (Config for transfer out) - type TransferAssetOrigin: EnsureOrigin; + type AssetTransferOrigin: EnsureOrigin; /// Max count of assets in one call /// (Config for transfer out) - type MaxAssetsLimit: Get; - /// Required origin for ping transfer. If successful, it resolves to `MultiLocation`. - /// (Config for transfer out) - type TransferPingOrigin: EnsureOrigin; - /// Configurable ping message, `None` means no message will be transferred. + type AssetsLimit: Get; + + /// Validates remote_destination if it is reachable from the point of configuration + type BridgedDestinationValidator: EnsureReachableDestination; + /// XCM sender which sends messages to the BridgeHub /// (Config for transfer out) - type PingMessageBuilder: PingMessageBuilder; + type BridgeXcmSender: SendXcm; /// Benchmarks helper. #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper: BenchmarkHelper; } - /// Details of configured bridges which are allowed for **transfer out**. - /// (Config for transfer out) - #[pallet::storage] - #[pallet::getter(fn allowed_exporters)] - pub(super) type AllowedExporters = - StorageMap<_, Blake2_128Concat, NetworkId, BridgeConfig>; - - /// Holds allowed mappings `MultiLocation->Junction` for `UniversalAliases` - /// E.g: - /// BridgeHubMultiLocation1 -> NetworkId::Kusama - /// BridgeHubMultiLocation1 -> NetworkId::Polkadot - /// (Config for transfer in) - #[pallet::storage] - #[pallet::getter(fn allowed_universal_aliases)] - pub(super) type AllowedUniversalAliases = StorageMap< - _, - Blake2_128Concat, - MultiLocation, - BoundedBTreeSet, - ValueQuery, - >; - - /// Holds allowed mappings `MultiLocation` as trusted reserve locations - /// (Config for transfer in) - #[pallet::storage] - #[pallet::getter(fn allowed_reserve_locations)] - pub(super) type AllowedReserveLocations = - StorageValue<_, BoundedBTreeSet, ValueQuery>; - #[pallet::error] #[cfg_attr(test, derive(PartialEq))] pub enum Error { - InvalidConfiguration, - UnavailableConfiguration, - ConfigurationAlreadyExists, InvalidAssets, - MaxAssetsLimitReached, + AssetsLimitReached, UnsupportedDestination, UnsupportedXcmVersion, + InvalidTargetLocation, InvalidRemoteDestination, BridgeCallError, FailedToReserve, - UnsupportedPing, + FailedToWithdraw, + UnsupportedAssetTransferKind, } #[pallet::event] @@ -277,25 +164,10 @@ pub mod pallet { sender_cost: MultiAssets, }, - /// Reserve asset passed + /// Reserve assets passed ReserveAssetsDeposited { from: MultiLocation, to: MultiLocation, assets: MultiAssets }, - - /// New bridge configuration was added - BridgeAdded, - /// Bridge configuration was removed - BridgeRemoved, - /// Bridge configuration was updated - BridgeUpdated, - - /// New universal alias was added - UniversalAliasAdded, - /// New universal alias was removed - UniversalAliasRemoved, - - /// New reserve location was added - ReserveLocationAdded, - /// New reserve location was removed - ReserveLocationRemoved, + /// Assets were withdrawn + AssetsWithdrawn { from: MultiLocation, assets: MultiAssets }, } #[pallet::call] @@ -314,1341 +186,24 @@ pub mod pallet { destination: Box, ) -> DispatchResult { // Check origin - let origin_location = T::TransferAssetOrigin::ensure_origin(origin)?; + let origin_location = T::AssetTransferOrigin::ensure_origin(origin)?; - // Check remote destination + bridge_config - let (_, bridge_config, remote_destination) = - Self::ensure_remote_destination(*destination)?; + // Check if remote destination is reachable + let destination = Self::ensure_reachable_remote_destination( + (*destination).try_into().map_err(|()| Error::::InvalidRemoteDestination)?, + )?; // Check assets (lets leave others checks on `AssetTransactor`) let assets: MultiAssets = (*assets).try_into().map_err(|()| Error::::InvalidAssets)?; - ensure!( - assets.len() <= T::MaxAssetsLimit::get() as usize, - Error::::MaxAssetsLimitReached - ); + ensure!(assets.len() <= T::AssetsLimit::get() as usize, Error::::AssetsLimitReached); // Do this in transaction (explicitly), the rollback should occur in case of any error and no assets will be trapped or lost - Self::do_reserve_and_send_in_transaction( + Self::initiate_transfer_asset_via_bridge_in_transaction( origin_location, - remote_destination, - assets, - bridge_config, - ) - } - - /// Transfer `ping` via bridge to different global consensus. - /// - /// - can be used for testing purposes that bridge transfer is working and configured for `destination` - /// - /// Parameters: - /// - /// * `destination`: Different consensus location, e.g. Polkadot's Statemint: `2, X2(GlobalConsensus(NetworkId::Polkadot), Parachain(1000))` - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::ping_via_bridge())] - pub fn ping_via_bridge( - origin: OriginFor, - destination: Box, - ) -> DispatchResult { - let origin_location = T::TransferPingOrigin::ensure_origin(origin)?; - - // Check remote destination + bridge_config - let (network, bridge_config, remote_destination) = - Self::ensure_remote_destination(*destination)?; - - // Check reserve account - sovereign account of bridge - let allowed_target_location = bridge_config.allowed_target_location; - - // Prepare `ping` message - let xcm: Xcm<()> = - T::PingMessageBuilder::try_build(&origin_location, &network, &remote_destination) - .ok_or(Error::::UnsupportedPing)?; - - // Initiate bridge transfer - Self::initiate_bridge_transfer(allowed_target_location, unique(&xcm), xcm) - .map_err(Into::into) - } - - /// Adds new bridge configuration, which allows transfer to this `bridged_network`. - /// - /// Parameters: - /// - /// * `bridged_network`: Network where we want to allow transfer funds - /// * `bridge_config`: contains location for BridgeHub in our network + fee - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::add_exporter_config())] - pub fn add_exporter_config( - origin: OriginFor, - bridged_network: NetworkId, - bridge_config: Box, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - ensure!( - !AllowedExporters::::contains_key(bridged_network), - Error::::ConfigurationAlreadyExists - ); - let allowed_target_location_network = bridge_config - .allowed_target_location - .interior() - .global_consensus() - .map_err(|_| Error::::InvalidConfiguration)?; - ensure!( - bridged_network == allowed_target_location_network, - Error::::InvalidConfiguration - ); - // bridged consensus must be different - let local_network = T::UniversalLocation::get() - .global_consensus() - .map_err(|_| Error::::InvalidConfiguration)?; - ensure!(bridged_network != local_network, Error::::InvalidConfiguration); - - AllowedExporters::::insert(bridged_network, bridge_config); - Self::deposit_event(Event::BridgeAdded); - Ok(()) - } - - /// Remove bridge configuration for specified `bridged_network`. - /// - /// Parameters: - /// - /// * `bridged_network`: Network where we want to remove - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::remove_exporter_config())] - pub fn remove_exporter_config( - origin: OriginFor, - bridged_network: NetworkId, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - ensure!( - AllowedExporters::::contains_key(bridged_network), - Error::::UnavailableConfiguration - ); - - AllowedExporters::::remove(bridged_network); - Self::deposit_event(Event::BridgeRemoved); - Ok(()) - } - - /// Updates bridge configuration for specified `bridged_network`. - /// - /// Parameters: - /// - /// * `bridged_network`: Network where we want to remove - /// * `fee`: New fee to update - #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::update_exporter_config())] - pub fn update_exporter_config( - origin: OriginFor, - bridged_network: NetworkId, - bridge_location_fee: Option>, - target_location_fee: Option>, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - - AllowedExporters::::try_mutate_exists(bridged_network, |maybe_bridge_config| { - let bridge_config = - maybe_bridge_config.as_mut().ok_or(Error::::UnavailableConfiguration)?; - bridge_config.bridge_location_fee = bridge_location_fee - .map(|fee| MultiAsset::try_from(*fee)) - .transpose() - .map_err(|_| Error::::UnsupportedXcmVersion)?; - bridge_config.max_target_location_fee = target_location_fee - .map(|fee| MultiAsset::try_from(*fee)) - .transpose() - .map_err(|_| Error::::UnsupportedXcmVersion)?; - Self::deposit_event(Event::BridgeUpdated); - Ok(()) - }) - } - - /// Add `(MultiLocation, Junction)` mapping to `AllowedUniversalAliases` - /// - /// Parameters: - /// - /// * `location`: key - /// * `junction`: value - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::add_universal_alias())] - pub fn add_universal_alias( - origin: OriginFor, - location: Box, - junction: Junction, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - - let location: MultiLocation = - (*location).try_into().map_err(|_| Error::::UnsupportedXcmVersion)?; - let added = AllowedUniversalAliases::::try_mutate(location, |junctions| { - junctions.try_insert(junction) - }) - .map_err(|_| Error::::InvalidConfiguration)?; - if added { - Self::deposit_event(Event::UniversalAliasAdded); - } - Ok(()) - } - - /// Remove `(MultiLocation, Junction)` mapping from `AllowedUniversalAliases` - /// - /// Parameters: - /// - /// * `location`: key - /// * `junction`: value - #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::remove_universal_alias())] - pub fn remove_universal_alias( - origin: OriginFor, - location: Box, - junctions_to_remove: sp_std::prelude::Vec, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - - let location: MultiLocation = - (*location).try_into().map_err(|_| Error::::UnsupportedXcmVersion)?; - let removed = AllowedUniversalAliases::::try_mutate( - location, - |junctions| -> Result> { - let mut removed = false; - for jtr in junctions_to_remove { - removed |= junctions.remove(&jtr); - } - Ok(removed) - }, - )?; - if removed { - Self::deposit_event(Event::UniversalAliasRemoved); - } - Ok(()) - } - - /// Add `MultiLocation` mapping to `AllowedReserveLocations` - /// - /// Parameters: - /// - /// * `location`: as reserve `MultiLocation` - #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::add_reserve_location())] - pub fn add_reserve_location( - origin: OriginFor, - location: Box, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - - let location: MultiLocation = - (*location).try_into().map_err(|_| Error::::UnsupportedXcmVersion)?; - let added = AllowedReserveLocations::::try_mutate(|locations| { - locations.try_insert(location) - }) - .map_err(|_| Error::::InvalidConfiguration)?; - if added { - Self::deposit_event(Event::ReserveLocationAdded); - } - Ok(()) - } - - /// Remove `MultiLocation` mapping from `AllowedReserveLocations` - /// - /// Parameters: - /// - /// * `location`: as reserve `MultiLocation` - #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::remove_reserve_location())] - pub fn remove_reserve_location( - origin: OriginFor, - locations_to_remove: sp_std::prelude::Vec, - ) -> DispatchResult { - let _ = T::AdminOrigin::ensure_origin(origin)?; - - let removed = - AllowedReserveLocations::::try_mutate(|locations| -> Result> { - let mut removed = false; - for ltr in locations_to_remove { - let ltr: MultiLocation = - ltr.try_into().map_err(|_| Error::::UnsupportedXcmVersion)?; - removed |= locations.remove(<r); - } - Ok(removed) - })?; - if removed { - Self::deposit_event(Event::ReserveLocationRemoved); - } - Ok(()) - } - } - - impl Pallet { - /// Validates destination and check if we support bridging to this remote global consensus - /// - /// Returns: correct remote location, where we should be able to bridge - pub(crate) fn ensure_remote_destination( - remote_destination: VersionedMultiLocation, - ) -> Result<(NetworkId, BridgeConfig, MultiLocation), Error> { - match remote_destination { - VersionedMultiLocation::V3(remote_location) => { - ensure!( - remote_location.parent_count() == 2, - Error::::UnsupportedDestination - ); - let local_network = T::UniversalLocation::get() - .global_consensus() - .map_err(|_| Error::::InvalidConfiguration)?; - let remote_network = remote_location - .interior() - .global_consensus() - .map_err(|_| Error::::UnsupportedDestination)?; - ensure!(local_network != remote_network, Error::::UnsupportedDestination); - match AllowedExporters::::get(remote_network) { - Some(bridge_config) => { - ensure!( - // TODO:check-parameter - verify and prepare test for ETH scenario - https://github.com/paritytech/cumulus/pull/2013#discussion_r1094909290 - remote_location.starts_with(&bridge_config.allowed_target_location), - Error::::UnsupportedDestination - ); - Ok((remote_network, bridge_config, remote_location)) - }, - None => return Err(Error::::UnsupportedDestination), - } - }, - _ => Err(Error::::UnsupportedXcmVersion), - } - } - - #[transactional] - fn do_reserve_and_send_in_transaction( - origin_location: MultiLocation, - remote_destination: MultiLocation, - assets: MultiAssets, - bridge_config: BridgeConfig, - ) -> Result<(), DispatchError> { - // Resolve reserve account - let reserve_account = - Self::resolve_reserve_account(&bridge_config, &remote_destination); - - // Resolve target destination - let target_destination = bridge_config.allowed_target_location; - - // UniversalLocation as sovereign account location on target_location (as target_location sees UniversalLocation) - let universal_location_as_sovereign_account_on_target_location = - T::UniversalLocation::get() - .invert_target(&target_destination) - .map_err(|_| Error::::InvalidConfiguration)?; - - // Prepare some XcmContext - let xcm_context = XcmContext::with_message_id(unique(reserve_account)); - - // lets try to do a reserve for all assets - let mut reserved_assets = xcm_executor::Assets::new(); - for asset in assets.into_inner() { - // TODO:check-parameter - verify this Joe's text - // Deposit assets into `AccountId` that corresponds to the bridge - // hub. In this way, Statemine acts as a reserve location to the - // bridge, such that it need not trust any consensus system from - // `./Parent/Parent/...`. (It may trust Polkadot, but would - // Polkadot trust Kusama with its DOT?) - - // Move asset to reserve account - T::AssetTransactor::transfer_asset( - &asset, - &origin_location, - &reserve_account, - &xcm_context, - ) - .and_then(|reserved_asset| { - Self::deposit_event(Event::ReserveAssetsDeposited { - from: origin_location, - to: reserve_account, - assets: reserved_asset.clone().into(), - }); - reserved_assets.subsume_assets(reserved_asset); - Ok(()) - }) - .map_err(|e| { - log::error!( - target: LOG_TARGET, - "AssetTransactor failed to reserve assets from origin_location: {:?} to reserve_account: {:?} for assets: {:?}, error: {:?}", - origin_location, - reserve_account, - asset, - e - ); - Error::::FailedToReserve - })?; - } - - // Prepare `ReserveAssetDeposited` msg to bridge to the other side. - - // Reanchor stuff - we need to convert local asset id/MultiLocation to format that could be understood by different consensus and from their point-of-view - reserved_assets.reanchor(&target_destination, T::UniversalLocation::get(), None); - let remote_destination = remote_destination - .reanchored(&target_destination, T::UniversalLocation::get()) - .map_err(|errored_dest| { - log::error!( - target: LOG_TARGET, - "Failed to reanchor remote_destination: {:?} for target_destination: {:?} and universal_location: {:?}", - errored_dest, - target_destination, - T::UniversalLocation::get() - ); - Error::::InvalidRemoteDestination - })?; - - // prepare xcm message - // 1. buy execution (if needed) -> (we expect UniversalLocation's sovereign account should pay) - let (mut xcm_instructions, maybe_buy_execution) = match bridge_config - .max_target_location_fee - { - Some(target_location_fee) => ( - sp_std::vec![ - WithdrawAsset(target_location_fee.clone().into()), - BuyExecution { fees: target_location_fee.clone(), weight_limit: Unlimited }, - ], - Some(target_location_fee), - ), - None => ( - sp_std::vec![UnpaidExecution { check_origin: None, weight_limit: Unlimited }], - None, - ), - }; - // 2. add deposit reserved asset to destination account - xcm_instructions.extend(sp_std::vec![ - ReserveAssetDeposited(reserved_assets.clone().into()), - DepositAsset { - assets: MultiAssetFilter::from(MultiAssets::from(reserved_assets)), - beneficiary: remote_destination - }, - ]); - // 3. add return unspent weight/asset back to the UniversalLocation's sovereign account on target - if let Some(target_location_fee) = maybe_buy_execution { - xcm_instructions.extend(sp_std::vec![ - RefundSurplus, - DepositAsset { - assets: MultiAssetFilter::from(MultiAssets::from(target_location_fee)), - beneficiary: universal_location_as_sovereign_account_on_target_location - }, - ]); - } - - Self::initiate_bridge_transfer( - target_destination, - xcm_context.message_id, - xcm_instructions.into(), - ) - .map_err(Into::into) - } - - fn initiate_bridge_transfer( - dest: MultiLocation, - message_id: XcmHash, - mut xcm: Xcm<()>, - ) -> Result<(), Error> { - // append message_id - xcm.0.extend(sp_std::vec![SetTopic(message_id.clone())]); - - log::info!( - target: LOG_TARGET, - "[T::BridgeXcmSender] send to bridge, dest: {:?}, xcm: {:?}, message_id: {:?}", - dest, - xcm, - message_id, - ); - - // call bridge - // TODO: check-parameter - should we handle `sender_cost` somehow ? - let (forwarded_message_id, sender_cost) = send_xcm::(dest, xcm) - .map_err(|e| { - log::error!( - target: LOG_TARGET, - "[T::BridgeXcmSender] SendError occurred, error: {:?}", - e - ); - Error::::BridgeCallError - })?; - - // just fire event - Self::deposit_event(Event::TransferInitiated { - message_id, - forwarded_message_id, - sender_cost, - }); - Ok(()) - } - - /// Resolve (sovereign) account which will be used as reserve account - fn resolve_reserve_account( - bridge_conig: &BridgeConfig, - _remote_destination: &MultiLocation, - ) -> MultiLocation { - // lets start with target_location - bridge_conig.allowed_target_location.clone() - } - } -} - -#[cfg(test)] -pub(crate) mod tests { - use super::*; - use crate as bridge_transfer; - use frame_support::traits::{ConstU32, Contains, ContainsPair, Currency, Everything}; - - use crate::impls::{AllowedUniversalAliasesOf, IsAllowedReserveOf}; - use frame_support::{ - assert_noop, assert_ok, dispatch::DispatchError, parameter_types, sp_io, sp_tracing, - }; - use frame_system::EnsureRoot; - use polkadot_parachain::primitives::Sibling; - use sp_runtime::{ - testing::{Header, H256}, - traits::{BlakeTwo256, IdentityLookup}, - AccountId32, ModuleError, - }; - use sp_version::RuntimeVersion; - use xcm_builder::{ - AccountId32Aliases, CurrencyAdapter, EnsureXcmOrigin, ExporterFor, - GlobalConsensusParachainConvertsFor, IsConcrete, SiblingParachainConvertsVia, - SignedToAccountId32, UnpaidRemoteExporter, - }; - use xcm_executor::traits::Convert; - - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; - type Block = frame_system::mocking::MockBlock; - - frame_support::construct_runtime!( - pub enum TestRuntime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - BridgeTransfer: bridge_transfer::{Pallet, Call, Event} = 52, - } - ); - - parameter_types! { - pub const BlockHashCount: u64 = 250; - pub Version: RuntimeVersion = RuntimeVersion { - spec_name: sp_version::create_runtime_str!("test"), - impl_name: sp_version::create_runtime_str!("system-test"), - authoring_version: 1, - spec_version: 1, - impl_version: 1, - apis: sp_version::create_apis_vec!([]), - transaction_version: 1, - state_version: 1, - }; - } - - pub type AccountId = AccountId32; - - impl frame_system::Config for TestRuntime { - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type Header = Header; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type BlockLength = (); - type BlockWeights = (); - type Version = Version; - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type DbWeight = (); - type BaseCallFilter = frame_support::traits::Everything; - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; - } - - parameter_types! { - pub const ExistentialDeposit: u64 = 5; - pub const MaxReserves: u32 = 50; - } - - impl pallet_balances::Config for TestRuntime { - type Balance = u64; - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); - type MaxLocks = (); - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; - type MaxFreezes = ConstU32<0>; - } - - parameter_types! { - // UniversalLocation as statemine - pub const RelayNetwork: NetworkId = NetworkId::ByGenesis([9; 32]); - pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(1000)); - // Test bridge cfg - pub TestBridgeTable: sp_std::prelude::Vec<(NetworkId, MultiLocation, Option)> = sp_std::vec![ - (NetworkId::Wococo, (Parent, Parachain(1013)).into(), None), - (NetworkId::Polkadot, (Parent, Parachain(1002)).into(), None), - ]; - // Relay chain currency/balance location (e.g. KsmLocation, DotLocation, ..) - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - } - - std::thread_local! { - static ROUTED_MESSAGE: std::cell::RefCell>> = std::cell::RefCell::new(None); - } - - pub struct ThreadLocalXcmRouter; - impl SendXcm for ThreadLocalXcmRouter { - type Ticket = Option>; - - fn validate( - destination: &mut Option, - message: &mut Option>, - ) -> SendResult { - log::info!( - target: super::LOG_TARGET, - "[ThreadLocalXcmRouter]: destination: {:?}, message: {:?}", destination, - message - ); - Ok((message.take(), MultiAssets::default())) - } - - fn deliver(ticket: Self::Ticket) -> Result { - match ticket { - Some(msg) => { - ROUTED_MESSAGE.with(|rm| *rm.borrow_mut() = Some(msg)); - Ok([0u8; 32]) - }, - None => Err(SendError::MissingArgument), - } - } - } - - pub struct NotApplicableOrFailOnParachain2222XcmRouter; - impl SendXcm for NotApplicableOrFailOnParachain2222XcmRouter { - type Ticket = Option>; - - fn validate( - destination: &mut Option, - message: &mut Option>, - ) -> SendResult { - log::info!( - target: super::LOG_TARGET, - "[NotApplicableOrFailOnParachain2222XcmRouter]: destination: {:?}, message: {:?}", - destination, - message - ); - if matches!( - destination, - Some(MultiLocation { interior: X1(Parachain(2222)), parents: 1 }) - ) { - Err(SendError::Transport("Simulate what ever error")) - } else { - Err(SendError::NotApplicable) - } - } - - fn deliver(ticket: Self::Ticket) -> Result { - unimplemented!("We should not come here, ticket: {:?}", ticket) - } - } - - pub type XcmRouter = (NotApplicableOrFailOnParachain2222XcmRouter, ThreadLocalXcmRouter); - - /// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus - pub type TestBridgeXcmSender = - UnpaidRemoteExporter; - - /// No local origins on this chain are allowed to dispatch XCM sends/executions. - pub type LocalOriginToLocation = SignedToAccountId32; - - pub type LocationToAccountId = ( - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, - // Different global consensus parachain sovereign account. - // (Used for over-bridge transfers and reserve processing) - GlobalConsensusParachainConvertsFor, - ); - - /// Means for transacting the native currency on this chain. - pub type CurrencyTransactor = CurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports of `Balances`. - (), - >; - - /// Bridge configuration we use in our tests. - fn test_bridge_config() -> (NetworkId, BridgeConfig) { - ( - Wococo, - BridgeConfig { - bridge_location: (Parent, Parachain(1013)).into(), - bridge_location_fee: None, - allowed_target_location: MultiLocation::new( - 2, - X2(GlobalConsensus(Wococo), Parachain(1000)), - ), - max_target_location_fee: None, - }, - ) - } - - /// Benchmarks helper. - #[cfg(feature = "runtime-benchmarks")] - pub struct TestBenchmarkHelper; - - #[cfg(feature = "runtime-benchmarks")] - impl BenchmarkHelper for TestBenchmarkHelper { - fn bridge_config() -> (NetworkId, BridgeConfig) { - test_bridge_config() - } - - fn prepare_asset_transfer() -> (RuntimeOrigin, VersionedMultiAssets, VersionedMultiLocation) - { - let assets_count = MaxAssetsLimit::get(); - - // sender account must have enough funds - let sender_account = account(1); - let total_deposit = ExistentialDeposit::get() * (1 + assets_count as u64); - let _ = Balances::deposit_creating(&sender_account, total_deposit); - - // finally - prepare assets and destination - let assets = VersionedMultiAssets::V3( - std::iter::repeat(MultiAsset { - fun: Fungible(ExistentialDeposit::get().into()), - id: Concrete(RelayLocation::get()), - }) - .take(assets_count as usize) - .collect::>() - .into(), - ); - let destination = VersionedMultiLocation::V3(MultiLocation::new( - 2, - X3(GlobalConsensus(Wococo), Parachain(1000), consensus_account(Wococo, 2)), - )); - - (RuntimeOrigin::signed(sender_account), assets, destination) - } - - fn prepare_ping_transfer() { - unimplemented!("Not implemented here - not needed"); - } - } - - parameter_types! { - pub const TrapCode: u64 = 12345; - pub const MaxAssetsLimit: u8 = 1; - } - - impl Config for TestRuntime { - type RuntimeEvent = RuntimeEvent; - type UniversalLocation = UniversalLocation; - type WeightInfo = (); - type AdminOrigin = EnsureRoot; - type UniversalAliasesLimit = ConstU32<2>; - type ReserveLocationsLimit = ConstU32<2>; - type AssetTransactor = CurrencyTransactor; - type BridgeXcmSender = TestBridgeXcmSender; - type TransferAssetOrigin = EnsureXcmOrigin; - type MaxAssetsLimit = MaxAssetsLimit; - type TransferPingOrigin = EnsureXcmOrigin; - type PingMessageBuilder = UnpaidTrapMessageBuilder; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = TestBenchmarkHelper; - } - - pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - sp_tracing::try_init_simple(); - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - // with 0 block_number events dont work - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| { - frame_system::Pallet::::set_block_number(1u32.into()); - }); - - ext - } - - fn account(account: u8) -> AccountId32 { - AccountId32::new([account; 32]) - } - - fn consensus_account(network: NetworkId, account: u8) -> Junction { - xcm::prelude::AccountId32 { - network: Some(network), - id: AccountId32::new([account; 32]).into(), - } - } - - #[test] - fn test_ensure_remote_destination() { - new_test_ext().execute_with(|| { - // insert bridge config - let bridge_network = Wococo; - let bridge_config = test_bridge_config().1; - assert_ok!(BridgeTransfer::add_exporter_config( - RuntimeOrigin::root(), - bridge_network, - Box::new(bridge_config.clone()), - )); - - // v2 not supported - assert_eq!( - BridgeTransfer::ensure_remote_destination(VersionedMultiLocation::V2( - xcm::v2::MultiLocation::default() - )), - Err(Error::::UnsupportedXcmVersion) - ); - - // v3 - "parent: 0" wrong - assert_eq!( - BridgeTransfer::ensure_remote_destination(VersionedMultiLocation::V3( - MultiLocation::new(0, X2(GlobalConsensus(Wococo), Parachain(1000))) - )), - Err(Error::::UnsupportedDestination) - ); - // v3 - "parent: 1" wrong - assert_eq!( - BridgeTransfer::ensure_remote_destination(VersionedMultiLocation::V3( - MultiLocation::new(1, X2(GlobalConsensus(Wococo), Parachain(1000))) - )), - Err(Error::::UnsupportedDestination) - ); - - // v3 - Rococo is not supported - assert_eq!( - BridgeTransfer::ensure_remote_destination(VersionedMultiLocation::V3( - MultiLocation::new(2, X2(GlobalConsensus(Rococo), Parachain(1000))) - )), - Err(Error::::UnsupportedDestination) - ); - - // v3 - remote_destination is not allowed - assert_eq!( - BridgeTransfer::ensure_remote_destination(VersionedMultiLocation::V3( - MultiLocation::new(2, X2(GlobalConsensus(Wococo), Parachain(1234))) - )), - Err(Error::::UnsupportedDestination) - ); - - // v3 - ok (allowed) - assert_eq!( - BridgeTransfer::ensure_remote_destination(VersionedMultiLocation::V3( - MultiLocation::new(2, X2(GlobalConsensus(Wococo), Parachain(1000))) - )), - Ok(( - bridge_network, - bridge_config, - MultiLocation::new(2, X2(GlobalConsensus(Wococo), Parachain(1000))) - )) - ); - }) - } - - #[test] - fn test_transfer_asset_via_bridge_for_currency_works() { - new_test_ext().execute_with(|| { - // initialize some Balances for user_account - let user_account = account(1); - let user_account_init_balance = 1000_u64; - let _ = Balances::deposit_creating(&user_account, user_account_init_balance); - let user_free_balance = Balances::free_balance(&user_account); - let balance_to_transfer = 15_u64; - assert!((user_free_balance - balance_to_transfer) >= ExistentialDeposit::get()); - // because, sovereign account needs to have ED otherwise reserve fails - assert!(balance_to_transfer >= ExistentialDeposit::get()); - - // insert bridge config - let bridged_network = Wococo; - assert_ok!(BridgeTransfer::add_exporter_config( - RuntimeOrigin::root(), - bridged_network, - Box::new(test_bridge_config().1), - )); - let target_location = AllowedExporters::::get(bridged_network) - .expect("stored BridgeConfig for bridged_network") - .allowed_target_location; - - // checks before - assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); - assert_eq!(Balances::free_balance(&user_account), user_account_init_balance); - let reserve_account = LocationToAccountId::convert_ref(target_location) - .expect("converted target_location as accountId"); - assert_eq!(Balances::free_balance(&reserve_account), 0); - - // trigger transfer_asset_via_bridge - should trigger new ROUTED_MESSAGE - let asset = MultiAsset { - fun: Fungible(balance_to_transfer.into()), - id: Concrete(RelayLocation::get()), - }; - let assets = Box::new(VersionedMultiAssets::from(MultiAssets::from(asset))); - - // destination is account from different consensus - let destination = Box::new(VersionedMultiLocation::from(MultiLocation::new( - 2, - X3(GlobalConsensus(Wococo), Parachain(1000), consensus_account(Wococo, 2)), - ))); - - // trigger asset transfer - assert_ok!(BridgeTransfer::transfer_asset_via_bridge( - RuntimeOrigin::signed(account(1)), assets, - destination, - )); - - // check user account decressed - assert_eq!( - Balances::free_balance(&user_account), - user_account_init_balance - balance_to_transfer - ); - // check reserve account increased - assert_eq!(Balances::free_balance(&reserve_account), 15); - - // check events - let events = System::events(); - assert!(!events.is_empty()); - - // check reserve asset deposited event - assert!(System::events().iter().any(|r| matches!( - r.event, - RuntimeEvent::BridgeTransfer(Event::ReserveAssetsDeposited { .. }) - ))); - assert!(System::events().iter().any(|r| matches!( - r.event, - RuntimeEvent::BridgeTransfer(Event::TransferInitiated { .. }) - ))); - - // check fired XCM ExportMessage to bridge-hub - let fired_xcm = - ROUTED_MESSAGE.with(|r| r.take().expect("xcm::ExportMessage should be here")); - - if let Some(ExportMessage { xcm, .. }) = fired_xcm.0.iter().find(|instr| { - matches!( - instr, - ExportMessage { network: Wococo, destination: X1(Parachain(1000)), .. } - ) - }) { - assert!(xcm.0.iter().any(|instr| matches!(instr, UnpaidExecution { .. }))); - assert!(xcm.0.iter().any(|instr| matches!(instr, ReserveAssetDeposited(..)))); - assert!(xcm.0.iter().any(|instr| matches!(instr, DepositAsset { .. }))); - assert!(xcm.0.iter().any(|instr| matches!(instr, SetTopic { .. }))); - } else { - assert!(false, "Does not contains [`ExportMessage`], fired_xcm: {:?}", fired_xcm); - } - }); - } - - #[test] - fn test_transfer_asset_via_bridge_in_case_of_error_transactional_works() { - new_test_ext().execute_with(|| { - // initialize some Balances for user_account - let user_account = account(1); - let user_account_init_balance = 1000_u64; - let _ = Balances::deposit_creating(&user_account, user_account_init_balance); - let user_free_balance = Balances::free_balance(&user_account); - let balance_to_transfer = 15_u64; - assert!((user_free_balance - balance_to_transfer) >= ExistentialDeposit::get()); - // because, sovereign account needs to have ED otherwise reserve fails - assert!(balance_to_transfer >= ExistentialDeposit::get()); - - // insert bridge config (with unroutable bridge_location - 2222) - let bridged_network = Wococo; - assert_ok!(BridgeTransfer::add_exporter_config( - RuntimeOrigin::root(), - bridged_network, - Box::new(BridgeConfig { - bridge_location: MultiLocation::new(1, Parachain(2222)).into(), - bridge_location_fee: None, - allowed_target_location: MultiLocation::new( - 2, - X2(GlobalConsensus(Wococo), Parachain(1000)), - ), - max_target_location_fee: None, - }), - )); - - let target_location = AllowedExporters::::get(bridged_network) - .expect("stored BridgeConfig for bridged_network") - .allowed_target_location; - - // checks before - assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); - let user_balance_before = Balances::free_balance(&user_account); - assert_eq!(user_balance_before, user_account_init_balance); - let reserve_account = LocationToAccountId::convert_ref(target_location) - .expect("converted target_location as accountId"); - let reserve_account_before = Balances::free_balance(&reserve_account); - assert_eq!(reserve_account_before, 0); - - // trigger transfer_asset_via_bridge - should trigger new ROUTED_MESSAGE - let asset = MultiAsset { - fun: Fungible(balance_to_transfer.into()), - id: Concrete(RelayLocation::get()), - }; - let assets = Box::new(VersionedMultiAssets::from(MultiAssets::from(asset))); - - // destination is account from different consensus - let destination = Box::new(VersionedMultiLocation::from(MultiLocation::new( - 2, - X3(GlobalConsensus(Wococo), Parachain(1000), consensus_account(Wococo, 2)), - ))); - - // reset events - System::reset_events(); - - // trigger asset transfer - assert_noop!( - BridgeTransfer::transfer_asset_via_bridge( - RuntimeOrigin::signed(account(1)), - assets, - destination - ), - DispatchError::Module(ModuleError { - index: 52, - error: [8, 0, 0, 0], - message: Some("BridgeCallError") - }) - ); - - // checks after - // balances are untouched - assert_eq!(Balances::free_balance(&user_account), user_balance_before); - assert_eq!(Balances::free_balance(&reserve_account), reserve_account_before); - // no xcm messages fired - assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); - // check events (no events because of rollback) - assert!(System::events().is_empty()); - }); - } - - #[test] - fn test_ping_via_bridge_works() { - new_test_ext().execute_with(|| { - // insert bridge config - let bridged_network = Wococo; - assert_ok!(BridgeTransfer::add_exporter_config( - RuntimeOrigin::root(), - bridged_network, - Box::new(test_bridge_config().1), - )); - - // checks before - assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); - - // trigger ping_via_bridge - should trigger new ROUTED_MESSAGE - // destination is account from different consensus - let destination = Box::new(VersionedMultiLocation::V3(MultiLocation::new( - 2, - X3(GlobalConsensus(Wococo), Parachain(1000), consensus_account(Wococo, 2)), - ))); - - // trigger asset transfer - assert_ok!(BridgeTransfer::ping_via_bridge( - RuntimeOrigin::signed(account(1)), - destination, - )); - - // check events - let events = System::events(); - assert!(!events.is_empty()); - - // check TransferInitiated - assert!(System::events().iter().any(|r| matches!( - r.event, - RuntimeEvent::BridgeTransfer(Event::TransferInitiated { .. }) - ))); - - // check fired XCM ExportMessage to bridge-hub - let fired_xcm = - ROUTED_MESSAGE.with(|r| r.take().expect("xcm::ExportMessage should be here")); - - if let Some(ExportMessage { xcm, .. }) = fired_xcm.0.iter().find(|instr| { - matches!( - instr, - ExportMessage { network: Wococo, destination: X1(Parachain(1000)), .. } - ) - }) { - assert!(xcm.0.iter().any(|instr| instr.eq(&Trap(TrapCode::get())))); - } else { - assert!(false, "Does not contains [`ExportMessage`], fired_xcm: {:?}", fired_xcm); - } - }); - } - - #[test] - fn allowed_exporters_management_works() { - let bridged_network = Rococo; - let bridged_config = Box::new(BridgeConfig { - bridge_location: (Parent, Parachain(1013)).into(), - bridge_location_fee: None, - allowed_target_location: MultiLocation::new( - 2, - X2(GlobalConsensus(bridged_network), Parachain(1000)), - ), - max_target_location_fee: None, - }); - let dummy_xcm = Xcm(vec![]); - let dummy_remote_interior_multilocation = X1(Parachain(1234)); - - { - let mut asset = xcm_executor::Assets::from(MultiAsset { - id: Concrete(MultiLocation::parent()), - fun: Fungible(1_000), - }); - println!("before: {:?}", asset); - asset.reanchor(&bridged_config.allowed_target_location, UniversalLocation::get(), None); - println!("after: {:?}", asset); - } - { - let mut asset = xcm_executor::Assets::from(MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: X1(Parachain(3000)) }), - fun: Fungible(1_000), - }); - println!("before: {:?}", asset); - asset.reanchor(&bridged_config.allowed_target_location, UniversalLocation::get(), None); - println!("after: {:?}", asset); + ) } - - new_test_ext().execute_with(|| { - assert_eq!(AllowedExporters::::iter().count(), 0); - - // should fail - just root is allowed - assert_noop!( - BridgeTransfer::add_exporter_config( - RuntimeOrigin::signed(account(1)), - bridged_network, - bridged_config.clone(), - ), - DispatchError::BadOrigin - ); - - // should fail - bridged_network should match allowed_target_location - assert_noop!( - BridgeTransfer::add_exporter_config(RuntimeOrigin::root(), bridged_network, { - let remote_network = Westend; - assert_ne!(bridged_network, remote_network); - Box::new(test_bridge_config().1) - }), - DispatchError::Module(ModuleError { - index: 52, - error: [0, 0, 0, 0], - message: Some("InvalidConfiguration") - }) - ); - // should fail - bridged_network must be different global consensus than our `UniversalLocation` - assert_noop!( - BridgeTransfer::add_exporter_config( - RuntimeOrigin::root(), - UniversalLocation::get().global_consensus().expect("any `NetworkId`"), - bridged_config.clone() - ), - DispatchError::Module(ModuleError { - index: 52, - error: [0, 0, 0, 0], - message: Some("InvalidConfiguration") - }) - ); - assert_eq!(AllowedExporters::::iter().count(), 0); - assert_eq!( - BridgeTransfer::exporter_for( - &bridged_network, - &dummy_remote_interior_multilocation, - &dummy_xcm - ), - None - ); - - // add with root - assert_ok!(BridgeTransfer::add_exporter_config( - RuntimeOrigin::root(), - bridged_network, - bridged_config.clone(), - )); - assert_eq!(AllowedExporters::::iter().count(), 1); - assert_eq!( - AllowedExporters::::get(bridged_network), - Some(*bridged_config.clone()) - ); - assert_eq!(AllowedExporters::::get(Wococo), None); - assert_eq!( - BridgeTransfer::exporter_for( - &bridged_network, - &dummy_remote_interior_multilocation, - &dummy_xcm - ), - Some((bridged_config.bridge_location, bridged_config.bridge_location_fee)) - ); - assert_eq!( - BridgeTransfer::exporter_for( - &Wococo, - &dummy_remote_interior_multilocation, - &dummy_xcm - ), - None - ); - - // update fee - // remove - assert_ok!(BridgeTransfer::update_exporter_config( - RuntimeOrigin::root(), - bridged_network, - Some(VersionedMultiAsset::V3((Parent, 200u128).into()).into()), - Some(VersionedMultiAsset::V3((Parent, 300u128).into()).into()), - )); - assert_eq!(AllowedExporters::::iter().count(), 1); - assert_eq!( - AllowedExporters::::get(bridged_network), - Some(BridgeConfig { - bridge_location: bridged_config.bridge_location.clone(), - bridge_location_fee: Some((Parent, 200u128).into()), - allowed_target_location: bridged_config.allowed_target_location.clone(), - max_target_location_fee: Some((Parent, 300u128).into()), - }) - ); - assert_eq!( - BridgeTransfer::exporter_for( - &bridged_network, - &dummy_remote_interior_multilocation, - &dummy_xcm - ), - Some((bridged_config.bridge_location, Some((Parent, 200u128).into()))) - ); - - // remove - assert_ok!(BridgeTransfer::remove_exporter_config( - RuntimeOrigin::root(), - bridged_network, - )); - assert_eq!(AllowedExporters::::get(bridged_network), None); - assert_eq!(AllowedExporters::::iter().count(), 0); - }) - } - - #[test] - fn allowed_universal_aliases_management_works() { - new_test_ext().execute_with(|| { - assert_eq!(AllowedUniversalAliases::::iter().count(), 0); - - let location1 = MultiLocation::new(1, X1(Parachain(1014))); - let junction1 = GlobalConsensus(ByGenesis([1; 32])); - let junction2 = GlobalConsensus(ByGenesis([2; 32])); - - // should fail - just root is allowed - assert_noop!( - BridgeTransfer::add_universal_alias( - RuntimeOrigin::signed(account(1)), - Box::new(VersionedMultiLocation::V3(location1.clone())), - junction1.clone(), - ), - DispatchError::BadOrigin - ); - assert_eq!(AllowedUniversalAliases::::iter().count(), 0); - assert!(!AllowedUniversalAliasesOf::::contains(&(location1, junction1))); - assert!(!AllowedUniversalAliasesOf::::contains(&(location1, junction2))); - - // add ok - assert_ok!(BridgeTransfer::add_universal_alias( - RuntimeOrigin::root(), - Box::new(VersionedMultiLocation::V3(location1.clone())), - junction1.clone(), - )); - assert_ok!(BridgeTransfer::add_universal_alias( - RuntimeOrigin::root(), - Box::new(VersionedMultiLocation::V3(location1.clone())), - junction2.clone(), - )); - assert!(AllowedUniversalAliasesOf::::contains(&(location1, junction1))); - assert!(AllowedUniversalAliasesOf::::contains(&(location1, junction2))); - - // remove ok - assert_ok!(BridgeTransfer::remove_universal_alias( - RuntimeOrigin::root(), - Box::new(VersionedMultiLocation::V3(location1.clone())), - vec![junction1.clone()], - )); - assert!(!AllowedUniversalAliasesOf::::contains(&(location1, junction1))); - assert!(AllowedUniversalAliasesOf::::contains(&(location1, junction2))); - - assert_ok!(BridgeTransfer::remove_universal_alias( - RuntimeOrigin::root(), - Box::new(VersionedMultiLocation::V3(location1.clone())), - vec![junction2.clone()], - )); - assert!(!AllowedUniversalAliasesOf::::contains(&(location1, junction1))); - assert!(!AllowedUniversalAliasesOf::::contains(&(location1, junction2))); - }) - } - - #[test] - fn allowed_reserve_locations_management_works() { - new_test_ext().execute_with(|| { - assert!(AllowedReserveLocations::::get().is_empty()); - - let location1 = MultiLocation::new(1, X1(Parachain(1014))); - let location2 = - MultiLocation::new(2, X2(GlobalConsensus(ByGenesis([1; 32])), Parachain(1014))); - let asset: MultiAsset = (Parent, 200u128).into(); - - // should fail - just root is allowed - assert_noop!( - BridgeTransfer::add_reserve_location( - RuntimeOrigin::signed(account(1)), - Box::new(VersionedMultiLocation::V3(location1.clone())) - ), - DispatchError::BadOrigin - ); - assert_eq!(AllowedReserveLocations::::get().len(), 0); - assert!(!IsAllowedReserveOf::::contains(&asset, &location1)); - assert!(!IsAllowedReserveOf::::contains(&asset, &location2)); - - // add ok - assert_ok!(BridgeTransfer::add_reserve_location( - RuntimeOrigin::root(), - Box::new(VersionedMultiLocation::V3(location1.clone())) - )); - assert_ok!(BridgeTransfer::add_reserve_location( - RuntimeOrigin::root(), - Box::new(VersionedMultiLocation::V3(location2.clone())) - )); - assert_eq!(AllowedReserveLocations::::get().len(), 2); - assert!(IsAllowedReserveOf::::contains(&asset, &location1)); - assert!(IsAllowedReserveOf::::contains(&asset, &location2)); - - // remove ok - assert_ok!(BridgeTransfer::remove_reserve_location( - RuntimeOrigin::root(), - vec![VersionedMultiLocation::V3(location1.clone())], - )); - assert_eq!(AllowedReserveLocations::::get().len(), 1); - assert!(!IsAllowedReserveOf::::contains(&asset, &location1)); - assert!(IsAllowedReserveOf::::contains(&asset, &location2)); - - assert_ok!(BridgeTransfer::remove_reserve_location( - RuntimeOrigin::root(), - vec![VersionedMultiLocation::V3(location2.clone())], - )); - assert!(AllowedReserveLocations::::get().is_empty()); - assert!(!IsAllowedReserveOf::::contains(&asset, &location1)); - assert!(!IsAllowedReserveOf::::contains(&asset, &location2)); - }) } } diff --git a/parachains/pallets/bridge-transfer/src/tests.rs b/parachains/pallets/bridge-transfer/src/tests.rs new file mode 100644 index 00000000000..33ef185cd3b --- /dev/null +++ b/parachains/pallets/bridge-transfer/src/tests.rs @@ -0,0 +1,539 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate as bridge_transfer; + +use crate::{ + features::{ + ConcreteAssetTransferKindResolver, + IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation, + }, + Config, Error, Event, +}; +use frame_support::{ + assert_noop, assert_ok, + dispatch::DispatchError, + parameter_types, sp_io, sp_tracing, + traits::{ConstU32, Currency}, +}; +use pallet_bridge_transfer_primitives::{ + AssetFilter, BridgeConfig, BridgesConfig, BridgesConfigAdapter, BridgesConfigBuilder, + MaybePaidLocation, MultiLocationFilter, ReachableDestination, +}; +use polkadot_parachain::primitives::Sibling; +use sp_runtime::{ + testing::{Header, H256}, + traits::{BlakeTwo256, IdentityLookup}, + AccountId32, ModuleError, +}; +use sp_version::RuntimeVersion; +use xcm::prelude::*; +use xcm_builder::{ + AccountId32Aliases, CurrencyAdapter, EnsureXcmOrigin, GlobalConsensusParachainConvertsFor, + IsConcrete, SiblingParachainConvertsVia, SignedToAccountId32, UnpaidRemoteExporter, +}; +use xcm_executor::traits::ConvertLocation; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum TestRuntime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + BridgeTransfer: bridge_transfer::{Pallet, Call, Event} = 52, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub Version: RuntimeVersion = RuntimeVersion { + spec_name: sp_version::create_runtime_str!("test"), + impl_name: sp_version::create_runtime_str!("system-test"), + authoring_version: 1, + spec_version: 1, + impl_version: 1, + apis: sp_version::create_apis_vec!([]), + transaction_version: 1, + state_version: 1, + }; +} + +pub type AccountId = AccountId32; + +impl frame_system::Config for TestRuntime { + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = Header; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockWeights = (); + type Version = Version; + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type DbWeight = (); + type BaseCallFilter = frame_support::traits::Everything; + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 5; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for TestRuntime { + type Balance = u64; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + type MaxLocks = (); + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; + type RuntimeHoldReason = RuntimeHoldReason; + type FreezeIdentifier = (); + type MaxHolds = ConstU32<0>; + type MaxFreezes = ConstU32<0>; +} + +parameter_types! { + pub const BridgedNetwork: NetworkId = NetworkId::ByGenesis([4; 32]); + pub BridgeLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1013))); + pub TargetLocation: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(BridgedNetwork::get()), Parachain(1000))); + // pub TargetLocationFee: Option = Some((MultiLocation::parent(), 1_000_000).into()); + pub TargetLocationFee: Option = None; + + pub const RelayNetwork: NetworkId = NetworkId::ByGenesis([9; 32]); + pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(1000)); + // Relay chain currency/balance location (e.g. KsmLocation, DotLocation, ..) + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + + pub Bridges: BridgesConfig = BridgesConfigBuilder::default() + .add_or_panic( + BridgedNetwork::get(), + BridgeConfig::new( + MaybePaidLocation { + location: BridgeLocation::get(), + maybe_fee: None, + } + ).add_target_location( + MaybePaidLocation { + location: TargetLocation::get(), + maybe_fee: TargetLocationFee::get(), + }, + Some(AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow transfer parent/relay native token + .add_equals(MultiLocation::parent()) + )) + ) + ) + .build(); + +} + +std::thread_local! { + static ROUTED_MESSAGE: std::cell::RefCell>> = std::cell::RefCell::new(None); + static NOT_APPLICABLE_AS_SOME_OR_FAIL_ROUTER_SWITCH: std::cell::RefCell> = std::cell::RefCell::new(Some(())); +} + +pub struct ThreadLocalXcmRouter; +impl SendXcm for ThreadLocalXcmRouter { + type Ticket = Option>; + + fn validate( + destination: &mut Option, + message: &mut Option>, + ) -> SendResult { + log::info!( + target: super::LOG_TARGET, + "[ThreadLocalXcmRouter]: destination: {:?}, message: {:?}", + destination, + message + ); + Ok((message.take(), MultiAssets::default())) + } + + fn deliver(ticket: Self::Ticket) -> Result { + match ticket { + Some(msg) => { + ROUTED_MESSAGE.with(|rm| *rm.borrow_mut() = Some(msg)); + Ok([0u8; 32]) + }, + None => Err(SendError::MissingArgument), + } + } +} + +pub struct NotApplicableOrFailRouter; +impl SendXcm for NotApplicableOrFailRouter { + type Ticket = Option>; + + fn validate( + destination: &mut Option, + message: &mut Option>, + ) -> SendResult { + log::info!( + target: super::LOG_TARGET, + "[NotApplicableOrFailRouter]: destination: {:?}, message: {:?}", + destination, + message + ); + + let wanna_fail = + NOT_APPLICABLE_AS_SOME_OR_FAIL_ROUTER_SWITCH.with(|s| s.borrow().is_none()); + if wanna_fail { + Err(SendError::Transport("Simulate what ever error")) + } else { + Err(SendError::NotApplicable) + } + } + + fn deliver(ticket: Self::Ticket) -> Result { + unimplemented!("We should not come here, ticket: {:?}", ticket) + } +} + +pub type XcmRouter = (NotApplicableOrFailRouter, ThreadLocalXcmRouter); + +/// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus +pub type TestBridgeXcmSender = + UnpaidRemoteExporter, XcmRouter, UniversalLocation>; + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = SignedToAccountId32; + +pub type LocationToAccountId = ( + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, + // Different global consensus parachain sovereign account. + // (Used for over-bridge transfers and reserve processing) + GlobalConsensusParachainConvertsFor, +); + +/// Means for transacting the native currency on this chain. +pub type CurrencyTransactor = CurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports of `Balances`. + (), +>; + +parameter_types! { + // na constantu + pub const AssetsLimit: u8 = 1; +} + +impl Config for TestRuntime { + type RuntimeEvent = RuntimeEvent; + type UniversalLocation = UniversalLocation; + type WeightInfo = (); + type AssetTransactor = CurrencyTransactor; + type AssetTransferKindResolver = ConcreteAssetTransferKindResolver< + (), + IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation, + >; + type AssetTransferOrigin = EnsureXcmOrigin; + type AssetsLimit = AssetsLimit; + type BridgedDestinationValidator = BridgesConfigAdapter; + type BridgeXcmSender = TestBridgeXcmSender; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); +} + +pub(crate) fn new_test_ext() -> sp_io::TestExternalities { + sp_tracing::try_init_simple(); + let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + // with 0 block_number events dont work + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| { + frame_system::Pallet::::set_block_number(1u32.into()); + }); + + ext +} + +fn account(account: u8) -> AccountId32 { + AccountId32::new([account; 32]) +} + +fn consensus_account(network: NetworkId, account: u8) -> Junction { + xcm::prelude::AccountId32 { network: Some(network), id: AccountId32::new([account; 32]).into() } +} + +#[test] +fn test_ensure_reachable_remote_destination() { + new_test_ext().execute_with(|| { + let bridged_network = BridgedNetwork::get(); + + // v3 - "parent: 0" wrong + assert_eq!( + BridgeTransfer::ensure_reachable_remote_destination(MultiLocation::new( + 0, + X2(GlobalConsensus(bridged_network), Parachain(1000)) + )), + Err(Error::::UnsupportedDestination) + ); + // v3 - "parent: 1" wrong + assert_eq!( + BridgeTransfer::ensure_reachable_remote_destination(MultiLocation::new( + 1, + X2(GlobalConsensus(bridged_network), Parachain(1000)) + )), + Err(Error::::UnsupportedDestination) + ); + + // v3 - Rococo is not supported + assert_eq!( + BridgeTransfer::ensure_reachable_remote_destination(MultiLocation::new( + 2, + X2(GlobalConsensus(Rococo), Parachain(1000)) + )), + Err(Error::::UnsupportedDestination) + ); + + // v3 - remote_destination is not allowed + assert_eq!( + BridgeTransfer::ensure_reachable_remote_destination(MultiLocation::new( + 2, + X2(GlobalConsensus(bridged_network), Parachain(1234)) + )), + Err(Error::::UnsupportedDestination) + ); + + // v3 - ok (allowed) + assert_ok!( + BridgeTransfer::ensure_reachable_remote_destination(MultiLocation::new( + 2, + X3( + GlobalConsensus(bridged_network), + Parachain(1000), + consensus_account(bridged_network, 35) + ) + ),), + ReachableDestination { + bridge: MaybePaidLocation { location: BridgeLocation::get(), maybe_fee: None }, + target: MaybePaidLocation { + location: MultiLocation::new( + 2, + X2(GlobalConsensus(bridged_network), Parachain(1000)) + ), + maybe_fee: TargetLocationFee::get(), + }, + target_destination: MultiLocation::new( + 2, + X3( + GlobalConsensus(bridged_network), + Parachain(1000), + consensus_account(bridged_network, 35) + ) + ), + } + ); + }) +} + +#[test] +fn test_transfer_asset_via_bridge_for_currency_works() { + new_test_ext().execute_with(|| { + // initialize some Balances for user_account + let user_account = account(1); + let user_account_init_balance = 1000_u64; + let _ = Balances::deposit_creating(&user_account, user_account_init_balance); + let user_free_balance = Balances::free_balance(&user_account); + let balance_to_transfer = 15_u64; + assert!((user_free_balance - balance_to_transfer) >= ExistentialDeposit::get()); + // because, sovereign account needs to have ED otherwise reserve fails + assert!(balance_to_transfer >= ExistentialDeposit::get()); + + let bridged_network = BridgedNetwork::get(); + let target_location = TargetLocation::get(); + + // checks before + assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); + assert_eq!(Balances::free_balance(&user_account), user_account_init_balance); + let reserve_account = LocationToAccountId::convert_location(&target_location) + .expect("converted target_location as accountId"); + assert_eq!(Balances::free_balance(&reserve_account), 0); + + // trigger transfer_asset_via_bridge - should trigger new ROUTED_MESSAGE + let asset = MultiAsset { + fun: Fungible(balance_to_transfer.into()), + id: Concrete(RelayLocation::get()), + }; + let assets = Box::new(VersionedMultiAssets::from(MultiAssets::from(asset))); + + // destination is account from different consensus + let destination = Box::new(VersionedMultiLocation::from(MultiLocation::new( + 2, + X3( + GlobalConsensus(bridged_network), + Parachain(1000), + consensus_account(bridged_network, 2), + ), + ))); + + // trigger asset transfer + assert_ok!(BridgeTransfer::transfer_asset_via_bridge( + RuntimeOrigin::signed(account(1)), + assets, + destination, + )); + + // check user account decressed + assert_eq!( + Balances::free_balance(&user_account), + user_account_init_balance - balance_to_transfer + ); + // check reserve account increased + assert_eq!(Balances::free_balance(&reserve_account), 15); + + // check events + let events = System::events(); + assert!(!events.is_empty()); + + // check reserve asset deposited event + assert!(System::events().iter().any(|r| matches!( + r.event, + RuntimeEvent::BridgeTransfer(Event::ReserveAssetsDeposited { .. }) + ))); + assert!(System::events().iter().any(|r| matches!( + r.event, + RuntimeEvent::BridgeTransfer(Event::TransferInitiated { .. }) + ))); + + // check fired XCM ExportMessage to bridge-hub + let fired_xcm = + ROUTED_MESSAGE.with(|r| r.take().expect("xcm::ExportMessage should be here")); + + if let Some(ExportMessage { xcm, .. }) = fired_xcm.0.iter().find(|instr| { + matches!( + instr, + ExportMessage { + network, + destination: X1(Parachain(1000)), + .. + } if network == &bridged_network + ) + }) { + println!("{:?}", xcm.0); + assert!(xcm.0.iter().any(|instr| matches!(instr, UnpaidExecution { .. }))); + assert!(xcm.0.iter().any(|instr| matches!(instr, ReserveAssetDeposited(..)))); + assert!(xcm.0.iter().any(|instr| matches!(instr, DepositAsset { .. }))); + assert!(xcm.0.iter().any(|instr| matches!(instr, SetTopic { .. }))); + } else { + assert!(false, "Does not contains [`ExportMessage`], fired_xcm: {:?}", fired_xcm); + } + }); +} + +#[test] +fn test_transfer_asset_via_bridge_in_case_of_error_transactional_works() { + new_test_ext().execute_with(|| { + // initialize some Balances for user_account + let user_account = account(1); + let user_account_init_balance = 1000_u64; + let _ = Balances::deposit_creating(&user_account, user_account_init_balance); + let user_free_balance = Balances::free_balance(&user_account); + let balance_to_transfer = 15_u64; + assert!((user_free_balance - balance_to_transfer) >= ExistentialDeposit::get()); + // because, sovereign account needs to have ED otherwise reserve fails + assert!(balance_to_transfer >= ExistentialDeposit::get()); + + let bridged_network = BridgedNetwork::get(); + let target_location = TargetLocation::get(); + + // checks before + assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); + let user_balance_before = Balances::free_balance(&user_account); + assert_eq!(user_balance_before, user_account_init_balance); + let reserve_account = LocationToAccountId::convert_location(&target_location) + .expect("converted target_location as accountId"); + let reserve_account_before = Balances::free_balance(&reserve_account); + assert_eq!(reserve_account_before, 0); + + // trigger transfer_asset_via_bridge - should trigger new ROUTED_MESSAGE + let asset = MultiAsset { + fun: Fungible(balance_to_transfer.into()), + id: Concrete(RelayLocation::get()), + }; + let assets = Box::new(VersionedMultiAssets::from(MultiAssets::from(asset))); + + // destination is account from different consensus + let destination = Box::new(VersionedMultiLocation::from(MultiLocation::new( + 2, + X3( + GlobalConsensus(bridged_network), + Parachain(1000), + consensus_account(bridged_network, 2), + ), + ))); + + // reset events + System::reset_events(); + + // Simulate XcmRouter failure + NOT_APPLICABLE_AS_SOME_OR_FAIL_ROUTER_SWITCH.with(|s| *s.borrow_mut() = None); + + // trigger asset transfer + assert_noop!( + BridgeTransfer::transfer_asset_via_bridge( + RuntimeOrigin::signed(account(1)), + assets, + destination + ), + DispatchError::Module(ModuleError { + index: 52, + error: [6, 0, 0, 0], + message: Some("BridgeCallError") + }) + ); + + // checks after + // balances are untouched + assert_eq!(Balances::free_balance(&user_account), user_balance_before); + assert_eq!(Balances::free_balance(&reserve_account), reserve_account_before); + // no xcm messages fired + assert!(ROUTED_MESSAGE.with(|r| r.borrow().is_none())); + // check events (no events because of rollback) + assert!(System::events().is_empty()); + }); +} diff --git a/parachains/pallets/bridge-transfer/src/types.rs b/parachains/pallets/bridge-transfer/src/types.rs new file mode 100644 index 00000000000..785d3ecf714 --- /dev/null +++ b/parachains/pallets/bridge-transfer/src/types.rs @@ -0,0 +1,38 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use xcm::prelude::*; + +/// Pallet support two kinds of transfer. +#[cfg_attr(feature = "std", derive(Debug, PartialEq))] +pub enum AssetTransferKind { + /// When we need to do a **reserve** on source chain to **reserve account** and then send it as `ReserveAssetDeposited` + ReserveBased, + /// When we need to do a opposite direction, withdraw/burn asset on source chain and send it as `Withdraw/Burn` on target chain from **reserve account**. + WithdrawReserve, + /// If not supported/permitted (e.g. missing configuration of trusted reserve location, ...). + Unsupported, +} + +/// Trait for resolving a transfer type for `asset` to `target_location` +pub trait ResolveAssetTransferKind { + fn resolve(asset: &MultiAsset, target_location: &MultiLocation) -> AssetTransferKind; +} + +impl ResolveAssetTransferKind for () { + fn resolve(_asset: &MultiAsset, _target_location: &MultiLocation) -> AssetTransferKind { + AssetTransferKind::Unsupported + } +} diff --git a/parachains/pallets/bridge-transfer/src/weights.rs b/parachains/pallets/bridge-transfer/src/weights.rs index be1eb001980..f3667a5daa3 100644 --- a/parachains/pallets/bridge-transfer/src/weights.rs +++ b/parachains/pallets/bridge-transfer/src/weights.rs @@ -26,25 +26,6 @@ use sp_std::marker::PhantomData; pub trait WeightInfo { /// Weight of the `transfer_asset_via_bridge` call. fn transfer_asset_via_bridge() -> Weight; - /// Weight of the `ping_via_bridge` call. - fn ping_via_bridge() -> Weight; - - /// Weight of the `add_exporter_config` call. - fn add_exporter_config() -> Weight; - /// Weight of the `remove_exporter_config` call. - fn remove_exporter_config() -> Weight; - /// Weight of the `update_exporter_config` call. - fn update_exporter_config() -> Weight; - - /// Weight of the `add_universal_alias` call. - fn add_universal_alias() -> Weight; - /// Weight of the `remove_universal_alias` call. - fn remove_universal_alias() -> Weight; - - /// Weight of the `add_reserve_location` call. - fn add_reserve_location() -> Weight; - /// Weight of the `remove_reserve_location` call. - fn remove_reserve_location() -> Weight; } // Zero weights to use in tests @@ -52,36 +33,4 @@ impl WeightInfo for () { fn transfer_asset_via_bridge() -> Weight { Weight::zero() } - - fn ping_via_bridge() -> Weight { - Weight::zero() - } - - fn add_exporter_config() -> Weight { - Weight::zero() - } - - fn remove_exporter_config() -> Weight { - Weight::zero() - } - - fn update_exporter_config() -> Weight { - Weight::zero() - } - - fn add_universal_alias() -> Weight { - Weight::zero() - } - - fn remove_universal_alias() -> Weight { - Weight::zero() - } - - fn add_reserve_location() -> Weight { - Weight::zero() - } - - fn remove_reserve_location() -> Weight { - Weight::zero() - } } diff --git a/parachains/runtimes/assets/README.md b/parachains/runtimes/assets/README.md index 7f995d043c4..78145395cbf 100644 --- a/parachains/runtimes/assets/README.md +++ b/parachains/runtimes/assets/README.md @@ -1,9 +1,9 @@ # Assets Parachain -Implementation of _Statemint_, a blockchain to support generic assets in the Polkadot and Kusama -networks. +Implementation of Asset Hub, a blockchain to support generic assets in the Polkadot and Kusama +networks. Asset Hub was formerly known as "Statemint". -Statemint allows users to: +Asset Hub allows users to: - Deploy promise-backed assets, both fungible and non-fungible, with a DOT/KSM deposit. - Set admin roles to manage assets and asset classes. @@ -13,11 +13,11 @@ Statemint allows users to: - Transfer (and approve transfer) assets. - Interact with the chain via its transactional API or XCM. -Statemint must stay fully aligned with the Relay Chain it is connected to. As such, it will accept +Asset Hub must stay fully aligned with the Relay Chain it is connected to. As such, it will accept the Relay Chain's governance origins as its own. See -[the article on Statemint as common good parachain](https://www.parity.io/blog/statemint-generic-assets-chain-proposing-a-common-good-parachain-to-polkadot-governance/) +[the article on Asset Hub as common good parachain](https://www.parity.io/blog/statemint-generic-assets-chain-proposing-a-common-good-parachain-to-polkadot-governance/) for a higher level description. Wallets, custodians, etc. should see diff --git a/parachains/runtimes/assets/statemine/Cargo.toml b/parachains/runtimes/assets/asset-hub-kusama/Cargo.toml similarity index 97% rename from parachains/runtimes/assets/statemine/Cargo.toml rename to parachains/runtimes/assets/asset-hub-kusama/Cargo.toml index fe56ac17f82..b7f63cfc8d7 100644 --- a/parachains/runtimes/assets/statemine/Cargo.toml +++ b/parachains/runtimes/assets/asset-hub-kusama/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "statemine-runtime" -version = "2.0.0" +name = "asset-hub-kusama-runtime" +version = "0.9.420" authors = ["Parity Technologies "] edition = "2021" -description = "Kusama variant of Statemint parachain runtime" +description = "Kusama variant of Asset Hub parachain runtime" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = "0.4.1" } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" @@ -75,6 +75,7 @@ parachain-info = { path = "../../../pallets/parachain-info", default-features = parachains-common = { path = "../../../common", default-features = false } assets-common = { path = "../common", default-features = false } pallet-bridge-transfer = { path = "../../../pallets/bridge-transfer", default-features = false } +pallet-bridge-transfer-primitives = { path = "../../../pallets/bridge-transfer/primitives", default-features = false } [dev-dependencies] asset-test-utils = { path = "../test-utils"} @@ -203,5 +204,6 @@ std = [ "parachains-common/std", "assets-common/std", "pallet-bridge-transfer/std", + "pallet-bridge-transfer-primitives/std", "substrate-wasm-builder", ] diff --git a/parachains/runtimes/assets/statemine/build.rs b/parachains/runtimes/assets/asset-hub-kusama/build.rs similarity index 100% rename from parachains/runtimes/assets/statemine/build.rs rename to parachains/runtimes/assets/asset-hub-kusama/build.rs diff --git a/parachains/runtimes/assets/statemine/src/constants.rs b/parachains/runtimes/assets/asset-hub-kusama/src/constants.rs similarity index 98% rename from parachains/runtimes/assets/statemine/src/constants.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/constants.rs index 95e8c166a96..7822698be6c 100644 --- a/parachains/runtimes/assets/statemine/src/constants.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/constants.rs @@ -73,7 +73,7 @@ pub mod fee { type Balance = Balance; fn polynomial() -> WeightToFeeCoefficients { // 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 + // in Asset Hub, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs similarity index 96% rename from parachains/runtimes/assets/statemine/src/lib.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/lib.rs index 1255b326909..238c2554200 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs @@ -13,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Statemine Runtime +//! # Asset Hub Kusama Runtime //! -//! Statemine is the canary network for its Polkadot cousin, Statemint. +//! Asset Hub Kusama, formerly known as "Statemine", is the canary network for its Polkadot cousin. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] @@ -52,7 +52,10 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, + traits::{ + AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, + InstanceFilter, + }, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -69,7 +72,7 @@ use parachains_common::{ NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - AssetTransactors, BridgeXcmSender, FellowshipLocation, ForeignAssetsConvertedConcreteId, + bridging, AssetTransactors, FellowshipLocation, ForeignAssetsConvertedConcreteId, GovernanceLocation, KsmLocation, LocalOriginToLocation, TrustBackedAssetsConvertedConcreteId, UniversalLocation, XcmConfig, }; @@ -96,6 +99,9 @@ impl_opaque_keys! { #[cfg(feature = "state-trie-version-1")] #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { + // Note: "statemine" is the legacy name for this chain. It has been renamed to + // "asset-hub-kusama". Many wallets/tools depend on the `spec_name`, so it remains "statemine" + // for the time being. Wallets/tools should update to treat "asset-hub-kusama" equally. spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, @@ -109,6 +115,9 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { #[cfg(not(feature = "state-trie-version-1"))] #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { + // Note: "statemine" is the legacy name for this change. It has been renamed to + // "asset-hub-kusama". Many wallets/tools depend on the `spec_name`, so it remains "statemine" + // for the time being. Wallets/tools should update to treat "asset-hub-kusama" equally. spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, @@ -578,6 +587,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -699,15 +709,17 @@ impl pallet_bridge_transfer::Config for Runtime { type RuntimeEvent = RuntimeEvent; type UniversalLocation = UniversalLocation; type WeightInfo = weights::pallet_bridge_transfer::WeightInfo; - type AdminOrigin = AssetsForceOrigin; - type UniversalAliasesLimit = ConstU32<24>; - type ReserveLocationsLimit = ConstU32<8>; type AssetTransactor = AssetTransactors; - type BridgeXcmSender = BridgeXcmSender; - type TransferAssetOrigin = EnsureXcmOrigin; - type MaxAssetsLimit = ConstU8<1>; - type TransferPingOrigin = EnsureXcmOrigin; - type PingMessageBuilder = pallet_bridge_transfer::UnpaidTrapMessageBuilder>; + type AssetTransferKindResolver = + pallet_bridge_transfer::features::ConcreteAssetTransferKindResolver< + bridging::IsTrustedBridgedReserveLocationForConcreteAsset, + pallet_bridge_transfer::features::IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation, + >; + type AssetTransferOrigin = EnsureXcmOrigin; + type AssetsLimit = ConstU8<1>; + type BridgedDestinationValidator = + pallet_bridge_transfer_primitives::BridgesConfigAdapter; + type BridgeXcmSender = bridging::BridgeXcmSender; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = xcm_config::BridgeTransferBenchmarksHelper; } @@ -1134,13 +1146,8 @@ impl_runtime_apis! { } fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> { - match <::BenchmarkHelper as pallet_bridge_transfer::BenchmarkHelper>::universal_alias() { - Some((location, junction)) => { - >::insert_universal_alias_for_benchmarks( - (location.clone().try_into().unwrap(), junction) - ); - Ok((location.clone().try_into().unwrap(), junction)) - }, + match xcm_config::BridgeTransferBenchmarksHelper::prepare_universal_alias() { + Some(alias) => Ok(alias), None => Err(BenchmarkError::Skip) } } @@ -1168,6 +1175,10 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Err(BenchmarkError::Skip) } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/assets/statemine/src/weights/block_weights.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/block_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemine/src/weights/block_weights.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/block_weights.rs diff --git a/parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs similarity index 85% rename from parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs index 01d65b30b4a..ff4816fecc9 100644 --- a/parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=cumulus_pallet_xcmp_queue @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/cumulus_pallet_xcmp_queue.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_514_000 picoseconds. - Weight::from_parts(5_658_000, 0) + // Minimum execution time: 5_530_000 picoseconds. + Weight::from_parts(5_817_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_517_000 picoseconds. - Weight::from_parts(5_773_000, 0) + // Minimum execution time: 5_715_000 picoseconds. + Weight::from_parts(5_893_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/assets/statemine/src/weights/extrinsic_weights.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/extrinsic_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemine/src/weights/extrinsic_weights.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/extrinsic_weights.rs diff --git a/parachains/runtimes/assets/statemine/src/weights/frame_system.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs similarity index 97% rename from parachains/runtimes/assets/statemine/src/weights/frame_system.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs index 89098f48120..09c24b48259 100644 --- a/parachains/runtimes/assets/statemine/src/weights/frame_system.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs @@ -20,13 +20,13 @@ //! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=frame_system @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/frame_system.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/parachains/runtimes/assets/statemine/src/weights/mod.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs similarity index 100% rename from parachains/runtimes/assets/statemine/src/weights/mod.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets.rs similarity index 99% rename from parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets.rs index 29a01e5bb9a..410043bc4fe 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets.rs @@ -20,13 +20,13 @@ //! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_assets @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs similarity index 83% rename from parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs index 3842783d98c..f672b1437f3 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_balances @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 54_579_000 picoseconds. - Weight::from_parts(55_271_000, 0) + // Minimum execution time: 53_267_000 picoseconds. + Weight::from_parts(53_923_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 41_342_000 picoseconds. - Weight::from_parts(41_759_000, 0) + // Minimum execution time: 40_670_000 picoseconds. + Weight::from_parts(41_297_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 16_403_000 picoseconds. - Weight::from_parts(16_651_000, 0) + // Minimum execution time: 15_862_000 picoseconds. + Weight::from_parts(16_038_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 23_225_000 picoseconds. - Weight::from_parts(23_577_000, 0) + // Minimum execution time: 22_408_000 picoseconds. + Weight::from_parts(22_898_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 56_084_000 picoseconds. - Weight::from_parts(56_374_000, 0) + // Minimum execution time: 54_670_000 picoseconds. + Weight::from_parts(55_371_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 50_374_000 picoseconds. - Weight::from_parts(52_040_000, 0) + // Minimum execution time: 49_603_000 picoseconds. + Weight::from_parts(50_053_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 18_975_000 picoseconds. - Weight::from_parts(19_317_000, 0) + // Minimum execution time: 18_439_000 picoseconds. + Weight::from_parts(18_825_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 18_579_000 picoseconds. - Weight::from_parts(18_668_000, 0) + // Minimum execution time: 18_031_000 picoseconds. + Weight::from_parts(18_318_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 9_111 - .saturating_add(Weight::from_parts(14_381_916, 0).saturating_mul(u.into())) + // Standard Error: 10_543 + .saturating_add(Weight::from_parts(14_123_878, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) diff --git a/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_bridge_transfer.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_bridge_transfer.rs new file mode 100644 index 00000000000..47938fd1066 --- /dev/null +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_bridge_transfer.rs @@ -0,0 +1,82 @@ +// Copyright 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_bridge_transfer` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 + +// Executed Command: +// target/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --pallet=pallet_bridge_transfer +// --chain=asset-hub-kusama-dev +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_bridge_transfer`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_transfer::WeightInfo for WeightInfo { + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: unknown `0x1fd0e9ea288ed87ef4c94f1a9a004f86` (r:1 w:0) + /// Proof Skipped: unknown `0x1fd0e9ea288ed87ef4c94f1a9a004f86` (r:1 w:0) + /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) + /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) + fn transfer_asset_via_bridge() -> Weight { + // Proof Size summary in bytes: + // Measured: `595` + // Estimated: `6196` + // Minimum execution time: 155_490_000 picoseconds. + Weight::from_parts(158_516_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs similarity index 88% rename from parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs index 37c59255469..bac78a8d37b 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_collator_selection @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_collator_selection.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `178 + b * (78 ±0)` // Estimated: `1168 + b * (2554 ±0)` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(14_942_281, 0) + // Minimum execution time: 15_198_000 picoseconds. + Weight::from_parts(15_308_042, 0) .saturating_add(Weight::from_parts(0, 1168)) - // Standard Error: 3_013 - .saturating_add(Weight::from_parts(2_673_944, 0).saturating_mul(b.into())) + // Standard Error: 2_782 + .saturating_add(Weight::from_parts(2_609_742, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_341_000 picoseconds. - Weight::from_parts(7_608_000, 0) + // Minimum execution time: 7_476_000 picoseconds. + Weight::from_parts(7_689_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_710_000 picoseconds. - Weight::from_parts(7_973_000, 0) + // Minimum execution time: 7_652_000 picoseconds. + Weight::from_parts(7_912_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1108 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 42_547_000 picoseconds. - Weight::from_parts(35_070_051, 0) + // Minimum execution time: 42_454_000 picoseconds. + Weight::from_parts(34_943_337, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_231 - .saturating_add(Weight::from_parts(105_769, 0).saturating_mul(c.into())) + // Standard Error: 1_259 + .saturating_add(Weight::from_parts(105_204, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `452 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 33_828_000 picoseconds. - Weight::from_parts(23_360_256, 0) + // Minimum execution time: 34_323_000 picoseconds. + Weight::from_parts(23_416_986, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_294 - .saturating_add(Weight::from_parts(106_027, 0).saturating_mul(c.into())) + // Standard Error: 1_277 + .saturating_add(Weight::from_parts(105_960, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 43_367_000 picoseconds. - Weight::from_parts(44_039_000, 0) + // Minimum execution time: 44_234_000 picoseconds. + Weight::from_parts(44_843_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22721 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2602 ±0)` - // Minimum execution time: 17_277_000 picoseconds. - Weight::from_parts(17_657_000, 0) + // Minimum execution time: 17_678_000 picoseconds. + Weight::from_parts(17_900_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 855_404 - .saturating_add(Weight::from_parts(30_433_186, 0).saturating_mul(c.into())) + // Standard Error: 854_072 + .saturating_add(Weight::from_parts(30_351_497, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs similarity index 75% rename from parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs index 3f708111d83..efb4cfdec19 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_multisig @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_multisig.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_556_000 picoseconds. - Weight::from_parts(11_977_075, 0) + // Minimum execution time: 11_543_000 picoseconds. + Weight::from_parts(12_043_787, 0) .saturating_add(Weight::from_parts(0, 0)) // Standard Error: 1 - .saturating_add(Weight::from_parts(493, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(540, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `262 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 41_285_000 picoseconds. - Weight::from_parts(35_323_592, 0) + // Minimum execution time: 42_087_000 picoseconds. + Weight::from_parts(36_466_676, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 454 - .saturating_add(Weight::from_parts(64_841, 0).saturating_mul(s.into())) - // Standard Error: 4 - .saturating_add(Weight::from_parts(1_195, 0).saturating_mul(z.into())) + // Standard Error: 401 + .saturating_add(Weight::from_parts(62_580, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_242, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 27_217_000 picoseconds. - Weight::from_parts(21_829_864, 0) + // Minimum execution time: 27_854_000 picoseconds. + Weight::from_parts(22_619_700, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 473 - .saturating_add(Weight::from_parts(59_818, 0).saturating_mul(s.into())) - // Standard Error: 4 - .saturating_add(Weight::from_parts(1_179, 0).saturating_mul(z.into())) + // Standard Error: 298 + .saturating_add(Weight::from_parts(58_268, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_230, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `385 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 46_235_000 picoseconds. - Weight::from_parts(38_643_321, 0) + // Minimum execution time: 47_373_000 picoseconds. + Weight::from_parts(40_149_301, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 484 - .saturating_add(Weight::from_parts(82_619, 0).saturating_mul(s.into())) + // Standard Error: 495 + .saturating_add(Weight::from_parts(80_531, 0).saturating_mul(s.into())) // Standard Error: 4 - .saturating_add(Weight::from_parts(1_223, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_268, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 31_827_000 picoseconds. - Weight::from_parts(33_743_065, 0) + // Minimum execution time: 32_765_000 picoseconds. + Weight::from_parts(34_501_173, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 669 - .saturating_add(Weight::from_parts(68_793, 0).saturating_mul(s.into())) + // Standard Error: 565 + .saturating_add(Weight::from_parts(68_661, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 19_148_000 picoseconds. - Weight::from_parts(20_211_716, 0) + // Minimum execution time: 19_404_000 picoseconds. + Weight::from_parts(20_727_462, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 376 - .saturating_add(Weight::from_parts(62_199, 0).saturating_mul(s.into())) + // Standard Error: 664 + .saturating_add(Weight::from_parts(60_980, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 32_770_000 picoseconds. - Weight::from_parts(34_731_111, 0) + // Minimum execution time: 33_353_000 picoseconds. + Weight::from_parts(35_328_237, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 761 - .saturating_add(Weight::from_parts(70_575, 0).saturating_mul(s.into())) + // Standard Error: 598 + .saturating_add(Weight::from_parts(66_829, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_nfts.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs similarity index 87% rename from parachains/runtimes/assets/westmint/src/weights/pallet_nfts.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs index 437bbd74b77..7f5ad055e97 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_nfts.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_nfts` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_nfts @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_nfts.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -62,8 +62,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3549` - // Minimum execution time: 38_536_000 picoseconds. - Weight::from_parts(39_046_000, 0) + // Minimum execution time: 38_401_000 picoseconds. + Weight::from_parts(38_949_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(5)) @@ -82,8 +82,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3549` - // Minimum execution time: 22_776_000 picoseconds. - Weight::from_parts(23_177_000, 0) + // Minimum execution time: 22_838_000 picoseconds. + Weight::from_parts(23_250_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(5)) @@ -107,15 +107,17 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `m` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy(_m: u32, _c: u32, a: u32, ) -> Weight { + fn destroy(m: u32, _c: u32, a: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `32170 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 989_671_000 picoseconds. - Weight::from_parts(935_494_331, 0) + // Minimum execution time: 992_022_000 picoseconds. + Weight::from_parts(935_139_491, 0) .saturating_add(Weight::from_parts(0, 2523990)) - // Standard Error: 3_986 - .saturating_add(Weight::from_parts(5_721_724, 0).saturating_mul(a.into())) + // Standard Error: 3_802 + .saturating_add(Weight::from_parts(1_298, 0).saturating_mul(m.into())) + // Standard Error: 3_802 + .saturating_add(Weight::from_parts(5_705_762, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1004)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1005)) @@ -138,8 +140,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `421` // Estimated: `4326` - // Minimum execution time: 48_990_000 picoseconds. - Weight::from_parts(49_439_000, 0) + // Minimum execution time: 48_174_000 picoseconds. + Weight::from_parts(48_672_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -160,8 +162,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `421` // Estimated: `4326` - // Minimum execution time: 48_068_000 picoseconds. - Weight::from_parts(48_446_000, 0) + // Minimum execution time: 47_306_000 picoseconds. + Weight::from_parts(47_667_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -186,14 +188,16 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `530` // Estimated: `4326` - // Minimum execution time: 48_943_000 picoseconds. - Weight::from_parts(49_568_000, 0) + // Minimum execution time: 48_476_000 picoseconds. + Weight::from_parts(49_047_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:1 w:0) @@ -210,10 +214,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `4326` - // Minimum execution time: 35_764_000 picoseconds. - Weight::from_parts(36_232_000, 0) + // Minimum execution time: 39_965_000 picoseconds. + Weight::from_parts(40_246_000, 0) .saturating_add(Weight::from_parts(0, 4326)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: Nfts Collection (r:1 w:0) @@ -227,11 +231,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `729 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 17_108_000 picoseconds. - Weight::from_parts(17_220_000, 0) + // Minimum execution time: 16_761_000 picoseconds. + Weight::from_parts(16_963_000, 0) .saturating_add(Weight::from_parts(0, 3549)) - // Standard Error: 14_557 - .saturating_add(Weight::from_parts(15_545_711, 0).saturating_mul(i.into())) + // Standard Error: 12_873 + .saturating_add(Weight::from_parts(15_337_079, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -245,8 +249,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `401` // Estimated: `3534` - // Minimum execution time: 20_958_000 picoseconds. - Weight::from_parts(21_129_000, 0) + // Minimum execution time: 20_221_000 picoseconds. + Weight::from_parts(20_418_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -259,8 +263,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `401` // Estimated: `3534` - // Minimum execution time: 20_864_000 picoseconds. - Weight::from_parts(21_016_000, 0) + // Minimum execution time: 20_112_000 picoseconds. + Weight::from_parts(20_387_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -273,8 +277,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3549` - // Minimum execution time: 17_934_000 picoseconds. - Weight::from_parts(18_152_000, 0) + // Minimum execution time: 17_323_000 picoseconds. + Weight::from_parts(17_523_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -289,8 +293,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `354` // Estimated: `3549` - // Minimum execution time: 23_477_000 picoseconds. - Weight::from_parts(23_830_000, 0) + // Minimum execution time: 23_135_000 picoseconds. + Weight::from_parts(23_379_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -303,8 +307,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `335` // Estimated: `6078` - // Minimum execution time: 40_775_000 picoseconds. - Weight::from_parts(41_159_000, 0) + // Minimum execution time: 40_209_000 picoseconds. + Weight::from_parts(40_875_000, 0) .saturating_add(Weight::from_parts(0, 6078)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(5)) @@ -317,8 +321,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3549` - // Minimum execution time: 18_569_000 picoseconds. - Weight::from_parts(18_844_000, 0) + // Minimum execution time: 18_103_000 picoseconds. + Weight::from_parts(18_330_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) @@ -331,8 +335,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `3549` - // Minimum execution time: 15_395_000 picoseconds. - Weight::from_parts(15_554_000, 0) + // Minimum execution time: 14_743_000 picoseconds. + Weight::from_parts(15_077_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -345,8 +349,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `401` // Estimated: `3534` - // Minimum execution time: 20_497_000 picoseconds. - Weight::from_parts(20_872_000, 0) + // Minimum execution time: 19_944_000 picoseconds. + Weight::from_parts(20_130_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -365,8 +369,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3944` - // Minimum execution time: 49_930_000 picoseconds. - Weight::from_parts(50_200_000, 0) + // Minimum execution time: 49_415_000 picoseconds. + Weight::from_parts(49_913_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -379,8 +383,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `310` // Estimated: `3944` - // Minimum execution time: 27_930_000 picoseconds. - Weight::from_parts(28_319_000, 0) + // Minimum execution time: 27_070_000 picoseconds. + Weight::from_parts(27_276_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -397,8 +401,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `949` // Estimated: `3944` - // Minimum execution time: 47_306_000 picoseconds. - Weight::from_parts(47_676_000, 0) + // Minimum execution time: 46_046_000 picoseconds. + Weight::from_parts(46_617_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -411,8 +415,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `4466` - // Minimum execution time: 18_749_000 picoseconds. - Weight::from_parts(19_080_000, 0) + // Minimum execution time: 18_270_000 picoseconds. + Weight::from_parts(18_542_000, 0) .saturating_add(Weight::from_parts(0, 4466)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -430,11 +434,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `726 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 28_200_000 picoseconds. - Weight::from_parts(28_552_000, 0) + // Minimum execution time: 27_394_000 picoseconds. + Weight::from_parts(27_660_000, 0) .saturating_add(Weight::from_parts(0, 4466)) - // Standard Error: 3_352 - .saturating_add(Weight::from_parts(5_584_045, 0).saturating_mul(n.into())) + // Standard Error: 3_479 + .saturating_add(Weight::from_parts(5_570_896, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -455,8 +459,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3812` - // Minimum execution time: 41_646_000 picoseconds. - Weight::from_parts(42_171_000, 0) + // Minimum execution time: 41_123_000 picoseconds. + Weight::from_parts(41_552_000, 0) .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -473,8 +477,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `815` // Estimated: `3812` - // Minimum execution time: 40_022_000 picoseconds. - Weight::from_parts(40_363_000, 0) + // Minimum execution time: 39_264_000 picoseconds. + Weight::from_parts(39_797_000, 0) .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -491,8 +495,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `364` // Estimated: `3759` - // Minimum execution time: 38_872_000 picoseconds. - Weight::from_parts(39_223_000, 0) + // Minimum execution time: 38_634_000 picoseconds. + Weight::from_parts(38_879_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -509,8 +513,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `682` // Estimated: `3759` - // Minimum execution time: 37_582_000 picoseconds. - Weight::from_parts(38_305_000, 0) + // Minimum execution time: 36_965_000 picoseconds. + Weight::from_parts(37_356_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -523,8 +527,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `376` // Estimated: `4326` - // Minimum execution time: 22_551_000 picoseconds. - Weight::from_parts(22_984_000, 0) + // Minimum execution time: 22_208_000 picoseconds. + Weight::from_parts(22_428_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -535,8 +539,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4326` - // Minimum execution time: 19_879_000 picoseconds. - Weight::from_parts(20_310_000, 0) + // Minimum execution time: 19_387_000 picoseconds. + Weight::from_parts(19_737_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -547,8 +551,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4326` - // Minimum execution time: 18_958_000 picoseconds. - Weight::from_parts(19_247_000, 0) + // Minimum execution time: 18_424_000 picoseconds. + Weight::from_parts(18_646_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -559,8 +563,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3517` - // Minimum execution time: 16_432_000 picoseconds. - Weight::from_parts(16_762_000, 0) + // Minimum execution time: 16_112_000 picoseconds. + Weight::from_parts(16_427_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -573,8 +577,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3549` - // Minimum execution time: 19_950_000 picoseconds. - Weight::from_parts(20_169_000, 0) + // Minimum execution time: 19_491_000 picoseconds. + Weight::from_parts(19_788_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -587,8 +591,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `289` // Estimated: `3538` - // Minimum execution time: 19_727_000 picoseconds. - Weight::from_parts(19_977_000, 0) + // Minimum execution time: 19_531_000 picoseconds. + Weight::from_parts(20_119_000, 0) .saturating_add(Weight::from_parts(0, 3538)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -605,8 +609,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `484` // Estimated: `4326` - // Minimum execution time: 24_200_000 picoseconds. - Weight::from_parts(24_433_000, 0) + // Minimum execution time: 23_920_000 picoseconds. + Weight::from_parts(24_183_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -617,6 +621,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemPriceOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:1 w:0) @@ -629,10 +635,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `671` // Estimated: `4326` - // Minimum execution time: 44_868_000 picoseconds. - Weight::from_parts(45_386_000, 0) + // Minimum execution time: 49_289_000 picoseconds. + Weight::from_parts(49_656_000, 0) .saturating_add(Weight::from_parts(0, 4326)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } /// The range of component `n` is `[0, 10]`. @@ -640,11 +646,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_573_000 picoseconds. - Weight::from_parts(4_309_077, 0) + // Minimum execution time: 2_443_000 picoseconds. + Weight::from_parts(4_101_841, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9_731 - .saturating_add(Weight::from_parts(3_668_159, 0).saturating_mul(n.into())) + // Standard Error: 9_462 + .saturating_add(Weight::from_parts(3_606_826, 0).saturating_mul(n.into())) } /// Storage: Nfts Item (r:2 w:0) /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) @@ -654,8 +660,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `460` // Estimated: `7662` - // Minimum execution time: 22_763_000 picoseconds. - Weight::from_parts(22_911_000, 0) + // Minimum execution time: 22_008_000 picoseconds. + Weight::from_parts(22_762_000, 0) .saturating_add(Weight::from_parts(0, 7662)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -668,8 +674,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `479` // Estimated: `4326` - // Minimum execution time: 21_393_000 picoseconds. - Weight::from_parts(21_656_000, 0) + // Minimum execution time: 20_800_000 picoseconds. + Weight::from_parts(21_008_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -680,6 +686,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:2 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:2 w:0) @@ -692,10 +700,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `800` // Estimated: `7662` - // Minimum execution time: 73_894_000 picoseconds. - Weight::from_parts(75_692_000, 0) + // Minimum execution time: 81_599_000 picoseconds. + Weight::from_parts(82_041_000, 0) .saturating_add(Weight::from_parts(0, 7662)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(10)) } /// Storage: Nfts CollectionRoleOf (r:2 w:0) @@ -721,11 +729,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `524` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 132_196_000 picoseconds. - Weight::from_parts(136_454_873, 0) + // Minimum execution time: 131_568_000 picoseconds. + Weight::from_parts(135_826_981, 0) .saturating_add(Weight::from_parts(0, 6078)) - // Standard Error: 18_901 - .saturating_add(Weight::from_parts(29_375_812, 0).saturating_mul(n.into())) + // Standard Error: 27_151 + .saturating_add(Weight::from_parts(29_423_870, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -749,11 +757,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `554` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 76_734_000 picoseconds. - Weight::from_parts(87_761_745, 0) + // Minimum execution time: 76_302_000 picoseconds. + Weight::from_parts(87_313_888, 0) .saturating_add(Weight::from_parts(0, 4466)) - // Standard Error: 59_520 - .saturating_add(Weight::from_parts(28_979_367, 0).saturating_mul(n.into())) + // Standard Error: 64_504 + .saturating_add(Weight::from_parts(29_044_884, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs similarity index 75% rename from parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs index 042af1203f5..9450b7f8ec6 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_proxy @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_proxy.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,11 +55,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 17_994_000 picoseconds. - Weight::from_parts(18_404_764, 0) + // Minimum execution time: 16_974_000 picoseconds. + Weight::from_parts(17_350_391, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 931 - .saturating_add(Weight::from_parts(29_489, 0).saturating_mul(p.into())) + // Standard Error: 577 + .saturating_add(Weight::from_parts(33_979, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: Proxy Proxies (r:1 w:0) @@ -74,13 +74,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 39_788_000 picoseconds. - Weight::from_parts(39_231_218, 0) + // Minimum execution time: 38_886_000 picoseconds. + Weight::from_parts(38_531_657, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_373 - .saturating_add(Weight::from_parts(144_577, 0).saturating_mul(a.into())) - // Standard Error: 1_418 - .saturating_add(Weight::from_parts(39_464, 0).saturating_mul(p.into())) + // Standard Error: 1_206 + .saturating_add(Weight::from_parts(134_756, 0).saturating_mul(a.into())) + // Standard Error: 1_246 + .saturating_add(Weight::from_parts(36_911, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -94,13 +94,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_778_000 picoseconds. - Weight::from_parts(26_117_943, 0) + // Minimum execution time: 25_243_000 picoseconds. + Weight::from_parts(25_821_401, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_161 - .saturating_add(Weight::from_parts(143_478, 0).saturating_mul(a.into())) - // Standard Error: 1_200 - .saturating_add(Weight::from_parts(8_492, 0).saturating_mul(p.into())) + // Standard Error: 1_156 + .saturating_add(Weight::from_parts(136_892, 0).saturating_mul(a.into())) + // Standard Error: 1_194 + .saturating_add(Weight::from_parts(9_176, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -114,13 +114,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_448_000 picoseconds. - Weight::from_parts(26_025_080, 0) + // Minimum execution time: 25_392_000 picoseconds. + Weight::from_parts(25_832_947, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_079 - .saturating_add(Weight::from_parts(146_383, 0).saturating_mul(a.into())) - // Standard Error: 1_115 - .saturating_add(Weight::from_parts(7_614, 0).saturating_mul(p.into())) + // Standard Error: 1_067 + .saturating_add(Weight::from_parts(135_109, 0).saturating_mul(a.into())) + // Standard Error: 1_102 + .saturating_add(Weight::from_parts(9_827, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -136,13 +136,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `386 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 35_200_000 picoseconds. - Weight::from_parts(34_858_670, 0) + // Minimum execution time: 35_063_000 picoseconds. + Weight::from_parts(34_933_848, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_692 - .saturating_add(Weight::from_parts(148_578, 0).saturating_mul(a.into())) - // Standard Error: 1_748 - .saturating_add(Weight::from_parts(38_530, 0).saturating_mul(p.into())) + // Standard Error: 1_466 + .saturating_add(Weight::from_parts(124_918, 0).saturating_mul(a.into())) + // Standard Error: 1_515 + .saturating_add(Weight::from_parts(19_204, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -153,11 +153,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 26_373_000 picoseconds. - Weight::from_parts(27_005_379, 0) + // Minimum execution time: 26_060_000 picoseconds. + Weight::from_parts(26_691_889, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 844 - .saturating_add(Weight::from_parts(58_125, 0).saturating_mul(p.into())) + // Standard Error: 951 + .saturating_add(Weight::from_parts(46_019, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -168,11 +168,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 26_455_000 picoseconds. - Weight::from_parts(27_435_800, 0) + // Minimum execution time: 26_241_000 picoseconds. + Weight::from_parts(27_136_775, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_489 - .saturating_add(Weight::from_parts(57_697, 0).saturating_mul(p.into())) + // Standard Error: 1_599 + .saturating_add(Weight::from_parts(56_033, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -183,11 +183,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 23_169_000 picoseconds. - Weight::from_parts(23_866_116, 0) + // Minimum execution time: 23_267_000 picoseconds. + Weight::from_parts(23_905_193, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 788 - .saturating_add(Weight::from_parts(25_795, 0).saturating_mul(p.into())) + // Standard Error: 917 + .saturating_add(Weight::from_parts(28_252, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -198,11 +198,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4706` - // Minimum execution time: 28_172_000 picoseconds. - Weight::from_parts(28_972_303, 0) + // Minimum execution time: 28_251_000 picoseconds. + Weight::from_parts(28_790_795, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 934 - .saturating_add(Weight::from_parts(10_208, 0).saturating_mul(p.into())) + // Standard Error: 852 + .saturating_add(Weight::from_parts(11_696, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -213,11 +213,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 24_193_000 picoseconds. - Weight::from_parts(25_184_514, 0) + // Minimum execution time: 24_236_000 picoseconds. + Weight::from_parts(24_726_740, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 3_667 - .saturating_add(Weight::from_parts(17_503, 0).saturating_mul(p.into())) + // Standard Error: 830 + .saturating_add(Weight::from_parts(36_700, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_session.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs similarity index 86% rename from parachains/runtimes/assets/statemint/src/weights/pallet_session.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs index 5a44e8e80bf..6ed5515e821 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_session.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_session @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_session.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `270` // Estimated: `3735` - // Minimum execution time: 17_271_000 picoseconds. - Weight::from_parts(17_533_000, 0) + // Minimum execution time: 17_361_000 picoseconds. + Weight::from_parts(17_619_000, 0) .saturating_add(Weight::from_parts(0, 3735)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `3707` - // Minimum execution time: 13_077_000 picoseconds. - Weight::from_parts(13_283_000, 0) + // Minimum execution time: 12_920_000 picoseconds. + Weight::from_parts(13_209_000, 0) .saturating_add(Weight::from_parts(0, 3707)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs similarity index 85% rename from parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs index 8ddde440fdf..eb249fae49e 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_timestamp @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_timestamp.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `86` // Estimated: `1493` - // Minimum execution time: 9_168_000 picoseconds. - Weight::from_parts(9_563_000, 0) + // Minimum execution time: 8_949_000 picoseconds. + Weight::from_parts(9_418_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 3_146_000 picoseconds. - Weight::from_parts(3_238_000, 0) + // Minimum execution time: 3_174_000 picoseconds. + Weight::from_parts(3_321_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs similarity index 86% rename from parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs index d04f1800399..f5cd293d187 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_uniques` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_uniques @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_uniques.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3643` - // Minimum execution time: 29_873_000 picoseconds. - Weight::from_parts(30_382_000, 0) + // Minimum execution time: 30_329_000 picoseconds. + Weight::from_parts(30_796_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3643` - // Minimum execution time: 14_338_000 picoseconds. - Weight::from_parts(14_710_000, 0) + // Minimum execution time: 14_523_000 picoseconds. + Weight::from_parts(14_862_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -99,15 +99,15 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `257 + a * (107 ±0) + m * (56 ±0) + n * (76 ±0)` // Estimated: `3643 + a * (2647 ±0) + m * (2662 ±0) + n * (2597 ±0)` - // Minimum execution time: 2_398_014_000 picoseconds. - Weight::from_parts(2_410_569_000, 0) + // Minimum execution time: 2_406_160_000 picoseconds. + Weight::from_parts(2_421_810_000, 0) .saturating_add(Weight::from_parts(0, 3643)) - // Standard Error: 24_769 - .saturating_add(Weight::from_parts(6_309_077, 0).saturating_mul(n.into())) - // Standard Error: 24_769 - .saturating_add(Weight::from_parts(257_995, 0).saturating_mul(m.into())) - // Standard Error: 24_769 - .saturating_add(Weight::from_parts(317_885, 0).saturating_mul(a.into())) + // Standard Error: 24_583 + .saturating_add(Weight::from_parts(6_208_225, 0).saturating_mul(n.into())) + // Standard Error: 24_583 + .saturating_add(Weight::from_parts(252_636, 0).saturating_mul(m.into())) + // Standard Error: 24_583 + .saturating_add(Weight::from_parts(322_596, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into()))) @@ -132,8 +132,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 36_084_000 picoseconds. - Weight::from_parts(36_377_000, 0) + // Minimum execution time: 36_433_000 picoseconds. + Weight::from_parts(36_859_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -150,8 +150,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 37_397_000 picoseconds. - Weight::from_parts(37_763_000, 0) + // Minimum execution time: 37_183_000 picoseconds. + Weight::from_parts(37_824_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -168,8 +168,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 27_423_000 picoseconds. - Weight::from_parts(27_666_000, 0) + // Minimum execution time: 26_985_000 picoseconds. + Weight::from_parts(27_384_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -183,11 +183,11 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `738 + i * (76 ±0)` // Estimated: `3643 + i * (2597 ±0)` - // Minimum execution time: 15_215_000 picoseconds. - Weight::from_parts(15_450_000, 0) + // Minimum execution time: 15_305_000 picoseconds. + Weight::from_parts(15_491_000, 0) .saturating_add(Weight::from_parts(0, 3643)) - // Standard Error: 12_841 - .saturating_add(Weight::from_parts(15_164_179, 0).saturating_mul(i.into())) + // Standard Error: 13_415 + .saturating_add(Weight::from_parts(15_181_685, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -202,8 +202,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 19_169_000 picoseconds. - Weight::from_parts(19_541_000, 0) + // Minimum execution time: 19_080_000 picoseconds. + Weight::from_parts(19_374_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -216,8 +216,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 18_941_000 picoseconds. - Weight::from_parts(19_336_000, 0) + // Minimum execution time: 19_100_000 picoseconds. + Weight::from_parts(19_779_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -228,8 +228,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 14_356_000 picoseconds. - Weight::from_parts(14_650_000, 0) + // Minimum execution time: 14_270_000 picoseconds. + Weight::from_parts(14_699_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -240,8 +240,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 14_303_000 picoseconds. - Weight::from_parts(14_504_000, 0) + // Minimum execution time: 14_372_000 picoseconds. + Weight::from_parts(14_646_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -256,8 +256,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `356` // Estimated: `3643` - // Minimum execution time: 22_663_000 picoseconds. - Weight::from_parts(23_053_000, 0) + // Minimum execution time: 22_401_000 picoseconds. + Weight::from_parts(22_747_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -268,8 +268,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 15_198_000 picoseconds. - Weight::from_parts(15_645_000, 0) + // Minimum execution time: 15_142_000 picoseconds. + Weight::from_parts(15_558_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -282,8 +282,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 17_381_000 picoseconds. - Weight::from_parts(17_588_000, 0) + // Minimum execution time: 17_162_000 picoseconds. + Weight::from_parts(17_630_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -298,8 +298,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `3652` - // Minimum execution time: 39_838_000 picoseconds. - Weight::from_parts(40_387_000, 0) + // Minimum execution time: 40_224_000 picoseconds. + Weight::from_parts(40_672_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -314,8 +314,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `756` // Estimated: `3652` - // Minimum execution time: 38_600_000 picoseconds. - Weight::from_parts(39_215_000, 0) + // Minimum execution time: 38_779_000 picoseconds. + Weight::from_parts(39_275_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -328,8 +328,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3652` - // Minimum execution time: 31_563_000 picoseconds. - Weight::from_parts(32_111_000, 0) + // Minimum execution time: 31_297_000 picoseconds. + Weight::from_parts(31_846_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -342,8 +342,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `3652` - // Minimum execution time: 31_525_000 picoseconds. - Weight::from_parts(31_904_000, 0) + // Minimum execution time: 31_600_000 picoseconds. + Weight::from_parts(32_762_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -356,8 +356,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 32_104_000 picoseconds. - Weight::from_parts(32_429_000, 0) + // Minimum execution time: 32_530_000 picoseconds. + Weight::from_parts(32_709_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -370,8 +370,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3643` - // Minimum execution time: 30_433_000 picoseconds. - Weight::from_parts(30_662_000, 0) + // Minimum execution time: 30_229_000 picoseconds. + Weight::from_parts(30_630_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -384,8 +384,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 20_463_000 picoseconds. - Weight::from_parts(20_879_000, 0) + // Minimum execution time: 20_391_000 picoseconds. + Weight::from_parts(20_699_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -398,8 +398,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `461` // Estimated: `3643` - // Minimum execution time: 20_158_000 picoseconds. - Weight::from_parts(20_465_000, 0) + // Minimum execution time: 20_292_000 picoseconds. + Weight::from_parts(20_612_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -410,8 +410,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3517` - // Minimum execution time: 16_009_000 picoseconds. - Weight::from_parts(16_396_000, 0) + // Minimum execution time: 16_174_000 picoseconds. + Weight::from_parts(16_545_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -424,8 +424,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 17_034_000 picoseconds. - Weight::from_parts(17_286_000, 0) + // Minimum execution time: 16_955_000 picoseconds. + Weight::from_parts(17_337_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -438,8 +438,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `259` // Estimated: `3587` - // Minimum execution time: 17_020_000 picoseconds. - Weight::from_parts(17_318_000, 0) + // Minimum execution time: 16_901_000 picoseconds. + Weight::from_parts(17_127_000, 0) .saturating_add(Weight::from_parts(0, 3587)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -456,8 +456,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `540` // Estimated: `3643` - // Minimum execution time: 37_771_000 picoseconds. - Weight::from_parts(38_708_000, 0) + // Minimum execution time: 37_629_000 picoseconds. + Weight::from_parts(38_136_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs similarity index 73% rename from parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs index 4dce4a9b391..36d85b1e1fd 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_utility @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_utility.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_065_000 picoseconds. - Weight::from_parts(7_907_851, 0) + // Minimum execution time: 6_865_000 picoseconds. + Weight::from_parts(10_920_777, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_515 - .saturating_add(Weight::from_parts(5_447_457, 0).saturating_mul(c.into())) + // Standard Error: 3_032 + .saturating_add(Weight::from_parts(5_314_717, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_845_000 picoseconds. - Weight::from_parts(6_053_000, 0) + // Minimum execution time: 5_642_000 picoseconds. + Weight::from_parts(5_867_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_094_000 picoseconds. - Weight::from_parts(1_459_029, 0) + // Minimum execution time: 6_829_000 picoseconds. + Weight::from_parts(9_153_009, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 4_016 - .saturating_add(Weight::from_parts(5_680_469, 0).saturating_mul(c.into())) + // Standard Error: 2_706 + .saturating_add(Weight::from_parts(5_583_934, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_972_000 picoseconds. - Weight::from_parts(10_167_000, 0) + // Minimum execution time: 9_503_000 picoseconds. + Weight::from_parts(9_779_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_148_000 picoseconds. - Weight::from_parts(6_914_554, 0) + // Minimum execution time: 6_781_000 picoseconds. + Weight::from_parts(9_714_832, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_605 - .saturating_add(Weight::from_parts(5_440_589, 0).saturating_mul(c.into())) + // Standard Error: 3_243 + .saturating_add(Weight::from_parts(5_320_789, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs similarity index 88% rename from parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs index 36672a02cd7..454b266f0c8 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_xcm @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -62,8 +62,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 29_342_000 picoseconds. - Weight::from_parts(29_952_000, 0) + // Minimum execution time: 28_412_000 picoseconds. + Weight::from_parts(28_911_000, 0) .saturating_add(Weight::from_parts(0, 3540)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1489` - // Minimum execution time: 28_744_000 picoseconds. - Weight::from_parts(29_193_000, 0) + // Minimum execution time: 24_889_000 picoseconds. + Weight::from_parts(25_368_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -85,8 +85,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1489` - // Minimum execution time: 21_757_000 picoseconds. - Weight::from_parts(22_088_000, 0) + // Minimum execution time: 19_085_000 picoseconds. + Weight::from_parts(19_812_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -106,8 +106,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_671_000 picoseconds. - Weight::from_parts(10_948_000, 0) + // Minimum execution time: 10_178_000 picoseconds. + Weight::from_parts(10_613_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -117,8 +117,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_132_000 picoseconds. - Weight::from_parts(3_374_000, 0) + // Minimum execution time: 3_328_000 picoseconds. + Weight::from_parts(3_498_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -142,8 +142,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 33_780_000 picoseconds. - Weight::from_parts(34_531_000, 0) + // Minimum execution time: 33_091_000 picoseconds. + Weight::from_parts(33_685_000, 0) .saturating_add(Weight::from_parts(0, 3540)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -166,8 +166,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `257` // Estimated: `3722` - // Minimum execution time: 35_215_000 picoseconds. - Weight::from_parts(35_685_000, 0) + // Minimum execution time: 35_012_000 picoseconds. + Weight::from_parts(35_720_000, 0) .saturating_add(Weight::from_parts(0, 3722)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -178,8 +178,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_252_000 picoseconds. - Weight::from_parts(3_392_000, 0) + // Minimum execution time: 3_359_000 picoseconds. + Weight::from_parts(3_490_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -189,8 +189,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `129` // Estimated: `11019` - // Minimum execution time: 17_330_000 picoseconds. - Weight::from_parts(17_730_000, 0) + // Minimum execution time: 17_077_000 picoseconds. + Weight::from_parts(17_773_000, 0) .saturating_add(Weight::from_parts(0, 11019)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -201,8 +201,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `133` // Estimated: `11023` - // Minimum execution time: 17_129_000 picoseconds. - Weight::from_parts(17_665_000, 0) + // Minimum execution time: 17_504_000 picoseconds. + Weight::from_parts(17_825_000, 0) .saturating_add(Weight::from_parts(0, 11023)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -213,8 +213,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `13505` - // Minimum execution time: 18_220_000 picoseconds. - Weight::from_parts(18_764_000, 0) + // Minimum execution time: 17_921_000 picoseconds. + Weight::from_parts(18_470_000, 0) .saturating_add(Weight::from_parts(0, 13505)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -234,8 +234,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `142` // Estimated: `6082` - // Minimum execution time: 31_356_000 picoseconds. - Weight::from_parts(31_850_000, 0) + // Minimum execution time: 31_192_000 picoseconds. + Weight::from_parts(31_681_000, 0) .saturating_add(Weight::from_parts(0, 6082)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -246,8 +246,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `172` // Estimated: `8587` - // Minimum execution time: 9_299_000 picoseconds. - Weight::from_parts(9_515_000, 0) + // Minimum execution time: 9_176_000 picoseconds. + Weight::from_parts(9_507_000, 0) .saturating_add(Weight::from_parts(0, 8587)) .saturating_add(T::DbWeight::get().reads(3)) } @@ -257,8 +257,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `11030` - // Minimum execution time: 17_472_000 picoseconds. - Weight::from_parts(18_170_000, 0) + // Minimum execution time: 17_655_000 picoseconds. + Weight::from_parts(18_061_000, 0) .saturating_add(Weight::from_parts(0, 11030)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -279,8 +279,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `146` // Estimated: `11036` - // Minimum execution time: 39_134_000 picoseconds. - Weight::from_parts(39_847_000, 0) + // Minimum execution time: 38_001_000 picoseconds. + Weight::from_parts(38_395_000, 0) .saturating_add(Weight::from_parts(0, 11036)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/assets/statemine/src/weights/paritydb_weights.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/paritydb_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemine/src/weights/paritydb_weights.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/paritydb_weights.rs diff --git a/parachains/runtimes/assets/statemine/src/weights/rocksdb_weights.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/rocksdb_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemine/src/weights/rocksdb_weights.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/rocksdb_weights.rs diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs similarity index 98% rename from parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs index 9cf8a95ccf2..94ed4aa5878 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs @@ -56,8 +56,8 @@ impl WeighMultiAssets for MultiAssets { } } -pub struct WestmintXcmWeight(core::marker::PhantomData); -impl XcmWeightInfo for WestmintXcmWeight { +pub struct AssetHubKusamaXcmWeight(core::marker::PhantomData); +impl XcmWeightInfo for AssetHubKusamaXcmWeight { fn withdraw_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) } diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs similarity index 88% rename from parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index ce142a079d2..997a2e2814f 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,17 +17,17 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet // --template=./templates/xcm-bench-template.hbs -// --chain=westmint-dev +// --chain=asset-hub-kusama-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_xcm_benchmarks::fungible @@ -36,7 +36,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 25_802_000 picoseconds. - Weight::from_parts(26_076_000, 3593) + // Minimum execution time: 26_264_000 picoseconds. + Weight::from_parts(26_613_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 48_092_000 picoseconds. - Weight::from_parts(48_397_000, 6196) + // Minimum execution time: 50_109_000 picoseconds. + Weight::from_parts(50_611_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -88,8 +88,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `6196` - // Minimum execution time: 70_237_000 picoseconds. - Weight::from_parts(70_692_000, 6196) + // Minimum execution time: 72_554_000 picoseconds. + Weight::from_parts(73_381_000, 6196) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -97,8 +97,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_045_000 picoseconds. - Weight::from_parts(4_135_000, 0) + // Minimum execution time: 3_858_000 picoseconds. + Weight::from_parts(3_970_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -106,8 +106,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 26_201_000 picoseconds. - Weight::from_parts(26_820_000, 3593) + // Minimum execution time: 26_650_000 picoseconds. + Weight::from_parts(27_186_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -129,8 +129,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3593` - // Minimum execution time: 50_526_000 picoseconds. - Weight::from_parts(51_121_000, 3593) + // Minimum execution time: 50_230_000 picoseconds. + Weight::from_parts(50_949_000, 3593) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -150,8 +150,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 30_690_000 picoseconds. - Weight::from_parts(31_032_000, 3540) + // Minimum execution time: 29_977_000 picoseconds. + Weight::from_parts(30_521_000, 3540) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs similarity index 81% rename from parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 04adea50076..329e3da1679 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,10 +17,10 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // target/production/polkadot-parachain @@ -34,10 +34,10 @@ // --heap-pages=4096 // --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --chain=statemine-dev +// --chain=asset-hub-kusama-dev // --header=./file_header.txt // --template=./templates/xcm-bench-template.hbs -// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/ +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -67,8 +67,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 344_397_000 picoseconds. - Weight::from_parts(349_695_000, 3540) + // Minimum execution time: 347_943_000 picoseconds. + Weight::from_parts(348_788_000, 3540) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -76,8 +76,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_726_000 picoseconds. - Weight::from_parts(3_944_000, 0) + // Minimum execution time: 3_881_000 picoseconds. + Weight::from_parts(3_982_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) @@ -85,58 +85,58 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `69` // Estimated: `3534` - // Minimum execution time: 10_846_000 picoseconds. - Weight::from_parts(11_114_000, 3534) + // Minimum execution time: 11_038_000 picoseconds. + Weight::from_parts(11_244_000, 3534) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_351_000 picoseconds. - Weight::from_parts(13_739_000, 0) + // Minimum execution time: 13_223_000 picoseconds. + Weight::from_parts(13_610_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_954_000 picoseconds. - Weight::from_parts(4_148_000, 0) + // Minimum execution time: 4_202_000 picoseconds. + Weight::from_parts(4_333_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_621_000 picoseconds. - Weight::from_parts(2_727_000, 0) + // Minimum execution time: 2_794_000 picoseconds. + Weight::from_parts(2_860_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_570_000 picoseconds. - Weight::from_parts(2_661_000, 0) + // Minimum execution time: 2_717_000 picoseconds. + Weight::from_parts(2_787_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_608_000 picoseconds. - Weight::from_parts(2_667_000, 0) + // Minimum execution time: 2_722_000 picoseconds. + Weight::from_parts(2_818_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_508_000 picoseconds. - Weight::from_parts(3_596_000, 0) + // Minimum execution time: 3_664_000 picoseconds. + Weight::from_parts(3_775_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_575_000 picoseconds. - Weight::from_parts(2_657_000, 0) + // Minimum execution time: 2_703_000 picoseconds. + Weight::from_parts(2_792_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -156,8 +156,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 27_743_000 picoseconds. - Weight::from_parts(28_461_000, 3540) + // Minimum execution time: 27_482_000 picoseconds. + Weight::from_parts(28_077_000, 3540) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -167,8 +167,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `126` // Estimated: `3591` - // Minimum execution time: 16_053_000 picoseconds. - Weight::from_parts(16_264_000, 3591) + // Minimum execution time: 15_603_000 picoseconds. + Weight::from_parts(15_899_000, 3591) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,8 +176,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_572_000 picoseconds. - Weight::from_parts(2_633_000, 0) + // Minimum execution time: 2_679_000 picoseconds. + Weight::from_parts(2_755_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -197,8 +197,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 30_340_000 picoseconds. - Weight::from_parts(31_234_000, 3540) + // Minimum execution time: 30_136_000 picoseconds. + Weight::from_parts(30_688_000, 3540) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -208,8 +208,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_829_000 picoseconds. - Weight::from_parts(5_059_000, 0) + // Minimum execution time: 4_817_000 picoseconds. + Weight::from_parts(4_978_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -230,8 +230,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 387_501_000 picoseconds. - Weight::from_parts(390_773_000, 3540) + // Minimum execution time: 387_992_000 picoseconds. + Weight::from_parts(392_283_000, 3540) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -239,36 +239,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 118_955_000 picoseconds. - Weight::from_parts(120_471_000, 0) + // Minimum execution time: 118_538_000 picoseconds. + Weight::from_parts(121_013_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_763_000 picoseconds. - Weight::from_parts(11_902_000, 0) + // Minimum execution time: 12_087_000 picoseconds. + Weight::from_parts(12_313_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_700_000 picoseconds. - Weight::from_parts(2_779_000, 0) + // Minimum execution time: 2_784_000 picoseconds. + Weight::from_parts(2_840_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_609_000 picoseconds. - Weight::from_parts(2_664_000, 0) + // Minimum execution time: 2_693_000 picoseconds. + Weight::from_parts(2_781_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_784_000 picoseconds. - Weight::from_parts(2_898_000, 0) + // Minimum execution time: 2_913_000 picoseconds. + Weight::from_parts(2_979_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -288,8 +288,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 31_631_000 picoseconds. - Weight::from_parts(32_254_000, 3540) + // Minimum execution time: 31_021_000 picoseconds. + Weight::from_parts(31_786_000, 3540) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -297,8 +297,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_333_000 picoseconds. - Weight::from_parts(10_284_000, 0) + // Minimum execution time: 5_201_000 picoseconds. + Weight::from_parts(5_335_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -318,8 +318,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 28_696_000 picoseconds. - Weight::from_parts(42_937_000, 3540) + // Minimum execution time: 27_837_000 picoseconds. + Weight::from_parts(28_360_000, 3540) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -327,47 +327,45 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_715_000 picoseconds. - Weight::from_parts(2_807_000, 0) + // Minimum execution time: 2_727_000 picoseconds. + Weight::from_parts(2_817_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_661_000 picoseconds. - Weight::from_parts(2_723_000, 0) + // Minimum execution time: 2_659_000 picoseconds. + Weight::from_parts(2_701_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_642_000 picoseconds. - Weight::from_parts(2_733_000, 0) + // Minimum execution time: 2_714_000 picoseconds. + Weight::from_parts(2_806_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: BridgeTransfer AllowedUniversalAliases (r:1 w:0) - // Proof: BridgeTransfer AllowedUniversalAliases (max_values: None, max_size: Some(2419), added: 4894, mode: MaxEncodedLen) pub fn universal_origin() -> Weight { // Proof Size summary in bytes: - // Measured: `158` - // Estimated: `5884` - // Minimum execution time: 9_621_000 picoseconds. - Weight::from_parts(9_838_000, 5884) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `0` + // Estimated: `1489` + // Minimum execution time: 5_104_000 picoseconds. + Weight::from_parts(5_236_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_705_000 picoseconds. - Weight::from_parts(2_755_000, 0) + // Minimum execution time: 2_694_000 picoseconds. + Weight::from_parts(2_747_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_842_000 picoseconds. - Weight::from_parts(2_920_000, 0) + // Minimum execution time: 2_937_000 picoseconds. + Weight::from_parts(2_992_000, 0) } } diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs similarity index 73% rename from parachains/runtimes/assets/statemine/src/xcm_config.rs rename to parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs index 27597514657..016e08d9deb 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs @@ -14,20 +14,18 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, BridgeTransfer, - ForeignAssets, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ForeignAssets, + ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; use assets_common::matching::{ - FromSiblingParachain, IsDifferentGlobalConsensusConcreteAsset, IsForeignConcreteAsset, - StartsWith, StartsWithExplicitGlobalConsensus, + FromSiblingParachain, IsForeignConcreteAsset, StartsWith, StartsWithExplicitGlobalConsensus, }; use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess}, }; use frame_system::EnsureRoot; -use pallet_bridge_transfer::impls::{AllowedUniversalAliasesOf, IsAllowedReserveOf}; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; use polkadot_parachain::primitives::Sibling; @@ -36,12 +34,12 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, - DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FungiblesAdapter, - GlobalConsensusParachainConvertsFor, IsConcrete, LocalMint, NativeAsset, NoChecking, - ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UnpaidRemoteExporter, - UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, + DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily, + EnsureXcmOrigin, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription, + IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -69,6 +67,8 @@ pub type LocationToAccountId = ( SiblingParachainConvertsVia, // Straight up local `AccountId32` origins just alias directly to `AccountId`. AccountId32Aliases, + // Foreign locations alias into accounts according to a hash of their standard description. + HashedDescription>, // Different global consensus parachain sovereign account. // (Used for over-bridge transfers and reserve processing) GlobalConsensusParachainConvertsFor, @@ -199,6 +199,14 @@ impl Contains for SafeCallFilter { } } + // Allow to change dedicated storage items (called by governance-like) + match call { + RuntimeCall::System(frame_system::Call::set_storage { items }) + if items.iter().any(|(k, _)| k.eq(&bridging::AssetHubPolkadotMaxFee::key())) => + return true, + _ => (), + }; + matches!( call, RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | @@ -340,7 +348,7 @@ impl Contains for SafeCallFilter { pallet_uniques::Call::set_collection_max_supply { .. } | pallet_uniques::Call::set_price { .. } | pallet_uniques::Call::buy_item { .. } - ) | RuntimeCall::BridgeTransfer(..) + ) ) } } @@ -382,12 +390,9 @@ impl xcm_executor::Config for XcmConfig { type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; - // Statemine acting _as_ a reserve location for KSM and assets created under `pallet-assets`. + // Asset Hub acting _as_ a reserve location for KSM and assets created under `pallet-assets`. // For KSM, users must use teleport where allowed (e.g. with the Relay Chain). - type IsReserve = IsAllowedReserveOf< - Runtime, - IsDifferentGlobalConsensusConcreteAsset, - >; + type IsReserve = bridging::IsTrustedBridgedReserveLocationForConcreteAsset; // We allow: // - teleportation of KSM // - teleportation of sibling parachain's assets (as ForeignCreators) @@ -398,7 +403,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = WeightInfoBounds< - crate::weights::xcm::StatemineXcmWeight, + crate::weights::xcm::AssetHubKusamaXcmWeight, RuntimeCall, MaxInstructions, >; @@ -426,9 +431,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = (); type MessageExporter = (); - type UniversalAliases = AllowedUniversalAliasesOf; + type UniversalAliases = bridging::BridgedUniversalAliases; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. @@ -462,7 +468,7 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = WeightInfoBounds< - crate::weights::xcm::StatemineXcmWeight, + crate::weights::xcm::AssetHubKusamaXcmWeight, RuntimeCall, MaxInstructions, >; @@ -505,128 +511,184 @@ impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { } } -/// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus -pub type BridgeXcmSender = UnpaidRemoteExporter; - -/// Benchmarks helper for over-bridge transfer pallet. -#[cfg(feature = "runtime-benchmarks")] -pub struct BridgeTransferBenchmarksHelper; - -#[cfg(feature = "runtime-benchmarks")] -impl BridgeTransferBenchmarksHelper { - /// Parachain at the other side of the bridge that we're connected to. - fn allowed_target_location() -> MultiLocation { - MultiLocation::new(2, X2(GlobalConsensus(Polkadot), Parachain(1000))) +/// All configuration related to bridging +pub mod bridging { + use super::*; + use pallet_bridge_transfer_primitives::{ + AssetFilter, BridgeConfig, BridgesConfig, BridgesConfigAdapter, BridgesConfigBuilder, + MaybePaidLocation, MultiLocationFilter, ReserveLocation, + }; + use sp_std::collections::btree_set::BTreeSet; + use xcm_builder::UnpaidRemoteExporter; + + parameter_types! { + pub BridgeHubKusamaParaId: u32 = 1002; + pub BridgeHubKusama: MultiLocation = MultiLocation::new(1, X1(Parachain(BridgeHubKusamaParaId::get()))); + pub const PolkadotNetwork: NetworkId = NetworkId::Polkadot; + pub AssetHubPolkadot: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(PolkadotNetwork::get()), Parachain(1000))); + // Initial value, this will be adjusted by governance motion on deployment with some more accurate value + pub storage AssetHubPolkadotMaxFee: Option = Some((MultiLocation::parent(), 1_000_000).into()); + pub DotLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(PolkadotNetwork::get()))); + + // Setup bridges configuration + // (hard-coded version - on-chain configuration will come later as separate feature) + pub Bridges: BridgesConfig = BridgesConfigBuilder::default() + // add exporter for Polkadot + .add_or_panic( + PolkadotNetwork::get(), + BridgeConfig::new( + MaybePaidLocation { + location: BridgeHubKusama::get(), + // Noe fees needed because we use `UnpaidRemoteExporter` and BridgeHubKusama allows unpaid execution for local system parachains + maybe_fee: None, + } + ).add_target_location( + // add target location as AssetHubPolkadot + MaybePaidLocation { + location: AssetHubPolkadot::get(), + maybe_fee: AssetHubPolkadotMaxFee::get(), + }, + Some(AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow transfer KSM + .add_equals(KsmLocation::get()) + )) + ) + ) + .build(); + + // Setup trusted bridged reserve locations + pub BridgedReserves: sp_std::vec::Vec = sp_std::vec![ + // trust assets from AssetHubPolkadot + ( + AssetHubPolkadot::get(), + AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow receive DOT + .add_equals(DotLocation::get()) + ) + ) + ]; + + /// Universal aliases + pub BridgedUniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter( + sp_std::vec![ + (BridgeHubKusama::get(), GlobalConsensus(PolkadotNetwork::get())) + ] + ); } - /// Max fee we are willing to pay on the bridged side - fn allowed_target_location_max_fee() -> Option { - Some((MultiLocation::parent(), 50_000_000_000_u128).into()) + impl Contains<(MultiLocation, Junction)> for BridgedUniversalAliases { + fn contains(alias: &(MultiLocation, Junction)) -> bool { + BridgedUniversalAliases::get().contains(alias) + } } - /// Identifier of the sibling bridge-hub parachain. - fn bridge_hub_para_id() -> u32 { - 1002 - } + /// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus + pub type BridgeXcmSender = + UnpaidRemoteExporter, XcmRouter, UniversalLocation>; + + /// Reserve locations filter for `xcm_executor::Config::IsReserve`. + pub type IsTrustedBridgedReserveLocationForConcreteAsset = + pallet_bridge_transfer::features::IsTrustedBridgedReserveLocationForConcreteAsset< + UniversalLocation, + BridgedReserves, + >; } +#[cfg(feature = "runtime-benchmarks")] +use pallet_bridge_transfer_primitives::{MaybePaidLocation, ReachableDestination}; + +/// Benchmarks helper for over-bridge transfer pallet. +#[cfg(feature = "runtime-benchmarks")] +pub struct BridgeTransferBenchmarksHelper; #[cfg(feature = "runtime-benchmarks")] impl pallet_bridge_transfer::BenchmarkHelper for BridgeTransferBenchmarksHelper { - fn bridge_config() -> Option<(NetworkId, pallet_bridge_transfer::BridgeConfig)> { - Some(( - Polkadot, - pallet_bridge_transfer::BridgeConfig { - bridge_location: (Parent, Parachain(Self::bridge_hub_para_id())).into(), - // Right now `UnpaidRemoteExporter` is used to send XCM messages and it requires - // fee to be `None`. If we're going to change that (are we?), then we should replace - // this `None` with `Some(Self::make_asset(crate::ExistentialDeposit::get()))` - bridge_location_fee: None, - allowed_target_location: Self::allowed_target_location(), - max_target_location_fee: Self::allowed_target_location_max_fee(), - }, - )) - } + fn desired_bridged_location() -> Option<(NetworkId, ReachableDestination)> { + let bridged_network = bridging::PolkadotNetwork::get(); + let target_location = bridging::AssetHubPolkadot::get(); + let target_location_fee = bridging::AssetHubPolkadotMaxFee::get(); + let target_location_account = target_location + .clone() + .appended_with(AccountId32 { + network: Some(bridged_network), + id: AccountId::from([42u8; 32]).into(), + }) + .expect("Correct target_location_account"); - fn universal_alias() -> Option<(xcm::VersionedMultiLocation, Junction)> { Some(( - xcm::VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: X1(Parachain(Self::bridge_hub_para_id())), - }), - GlobalConsensus(Polkadot), + bridging::PolkadotNetwork::get(), + ReachableDestination { + bridge: MaybePaidLocation { + location: bridging::BridgeHubKusama::get(), + // Right now `UnpaidRemoteExporter` is used to send XCM messages and it requires + // fee to be `None`. If we're going to change that (are we?), then we should replace + // this `None` with `Some(Self::make_asset(crate::ExistentialDeposit::get()))` + maybe_fee: None, + }, + target: MaybePaidLocation { + location: target_location, + maybe_fee: target_location_fee, + }, + target_destination: target_location_account, + }, )) } - fn reserve_location() -> Option { - Some(xcm::VersionedMultiLocation::V3(MultiLocation { - parents: 2, - interior: X2(GlobalConsensus(Polkadot), Parachain(1000)), - })) - } - - fn prepare_asset_transfer( + fn prepare_asset_transfer_for( + desired_bridged_location: (NetworkId, ReachableDestination), + assumed_reserve_account: MultiLocation, ) -> Option<(RuntimeOrigin, xcm::VersionedMultiAssets, xcm::VersionedMultiLocation)> { use frame_support::traits::Currency; + let (_, desired_bridged_location) = desired_bridged_location; // our `BridgeXcmSender` assumes that the HRMP channel is opened between this - // parachain and the sibling bridge-hub parachain + // parachain and the sibling bridge-hub parachain. + // we expect local bridge-hub + let bridge_hub_para_id = match desired_bridged_location.bridge.location { + MultiLocation { parents: 1, interior: X1(Parachain(bridge_hub_para_id)) } => + bridge_hub_para_id, + _ => panic!("Cannot resolve bridge_hub_para_id"), + }; cumulus_pallet_parachain_system::Pallet::::open_outbound_hrmp_channel_for_benchmarks( - Self::bridge_hub_para_id().into(), + bridge_hub_para_id.into(), ); // sender account let sender_account = AccountId::from([42u8; 32]); + // reserve account + use xcm_executor::traits::ConvertLocation; + let assumed_reserve_account = + LocationToAccountId::convert_location(&assumed_reserve_account) + .expect("Correct AccountId"); - // We need root origin to create asset - let minimum_asset_balance = 3333333_u128; - let local_asset_id = 1; - frame_support::assert_ok!(Assets::force_create( - RuntimeOrigin::root(), - local_asset_id.into(), - sender_account.clone().into(), - true, - minimum_asset_balance - )); - - // We mint enough asset for the account to exist for assets - frame_support::assert_ok!(Assets::mint( - RuntimeOrigin::signed(sender_account.clone()), - local_asset_id.into(), - sender_account.clone().into(), - minimum_asset_balance * 4 - )); - - // deposit enough funds to the sender account + // deposit enough (ED) funds to the sender and reserve account let existential_deposit = crate::ExistentialDeposit::get(); let _ = Balances::deposit_creating(&sender_account, existential_deposit * 10); + let _ = Balances::deposit_creating(&assumed_reserve_account, existential_deposit * 10); - // finally - prepare assets and destination (pallet_assets is worse than pallet_balances) - use xcm_executor::traits::Convert; - let asset_id_location = assets_common::AssetIdForTrustBackedAssetsConvert::< - TrustBackedAssetsPalletLocation, - >::reverse_ref(local_asset_id) - .unwrap(); - let asset: MultiAsset = (Concrete(asset_id_location), minimum_asset_balance * 2).into(); + // finally - prepare assets + // lets consider our worst case scenario - reserve based transfer with relay chain tokens + let asset: MultiAsset = (Concrete(KsmLocation::get()), existential_deposit * 2).into(); - let assets = xcm::VersionedMultiAssets::V3(asset.into()); - let destination = xcm::VersionedMultiLocation::V3(Self::allowed_target_location()); + let assets = xcm::VersionedMultiAssets::from(MultiAssets::from(asset)); + let destination = + xcm::VersionedMultiLocation::from(desired_bridged_location.target_destination); Some((RuntimeOrigin::signed(sender_account), assets, destination)) } +} - fn prepare_ping_transfer() -> Option<(RuntimeOrigin, xcm::VersionedMultiLocation)> { - // our `BridgeXcmSender` assumes that the HRMP channel is opened between this - // parachain and the sibling bridge-hub parachain - cumulus_pallet_parachain_system::Pallet::::open_outbound_hrmp_channel_for_benchmarks( - Self::bridge_hub_para_id().into(), +#[cfg(feature = "runtime-benchmarks")] +impl BridgeTransferBenchmarksHelper { + pub fn prepare_universal_alias() -> Option<(MultiLocation, Junction)> { + let alias = bridging::BridgedUniversalAliases::get().into_iter().find_map( + |(location, junction)| match bridging::BridgeHubKusama::get().eq(&location) { + true => Some((location, junction)), + false => None, + }, ); - - // sender account - let sender_account = AccountId::from([42u8; 32]); - - // finally - prepare destination - let destination = xcm::VersionedMultiLocation::V3(Self::allowed_target_location()); - - Some((RuntimeOrigin::signed(sender_account), destination)) + assert!(alias.is_some(), "we expect here BridgeHubKusama to Polkadot mapping at least"); + Some(alias.unwrap()) } } diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs similarity index 82% rename from parachains/runtimes/assets/statemine/tests/tests.rs rename to parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs index cea7157b6c8..db2001aa49c 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs @@ -1,3 +1,35 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests for the Statemine (Kusama Assets Hub) chain. + +use asset_hub_kusama_runtime::xcm_config::{ + AssetFeeAsExistentialDepositMultiplierFeeCharger, KsmLocation, TrustBackedAssetsPalletLocation, +}; +pub use asset_hub_kusama_runtime::{ + constants::fee::WeightToFee, + xcm_config::{ + bridging, CheckingAccount, ForeignCreatorsSovereignAccountOf, LocationToAccountId, + XcmConfig, + }, + AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, + MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime, RuntimeCall, + RuntimeEvent, SessionKeys, System, TrustBackedAssetsInstance, XcmpQueue, +}; use asset_test_utils::{CollatorSessionKeys, ExtBuilder, RuntimeHelper}; use codec::{Decode, Encode}; use cumulus_primitives_utility::ChargeWeightInFungibles; @@ -7,21 +39,9 @@ use frame_support::{ weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance}; -use statemine_runtime::xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, KsmLocation, TrustBackedAssetsPalletLocation, -}; -pub use statemine_runtime::{ - constants::fee::WeightToFee, - xcm_config::{ - CheckingAccount, ForeignCreatorsSovereignAccountOf, LocationToAccountId, XcmConfig, - }, - AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, - MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, PolkadotXcm, Runtime, - RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys, System, TrustBackedAssetsInstance, - XcmpQueue, -}; +use sp_runtime::traits::MaybeEquivalence; use xcm::latest::prelude::*; -use xcm_executor::traits::{Convert, Identity, JustTry, WeightTrader}; +use xcm_executor::traits::{Identity, JustTry, WeightTrader}; const ALICE: [u8; 32] = [1u8; 32]; const BOB: [u8; 32] = [0u8; 32]; @@ -70,7 +90,7 @@ fn test_asset_xcm_trader() { // get asset id as multilocation let asset_multilocation = - AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(); + AssetIdForTrustBackedAssetsConvert::convert_back(&local_asset_id).unwrap(); // Set Alice as block author, who will receive fees RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); @@ -154,7 +174,7 @@ fn test_asset_xcm_trader_with_refund() { // We are going to buy 4e9 weight let bought = Weight::from_parts(4_000_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); // lets calculate amount needed let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -224,7 +244,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { // We are going to buy small amount let bought = Weight::from_parts(500_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -275,7 +295,7 @@ fn test_that_buying_ed_refund_does_not_refund() { // We are gonna buy ED let bought = Weight::from_parts(ExistentialDeposit::get().try_into().unwrap(), 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -350,7 +370,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { // lets calculate amount needed let asset_amount_needed = WeightToFee::weight_to_fee(&bought); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let asset: MultiAsset = (asset_multilocation, asset_amount_needed).into(); @@ -465,13 +485,13 @@ fn test_assets_balances_api_works() { ))); // check trusted asset assert!(result.inner().iter().any(|asset| asset.eq(&( - AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), + AssetIdForTrustBackedAssetsConvert::convert_back(&local_asset_id).unwrap(), minimum_asset_balance ) .into()))); // check foreign asset assert!(result.inner().iter().any(|asset| asset.eq(&( - Identity::reverse_ref(foreign_asset_id_multilocation).unwrap(), + Identity::convert_back(&foreign_asset_id_multilocation).unwrap(), 6 * foreign_asset_minimum_asset_balance ) .into()))); @@ -606,31 +626,59 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p }) ); +fn bridging_to_asset_hub_polkadot() -> asset_test_utils::test_cases_over_bridge::TestBridgingConfig +{ + asset_test_utils::test_cases_over_bridge::TestBridgingConfig { + bridged_network: bridging::PolkadotNetwork::get(), + local_bridge_hub_para_id: bridging::BridgeHubKusamaParaId::get(), + local_bridge_hub_location: pallet_bridge_transfer_primitives::MaybePaidLocation { + location: bridging::BridgeHubKusama::get(), + maybe_fee: None, + }, + bridged_target_location: pallet_bridge_transfer_primitives::MaybePaidLocation { + location: bridging::AssetHubPolkadot::get(), + maybe_fee: bridging::AssetHubPolkadotMaxFee::get(), + }, + } +} + #[test] -fn can_governance_change_bridge_transfer_out_configuration() { - asset_test_utils::test_cases::can_governance_change_bridge_transfer_out_configuration::< +fn transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works() { + asset_test_utils::test_cases_over_bridge::transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works::< Runtime, XcmConfig, + ParachainSystem, + XcmpQueue, + LocationToAccountId, >( collator_session_keys(), - Box::new(|call| RuntimeCall::BridgeTransfer(call).encode()), + ExistentialDeposit::get(), + AccountId::from(ALICE), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { Ok(RuntimeEvent::BridgeTransfer(event)) => Some(event), _ => None, } }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }), + bridging_to_asset_hub_polkadot ) } #[test] -fn initiate_transfer_asset_via_bridge_for_native_asset_works() { - asset_test_utils::test_cases::initiate_transfer_asset_via_bridge_for_native_asset_works::< +fn transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works() { + asset_test_utils::test_cases_over_bridge::transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works::< Runtime, XcmConfig, ParachainSystem, XcmpQueue, LocationToAccountId, + ForeignAssetsInstance, >( collator_session_keys(), ExistentialDeposit::get(), @@ -647,33 +695,37 @@ fn initiate_transfer_asset_via_bridge_for_native_asset_works() { _ => None, } }), + bridging_to_asset_hub_polkadot ) } #[test] -fn can_governance_change_bridge_transfer_in_configuration() { - asset_test_utils::test_cases::can_governance_change_bridge_transfer_in_configuration::< +fn receive_reserve_asset_deposited_from_different_consensus_over_bridge_works() { + asset_test_utils::test_cases_over_bridge::receive_reserve_asset_deposited_from_different_consensus_over_bridge_works::< Runtime, XcmConfig, + LocationToAccountId, + ForeignAssetsInstance, >( collator_session_keys(), - Box::new(|call| RuntimeCall::BridgeTransfer(call).encode()), + ExistentialDeposit::get(), + AccountId::from(BOB), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { - Ok(RuntimeEvent::BridgeTransfer(event)) => Some(event), + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), _ => None, } }), + bridging_to_asset_hub_polkadot ) } #[test] -fn receive_reserve_asset_deposited_from_different_consensus_works() { - asset_test_utils::test_cases::receive_reserve_asset_deposited_from_different_consensus_works::< +fn withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works() { + asset_test_utils::test_cases_over_bridge::withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works::< Runtime, XcmConfig, LocationToAccountId, - ForeignAssetsInstance, >( collator_session_keys(), ExistentialDeposit::get(), @@ -684,5 +736,31 @@ fn receive_reserve_asset_deposited_from_different_consensus_works() { _ => None, } }), + bridging_to_asset_hub_polkadot + ) +} + +#[test] +fn change_asset_hub_polkadot_max_fee_by_governance_works() { + asset_test_utils::test_cases::change_storage_constant_by_governance_works::< + Runtime, + bridging::AssetHubPolkadotMaxFee, + Option, + >( + collator_session_keys(), + 1000, + Box::new(|call| RuntimeCall::System(call).encode()), + || { + ( + bridging::AssetHubPolkadotMaxFee::key().to_vec(), + bridging::AssetHubPolkadotMaxFee::get(), + ) + }, + |old_value| match old_value { + Some(MultiAsset { id, fun: Fungible(old_amount) }) => + Some(MultiAsset { id: *id, fun: Fungible(old_amount * 2) }), + Some(_) => None, + None => Some(MultiAsset::from((Here, 123456))), + }, ) } diff --git a/parachains/runtimes/assets/statemint/Cargo.toml b/parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml similarity index 94% rename from parachains/runtimes/assets/statemint/Cargo.toml rename to parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml index d5dd4fdf974..cdc5b205e7a 100644 --- a/parachains/runtimes/assets/statemint/Cargo.toml +++ b/parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "statemint-runtime" -version = "1.0.0" +name = "asset-hub-polkadot-runtime" +version = "0.9.420" authors = ["Parity Technologies "] edition = "2021" -description = "Statemint parachain runtime" +description = "Asset Hub Polkadot parachain runtime" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = "0.4.1", optional = true } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" @@ -73,6 +73,8 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } assets-common = { path = "../common", default-features = false } +pallet-bridge-transfer = { path = "../../../pallets/bridge-transfer", default-features = false } +pallet-bridge-transfer-primitives = { path = "../../../pallets/bridge-transfer/primitives", default-features = false } [dev-dependencies] hex-literal = "0.4.1" @@ -101,10 +103,12 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "assets-common/runtime-benchmarks", + "pallet-bridge-transfer/runtime-benchmarks", ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", @@ -131,6 +135,7 @@ try-runtime = [ "pallet-utility/try-runtime", "pallet-xcm/try-runtime", "parachain-info/try-runtime", + "pallet-bridge-transfer/try-runtime", ] std = [ "codec/std", @@ -186,5 +191,7 @@ std = [ "parachain-info/std", "parachains-common/std", "assets-common/std", + "pallet-bridge-transfer/std", + "pallet-bridge-transfer-primitives/std", "substrate-wasm-builder", ] diff --git a/parachains/runtimes/assets/statemint/build.rs b/parachains/runtimes/assets/asset-hub-polkadot/build.rs similarity index 100% rename from parachains/runtimes/assets/statemint/build.rs rename to parachains/runtimes/assets/asset-hub-polkadot/build.rs diff --git a/parachains/runtimes/assets/statemint/src/constants.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs similarity index 98% rename from parachains/runtimes/assets/statemint/src/constants.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs index 35e7f03695b..dea920979f6 100644 --- a/parachains/runtimes/assets/statemint/src/constants.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs @@ -74,7 +74,7 @@ pub mod fee { type Balance = Balance; fn polynomial() -> WeightToFeeCoefficients { // 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 + // in Asset Hub, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs similarity index 93% rename from parachains/runtimes/assets/statemint/src/lib.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs index 518fb3c4cab..070007bb6f0 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs @@ -13,10 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Statemint Runtime +//! # Asset Hub Polkadot Runtime //! -//! Statemint is a parachain that provides an interface to create, manage, and use assets. Assets -//! may be fungible or non-fungible. +//! Asset Hub Polkadot is a parachain that provides an interface to create, manage, and use assets. +//! Assets may be fungible or non-fungible. +//! +//! ## Renaming +//! +//! This chain was originally known as "Statemint". You may see references to Statemint, Statemine, +//! and Westmint throughout the codebase. These are synonymous with "Asset Hub Polkadot, Kusama, and +//! Westend", respectively. //! //! ## Assets //! @@ -27,22 +33,22 @@ //! //! ### Native Balances //! -//! Statemint uses its parent DOT token as its native asset. +//! Asset Hub Polkadot uses its parent DOT token as its native asset. //! //! ### Governance //! -//! As a common good parachain, Statemint defers its governance (namely, its `Root` origin), to its +//! As a system parachain, Asset Hub defers its governance (namely, its `Root` origin), to its //! Relay Chain parent, Polkadot. //! //! ### Collator Selection //! -//! Statemint uses `pallet-collator-selection`, a simple first-come-first-served registration +//! Asset Hub uses `pallet-collator-selection`, a simple first-come-first-served registration //! system where collators can reserve a small bond to join the block producer set. There is no //! slashing. //! //! ### XCM //! -//! Because Statemint is fully under the control of the Relay Chain, it is meant to be a +//! Because Asset Hub is fully under the control of the Relay Chain, it is meant to be a //! `TrustedTeleporter`. It can also serve as a reserve location to other parachains for DOT as well //! as other local assets. @@ -81,7 +87,10 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, + traits::{ + AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, + InstanceFilter, + }, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -93,13 +102,14 @@ use pallet_nfts::PalletFeatures; pub use parachains_common as common; use parachains_common::{ impls::{AssetsToBlockAuthor, DealWithFees}, - opaque, AccountId, AssetIdForTrustBackedAssets, Balance, BlockNumber, Hash, Header, Index, - Signature, StatemintAuraId as AuraId, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, + opaque, AccountId, AssetHubPolkadotAuraId as AuraId, AssetIdForTrustBackedAssets, Balance, + BlockNumber, Hash, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - DotLocation, FellowshipLocation, ForeignAssetsConvertedConcreteId, GovernanceLocation, - TrustBackedAssetsConvertedConcreteId, XcmConfig, XcmOriginToTransactDispatchOrigin, + bridging, AssetTransactors, DotLocation, FellowshipLocation, ForeignAssetsConvertedConcreteId, + GovernanceLocation, LocalOriginToLocation, TrustBackedAssetsConvertedConcreteId, + UniversalLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, }; #[cfg(any(feature = "std", test))] @@ -109,6 +119,7 @@ pub use sp_runtime::BuildStorage; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm::latest::BodyId; +use xcm_builder::EnsureXcmOrigin; use xcm_executor::XcmExecutor; use crate::xcm_config::ForeignCreatorsSovereignAccountOf; @@ -122,6 +133,9 @@ impl_opaque_keys! { #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { + // Note: "statemint" is the legacy name for this chain. It has been renamed to + // "asset-hub-polkadot". Many wallets/tools depend on the `spec_name`, so it remains "statemint" + // for the time being. Wallets/tools should update to treat "asset-hub-polkadot" equally. spec_name: create_runtime_str!("statemint"), impl_name: create_runtime_str!("statemint"), authoring_version: 1, @@ -547,7 +561,6 @@ parameter_types! { } impl cumulus_pallet_xcmp_queue::Config for Runtime { - type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; @@ -559,6 +572,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type PriceForSiblingDelivery = (); + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -590,6 +604,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -707,6 +722,25 @@ impl pallet_nfts::Config for Runtime { type Helper = (); } +impl pallet_bridge_transfer::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type UniversalLocation = UniversalLocation; + type WeightInfo = weights::pallet_bridge_transfer::WeightInfo; + type AssetTransactor = AssetTransactors; + type AssetTransferKindResolver = + pallet_bridge_transfer::features::ConcreteAssetTransferKindResolver< + bridging::IsTrustedBridgedReserveLocationForConcreteAsset, + pallet_bridge_transfer::features::IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation, + >; + type AssetTransferOrigin = EnsureXcmOrigin; + type AssetsLimit = ConstU8<1>; + type BridgedDestinationValidator = + pallet_bridge_transfer_primitives::BridgesConfigAdapter; + type BridgeXcmSender = bridging::BridgeXcmSender; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = xcm_config::BridgeTransferBenchmarksHelper; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -751,6 +785,7 @@ construct_runtime!( Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 51, Nfts: pallet_nfts::{Pallet, Call, Storage, Event} = 52, ForeignAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 53, + BridgeTransfer: pallet_bridge_transfer::{Pallet, Call, Storage, Event} = 54, } ); @@ -811,6 +846,7 @@ mod benches { [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] + [pallet_bridge_transfer, BridgeTransfer] // XCM [pallet_xcm, PolkadotXcm] // NOTE: Make sure you point to the individual modules below. @@ -1123,7 +1159,10 @@ impl_runtime_apis! { } fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> { - Err(BenchmarkError::Skip) + match xcm_config::BridgeTransferBenchmarksHelper::prepare_universal_alias() { + Some(alias) => Ok(alias), + None => Err(BenchmarkError::Skip) + } } fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { @@ -1149,6 +1188,10 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Err(BenchmarkError::Skip) } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/assets/statemint/src/weights/block_weights.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/block_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemint/src/weights/block_weights.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/block_weights.rs diff --git a/parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs similarity index 85% rename from parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs index 6b492b2c1e5..81510fa1136 100644 --- a/parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=cumulus_pallet_xcmp_queue @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/cumulus_pallet_xcmp_queue.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_499_000 picoseconds. - Weight::from_parts(5_677_000, 0) + // Minimum execution time: 5_582_000 picoseconds. + Weight::from_parts(5_689_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_747_000 picoseconds. - Weight::from_parts(5_911_000, 0) + // Minimum execution time: 5_509_000 picoseconds. + Weight::from_parts(5_759_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/assets/statemint/src/weights/extrinsic_weights.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/extrinsic_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemint/src/weights/extrinsic_weights.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/extrinsic_weights.rs diff --git a/parachains/runtimes/assets/statemint/src/weights/frame_system.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs similarity index 96% rename from parachains/runtimes/assets/statemint/src/weights/frame_system.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs index 9884d6d9c3d..763a58394ff 100644 --- a/parachains/runtimes/assets/statemint/src/weights/frame_system.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs @@ -20,13 +20,13 @@ //! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=frame_system @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/frame_system.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/parachains/runtimes/assets/statemint/src/weights/mod.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs similarity index 95% rename from parachains/runtimes/assets/statemint/src/weights/mod.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs index 92af360ced1..518bd88bc2e 100644 --- a/parachains/runtimes/assets/statemint/src/weights/mod.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs @@ -4,6 +4,7 @@ pub mod extrinsic_weights; pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; +pub mod pallet_bridge_transfer; pub mod pallet_collator_selection; pub mod pallet_multisig; pub mod pallet_nfts; diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets.rs similarity index 99% rename from parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets.rs index cf9dae9dee3..20ac7e5e208 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets.rs @@ -20,13 +20,13 @@ //! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_assets @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs similarity index 83% rename from parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs index 631d8b00c34..7dd91e63fdf 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_balances @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_balances.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 52_756_000 picoseconds. - Weight::from_parts(53_298_000, 0) + // Minimum execution time: 53_598_000 picoseconds. + Weight::from_parts(54_155_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 40_071_000 picoseconds. - Weight::from_parts(40_563_000, 0) + // Minimum execution time: 40_406_000 picoseconds. + Weight::from_parts(40_873_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 15_936_000 picoseconds. - Weight::from_parts(16_317_000, 0) + // Minimum execution time: 15_391_000 picoseconds. + Weight::from_parts(15_785_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 22_750_000 picoseconds. - Weight::from_parts(23_053_000, 0) + // Minimum execution time: 22_234_000 picoseconds. + Weight::from_parts(22_635_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 54_270_000 picoseconds. - Weight::from_parts(54_857_000, 0) + // Minimum execution time: 54_846_000 picoseconds. + Weight::from_parts(55_311_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 49_155_000 picoseconds. - Weight::from_parts(49_567_000, 0) + // Minimum execution time: 49_697_000 picoseconds. + Weight::from_parts(50_079_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 18_651_000 picoseconds. - Weight::from_parts(19_007_000, 0) + // Minimum execution time: 18_390_000 picoseconds. + Weight::from_parts(18_601_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 18_523_000 picoseconds. - Weight::from_parts(18_943_000, 0) + // Minimum execution time: 17_844_000 picoseconds. + Weight::from_parts(18_052_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 11_771 - .saturating_add(Weight::from_parts(14_176_687, 0).saturating_mul(u.into())) + // Standard Error: 10_090 + .saturating_add(Weight::from_parts(13_977_021, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) diff --git a/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_bridge_transfer.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_bridge_transfer.rs new file mode 100644 index 00000000000..0341dec67c9 --- /dev/null +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_bridge_transfer.rs @@ -0,0 +1,82 @@ +// Copyright 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_bridge_transfer` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// target/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --pallet=pallet_bridge_transfer +// --chain=asset-hub-polkadot-dev +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_bridge_transfer`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_transfer::WeightInfo for WeightInfo { + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: unknown `0x732f1cab5e78eadace5c4f5d259acee9` (r:1 w:0) + /// Proof Skipped: unknown `0x732f1cab5e78eadace5c4f5d259acee9` (r:1 w:0) + /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) + /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) + fn transfer_asset_via_bridge() -> Weight { + // Proof Size summary in bytes: + // Measured: `520` + // Estimated: `6196` + // Minimum execution time: 155_232_000 picoseconds. + Weight::from_parts(159_180_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs similarity index 88% rename from parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs index 7c518a45ddf..f26fd83b17b 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_collator_selection @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `178 + b * (78 ±0)` // Estimated: `1168 + b * (2554 ±0)` - // Minimum execution time: 15_571_000 picoseconds. - Weight::from_parts(15_554_982, 0) + // Minimum execution time: 14_980_000 picoseconds. + Weight::from_parts(14_771_757, 0) .saturating_add(Weight::from_parts(0, 1168)) - // Standard Error: 2_818 - .saturating_add(Weight::from_parts(2_610_335, 0).saturating_mul(b.into())) + // Standard Error: 3_716 + .saturating_add(Weight::from_parts(2_641_816, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_816_000 picoseconds. - Weight::from_parts(8_030_000, 0) + // Minimum execution time: 7_374_000 picoseconds. + Weight::from_parts(7_705_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_077_000 picoseconds. - Weight::from_parts(8_293_000, 0) + // Minimum execution time: 7_764_000 picoseconds. + Weight::from_parts(7_936_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1108 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 43_072_000 picoseconds. - Weight::from_parts(35_712_990, 0) + // Minimum execution time: 42_370_000 picoseconds. + Weight::from_parts(35_043_461, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_261 - .saturating_add(Weight::from_parts(112_854, 0).saturating_mul(c.into())) + // Standard Error: 1_207 + .saturating_add(Weight::from_parts(106_062, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `452 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 35_372_000 picoseconds. - Weight::from_parts(26_886_289, 0) + // Minimum execution time: 33_605_000 picoseconds. + Weight::from_parts(23_203_974, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_388 - .saturating_add(Weight::from_parts(106_632, 0).saturating_mul(c.into())) + // Standard Error: 1_271 + .saturating_add(Weight::from_parts(106_769, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 44_209_000 picoseconds. - Weight::from_parts(44_590_000, 0) + // Minimum execution time: 43_406_000 picoseconds. + Weight::from_parts(44_012_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22721 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2602 ±0)` - // Minimum execution time: 17_397_000 picoseconds. - Weight::from_parts(17_600_000, 0) + // Minimum execution time: 17_235_000 picoseconds. + Weight::from_parts(17_435_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 897_810 - .saturating_add(Weight::from_parts(31_873_549, 0).saturating_mul(c.into())) + // Standard Error: 847_163 + .saturating_add(Weight::from_parts(30_138_555, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs similarity index 75% rename from parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs index 2753cea0a8f..86cf695e867 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_multisig @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_multisig.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_303_000 picoseconds. - Weight::from_parts(12_695_362, 0) + // Minimum execution time: 11_495_000 picoseconds. + Weight::from_parts(11_941_097, 0) .saturating_add(Weight::from_parts(0, 0)) // Standard Error: 1 - .saturating_add(Weight::from_parts(557, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(532, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `262 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 42_467_000 picoseconds. - Weight::from_parts(36_773_932, 0) + // Minimum execution time: 42_360_000 picoseconds. + Weight::from_parts(36_485_166, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 459 - .saturating_add(Weight::from_parts(63_612, 0).saturating_mul(s.into())) - // Standard Error: 4 - .saturating_add(Weight::from_parts(1_269, 0).saturating_mul(z.into())) + // Standard Error: 572 + .saturating_add(Weight::from_parts(63_611, 0).saturating_mul(s.into())) + // Standard Error: 5 + .saturating_add(Weight::from_parts(1_226, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 28_843_000 picoseconds. - Weight::from_parts(23_142_157, 0) + // Minimum execution time: 28_202_000 picoseconds. + Weight::from_parts(22_787_062, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 229 - .saturating_add(Weight::from_parts(63_362, 0).saturating_mul(s.into())) - // Standard Error: 2 - .saturating_add(Weight::from_parts(1_241, 0).saturating_mul(z.into())) + // Standard Error: 369 + .saturating_add(Weight::from_parts(60_124, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_203, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `385 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 48_265_000 picoseconds. - Weight::from_parts(40_503_415, 0) + // Minimum execution time: 47_308_000 picoseconds. + Weight::from_parts(39_699_574, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 528 - .saturating_add(Weight::from_parts(85_941, 0).saturating_mul(s.into())) - // Standard Error: 5 - .saturating_add(Weight::from_parts(1_281, 0).saturating_mul(z.into())) + // Standard Error: 456 + .saturating_add(Weight::from_parts(81_841, 0).saturating_mul(s.into())) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_257, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 32_680_000 picoseconds. - Weight::from_parts(34_368_418, 0) + // Minimum execution time: 32_514_000 picoseconds. + Weight::from_parts(34_143_424, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 558 - .saturating_add(Weight::from_parts(72_172, 0).saturating_mul(s.into())) + // Standard Error: 594 + .saturating_add(Weight::from_parts(70_761, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 19_571_000 picoseconds. - Weight::from_parts(20_887_762, 0) + // Minimum execution time: 19_413_000 picoseconds. + Weight::from_parts(20_545_498, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 858 - .saturating_add(Weight::from_parts(64_869, 0).saturating_mul(s.into())) + // Standard Error: 435 + .saturating_add(Weight::from_parts(62_293, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 32_681_000 picoseconds. - Weight::from_parts(34_919_059, 0) + // Minimum execution time: 32_795_000 picoseconds. + Weight::from_parts(34_829_791, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 613 - .saturating_add(Weight::from_parts(72_149, 0).saturating_mul(s.into())) + // Standard Error: 703 + .saturating_add(Weight::from_parts(69_968, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_nfts.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs similarity index 85% rename from parachains/runtimes/assets/statemine/src/weights/pallet_nfts.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs index 3655836b0a0..011af60e182 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_nfts.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_nfts` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_nfts @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_nfts.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,10 +60,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionAccount (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `145` + // Measured: `179` // Estimated: `3549` - // Minimum execution time: 39_589_000 picoseconds. - Weight::from_parts(40_305_000, 0) + // Minimum execution time: 39_242_000 picoseconds. + Weight::from_parts(39_979_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(5)) @@ -80,10 +80,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionAccount (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) fn force_create() -> Weight { // Proof Size summary in bytes: - // Measured: `42` + // Measured: `76` // Estimated: `3549` - // Minimum execution time: 23_945_000 picoseconds. - Weight::from_parts(24_351_000, 0) + // Minimum execution time: 22_811_000 picoseconds. + Weight::from_parts(23_487_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(5)) @@ -107,15 +107,17 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `m` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy(_m: u32, _c: u32, a: u32, ) -> Weight { + fn destroy(m: u32, _c: u32, a: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `32170 + a * (366 ±0)` + // Measured: `32204 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 992_533_000 picoseconds. - Weight::from_parts(941_813_359, 0) + // Minimum execution time: 1_008_270_000 picoseconds. + Weight::from_parts(949_754_969, 0) .saturating_add(Weight::from_parts(0, 2523990)) - // Standard Error: 3_954 - .saturating_add(Weight::from_parts(5_784_754, 0).saturating_mul(a.into())) + // Standard Error: 3_875 + .saturating_add(Weight::from_parts(7_023, 0).saturating_mul(m.into())) + // Standard Error: 3_875 + .saturating_add(Weight::from_parts(5_813_679, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1004)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1005)) @@ -136,10 +138,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Account (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `421` + // Measured: `455` // Estimated: `4326` - // Minimum execution time: 49_305_000 picoseconds. - Weight::from_parts(50_143_000, 0) + // Minimum execution time: 49_850_000 picoseconds. + Weight::from_parts(50_181_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -158,10 +160,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Account (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn force_mint() -> Weight { // Proof Size summary in bytes: - // Measured: `421` + // Measured: `455` // Estimated: `4326` - // Minimum execution time: 48_627_000 picoseconds. - Weight::from_parts(48_954_000, 0) + // Minimum execution time: 48_785_000 picoseconds. + Weight::from_parts(49_386_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -184,16 +186,18 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) fn burn() -> Weight { // Proof Size summary in bytes: - // Measured: `530` + // Measured: `564` // Estimated: `4326` - // Minimum execution time: 49_958_000 picoseconds. - Weight::from_parts(50_387_000, 0) + // Minimum execution time: 50_001_000 picoseconds. + Weight::from_parts(50_295_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:1 w:0) @@ -208,12 +212,12 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `559` + // Measured: `593` // Estimated: `4326` - // Minimum execution time: 36_267_000 picoseconds. - Weight::from_parts(36_712_000, 0) + // Minimum execution time: 40_767_000 picoseconds. + Weight::from_parts(41_056_000, 0) .saturating_add(Weight::from_parts(0, 4326)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: Nfts Collection (r:1 w:0) @@ -225,13 +229,13 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `i` is `[0, 5000]`. fn redeposit(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `729 + i * (108 ±0)` + // Measured: `763 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 17_738_000 picoseconds. - Weight::from_parts(17_801_000, 0) + // Minimum execution time: 17_346_000 picoseconds. + Weight::from_parts(17_545_000, 0) .saturating_add(Weight::from_parts(0, 3549)) - // Standard Error: 13_596 - .saturating_add(Weight::from_parts(15_695_790, 0).saturating_mul(i.into())) + // Standard Error: 13_113 + .saturating_add(Weight::from_parts(15_650_659, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -243,10 +247,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) fn lock_item_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `401` + // Measured: `435` // Estimated: `3534` - // Minimum execution time: 20_845_000 picoseconds. - Weight::from_parts(21_133_000, 0) + // Minimum execution time: 20_978_000 picoseconds. + Weight::from_parts(21_261_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -257,10 +261,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) fn unlock_item_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `401` + // Measured: `435` // Estimated: `3534` - // Minimum execution time: 20_862_000 picoseconds. - Weight::from_parts(21_105_000, 0) + // Minimum execution time: 20_612_000 picoseconds. + Weight::from_parts(21_057_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -271,10 +275,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) fn lock_collection() -> Weight { // Proof Size summary in bytes: - // Measured: `306` + // Measured: `340` // Estimated: `3549` - // Minimum execution time: 18_196_000 picoseconds. - Weight::from_parts(18_333_000, 0) + // Minimum execution time: 18_161_000 picoseconds. + Weight::from_parts(18_387_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -287,10 +291,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionAccount (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `354` + // Measured: `388` // Estimated: `3549` - // Minimum execution time: 24_025_000 picoseconds. - Weight::from_parts(24_277_000, 0) + // Minimum execution time: 23_737_000 picoseconds. + Weight::from_parts(24_195_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -301,10 +305,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionRoleOf (max_values: None, max_size: Some(69), added: 2544, mode: MaxEncodedLen) fn set_team() -> Weight { // Proof Size summary in bytes: - // Measured: `335` + // Measured: `369` // Estimated: `6078` - // Minimum execution time: 40_974_000 picoseconds. - Weight::from_parts(41_706_000, 0) + // Minimum execution time: 40_987_000 picoseconds. + Weight::from_parts(42_056_000, 0) .saturating_add(Weight::from_parts(0, 6078)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(5)) @@ -315,10 +319,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionAccount (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) fn force_collection_owner() -> Weight { // Proof Size summary in bytes: - // Measured: `277` + // Measured: `311` // Estimated: `3549` - // Minimum execution time: 19_044_000 picoseconds. - Weight::from_parts(19_465_000, 0) + // Minimum execution time: 18_644_000 picoseconds. + Weight::from_parts(18_987_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) @@ -329,10 +333,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) fn force_collection_config() -> Weight { // Proof Size summary in bytes: - // Measured: `242` + // Measured: `276` // Estimated: `3549` - // Minimum execution time: 15_591_000 picoseconds. - Weight::from_parts(15_858_000, 0) + // Minimum execution time: 15_356_000 picoseconds. + Weight::from_parts(15_548_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -343,10 +347,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) fn lock_item_properties() -> Weight { // Proof Size summary in bytes: - // Measured: `401` + // Measured: `435` // Estimated: `3534` - // Minimum execution time: 20_831_000 picoseconds. - Weight::from_parts(21_121_000, 0) + // Minimum execution time: 20_805_000 picoseconds. + Weight::from_parts(21_023_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -363,10 +367,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) fn set_attribute() -> Weight { // Proof Size summary in bytes: - // Measured: `505` + // Measured: `539` // Estimated: `3944` - // Minimum execution time: 50_650_000 picoseconds. - Weight::from_parts(51_315_000, 0) + // Minimum execution time: 50_508_000 picoseconds. + Weight::from_parts(50_955_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -377,10 +381,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) fn force_set_attribute() -> Weight { // Proof Size summary in bytes: - // Measured: `310` + // Measured: `344` // Estimated: `3944` - // Minimum execution time: 28_244_000 picoseconds. - Weight::from_parts(28_627_000, 0) + // Minimum execution time: 27_790_000 picoseconds. + Weight::from_parts(28_096_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -395,10 +399,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) fn clear_attribute() -> Weight { // Proof Size summary in bytes: - // Measured: `949` + // Measured: `983` // Estimated: `3944` - // Minimum execution time: 47_299_000 picoseconds. - Weight::from_parts(47_921_000, 0) + // Minimum execution time: 47_390_000 picoseconds. + Weight::from_parts(47_933_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -409,10 +413,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemAttributesApprovalsOf (max_values: None, max_size: Some(1001), added: 3476, mode: MaxEncodedLen) fn approve_item_attributes() -> Weight { // Proof Size summary in bytes: - // Measured: `347` + // Measured: `381` // Estimated: `4466` - // Minimum execution time: 19_400_000 picoseconds. - Weight::from_parts(19_601_000, 0) + // Minimum execution time: 19_011_000 picoseconds. + Weight::from_parts(19_334_000, 0) .saturating_add(Weight::from_parts(0, 4466)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -428,13 +432,13 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 1000]`. fn cancel_item_attributes_approval(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `726 + n * (398 ±0)` + // Measured: `760 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 28_552_000 picoseconds. - Weight::from_parts(28_822_000, 0) + // Minimum execution time: 28_418_000 picoseconds. + Weight::from_parts(28_675_000, 0) .saturating_add(Weight::from_parts(0, 4466)) - // Standard Error: 3_265 - .saturating_add(Weight::from_parts(5_570_824, 0).saturating_mul(n.into())) + // Standard Error: 3_721 + .saturating_add(Weight::from_parts(5_652_766, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -453,10 +457,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemMetadataOf (max_values: None, max_size: Some(347), added: 2822, mode: MaxEncodedLen) fn set_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `505` + // Measured: `539` // Estimated: `3812` - // Minimum execution time: 42_425_000 picoseconds. - Weight::from_parts(42_883_000, 0) + // Minimum execution time: 42_204_000 picoseconds. + Weight::from_parts(42_653_000, 0) .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -471,10 +475,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) fn clear_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `815` + // Measured: `849` // Estimated: `3812` - // Minimum execution time: 40_219_000 picoseconds. - Weight::from_parts(41_709_000, 0) + // Minimum execution time: 40_302_000 picoseconds. + Weight::from_parts(40_764_000, 0) .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -489,10 +493,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionMetadataOf (max_values: None, max_size: Some(294), added: 2769, mode: MaxEncodedLen) fn set_collection_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `364` + // Measured: `398` // Estimated: `3759` - // Minimum execution time: 39_376_000 picoseconds. - Weight::from_parts(39_895_000, 0) + // Minimum execution time: 39_557_000 picoseconds. + Weight::from_parts(39_873_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -507,10 +511,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionMetadataOf (max_values: None, max_size: Some(294), added: 2769, mode: MaxEncodedLen) fn clear_collection_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `682` + // Measured: `716` // Estimated: `3759` - // Minimum execution time: 38_414_000 picoseconds. - Weight::from_parts(38_627_000, 0) + // Minimum execution time: 37_964_000 picoseconds. + Weight::from_parts(38_410_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -521,10 +525,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) fn approve_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `376` + // Measured: `410` // Estimated: `4326` - // Minimum execution time: 22_896_000 picoseconds. - Weight::from_parts(23_137_000, 0) + // Minimum execution time: 22_516_000 picoseconds. + Weight::from_parts(22_843_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -533,10 +537,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) fn cancel_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `384` + // Measured: `418` // Estimated: `4326` - // Minimum execution time: 20_602_000 picoseconds. - Weight::from_parts(20_869_000, 0) + // Minimum execution time: 20_051_000 picoseconds. + Weight::from_parts(20_396_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -545,10 +549,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) fn clear_all_transfer_approvals() -> Weight { // Proof Size summary in bytes: - // Measured: `384` + // Measured: `418` // Estimated: `4326` - // Minimum execution time: 19_415_000 picoseconds. - Weight::from_parts(19_594_000, 0) + // Minimum execution time: 19_044_000 picoseconds. + Weight::from_parts(19_380_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -557,10 +561,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts OwnershipAcceptance (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) fn set_accept_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `42` + // Measured: `76` // Estimated: `3517` - // Minimum execution time: 16_784_000 picoseconds. - Weight::from_parts(17_133_000, 0) + // Minimum execution time: 16_713_000 picoseconds. + Weight::from_parts(16_965_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -571,10 +575,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) fn set_collection_max_supply() -> Weight { // Proof Size summary in bytes: - // Measured: `306` + // Measured: `340` // Estimated: `3549` - // Minimum execution time: 20_391_000 picoseconds. - Weight::from_parts(20_710_000, 0) + // Minimum execution time: 20_309_000 picoseconds. + Weight::from_parts(20_536_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -585,10 +589,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) fn update_mint_settings() -> Weight { // Proof Size summary in bytes: - // Measured: `289` + // Measured: `323` // Estimated: `3538` - // Minimum execution time: 19_989_000 picoseconds. - Weight::from_parts(20_179_000, 0) + // Minimum execution time: 19_927_000 picoseconds. + Weight::from_parts(20_342_000, 0) .saturating_add(Weight::from_parts(0, 3538)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -603,10 +607,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemPriceOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) fn set_price() -> Weight { // Proof Size summary in bytes: - // Measured: `484` + // Measured: `518` // Estimated: `4326` - // Minimum execution time: 24_308_000 picoseconds. - Weight::from_parts(24_721_000, 0) + // Minimum execution time: 25_179_000 picoseconds. + Weight::from_parts(25_440_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -617,6 +621,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemPriceOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:1 w:0) @@ -627,12 +633,12 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) fn buy_item() -> Weight { // Proof Size summary in bytes: - // Measured: `671` + // Measured: `705` // Estimated: `4326` - // Minimum execution time: 45_626_000 picoseconds. - Weight::from_parts(46_030_000, 0) + // Minimum execution time: 50_407_000 picoseconds. + Weight::from_parts(50_878_000, 0) .saturating_add(Weight::from_parts(0, 4326)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } /// The range of component `n` is `[0, 10]`. @@ -640,11 +646,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_654_000 picoseconds. - Weight::from_parts(4_301_940, 0) + // Minimum execution time: 2_590_000 picoseconds. + Weight::from_parts(4_219_244, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9_223 - .saturating_add(Weight::from_parts(3_945_966, 0).saturating_mul(n.into())) + // Standard Error: 9_402 + .saturating_add(Weight::from_parts(3_693_213, 0).saturating_mul(n.into())) } /// Storage: Nfts Item (r:2 w:0) /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) @@ -652,10 +658,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) fn create_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `460` + // Measured: `494` // Estimated: `7662` - // Minimum execution time: 23_071_000 picoseconds. - Weight::from_parts(23_535_000, 0) + // Minimum execution time: 22_440_000 picoseconds. + Weight::from_parts(22_872_000, 0) .saturating_add(Weight::from_parts(0, 7662)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -666,10 +672,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) fn cancel_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `479` + // Measured: `513` // Estimated: `4326` - // Minimum execution time: 21_554_000 picoseconds. - Weight::from_parts(21_941_000, 0) + // Minimum execution time: 21_391_000 picoseconds. + Weight::from_parts(21_718_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -680,6 +686,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:2 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:2 w:0) @@ -690,12 +698,12 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemPriceOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) fn claim_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `800` + // Measured: `834` // Estimated: `7662` - // Minimum execution time: 74_272_000 picoseconds. - Weight::from_parts(75_374_000, 0) + // Minimum execution time: 82_838_000 picoseconds. + Weight::from_parts(83_842_000, 0) .saturating_add(Weight::from_parts(0, 7662)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(10)) } /// Storage: Nfts CollectionRoleOf (r:2 w:0) @@ -719,13 +727,13 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 10]`. fn mint_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `524` + // Measured: `558` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 133_545_000 picoseconds. - Weight::from_parts(137_797_962, 0) + // Minimum execution time: 133_585_000 picoseconds. + Weight::from_parts(138_200_829, 0) .saturating_add(Weight::from_parts(0, 6078)) - // Standard Error: 33_124 - .saturating_add(Weight::from_parts(29_785_862, 0).saturating_mul(n.into())) + // Standard Error: 24_914 + .saturating_add(Weight::from_parts(29_531_886, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -747,13 +755,13 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 10]`. fn set_attributes_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `554` + // Measured: `588` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 77_475_000 picoseconds. - Weight::from_parts(88_353_947, 0) + // Minimum execution time: 77_015_000 picoseconds. + Weight::from_parts(87_887_301, 0) .saturating_add(Weight::from_parts(0, 4466)) - // Standard Error: 60_491 - .saturating_add(Weight::from_parts(29_507_037, 0).saturating_mul(n.into())) + // Standard Error: 60_927 + .saturating_add(Weight::from_parts(29_146_930, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs similarity index 76% rename from parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs index dbee1b7b3e2..433c4a8bcc4 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_proxy @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_proxy.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,11 +55,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 16_863_000 picoseconds. - Weight::from_parts(17_287_999, 0) + // Minimum execution time: 16_918_000 picoseconds. + Weight::from_parts(17_287_335, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 841 - .saturating_add(Weight::from_parts(25_908, 0).saturating_mul(p.into())) + // Standard Error: 666 + .saturating_add(Weight::from_parts(31_973, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: Proxy Proxies (r:1 w:0) @@ -74,13 +74,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 38_170_000 picoseconds. - Weight::from_parts(37_695_584, 0) + // Minimum execution time: 38_674_000 picoseconds. + Weight::from_parts(38_274_665, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_836 - .saturating_add(Weight::from_parts(146_800, 0).saturating_mul(a.into())) - // Standard Error: 1_897 - .saturating_add(Weight::from_parts(38_057, 0).saturating_mul(p.into())) + // Standard Error: 1_237 + .saturating_add(Weight::from_parts(138_094, 0).saturating_mul(a.into())) + // Standard Error: 1_278 + .saturating_add(Weight::from_parts(39_024, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -94,13 +94,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_161_000 picoseconds. - Weight::from_parts(25_440_795, 0) + // Minimum execution time: 25_185_000 picoseconds. + Weight::from_parts(25_535_225, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_095 - .saturating_add(Weight::from_parts(135_319, 0).saturating_mul(a.into())) - // Standard Error: 1_131 - .saturating_add(Weight::from_parts(11_250, 0).saturating_mul(p.into())) + // Standard Error: 1_084 + .saturating_add(Weight::from_parts(136_564, 0).saturating_mul(a.into())) + // Standard Error: 1_120 + .saturating_add(Weight::from_parts(12_707, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -114,13 +114,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_441_000 picoseconds. - Weight::from_parts(25_850_657, 0) + // Minimum execution time: 25_221_000 picoseconds. + Weight::from_parts(25_590_585, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_148 - .saturating_add(Weight::from_parts(127_981, 0).saturating_mul(a.into())) - // Standard Error: 1_186 - .saturating_add(Weight::from_parts(6_961, 0).saturating_mul(p.into())) + // Standard Error: 1_052 + .saturating_add(Weight::from_parts(138_590, 0).saturating_mul(a.into())) + // Standard Error: 1_087 + .saturating_add(Weight::from_parts(8_904, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -136,13 +136,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `386 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 34_657_000 picoseconds. - Weight::from_parts(33_913_455, 0) + // Minimum execution time: 34_734_000 picoseconds. + Weight::from_parts(34_221_807, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_087 - .saturating_add(Weight::from_parts(128_175, 0).saturating_mul(a.into())) - // Standard Error: 1_123 - .saturating_add(Weight::from_parts(40_321, 0).saturating_mul(p.into())) + // Standard Error: 1_181 + .saturating_add(Weight::from_parts(129_837, 0).saturating_mul(a.into())) + // Standard Error: 1_220 + .saturating_add(Weight::from_parts(39_750, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -153,11 +153,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 25_575_000 picoseconds. - Weight::from_parts(26_235_398, 0) + // Minimum execution time: 25_941_000 picoseconds. + Weight::from_parts(26_592_291, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 924 - .saturating_add(Weight::from_parts(51_662, 0).saturating_mul(p.into())) + // Standard Error: 937 + .saturating_add(Weight::from_parts(51_915, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -168,11 +168,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 25_416_000 picoseconds. - Weight::from_parts(26_557_151, 0) + // Minimum execution time: 25_923_000 picoseconds. + Weight::from_parts(26_787_019, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_447 - .saturating_add(Weight::from_parts(50_558, 0).saturating_mul(p.into())) + // Standard Error: 1_562 + .saturating_add(Weight::from_parts(58_776, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -183,11 +183,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 22_606_000 picoseconds. - Weight::from_parts(23_262_867, 0) + // Minimum execution time: 22_908_000 picoseconds. + Weight::from_parts(23_854_629, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_186 - .saturating_add(Weight::from_parts(26_393, 0).saturating_mul(p.into())) + // Standard Error: 5_136 + .saturating_add(Weight::from_parts(32_465, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -198,11 +198,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4706` - // Minimum execution time: 27_288_000 picoseconds. - Weight::from_parts(27_957_909, 0) + // Minimum execution time: 27_585_000 picoseconds. + Weight::from_parts(28_380_794, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 706 - .saturating_add(Weight::from_parts(8_841, 0).saturating_mul(p.into())) + // Standard Error: 755 + .saturating_add(Weight::from_parts(10_118, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -213,11 +213,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 23_640_000 picoseconds. - Weight::from_parts(24_327_982, 0) + // Minimum execution time: 24_123_000 picoseconds. + Weight::from_parts(24_704_742, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 828 - .saturating_add(Weight::from_parts(28_240, 0).saturating_mul(p.into())) + // Standard Error: 680 + .saturating_add(Weight::from_parts(29_566, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_session.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs similarity index 86% rename from parachains/runtimes/assets/westmint/src/weights/pallet_session.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs index b48ff8dd064..cedb152c09e 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_session.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_session @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_session.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `270` // Estimated: `3735` - // Minimum execution time: 17_308_000 picoseconds. - Weight::from_parts(17_624_000, 0) + // Minimum execution time: 17_602_000 picoseconds. + Weight::from_parts(18_067_000, 0) .saturating_add(Weight::from_parts(0, 3735)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `3707` - // Minimum execution time: 12_828_000 picoseconds. - Weight::from_parts(12_985_000, 0) + // Minimum execution time: 13_189_000 picoseconds. + Weight::from_parts(13_413_000, 0) .saturating_add(Weight::from_parts(0, 3707)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs similarity index 85% rename from parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs index 361bb6245fc..a2cc622a039 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_timestamp @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_timestamp.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `86` // Estimated: `1493` - // Minimum execution time: 9_418_000 picoseconds. - Weight::from_parts(9_665_000, 0) + // Minimum execution time: 9_075_000 picoseconds. + Weight::from_parts(9_252_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 3_266_000 picoseconds. - Weight::from_parts(3_386_000, 0) + // Minimum execution time: 3_167_000 picoseconds. + Weight::from_parts(3_293_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs similarity index 86% rename from parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs index 80c1adfe5e6..d99522e7e52 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_uniques` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_uniques @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_uniques.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3643` - // Minimum execution time: 31_630_000 picoseconds. - Weight::from_parts(32_135_000, 0) + // Minimum execution time: 30_359_000 picoseconds. + Weight::from_parts(30_900_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3643` - // Minimum execution time: 15_573_000 picoseconds. - Weight::from_parts(15_971_000, 0) + // Minimum execution time: 14_650_000 picoseconds. + Weight::from_parts(14_899_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -99,15 +99,15 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `257 + a * (107 ±0) + m * (56 ±0) + n * (76 ±0)` // Estimated: `3643 + a * (2647 ±0) + m * (2662 ±0) + n * (2597 ±0)` - // Minimum execution time: 2_397_568_000 picoseconds. - Weight::from_parts(2_408_280_000, 0) + // Minimum execution time: 2_396_572_000 picoseconds. + Weight::from_parts(2_413_348_000, 0) .saturating_add(Weight::from_parts(0, 3643)) - // Standard Error: 24_497 - .saturating_add(Weight::from_parts(6_425_310, 0).saturating_mul(n.into())) - // Standard Error: 24_497 - .saturating_add(Weight::from_parts(252_611, 0).saturating_mul(m.into())) - // Standard Error: 24_497 - .saturating_add(Weight::from_parts(313_131, 0).saturating_mul(a.into())) + // Standard Error: 24_476 + .saturating_add(Weight::from_parts(6_224_926, 0).saturating_mul(n.into())) + // Standard Error: 24_476 + .saturating_add(Weight::from_parts(252_975, 0).saturating_mul(m.into())) + // Standard Error: 24_476 + .saturating_add(Weight::from_parts(333_637, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into()))) @@ -132,8 +132,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 37_233_000 picoseconds. - Weight::from_parts(37_731_000, 0) + // Minimum execution time: 36_494_000 picoseconds. + Weight::from_parts(36_988_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -150,8 +150,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 38_493_000 picoseconds. - Weight::from_parts(38_939_000, 0) + // Minimum execution time: 37_659_000 picoseconds. + Weight::from_parts(38_296_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -168,8 +168,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 28_125_000 picoseconds. - Weight::from_parts(28_354_000, 0) + // Minimum execution time: 26_933_000 picoseconds. + Weight::from_parts(27_327_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -183,11 +183,11 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `738 + i * (76 ±0)` // Estimated: `3643 + i * (2597 ±0)` - // Minimum execution time: 16_016_000 picoseconds. - Weight::from_parts(16_298_000, 0) + // Minimum execution time: 15_444_000 picoseconds. + Weight::from_parts(15_547_000, 0) .saturating_add(Weight::from_parts(0, 3643)) - // Standard Error: 12_979 - .saturating_add(Weight::from_parts(15_665_767, 0).saturating_mul(i.into())) + // Standard Error: 13_661 + .saturating_add(Weight::from_parts(15_215_524, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -202,8 +202,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 19_730_000 picoseconds. - Weight::from_parts(20_008_000, 0) + // Minimum execution time: 19_485_000 picoseconds. + Weight::from_parts(19_662_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -216,8 +216,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 19_683_000 picoseconds. - Weight::from_parts(20_096_000, 0) + // Minimum execution time: 19_229_000 picoseconds. + Weight::from_parts(19_472_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -228,8 +228,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 14_854_000 picoseconds. - Weight::from_parts(15_217_000, 0) + // Minimum execution time: 14_393_000 picoseconds. + Weight::from_parts(14_773_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -240,8 +240,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 14_659_000 picoseconds. - Weight::from_parts(15_072_000, 0) + // Minimum execution time: 14_292_000 picoseconds. + Weight::from_parts(14_687_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -256,8 +256,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `356` // Estimated: `3643` - // Minimum execution time: 23_412_000 picoseconds. - Weight::from_parts(23_634_000, 0) + // Minimum execution time: 22_904_000 picoseconds. + Weight::from_parts(23_221_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -268,8 +268,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 15_816_000 picoseconds. - Weight::from_parts(16_303_000, 0) + // Minimum execution time: 15_406_000 picoseconds. + Weight::from_parts(15_881_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -282,8 +282,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 18_056_000 picoseconds. - Weight::from_parts(18_315_000, 0) + // Minimum execution time: 17_530_000 picoseconds. + Weight::from_parts(18_137_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -298,8 +298,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `3652` - // Minimum execution time: 41_560_000 picoseconds. - Weight::from_parts(41_962_000, 0) + // Minimum execution time: 40_556_000 picoseconds. + Weight::from_parts(41_098_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -314,8 +314,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `756` // Estimated: `3652` - // Minimum execution time: 40_334_000 picoseconds. - Weight::from_parts(40_590_000, 0) + // Minimum execution time: 38_924_000 picoseconds. + Weight::from_parts(39_677_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -328,8 +328,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3652` - // Minimum execution time: 33_142_000 picoseconds. - Weight::from_parts(33_683_000, 0) + // Minimum execution time: 31_466_000 picoseconds. + Weight::from_parts(32_020_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -342,8 +342,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `3652` - // Minimum execution time: 32_918_000 picoseconds. - Weight::from_parts(33_270_000, 0) + // Minimum execution time: 31_880_000 picoseconds. + Weight::from_parts(32_386_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -356,8 +356,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 33_736_000 picoseconds. - Weight::from_parts(34_148_000, 0) + // Minimum execution time: 32_995_000 picoseconds. + Weight::from_parts(33_393_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -370,8 +370,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3643` - // Minimum execution time: 31_648_000 picoseconds. - Weight::from_parts(32_074_000, 0) + // Minimum execution time: 30_666_000 picoseconds. + Weight::from_parts(31_009_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -384,8 +384,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 21_429_000 picoseconds. - Weight::from_parts(21_830_000, 0) + // Minimum execution time: 20_706_000 picoseconds. + Weight::from_parts(21_146_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -398,8 +398,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `461` // Estimated: `3643` - // Minimum execution time: 21_317_000 picoseconds. - Weight::from_parts(21_565_000, 0) + // Minimum execution time: 20_681_000 picoseconds. + Weight::from_parts(21_024_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -410,8 +410,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3517` - // Minimum execution time: 17_070_000 picoseconds. - Weight::from_parts(17_433_000, 0) + // Minimum execution time: 16_501_000 picoseconds. + Weight::from_parts(16_736_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -424,8 +424,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 17_943_000 picoseconds. - Weight::from_parts(18_307_000, 0) + // Minimum execution time: 17_273_000 picoseconds. + Weight::from_parts(17_518_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -438,8 +438,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `259` // Estimated: `3587` - // Minimum execution time: 17_872_000 picoseconds. - Weight::from_parts(18_029_000, 0) + // Minimum execution time: 17_061_000 picoseconds. + Weight::from_parts(17_376_000, 0) .saturating_add(Weight::from_parts(0, 3587)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -456,8 +456,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `540` // Estimated: `3643` - // Minimum execution time: 39_380_000 picoseconds. - Weight::from_parts(40_347_000, 0) + // Minimum execution time: 37_517_000 picoseconds. + Weight::from_parts(38_117_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs similarity index 73% rename from parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs index be360bb42b8..d165e337d65 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_utility @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_utility.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_460_000 picoseconds. - Weight::from_parts(8_335_963, 0) + // Minimum execution time: 6_788_000 picoseconds. + Weight::from_parts(5_372_028, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_566 - .saturating_add(Weight::from_parts(6_080_076, 0).saturating_mul(c.into())) + // Standard Error: 2_689 + .saturating_add(Weight::from_parts(5_478_512, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_272_000 picoseconds. - Weight::from_parts(6_403_000, 0) + // Minimum execution time: 5_852_000 picoseconds. + Weight::from_parts(5_999_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_570_000 picoseconds. - Weight::from_parts(18_080_572, 0) + // Minimum execution time: 6_799_000 picoseconds. + Weight::from_parts(4_624_255, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 5_851 - .saturating_add(Weight::from_parts(6_351_469, 0).saturating_mul(c.into())) + // Standard Error: 3_340 + .saturating_add(Weight::from_parts(5_722_236, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_413_000 picoseconds. - Weight::from_parts(10_584_000, 0) + // Minimum execution time: 9_484_000 picoseconds. + Weight::from_parts(9_774_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_470_000 picoseconds. - Weight::from_parts(4_574_861, 0) + // Minimum execution time: 6_900_000 picoseconds. + Weight::from_parts(7_048_527, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_330 - .saturating_add(Weight::from_parts(6_093_390, 0).saturating_mul(c.into())) + // Standard Error: 3_199 + .saturating_add(Weight::from_parts(5_473_463, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs similarity index 81% rename from parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs index a8e6dfaa951..ff1e88f454e 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_xcm @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -60,11 +60,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 26_503_000 picoseconds. - Weight::from_parts(26_786_000, 0) - .saturating_add(Weight::from_parts(0, 3503)) + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 29_223_000 picoseconds. + Weight::from_parts(29_633_000, 0) + .saturating_add(Weight::from_parts(0, 3574)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1489` - // Minimum execution time: 25_005_000 picoseconds. - Weight::from_parts(25_355_000, 0) + // Minimum execution time: 24_692_000 picoseconds. + Weight::from_parts(25_226_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -85,8 +85,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1489` - // Minimum execution time: 19_585_000 picoseconds. - Weight::from_parts(19_921_000, 0) + // Minimum execution time: 19_046_000 picoseconds. + Weight::from_parts(19_397_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -96,8 +96,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) + // Minimum execution time: 9_714_000 picoseconds. + Weight::from_parts(9_898_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: PolkadotXcm SupportedVersion (r:0 w:1) @@ -106,8 +106,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_923_000 picoseconds. - Weight::from_parts(10_123_000, 0) + // Minimum execution time: 9_725_000 picoseconds. + Weight::from_parts(9_957_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -117,8 +117,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_048_000 picoseconds. - Weight::from_parts(3_226_000, 0) + // Minimum execution time: 3_039_000 picoseconds. + Weight::from_parts(3_217_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -140,11 +140,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 30_761_000 picoseconds. - Weight::from_parts(31_177_000, 0) - .saturating_add(Weight::from_parts(0, 3503)) + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 32_070_000 picoseconds. + Weight::from_parts(32_967_000, 0) + .saturating_add(Weight::from_parts(0, 3574)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -164,11 +164,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `220` - // Estimated: `3685` - // Minimum execution time: 33_124_000 picoseconds. - Weight::from_parts(33_531_000, 0) - .saturating_add(Weight::from_parts(0, 3685)) + // Measured: `291` + // Estimated: `3756` + // Minimum execution time: 33_377_000 picoseconds. + Weight::from_parts(34_165_000, 0) + .saturating_add(Weight::from_parts(0, 3756)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -178,8 +178,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_119_000 picoseconds. - Weight::from_parts(3_353_000, 0) + // Minimum execution time: 3_171_000 picoseconds. + Weight::from_parts(3_293_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -187,11 +187,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn migrate_supported_version() -> Weight { // Proof Size summary in bytes: - // Measured: `95` - // Estimated: `10985` - // Minimum execution time: 14_497_000 picoseconds. - Weight::from_parts(14_785_000, 0) - .saturating_add(Weight::from_parts(0, 10985)) + // Measured: `162` + // Estimated: `11052` + // Minimum execution time: 16_609_000 picoseconds. + Weight::from_parts(16_950_000, 0) + .saturating_add(Weight::from_parts(0, 11052)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -199,11 +199,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm VersionNotifiers (max_values: None, max_size: None, mode: Measured) fn migrate_version_notifiers() -> Weight { // Proof Size summary in bytes: - // Measured: `99` - // Estimated: `10989` - // Minimum execution time: 14_846_000 picoseconds. - Weight::from_parts(15_064_000, 0) - .saturating_add(Weight::from_parts(0, 10989)) + // Measured: `166` + // Estimated: `11056` + // Minimum execution time: 16_545_000 picoseconds. + Weight::from_parts(17_052_000, 0) + .saturating_add(Weight::from_parts(0, 11056)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -211,11 +211,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `13471` - // Minimum execution time: 15_346_000 picoseconds. - Weight::from_parts(15_580_000, 0) - .saturating_add(Weight::from_parts(0, 13471)) + // Measured: `173` + // Estimated: `13538` + // Minimum execution time: 17_442_000 picoseconds. + Weight::from_parts(17_766_000, 0) + .saturating_add(Weight::from_parts(0, 13538)) .saturating_add(T::DbWeight::get().reads(5)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -232,11 +232,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `6046` - // Minimum execution time: 29_631_000 picoseconds. - Weight::from_parts(30_224_000, 0) - .saturating_add(Weight::from_parts(0, 6046)) + // Measured: `176` + // Estimated: `6116` + // Minimum execution time: 30_075_000 picoseconds. + Weight::from_parts(30_744_000, 0) + .saturating_add(Weight::from_parts(0, 6116)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -244,22 +244,22 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn notify_target_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `136` - // Estimated: `8551` - // Minimum execution time: 8_203_000 picoseconds. - Weight::from_parts(8_380_000, 0) - .saturating_add(Weight::from_parts(0, 8551)) + // Measured: `206` + // Estimated: `8621` + // Minimum execution time: 8_683_000 picoseconds. + Weight::from_parts(8_979_000, 0) + .saturating_add(Weight::from_parts(0, 8621)) .saturating_add(T::DbWeight::get().reads(3)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn migrate_version_notify_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `10996` - // Minimum execution time: 15_138_000 picoseconds. - Weight::from_parts(15_396_000, 0) - .saturating_add(Weight::from_parts(0, 10996)) + // Measured: `173` + // Estimated: `11063` + // Minimum execution time: 16_960_000 picoseconds. + Weight::from_parts(17_519_000, 0) + .saturating_add(Weight::from_parts(0, 11063)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -277,11 +277,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `11002` - // Minimum execution time: 34_941_000 picoseconds. - Weight::from_parts(35_810_000, 0) - .saturating_add(Weight::from_parts(0, 11002)) + // Measured: `179` + // Estimated: `11069` + // Minimum execution time: 37_173_000 picoseconds. + Weight::from_parts(37_506_000, 0) + .saturating_add(Weight::from_parts(0, 11069)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) } diff --git a/parachains/runtimes/assets/statemint/src/weights/paritydb_weights.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/paritydb_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemint/src/weights/paritydb_weights.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/paritydb_weights.rs diff --git a/parachains/runtimes/assets/statemint/src/weights/rocksdb_weights.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/rocksdb_weights.rs similarity index 100% rename from parachains/runtimes/assets/statemint/src/weights/rocksdb_weights.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/rocksdb_weights.rs diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs similarity index 97% rename from parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs index 768f2b152cd..69c138c888a 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs @@ -56,8 +56,8 @@ impl WeighMultiAssets for MultiAssets { } } -pub struct StatemintXcmWeight(core::marker::PhantomData); -impl XcmWeightInfo for StatemintXcmWeight { +pub struct AssetHubPolkadotXcmWeight(core::marker::PhantomData); +impl XcmWeightInfo for AssetHubPolkadotXcmWeight { fn withdraw_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) } @@ -214,7 +214,7 @@ impl XcmWeightInfo for StatemintXcmWeight { XcmGeneric::::clear_transact_status() } fn universal_origin(_: &Junction) -> Weight { - Weight::MAX + XcmGeneric::::universal_origin() } fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { Weight::MAX diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs similarity index 88% rename from parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 8f802fb4211..8dfc7b2d84d 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,17 +17,17 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet // --template=./templates/xcm-bench-template.hbs -// --chain=statemine-dev +// --chain=asset-hub-polkadot-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_xcm_benchmarks::fungible @@ -36,7 +36,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 27_006_000 picoseconds. - Weight::from_parts(27_426_000, 3593) + // Minimum execution time: 25_619_000 picoseconds. + Weight::from_parts(26_283_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 51_640_000 picoseconds. - Weight::from_parts(52_045_000, 6196) + // Minimum execution time: 48_538_000 picoseconds. + Weight::from_parts(49_245_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -88,8 +88,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `6196` - // Minimum execution time: 75_401_000 picoseconds. - Weight::from_parts(75_956_000, 6196) + // Minimum execution time: 70_133_000 picoseconds. + Weight::from_parts(70_675_000, 6196) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -97,8 +97,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_767_000 picoseconds. - Weight::from_parts(4_848_000, 0) + // Minimum execution time: 3_765_000 picoseconds. + Weight::from_parts(3_860_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -106,8 +106,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 29_115_000 picoseconds. - Weight::from_parts(29_369_000, 3593) + // Minimum execution time: 26_210_000 picoseconds. + Weight::from_parts(26_602_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -129,8 +129,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3593` - // Minimum execution time: 54_197_000 picoseconds. - Weight::from_parts(54_906_000, 3593) + // Minimum execution time: 50_179_000 picoseconds. + Weight::from_parts(50_814_000, 3593) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -150,8 +150,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 33_366_000 picoseconds. - Weight::from_parts(33_874_000, 3540) + // Minimum execution time: 29_986_000 picoseconds. + Weight::from_parts(30_384_000, 3540) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs similarity index 67% rename from parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index f38bec29144..a7ba2221693 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,26 +17,27 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=statemint-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=asset-hub-polkadot-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --template=./templates/xcm-bench-template.hbs +// --output=./parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,6 +51,8 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + // Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) @@ -62,81 +65,83 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 360_004_000 picoseconds. - Weight::from_parts(361_533_000, 3503) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 348_938_000 picoseconds. + Weight::from_parts(350_779_000, 3540) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } pub fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_029_000 picoseconds. - Weight::from_parts(4_132_000, 0) + // Minimum execution time: 3_749_000 picoseconds. + Weight::from_parts(3_919_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) pub fn query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `32` - // Estimated: `3497` - // Minimum execution time: 10_802_000 picoseconds. - Weight::from_parts(10_932_000, 3497) + // Measured: `69` + // Estimated: `3534` + // Minimum execution time: 10_776_000 picoseconds. + Weight::from_parts(11_028_000, 3534) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_281_000 picoseconds. - Weight::from_parts(13_574_000, 0) + // Minimum execution time: 13_250_000 picoseconds. + Weight::from_parts(13_476_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_257_000 picoseconds. - Weight::from_parts(4_394_000, 0) + // Minimum execution time: 4_072_000 picoseconds. + Weight::from_parts(4_131_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_829_000 picoseconds. - Weight::from_parts(2_911_000, 0) + // Minimum execution time: 2_734_000 picoseconds. + Weight::from_parts(2_801_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_881_000 picoseconds. - Weight::from_parts(2_964_000, 0) + // Minimum execution time: 2_658_000 picoseconds. + Weight::from_parts(2_734_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_850_000 picoseconds. - Weight::from_parts(2_915_000, 0) + // Minimum execution time: 2_617_000 picoseconds. + Weight::from_parts(2_688_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_663_000 picoseconds. - Weight::from_parts(3_745_000, 0) + // Minimum execution time: 3_621_000 picoseconds. + Weight::from_parts(3_703_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_804_000 picoseconds. - Weight::from_parts(2_895_000, 0) + // Minimum execution time: 2_571_000 picoseconds. + Weight::from_parts(2_662_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + // Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) @@ -149,21 +154,21 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 24_558_000 picoseconds. - Weight::from_parts(24_983_000, 3503) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 27_767_000 picoseconds. + Weight::from_parts(28_324_000, 3540) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) pub fn claim_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `90` - // Estimated: `3555` - // Minimum execution time: 15_020_000 picoseconds. - Weight::from_parts(15_368_000, 3555) + // Measured: `126` + // Estimated: `3591` + // Minimum execution time: 15_855_000 picoseconds. + Weight::from_parts(16_046_000, 3591) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,11 +176,13 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_954_000 picoseconds. - Weight::from_parts(3_028_000, 0) + // Minimum execution time: 2_572_000 picoseconds. + Weight::from_parts(2_676_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + // Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) @@ -188,12 +195,12 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 26_773_000 picoseconds. - Weight::from_parts(27_256_000, 3503) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 30_238_000 picoseconds. + Weight::from_parts(30_909_000, 3540) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -201,12 +208,14 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_896_000 picoseconds. - Weight::from_parts(5_044_000, 0) + // Minimum execution time: 4_836_000 picoseconds. + Weight::from_parts(4_966_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + // Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) @@ -219,50 +228,52 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 399_114_000 picoseconds. - Weight::from_parts(400_268_000, 3503) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 389_344_000 picoseconds. + Weight::from_parts(391_677_000, 3540) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 122_318_000 picoseconds. - Weight::from_parts(122_649_000, 0) + // Minimum execution time: 119_600_000 picoseconds. + Weight::from_parts(120_116_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_851_000 picoseconds. - Weight::from_parts(13_267_000, 0) + // Minimum execution time: 11_966_000 picoseconds. + Weight::from_parts(12_237_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_886_000 picoseconds. - Weight::from_parts(2_954_000, 0) + // Minimum execution time: 2_730_000 picoseconds. + Weight::from_parts(2_820_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_920_000 picoseconds. - Weight::from_parts(3_021_000, 0) + // Minimum execution time: 2_607_000 picoseconds. + Weight::from_parts(2_700_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_184_000 picoseconds. - Weight::from_parts(3_236_000, 0) + // Minimum execution time: 2_752_000 picoseconds. + Weight::from_parts(2_867_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + // Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) @@ -275,22 +286,24 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_230_000 picoseconds. - Weight::from_parts(27_825_000, 3503) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 31_044_000 picoseconds. + Weight::from_parts(31_788_000, 3540) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_273_000 picoseconds. - Weight::from_parts(5_359_000, 0) + // Minimum execution time: 5_150_000 picoseconds. + Weight::from_parts(5_206_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + // Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) @@ -303,46 +316,56 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 24_714_000 picoseconds. - Weight::from_parts(25_082_000, 3503) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 28_127_000 picoseconds. + Weight::from_parts(28_578_000, 3540) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_817_000 picoseconds. - Weight::from_parts(2_880_000, 0) + // Minimum execution time: 2_619_000 picoseconds. + Weight::from_parts(2_697_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_775_000 picoseconds. - Weight::from_parts(2_847_000, 0) + // Minimum execution time: 2_586_000 picoseconds. + Weight::from_parts(2_672_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_806_000 picoseconds. - Weight::from_parts(2_869_000, 0) + // Minimum execution time: 2_596_000 picoseconds. + Weight::from_parts(2_654_000, 0) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + pub fn universal_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `1489` + // Minimum execution time: 5_113_000 picoseconds. + Weight::from_parts(5_209_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_881_000 picoseconds. - Weight::from_parts(2_964_000, 0) + // Minimum execution time: 2_597_000 picoseconds. + Weight::from_parts(2_698_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_985_000 picoseconds. - Weight::from_parts(3_087_000, 0) + // Minimum execution time: 2_753_000 picoseconds. + Weight::from_parts(2_850_000, 0) } } diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs similarity index 66% rename from parachains/runtimes/assets/statemint/src/xcm_config.rs rename to parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs index 82414a20a4b..11d7012e1f9 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs @@ -34,11 +34,12 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, - DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, - LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, - WeightInfoBounds, WithComputedOrigin, + DenyReserveTransferToRelayChain, DenyThenTry, DescribeFamily, DescribePalletTerminal, + EnsureXcmOrigin, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription, + IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -66,6 +67,12 @@ pub type LocationToAccountId = ( SiblingParachainConvertsVia, // Straight up local `AccountId32` origins just alias directly to `AccountId`. AccountId32Aliases, + // Foreign chain account alias into local accounts according to a hash of their standard + // description. + HashedDescription>, + // Different global consensus parachain sovereign account. + // (Used for over-bridge transfers and reserve processing) + GlobalConsensusParachainConvertsFor, ); /// Means for transacting the native currency on this chain. @@ -177,6 +184,9 @@ match_types! { pub type FellowsPlurality: impl Contains = { MultiLocation { parents: 1, interior: X2(Parachain(1001), Plurality { id: BodyId::Technical, ..}) } }; + pub type FellowshipSalaryPallet: impl Contains = { + MultiLocation { parents: 1, interior: X2(Parachain(1001), PalletInstance(64)) } + }; } /// A call filter for the XCM Transact instruction. This is a temporary measure until we properly @@ -196,6 +206,14 @@ impl Contains for SafeCallFilter { } } + // Allow to change dedicated storage items (called by governance-like) + match call { + RuntimeCall::System(frame_system::Call::set_storage { items }) + if items.iter().any(|(k, _)| k.eq(&bridging::AssetHubKusamaMaxFee::key())) => + return true, + _ => (), + }; + matches!( call, RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | @@ -343,26 +361,32 @@ impl Contains for SafeCallFilter { } } -pub type Barrier = DenyThenTry< - DenyReserveTransferToRelayChain, - ( - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - // Allow XCMs with some computed origins to pass through. - WithComputedOrigin< - ( - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies), and the Fellows plurality get free execution. - AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, FellowsPlurality)>, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), - UniversalLocation, - ConstU32<8>, - >, - ), +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + // Allow XCMs with some computed origins to pass through. + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Parent, its pluralities (i.e. governance bodies), and the Fellows plurality get free execution. + AllowExplicitUnpaidExecutionFrom<( + ParentOrParentsPlurality, + FellowsPlurality, + FellowshipSalaryPallet, + )>, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, + ), + >, >; pub type AssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier< @@ -378,10 +402,9 @@ impl xcm_executor::Config for XcmConfig { type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; - // Statemint does not recognize a reserve location for any asset. This does not prevent - // Statemint acting _as_ a reserve location for DOT and assets created under `pallet-assets`. + // Asset Hub acting _as_ a reserve location for DOT and assets created under `pallet-assets`. // For DOT, users must use teleport where allowed (e.g. with the Relay Chain). - type IsReserve = (); + type IsReserve = bridging::IsTrustedBridgedReserveLocationForConcreteAsset; // We allow: // - teleportation of DOT // - teleportation of sibling parachain's assets (as ForeignCreators) @@ -392,7 +415,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = WeightInfoBounds< - crate::weights::xcm::StatemintXcmWeight, + crate::weights::xcm::AssetHubPolkadotXcmWeight, RuntimeCall, MaxInstructions, >; @@ -420,9 +443,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = (); type MessageExporter = (); - type UniversalAliases = Nothing; + type UniversalAliases = bridging::BridgedUniversalAliases; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. @@ -431,12 +455,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { @@ -456,7 +480,7 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = WeightInfoBounds< - crate::weights::xcm::StatemintXcmWeight, + crate::weights::xcm::AssetHubPolkadotXcmWeight, RuntimeCall, MaxInstructions, >; @@ -497,3 +521,200 @@ impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { MultiLocation { parents: 1, interior: X1(Parachain(id)) } } } + +#[test] +fn foreign_pallet_has_correct_local_account() { + use sp_core::crypto::{Ss58AddressFormat, Ss58Codec}; + use xcm_executor::traits::ConvertLocation; + + const COLLECTIVES_PARAID: u32 = 1001; + const FELLOWSHIP_SALARY_PALLET_ID: u8 = 64; + let fellowship_salary = + (Parent, Parachain(COLLECTIVES_PARAID), PalletInstance(FELLOWSHIP_SALARY_PALLET_ID)); + let account = LocationToAccountId::convert_location(&fellowship_salary.into()).unwrap(); + let polkadot = Ss58AddressFormat::try_from("polkadot").unwrap(); + let address = Ss58Codec::to_ss58check_with_version(&account, polkadot); + assert_eq!(address, "13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS"); +} + +/// All configuration related to bridging +pub mod bridging { + use super::*; + use pallet_bridge_transfer_primitives::{ + AssetFilter, BridgeConfig, BridgesConfig, BridgesConfigAdapter, BridgesConfigBuilder, + MaybePaidLocation, MultiLocationFilter, ReserveLocation, + }; + use sp_std::collections::btree_set::BTreeSet; + use xcm_builder::UnpaidRemoteExporter; + + parameter_types! { + pub BridgeHubPolkadotParaId: u32 = 1002; + pub BridgeHubPolkadot: MultiLocation = MultiLocation::new(1, X1(Parachain(BridgeHubPolkadotParaId::get()))); + pub const KusamaNetwork: NetworkId = NetworkId::Kusama; + pub AssetHubKusama: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(KusamaNetwork::get()), Parachain(1000))); + // Initial value, this will be adjusted by governance motion on deployment with some more accurate value + pub storage AssetHubKusamaMaxFee: Option = Some((MultiLocation::parent(), 1_000_000).into()); + pub KsmLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(KusamaNetwork::get()))); + + // Setup bridges configuration + // (hard-coded version - on-chain configuration will come later as separate feature) + pub Bridges: BridgesConfig = BridgesConfigBuilder::default() + // add exporter for Kusama + .add_or_panic( + KusamaNetwork::get(), + BridgeConfig::new( + MaybePaidLocation { + location: BridgeHubPolkadot::get(), + // Noe fees needed because we use `UnpaidRemoteExporter` and BridgeHubPolkadot allows unpaid execution for local system parachains + maybe_fee: None, + } + ).add_target_location( + // add target location as AssetHubPolkadot + MaybePaidLocation { + location: AssetHubKusama::get(), + maybe_fee: AssetHubKusamaMaxFee::get(), + }, + Some(AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow transfer DOT + .add_equals(DotLocation::get()) + )) + ) + ) + .build(); + + // Setup trusted bridged reserve locations + pub BridgedReserves: sp_std::vec::Vec = sp_std::vec![ + // trust assets from AssetHubPolkadot + ( + AssetHubKusama::get(), + AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow receive KSM + .add_equals(KsmLocation::get()) + ) + ) + ]; + + /// Universal aliases + pub BridgedUniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter( + sp_std::vec![ + (BridgeHubPolkadot::get(), GlobalConsensus(KusamaNetwork::get())) + ] + ); + } + + impl Contains<(MultiLocation, Junction)> for BridgedUniversalAliases { + fn contains(alias: &(MultiLocation, Junction)) -> bool { + BridgedUniversalAliases::get().contains(alias) + } + } + + /// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus + pub type BridgeXcmSender = + UnpaidRemoteExporter, XcmRouter, UniversalLocation>; + + /// Reserve locations filter for `xcm_executor::Config::IsReserve`. + pub type IsTrustedBridgedReserveLocationForConcreteAsset = + pallet_bridge_transfer::features::IsTrustedBridgedReserveLocationForConcreteAsset< + UniversalLocation, + BridgedReserves, + >; +} + +#[cfg(feature = "runtime-benchmarks")] +use pallet_bridge_transfer_primitives::{MaybePaidLocation, ReachableDestination}; + +/// Benchmarks helper for over-bridge transfer pallet. +#[cfg(feature = "runtime-benchmarks")] +pub struct BridgeTransferBenchmarksHelper; +#[cfg(feature = "runtime-benchmarks")] +impl pallet_bridge_transfer::BenchmarkHelper for BridgeTransferBenchmarksHelper { + fn desired_bridged_location() -> Option<(NetworkId, ReachableDestination)> { + let bridged_network = bridging::KusamaNetwork::get(); + let target_location = bridging::AssetHubKusama::get(); + let target_location_fee = bridging::AssetHubKusamaMaxFee::get(); + let target_location_account = target_location + .clone() + .appended_with(AccountId32 { + network: Some(bridged_network), + id: AccountId::from([42u8; 32]).into(), + }) + .expect("Correct target_location_account"); + + Some(( + bridging::KusamaNetwork::get(), + ReachableDestination { + bridge: MaybePaidLocation { + location: bridging::BridgeHubPolkadot::get(), + // Right now `UnpaidRemoteExporter` is used to send XCM messages and it requires + // fee to be `None`. If we're going to change that (are we?), then we should replace + // this `None` with `Some(Self::make_asset(crate::ExistentialDeposit::get()))` + maybe_fee: None, + }, + target: MaybePaidLocation { + location: target_location, + maybe_fee: target_location_fee, + }, + target_destination: target_location_account, + }, + )) + } + + fn prepare_asset_transfer_for( + desired_bridged_location: (NetworkId, ReachableDestination), + assumed_reserve_account: MultiLocation, + ) -> Option<(RuntimeOrigin, xcm::VersionedMultiAssets, xcm::VersionedMultiLocation)> { + use frame_support::traits::Currency; + let (_, desired_bridged_location) = desired_bridged_location; + + // our `BridgeXcmSender` assumes that the HRMP channel is opened between this + // parachain and the sibling bridge-hub parachain. + // we expect local bridge-hub + let bridge_hub_para_id = match desired_bridged_location.bridge.location { + MultiLocation { parents: 1, interior: X1(Parachain(bridge_hub_para_id)) } => + bridge_hub_para_id, + _ => panic!("Cannot resolve bridge_hub_para_id"), + }; + cumulus_pallet_parachain_system::Pallet::::open_outbound_hrmp_channel_for_benchmarks( + bridge_hub_para_id.into(), + ); + + // sender account + let sender_account = AccountId::from([42u8; 32]); + // reserve account + use xcm_executor::traits::ConvertLocation; + let assumed_reserve_account = + LocationToAccountId::convert_location(&assumed_reserve_account) + .expect("Correct AccountId"); + + // deposit enough (ED) funds to the sender and reserve account + let existential_deposit = crate::ExistentialDeposit::get(); + let _ = Balances::deposit_creating(&sender_account, existential_deposit * 10); + let _ = Balances::deposit_creating(&assumed_reserve_account, existential_deposit * 10); + + // finally - prepare assets + // lets consider our worst case scenario - reserve based transfer with relay chain tokens + let asset: MultiAsset = (Concrete(DotLocation::get()), existential_deposit * 2).into(); + + let assets = xcm::VersionedMultiAssets::from(MultiAssets::from(asset)); + let destination = + xcm::VersionedMultiLocation::from(desired_bridged_location.target_destination); + + Some((RuntimeOrigin::signed(sender_account), assets, destination)) + } +} + +#[cfg(feature = "runtime-benchmarks")] +impl BridgeTransferBenchmarksHelper { + pub fn prepare_universal_alias() -> Option<(MultiLocation, Junction)> { + let alias = bridging::BridgedUniversalAliases::get().into_iter().find_map( + |(location, junction)| match bridging::BridgeHubPolkadot::get().eq(&location) { + true => Some((location, junction)), + false => None, + }, + ); + assert!(alias.is_some(), "we expect here BridgeHubPolkadot to Kusama mapping at least"); + Some(alias.unwrap()) + } +} diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs similarity index 76% rename from parachains/runtimes/assets/statemint/tests/tests.rs rename to parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs index bb4d52a1452..d67091ec0c9 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs @@ -1,3 +1,32 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests for the Statemint (Polkadot Assets Hub) chain. + +use asset_hub_polkadot_runtime::xcm_config::{ + bridging, AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount, DotLocation, + ForeignCreatorsSovereignAccountOf, LocationToAccountId, TrustBackedAssetsPalletLocation, + XcmConfig, +}; +pub use asset_hub_polkadot_runtime::{ + constants::fee::WeightToFee, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, + ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime, + RuntimeCall, RuntimeEvent, SessionKeys, System, TrustBackedAssetsInstance, XcmpQueue, +}; use asset_test_utils::{CollatorSessionKeys, ExtBuilder, RuntimeHelper}; use codec::{Decode, Encode}; use cumulus_primitives_utility::ChargeWeightInFungibles; @@ -7,21 +36,14 @@ use frame_support::{ weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{ - AccountId, AssetIdForTrustBackedAssets, Balance, StatemintAuraId as AuraId, -}; -use statemint_runtime::xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount, DotLocation, - ForeignCreatorsSovereignAccountOf, TrustBackedAssetsPalletLocation, XcmConfig, -}; -pub use statemint_runtime::{ - constants::fee::WeightToFee, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, - ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime, - RuntimeCall, RuntimeEvent, SessionKeys, System, TrustBackedAssetsInstance, + AccountId, AssetHubPolkadotAuraId as AuraId, AssetIdForTrustBackedAssets, Balance, }; +use sp_runtime::traits::MaybeEquivalence; use xcm::latest::prelude::*; -use xcm_executor::traits::{Convert, Identity, JustTry, WeightTrader}; +use xcm_executor::traits::{Identity, JustTry, WeightTrader}; const ALICE: [u8; 32] = [1u8; 32]; +const BOB: [u8; 32] = [0u8; 32]; const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32]; type AssetIdForTrustBackedAssetsConvert = @@ -67,13 +89,13 @@ fn test_asset_xcm_trader() { // get asset id as multilocation let asset_multilocation = - AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(); + AssetIdForTrustBackedAssetsConvert::convert_back(&local_asset_id).unwrap(); // Set Alice as block author, who will receive fees RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); // We are going to buy 400e9 weight - // Because of the ED being higher in statemine + // Because of the ED being higher in kusama's asset hub // and not to complicate things, we use a little // bit more of weight let bought = Weight::from_parts(400_000_000_000u64, 0); @@ -152,12 +174,12 @@ fn test_asset_xcm_trader_with_refund() { RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); // We are going to buy 400e9 weight - // Because of the ED being higher in statemine + // Because of the ED being higher in kusama's asset hub // and not to complicate things, we use a little // bit more of weight let bought = Weight::from_parts(400_000_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); // lets calculate amount needed let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -225,12 +247,12 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); // We are going to buy 50e9 weight - // Because of the ED being higher in statemine + // Because of the ED being higher in kusama's asset hub // and not to complicate things, we use a little // bit more of weight let bought = Weight::from_parts(50_000_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -281,7 +303,7 @@ fn test_that_buying_ed_refund_does_not_refund() { // We are gonna buy ED let bought = Weight::from_parts(ExistentialDeposit::get().try_into().unwrap(), 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -351,7 +373,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); // We are going to buy 400e9 weight - // Because of the ED being higher in statemine + // Because of the ED being higher in kusama's asset hub // and not to complicate things, we use a little // bit more of weight let bought = Weight::from_parts(400_000_000_000u64, 0); @@ -359,7 +381,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { // lets calculate amount needed let asset_amount_needed = WeightToFee::weight_to_fee(&bought); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let asset: MultiAsset = (asset_multilocation, asset_amount_needed).into(); @@ -474,13 +496,13 @@ fn test_assets_balances_api_works() { ))); // check trusted asset assert!(result.inner().iter().any(|asset| asset.eq(&( - AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), + AssetIdForTrustBackedAssetsConvert::convert_back(&local_asset_id).unwrap(), minimum_asset_balance ) .into()))); // check foreign asset assert!(result.inner().iter().any(|asset| asset.eq(&( - Identity::reverse_ref(foreign_asset_id_multilocation).unwrap(), + Identity::convert_back(&foreign_asset_id_multilocation).unwrap(), 6 * foreign_asset_minimum_asset_balance ) .into()))); @@ -626,3 +648,136 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p assert_eq!(ForeignAssets::asset_ids().collect::>().len(), 1); }) ); + +fn bridging_to_asset_hub_kusama() -> asset_test_utils::test_cases_over_bridge::TestBridgingConfig { + asset_test_utils::test_cases_over_bridge::TestBridgingConfig { + bridged_network: bridging::KusamaNetwork::get(), + local_bridge_hub_para_id: bridging::BridgeHubPolkadotParaId::get(), + local_bridge_hub_location: pallet_bridge_transfer_primitives::MaybePaidLocation { + location: bridging::BridgeHubPolkadot::get(), + maybe_fee: None, + }, + bridged_target_location: pallet_bridge_transfer_primitives::MaybePaidLocation { + location: bridging::AssetHubKusama::get(), + maybe_fee: bridging::AssetHubKusamaMaxFee::get(), + }, + } +} + +#[test] +fn transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works() { + asset_test_utils::test_cases_over_bridge::transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works::< + Runtime, + XcmConfig, + ParachainSystem, + XcmpQueue, + LocationToAccountId, + >( + collator_session_keys(), + ExistentialDeposit::get(), + AccountId::from(ALICE), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::BridgeTransfer(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }), + bridging_to_asset_hub_kusama + ) +} + +#[test] +fn transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works() { + asset_test_utils::test_cases_over_bridge::transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works::< + Runtime, + XcmConfig, + ParachainSystem, + XcmpQueue, + LocationToAccountId, + ForeignAssetsInstance, + >( + collator_session_keys(), + ExistentialDeposit::get(), + AccountId::from(ALICE), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::BridgeTransfer(event)) => Some(event), + _ => None, + } + }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }), + bridging_to_asset_hub_kusama + ) +} + +#[test] +fn receive_reserve_asset_deposited_from_different_consensus_over_bridge_works() { + asset_test_utils::test_cases_over_bridge::receive_reserve_asset_deposited_from_different_consensus_over_bridge_works::< + Runtime, + XcmConfig, + LocationToAccountId, + ForeignAssetsInstance, + >( + collator_session_keys(), + ExistentialDeposit::get(), + AccountId::from(BOB), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + bridging_to_asset_hub_kusama + ) +} + +#[test] +fn withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works() { + asset_test_utils::test_cases_over_bridge::withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works::< + Runtime, + XcmConfig, + LocationToAccountId, + >( + collator_session_keys(), + ExistentialDeposit::get(), + AccountId::from(BOB), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), + _ => None, + } + }), + bridging_to_asset_hub_kusama + ) +} + +#[test] +fn change_asset_hub_kusama_max_fee_by_governance_works() { + asset_test_utils::test_cases::change_storage_constant_by_governance_works::< + Runtime, + bridging::AssetHubKusamaMaxFee, + Option, + >( + collator_session_keys(), + 1000, + Box::new(|call| RuntimeCall::System(call).encode()), + || (bridging::AssetHubKusamaMaxFee::key().to_vec(), bridging::AssetHubKusamaMaxFee::get()), + |old_value| match old_value { + Some(MultiAsset { id, fun: Fungible(old_amount) }) => + Some(MultiAsset { id: *id, fun: Fungible(old_amount * 2) }), + Some(_) => None, + None => Some(MultiAsset::from((Here, 123456))), + }, + ) +} diff --git a/parachains/runtimes/assets/westmint/Cargo.toml b/parachains/runtimes/assets/asset-hub-westend/Cargo.toml similarity index 96% rename from parachains/runtimes/assets/westmint/Cargo.toml rename to parachains/runtimes/assets/asset-hub-westend/Cargo.toml index 5c9dc4a4c9f..94085acbef4 100644 --- a/parachains/runtimes/assets/westmint/Cargo.toml +++ b/parachains/runtimes/assets/asset-hub-westend/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "westmint-runtime" -version = "1.0.0" +name = "asset-hub-westend-runtime" +version = "0.9.420" authors = ["Parity Technologies "] edition = "2021" -description = "Westend variant of Statemint parachain runtime" +description = "Westend variant of Asset Hub parachain runtime" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = "0.4.1", optional = true } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" @@ -74,6 +74,7 @@ parachain-info = { path = "../../../pallets/parachain-info", default-features = parachains-common = { path = "../../../common", default-features = false } assets-common = { path = "../common", default-features = false } pallet-bridge-transfer = { path = "../../../pallets/bridge-transfer", default-features = false } +pallet-bridge-transfer-primitives = { path = "../../../pallets/bridge-transfer/primitives", default-features = false } [dev-dependencies] hex-literal = "0.4.1" @@ -194,5 +195,6 @@ std = [ "parachains-common/std", "assets-common/std", "pallet-bridge-transfer/std", + "pallet-bridge-transfer-primitives/std", "substrate-wasm-builder", ] diff --git a/parachains/runtimes/assets/westmint/build.rs b/parachains/runtimes/assets/asset-hub-westend/build.rs similarity index 100% rename from parachains/runtimes/assets/westmint/build.rs rename to parachains/runtimes/assets/asset-hub-westend/build.rs diff --git a/parachains/runtimes/assets/westmint/src/constants.rs b/parachains/runtimes/assets/asset-hub-westend/src/constants.rs similarity index 98% rename from parachains/runtimes/assets/westmint/src/constants.rs rename to parachains/runtimes/assets/asset-hub-westend/src/constants.rs index 11e6d1bf35b..e3e2dff1db9 100644 --- a/parachains/runtimes/assets/westmint/src/constants.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/constants.rs @@ -76,7 +76,7 @@ pub mod fee { type Balance = Balance; fn polynomial() -> WeightToFeeCoefficients { // in Westend, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: - // in Westmint, we map to 1/10 of that, or 1/100 CENT + // in Asset Hub, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs similarity index 96% rename from parachains/runtimes/assets/westmint/src/lib.rs rename to parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 09597cbbc47..4154fd9d54c 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -13,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Westmint Runtime +//! # Asset Hub Westend Runtime //! -//! Westmint is the testnet for Statemint. +//! Testnet for Asset Hub Polkadot. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] @@ -50,8 +50,8 @@ use frame_support::{ dispatch::DispatchClass, parameter_types, traits::{ - tokens::nonfungibles_v2::Inspect, AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, - InstanceFilter, + tokens::nonfungibles_v2::Inspect, AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, + ConstU8, InstanceFilter, }, weights::{ConstantMultiplier, Weight}, BoundedVec, PalletId, RuntimeDebug, @@ -69,8 +69,8 @@ use parachains_common::{ NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - ForeignAssetsConvertedConcreteId, TrustBackedAssetsConvertedConcreteId, WestendLocation, - XcmConfig, XcmOriginToTransactDispatchOrigin, + bridging, ForeignAssetsConvertedConcreteId, TrustBackedAssetsConvertedConcreteId, + WestendLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, }; #[cfg(any(feature = "std", test))] @@ -84,8 +84,7 @@ use xcm_builder::EnsureXcmOrigin; use xcm_executor::XcmExecutor; use crate::xcm_config::{ - AssetTransactors, BridgeXcmSender, ForeignCreatorsSovereignAccountOf, LocalOriginToLocation, - UniversalLocation, + AssetTransactors, ForeignCreatorsSovereignAccountOf, LocalOriginToLocation, UniversalLocation, }; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; @@ -97,6 +96,9 @@ impl_opaque_keys! { #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { + // Note: "westmint" is the legacy name for this chain. It has been renamed to + // "asset-hub-westend". Many wallets/tools depend on the `spec_name`, so it remains "westmint" + // for the time being. Wallets/tools should update to treat "asset-hub-westend" equally. spec_name: create_runtime_str!("westmint"), impl_name: create_runtime_str!("westmint"), authoring_version: 1, @@ -559,6 +561,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -700,15 +703,17 @@ impl pallet_bridge_transfer::Config for Runtime { type RuntimeEvent = RuntimeEvent; type UniversalLocation = UniversalLocation; type WeightInfo = weights::pallet_bridge_transfer::WeightInfo; - type AdminOrigin = AssetsForceOrigin; - type UniversalAliasesLimit = ConstU32<24>; - type ReserveLocationsLimit = ConstU32<8>; type AssetTransactor = AssetTransactors; - type BridgeXcmSender = BridgeXcmSender; - type TransferAssetOrigin = EnsureXcmOrigin; - type MaxAssetsLimit = ConstU8<1>; - type TransferPingOrigin = EnsureXcmOrigin; - type PingMessageBuilder = pallet_bridge_transfer::UnpaidTrapMessageBuilder>; + type AssetTransferKindResolver = + pallet_bridge_transfer::features::ConcreteAssetTransferKindResolver< + bridging::IsTrustedBridgedReserveLocationForConcreteAsset, + pallet_bridge_transfer::features::IsAllowedReserveBasedTransferForConcreteAssetToBridgedLocation, + >; + type AssetTransferOrigin = EnsureXcmOrigin; + type AssetsLimit = ConstU8<1>; + type BridgedDestinationValidator = + pallet_bridge_transfer_primitives::BridgesConfigAdapter; + type BridgeXcmSender = bridging::BridgeXcmSender; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = xcm_config::BridgeTransferBenchmarksHelper; } @@ -1181,13 +1186,8 @@ impl_runtime_apis! { } fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> { - match <::BenchmarkHelper as pallet_bridge_transfer::BenchmarkHelper>::universal_alias() { - Some((location, junction)) => { - >::insert_universal_alias_for_benchmarks( - (location.clone().try_into().unwrap(), junction) - ); - Ok((location.clone().try_into().unwrap(), junction)) - }, + match xcm_config::BridgeTransferBenchmarksHelper::prepare_universal_alias() { + Some(alias) => Ok(alias), None => Err(BenchmarkError::Skip) } } @@ -1215,6 +1215,10 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Err(BenchmarkError::Skip) } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/assets/westmint/src/weights/block_weights.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/block_weights.rs similarity index 100% rename from parachains/runtimes/assets/westmint/src/weights/block_weights.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/block_weights.rs diff --git a/parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs similarity index 85% rename from parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs index b19f8098775..42c744bfa78 100644 --- a/parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=cumulus_pallet_xcmp_queue @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/cumulus_pallet_xcmp_queue.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_800_000 picoseconds. - Weight::from_parts(5_998_000, 0) + // Minimum execution time: 5_542_000 picoseconds. + Weight::from_parts(5_836_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_975_000 picoseconds. - Weight::from_parts(6_136_000, 0) + // Minimum execution time: 5_574_000 picoseconds. + Weight::from_parts(5_707_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/assets/westmint/src/weights/extrinsic_weights.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/extrinsic_weights.rs similarity index 100% rename from parachains/runtimes/assets/westmint/src/weights/extrinsic_weights.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/extrinsic_weights.rs diff --git a/parachains/runtimes/assets/westmint/src/weights/frame_system.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs similarity index 96% rename from parachains/runtimes/assets/westmint/src/weights/frame_system.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs index 2515235087d..90dced86bd0 100644 --- a/parachains/runtimes/assets/westmint/src/weights/frame_system.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs @@ -20,13 +20,13 @@ //! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=frame_system @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/frame_system.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/parachains/runtimes/assets/westmint/src/weights/mod.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs similarity index 100% rename from parachains/runtimes/assets/westmint/src/weights/mod.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets.rs similarity index 99% rename from parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets.rs index 75518b3ef41..a3d1d19438b 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets.rs @@ -20,13 +20,13 @@ //! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_assets @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs similarity index 83% rename from parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs index 865d674d6ce..061d35c82a4 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_balances @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_balances.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 52_618_000 picoseconds. - Weight::from_parts(53_260_000, 0) + // Minimum execution time: 53_217_000 picoseconds. + Weight::from_parts(53_720_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 39_969_000 picoseconds. - Weight::from_parts(40_584_000, 0) + // Minimum execution time: 40_340_000 picoseconds. + Weight::from_parts(40_909_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 15_907_000 picoseconds. - Weight::from_parts(16_236_000, 0) + // Minimum execution time: 15_617_000 picoseconds. + Weight::from_parts(15_850_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 22_839_000 picoseconds. - Weight::from_parts(23_138_000, 0) + // Minimum execution time: 22_529_000 picoseconds. + Weight::from_parts(22_838_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 53_986_000 picoseconds. - Weight::from_parts(54_583_000, 0) + // Minimum execution time: 54_674_000 picoseconds. + Weight::from_parts(55_393_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 48_496_000 picoseconds. - Weight::from_parts(49_111_000, 0) + // Minimum execution time: 49_448_000 picoseconds. + Weight::from_parts(49_999_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 18_457_000 picoseconds. - Weight::from_parts(18_719_000, 0) + // Minimum execution time: 18_098_000 picoseconds. + Weight::from_parts(18_419_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 18_243_000 picoseconds. - Weight::from_parts(18_314_000, 0) + // Minimum execution time: 17_698_000 picoseconds. + Weight::from_parts(17_975_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 10_135 - .saturating_add(Weight::from_parts(13_980_773, 0).saturating_mul(u.into())) + // Standard Error: 10_679 + .saturating_add(Weight::from_parts(14_038_869, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) diff --git a/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_bridge_transfer.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_bridge_transfer.rs new file mode 100644 index 00000000000..5851ba35a6a --- /dev/null +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_bridge_transfer.rs @@ -0,0 +1,82 @@ +// Copyright 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_bridge_transfer` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 + +// Executed Command: +// target/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --pallet=pallet_bridge_transfer +// --chain=asset-hub-westend-dev +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_bridge_transfer`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_transfer::WeightInfo for WeightInfo { + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: unknown `0x36e13a2aa5713f59bab8576f408dc957` (r:1 w:0) + /// Proof Skipped: unknown `0x36e13a2aa5713f59bab8576f408dc957` (r:1 w:0) + /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) + /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) + fn transfer_asset_via_bridge() -> Weight { + // Proof Size summary in bytes: + // Measured: `554` + // Estimated: `6196` + // Minimum execution time: 157_282_000 picoseconds. + Weight::from_parts(239_207_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs similarity index 88% rename from parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs index 8b157d96d76..07466709885 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_collator_selection @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_collator_selection.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `178 + b * (78 ±0)` // Estimated: `1168 + b * (2554 ±0)` - // Minimum execution time: 14_583_000 picoseconds. - Weight::from_parts(14_662_374, 0) + // Minimum execution time: 14_772_000 picoseconds. + Weight::from_parts(14_666_129, 0) .saturating_add(Weight::from_parts(0, 1168)) - // Standard Error: 2_862 - .saturating_add(Weight::from_parts(2_576_034, 0).saturating_mul(b.into())) + // Standard Error: 3_170 + .saturating_add(Weight::from_parts(2_617_950, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_240_000 picoseconds. - Weight::from_parts(7_430_000, 0) + // Minimum execution time: 6_971_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_517_000 picoseconds. - Weight::from_parts(7_704_000, 0) + // Minimum execution time: 7_375_000 picoseconds. + Weight::from_parts(7_572_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1108 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 42_001_000 picoseconds. - Weight::from_parts(34_741_590, 0) + // Minimum execution time: 41_905_000 picoseconds. + Weight::from_parts(33_877_512, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_220 - .saturating_add(Weight::from_parts(104_452, 0).saturating_mul(c.into())) + // Standard Error: 1_303 + .saturating_add(Weight::from_parts(106_312, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `469 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 31_537_000 picoseconds. - Weight::from_parts(23_342_837, 0) + // Minimum execution time: 31_654_000 picoseconds. + Weight::from_parts(23_280_036, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_210 - .saturating_add(Weight::from_parts(104_584, 0).saturating_mul(c.into())) + // Standard Error: 1_185 + .saturating_add(Weight::from_parts(108_563, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 42_787_000 picoseconds. - Weight::from_parts(43_339_000, 0) + // Minimum execution time: 43_613_000 picoseconds. + Weight::from_parts(44_002_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22693 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2603 ±0)` - // Minimum execution time: 17_395_000 picoseconds. - Weight::from_parts(17_530_000, 0) + // Minimum execution time: 17_377_000 picoseconds. + Weight::from_parts(17_459_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 848_373 - .saturating_add(Weight::from_parts(30_252_593, 0).saturating_mul(c.into())) + // Standard Error: 846_646 + .saturating_add(Weight::from_parts(30_121_171, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs similarity index 75% rename from parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs index a98f72512a0..122567ffc13 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_multisig @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_multisig.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_856_000 picoseconds. - Weight::from_parts(12_334_994, 0) + // Minimum execution time: 11_491_000 picoseconds. + Weight::from_parts(11_915_816, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2 - .saturating_add(Weight::from_parts(506, 0).saturating_mul(z.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(540, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `262 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 41_975_000 picoseconds. - Weight::from_parts(35_772_064, 0) + // Minimum execution time: 41_691_000 picoseconds. + Weight::from_parts(36_116_749, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 481 - .saturating_add(Weight::from_parts(67_985, 0).saturating_mul(s.into())) - // Standard Error: 4 - .saturating_add(Weight::from_parts(1_213, 0).saturating_mul(z.into())) + // Standard Error: 320 + .saturating_add(Weight::from_parts(62_101, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_215, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 28_065_000 picoseconds. - Weight::from_parts(22_550_479, 0) + // Minimum execution time: 27_674_000 picoseconds. + Weight::from_parts(22_338_135, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 333 - .saturating_add(Weight::from_parts(60_600, 0).saturating_mul(s.into())) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_194, 0).saturating_mul(z.into())) + // Standard Error: 305 + .saturating_add(Weight::from_parts(58_947, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_211, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `385 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 47_059_000 picoseconds. - Weight::from_parts(39_787_186, 0) + // Minimum execution time: 46_841_000 picoseconds. + Weight::from_parts(39_485_679, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 556 - .saturating_add(Weight::from_parts(82_920, 0).saturating_mul(s.into())) - // Standard Error: 5 - .saturating_add(Weight::from_parts(1_236, 0).saturating_mul(z.into())) + // Standard Error: 423 + .saturating_add(Weight::from_parts(81_324, 0).saturating_mul(s.into())) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_248, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 31_979_000 picoseconds. - Weight::from_parts(33_915_067, 0) + // Minimum execution time: 31_821_000 picoseconds. + Weight::from_parts(33_729_506, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 567 - .saturating_add(Weight::from_parts(72_232, 0).saturating_mul(s.into())) + // Standard Error: 723 + .saturating_add(Weight::from_parts(74_421, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 19_301_000 picoseconds. - Weight::from_parts(20_450_461, 0) + // Minimum execution time: 19_216_000 picoseconds. + Weight::from_parts(20_226_622, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 407 - .saturating_add(Weight::from_parts(63_650, 0).saturating_mul(s.into())) + // Standard Error: 474 + .saturating_add(Weight::from_parts(64_787, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 32_846_000 picoseconds. - Weight::from_parts(34_842_187, 0) + // Minimum execution time: 33_035_000 picoseconds. + Weight::from_parts(34_840_029, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 637 - .saturating_add(Weight::from_parts(71_046, 0).saturating_mul(s.into())) + // Standard Error: 618 + .saturating_add(Weight::from_parts(72_456, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs new file mode 100644 index 00000000000..b895ea2ef9e --- /dev/null +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs @@ -0,0 +1,113 @@ +// Copyright 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_nft_fractionalization` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=asset-hub-westend-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_nft_fractionalization +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_nft_fractionalization`. +pub struct WeightInfo(PhantomData); +impl pallet_nft_fractionalization::WeightInfo for WeightInfo { + /// Storage: Nfts Item (r:1 w:0) + /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) + /// Storage: Balances Holds (r:1 w:1) + /// Proof: Balances Holds (max_values: None, max_size: Some(66), added: 2541, mode: MaxEncodedLen) + /// Storage: Nfts Collection (r:1 w:1) + /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:1) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:1) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + /// Storage: NftFractionalization NftToAsset (r:0 w:1) + /// Proof: NftFractionalization NftToAsset (max_values: None, max_size: Some(92), added: 2567, mode: MaxEncodedLen) + fn fractionalize() -> Weight { + // Proof Size summary in bytes: + // Measured: `462` + // Estimated: `4326` + // Minimum execution time: 167_532_000 picoseconds. + Weight::from_parts(168_850_000, 0) + .saturating_add(Weight::from_parts(0, 4326)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) + } + /// Storage: NftFractionalization NftToAsset (r:1 w:1) + /// Proof: NftFractionalization NftToAsset (max_values: None, max_size: Some(92), added: 2567, mode: MaxEncodedLen) + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:1) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) + /// Storage: Nfts Collection (r:1 w:1) + /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts CollectionConfigOf (r:1 w:0) + /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) + /// Storage: Nfts ItemConfigOf (r:1 w:0) + /// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) + /// Storage: Nfts Item (r:1 w:1) + /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) + /// Storage: Balances Holds (r:1 w:1) + /// Proof: Balances Holds (max_values: None, max_size: Some(66), added: 2541, mode: MaxEncodedLen) + /// Storage: Nfts Account (r:0 w:1) + /// Proof: Nfts Account (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + /// Storage: Nfts ItemPriceOf (r:0 w:1) + /// Proof: Nfts ItemPriceOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) + /// Storage: Nfts PendingSwapOf (r:0 w:1) + /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) + fn unify() -> Weight { + // Proof Size summary in bytes: + // Measured: `1274` + // Estimated: `4326` + // Minimum execution time: 122_877_000 picoseconds. + Weight::from_parts(124_095_000, 0) + .saturating_add(Weight::from_parts(0, 4326)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(10)) + } +} diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_nfts.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs similarity index 87% rename from parachains/runtimes/assets/statemint/src/weights/pallet_nfts.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs index 1f1f718c9c5..a0ce0c90cbb 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_nfts.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_nfts` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_nfts @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_nfts.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -62,8 +62,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3549` - // Minimum execution time: 39_589_000 picoseconds. - Weight::from_parts(40_305_000, 0) + // Minimum execution time: 38_310_000 picoseconds. + Weight::from_parts(39_252_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(5)) @@ -82,8 +82,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3549` - // Minimum execution time: 23_945_000 picoseconds. - Weight::from_parts(24_351_000, 0) + // Minimum execution time: 22_616_000 picoseconds. + Weight::from_parts(23_443_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(5)) @@ -107,15 +107,17 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// The range of component `m` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy(_m: u32, _c: u32, a: u32, ) -> Weight { + fn destroy(m: u32, _c: u32, a: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `32170 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 992_533_000 picoseconds. - Weight::from_parts(941_813_359, 0) + // Minimum execution time: 992_074_000 picoseconds. + Weight::from_parts(940_582_602, 0) .saturating_add(Weight::from_parts(0, 2523990)) - // Standard Error: 3_954 - .saturating_add(Weight::from_parts(5_784_754, 0).saturating_mul(a.into())) + // Standard Error: 3_741 + .saturating_add(Weight::from_parts(256, 0).saturating_mul(m.into())) + // Standard Error: 3_741 + .saturating_add(Weight::from_parts(5_667_401, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1004)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1005)) @@ -138,8 +140,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `421` // Estimated: `4326` - // Minimum execution time: 49_305_000 picoseconds. - Weight::from_parts(50_143_000, 0) + // Minimum execution time: 49_283_000 picoseconds. + Weight::from_parts(49_608_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -160,8 +162,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `421` // Estimated: `4326` - // Minimum execution time: 48_627_000 picoseconds. - Weight::from_parts(48_954_000, 0) + // Minimum execution time: 47_755_000 picoseconds. + Weight::from_parts(48_168_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -186,14 +188,16 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `530` // Estimated: `4326` - // Minimum execution time: 49_958_000 picoseconds. - Weight::from_parts(50_387_000, 0) + // Minimum execution time: 49_183_000 picoseconds. + Weight::from_parts(49_758_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:1 w:0) @@ -210,10 +214,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `4326` - // Minimum execution time: 36_267_000 picoseconds. - Weight::from_parts(36_712_000, 0) + // Minimum execution time: 40_454_000 picoseconds. + Weight::from_parts(40_858_000, 0) .saturating_add(Weight::from_parts(0, 4326)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: Nfts Collection (r:1 w:0) @@ -227,11 +231,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `729 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 17_738_000 picoseconds. - Weight::from_parts(17_801_000, 0) + // Minimum execution time: 16_765_000 picoseconds. + Weight::from_parts(16_884_000, 0) .saturating_add(Weight::from_parts(0, 3549)) - // Standard Error: 13_596 - .saturating_add(Weight::from_parts(15_695_790, 0).saturating_mul(i.into())) + // Standard Error: 13_552 + .saturating_add(Weight::from_parts(15_383_176, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -245,8 +249,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `401` // Estimated: `3534` - // Minimum execution time: 20_845_000 picoseconds. - Weight::from_parts(21_133_000, 0) + // Minimum execution time: 20_317_000 picoseconds. + Weight::from_parts(20_603_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -259,8 +263,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `401` // Estimated: `3534` - // Minimum execution time: 20_862_000 picoseconds. - Weight::from_parts(21_105_000, 0) + // Minimum execution time: 20_127_000 picoseconds. + Weight::from_parts(20_356_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -273,8 +277,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3549` - // Minimum execution time: 18_196_000 picoseconds. - Weight::from_parts(18_333_000, 0) + // Minimum execution time: 17_350_000 picoseconds. + Weight::from_parts(17_626_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -289,8 +293,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `354` // Estimated: `3549` - // Minimum execution time: 24_025_000 picoseconds. - Weight::from_parts(24_277_000, 0) + // Minimum execution time: 23_107_000 picoseconds. + Weight::from_parts(23_524_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -303,8 +307,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `335` // Estimated: `6078` - // Minimum execution time: 40_974_000 picoseconds. - Weight::from_parts(41_706_000, 0) + // Minimum execution time: 39_318_000 picoseconds. + Weight::from_parts(39_996_000, 0) .saturating_add(Weight::from_parts(0, 6078)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(5)) @@ -317,8 +321,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3549` - // Minimum execution time: 19_044_000 picoseconds. - Weight::from_parts(19_465_000, 0) + // Minimum execution time: 18_386_000 picoseconds. + Weight::from_parts(18_612_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) @@ -331,8 +335,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `3549` - // Minimum execution time: 15_591_000 picoseconds. - Weight::from_parts(15_858_000, 0) + // Minimum execution time: 14_945_000 picoseconds. + Weight::from_parts(15_330_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -345,8 +349,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `401` // Estimated: `3534` - // Minimum execution time: 20_831_000 picoseconds. - Weight::from_parts(21_121_000, 0) + // Minimum execution time: 20_130_000 picoseconds. + Weight::from_parts(20_506_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -365,8 +369,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3944` - // Minimum execution time: 50_650_000 picoseconds. - Weight::from_parts(51_315_000, 0) + // Minimum execution time: 50_086_000 picoseconds. + Weight::from_parts(50_663_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -379,8 +383,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `310` // Estimated: `3944` - // Minimum execution time: 28_244_000 picoseconds. - Weight::from_parts(28_627_000, 0) + // Minimum execution time: 27_703_000 picoseconds. + Weight::from_parts(27_983_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -397,8 +401,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `949` // Estimated: `3944` - // Minimum execution time: 47_299_000 picoseconds. - Weight::from_parts(47_921_000, 0) + // Minimum execution time: 46_689_000 picoseconds. + Weight::from_parts(47_446_000, 0) .saturating_add(Weight::from_parts(0, 3944)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -411,8 +415,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `4466` - // Minimum execution time: 19_400_000 picoseconds. - Weight::from_parts(19_601_000, 0) + // Minimum execution time: 18_389_000 picoseconds. + Weight::from_parts(18_666_000, 0) .saturating_add(Weight::from_parts(0, 4466)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -430,11 +434,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `726 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 28_552_000 picoseconds. - Weight::from_parts(28_822_000, 0) + // Minimum execution time: 27_274_000 picoseconds. + Weight::from_parts(27_603_000, 0) .saturating_add(Weight::from_parts(0, 4466)) - // Standard Error: 3_265 - .saturating_add(Weight::from_parts(5_570_824, 0).saturating_mul(n.into())) + // Standard Error: 3_583 + .saturating_add(Weight::from_parts(5_552_652, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -455,8 +459,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3812` - // Minimum execution time: 42_425_000 picoseconds. - Weight::from_parts(42_883_000, 0) + // Minimum execution time: 41_699_000 picoseconds. + Weight::from_parts(42_130_000, 0) .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -473,8 +477,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `815` // Estimated: `3812` - // Minimum execution time: 40_219_000 picoseconds. - Weight::from_parts(41_709_000, 0) + // Minimum execution time: 39_843_000 picoseconds. + Weight::from_parts(40_263_000, 0) .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -491,8 +495,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `364` // Estimated: `3759` - // Minimum execution time: 39_376_000 picoseconds. - Weight::from_parts(39_895_000, 0) + // Minimum execution time: 39_138_000 picoseconds. + Weight::from_parts(39_467_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -509,8 +513,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `682` // Estimated: `3759` - // Minimum execution time: 38_414_000 picoseconds. - Weight::from_parts(38_627_000, 0) + // Minimum execution time: 37_291_000 picoseconds. + Weight::from_parts(37_747_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -523,8 +527,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `376` // Estimated: `4326` - // Minimum execution time: 22_896_000 picoseconds. - Weight::from_parts(23_137_000, 0) + // Minimum execution time: 22_575_000 picoseconds. + Weight::from_parts(22_957_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -535,8 +539,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4326` - // Minimum execution time: 20_602_000 picoseconds. - Weight::from_parts(20_869_000, 0) + // Minimum execution time: 19_630_000 picoseconds. + Weight::from_parts(19_901_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -547,8 +551,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4326` - // Minimum execution time: 19_415_000 picoseconds. - Weight::from_parts(19_594_000, 0) + // Minimum execution time: 18_787_000 picoseconds. + Weight::from_parts(19_071_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -559,8 +563,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3517` - // Minimum execution time: 16_784_000 picoseconds. - Weight::from_parts(17_133_000, 0) + // Minimum execution time: 16_183_000 picoseconds. + Weight::from_parts(16_588_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -573,8 +577,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3549` - // Minimum execution time: 20_391_000 picoseconds. - Weight::from_parts(20_710_000, 0) + // Minimum execution time: 19_707_000 picoseconds. + Weight::from_parts(19_925_000, 0) .saturating_add(Weight::from_parts(0, 3549)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -587,8 +591,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `289` // Estimated: `3538` - // Minimum execution time: 19_989_000 picoseconds. - Weight::from_parts(20_179_000, 0) + // Minimum execution time: 19_159_000 picoseconds. + Weight::from_parts(19_430_000, 0) .saturating_add(Weight::from_parts(0, 3538)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -605,8 +609,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `484` // Estimated: `4326` - // Minimum execution time: 24_308_000 picoseconds. - Weight::from_parts(24_721_000, 0) + // Minimum execution time: 23_770_000 picoseconds. + Weight::from_parts(24_281_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -617,6 +621,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts ItemPriceOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:1 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:1 w:0) @@ -629,10 +635,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `671` // Estimated: `4326` - // Minimum execution time: 45_626_000 picoseconds. - Weight::from_parts(46_030_000, 0) + // Minimum execution time: 49_633_000 picoseconds. + Weight::from_parts(50_363_000, 0) .saturating_add(Weight::from_parts(0, 4326)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } /// The range of component `n` is `[0, 10]`. @@ -640,11 +646,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_654_000 picoseconds. - Weight::from_parts(4_301_940, 0) + // Minimum execution time: 2_515_000 picoseconds. + Weight::from_parts(4_116_276, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9_223 - .saturating_add(Weight::from_parts(3_945_966, 0).saturating_mul(n.into())) + // Standard Error: 9_140 + .saturating_add(Weight::from_parts(3_634_187, 0).saturating_mul(n.into())) } /// Storage: Nfts Item (r:2 w:0) /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) @@ -654,8 +660,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `460` // Estimated: `7662` - // Minimum execution time: 23_071_000 picoseconds. - Weight::from_parts(23_535_000, 0) + // Minimum execution time: 22_105_000 picoseconds. + Weight::from_parts(22_488_000, 0) .saturating_add(Weight::from_parts(0, 7662)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -668,8 +674,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `479` // Estimated: `4326` - // Minimum execution time: 21_554_000 picoseconds. - Weight::from_parts(21_941_000, 0) + // Minimum execution time: 20_850_000 picoseconds. + Weight::from_parts(21_320_000, 0) .saturating_add(Weight::from_parts(0, 4326)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -680,6 +686,8 @@ impl pallet_nfts::WeightInfo for WeightInfo { /// Proof: Nfts PendingSwapOf (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: Nfts Collection (r:1 w:0) /// Proof: Nfts Collection (max_values: None, max_size: Some(84), added: 2559, mode: MaxEncodedLen) + /// Storage: Nfts Attribute (r:2 w:0) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(479), added: 2954, mode: MaxEncodedLen) /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) /// Storage: Nfts ItemConfigOf (r:2 w:0) @@ -692,10 +700,10 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `800` // Estimated: `7662` - // Minimum execution time: 74_272_000 picoseconds. - Weight::from_parts(75_374_000, 0) + // Minimum execution time: 82_411_000 picoseconds. + Weight::from_parts(82_891_000, 0) .saturating_add(Weight::from_parts(0, 7662)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(10)) } /// Storage: Nfts CollectionRoleOf (r:2 w:0) @@ -721,11 +729,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `524` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 133_545_000 picoseconds. - Weight::from_parts(137_797_962, 0) + // Minimum execution time: 131_511_000 picoseconds. + Weight::from_parts(136_312_961, 0) .saturating_add(Weight::from_parts(0, 6078)) - // Standard Error: 33_124 - .saturating_add(Weight::from_parts(29_785_862, 0).saturating_mul(n.into())) + // Standard Error: 23_681 + .saturating_add(Weight::from_parts(29_674_702, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -749,11 +757,11 @@ impl pallet_nfts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `554` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 77_475_000 picoseconds. - Weight::from_parts(88_353_947, 0) + // Minimum execution time: 76_717_000 picoseconds. + Weight::from_parts(88_114_044, 0) .saturating_add(Weight::from_parts(0, 4466)) - // Standard Error: 60_491 - .saturating_add(Weight::from_parts(29_507_037, 0).saturating_mul(n.into())) + // Standard Error: 61_294 + .saturating_add(Weight::from_parts(29_187_148, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs similarity index 76% rename from parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs index d6b2795b062..8684ad9e721 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_proxy @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_proxy.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,11 +55,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 16_736_000 picoseconds. - Weight::from_parts(17_180_115, 0) + // Minimum execution time: 16_666_000 picoseconds. + Weight::from_parts(17_158_137, 0) .saturating_add(Weight::from_parts(0, 4706)) // Standard Error: 616 - .saturating_add(Weight::from_parts(29_847, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(38_554, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: Proxy Proxies (r:1 w:0) @@ -74,13 +74,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 38_677_000 picoseconds. - Weight::from_parts(38_332_966, 0) + // Minimum execution time: 38_208_000 picoseconds. + Weight::from_parts(37_783_373, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_354 - .saturating_add(Weight::from_parts(134_195, 0).saturating_mul(a.into())) - // Standard Error: 1_399 - .saturating_add(Weight::from_parts(37_946, 0).saturating_mul(p.into())) + // Standard Error: 1_206 + .saturating_add(Weight::from_parts(137_436, 0).saturating_mul(a.into())) + // Standard Error: 1_246 + .saturating_add(Weight::from_parts(40_721, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -94,13 +94,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_593_000 picoseconds. - Weight::from_parts(26_236_639, 0) + // Minimum execution time: 25_208_000 picoseconds. + Weight::from_parts(25_736_136, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_160 - .saturating_add(Weight::from_parts(129_362, 0).saturating_mul(a.into())) - // Standard Error: 1_199 - .saturating_add(Weight::from_parts(8_687, 0).saturating_mul(p.into())) + // Standard Error: 1_082 + .saturating_add(Weight::from_parts(126_566, 0).saturating_mul(a.into())) + // Standard Error: 1_118 + .saturating_add(Weight::from_parts(9_935, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -114,13 +114,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_596_000 picoseconds. - Weight::from_parts(25_854_867, 0) + // Minimum execution time: 25_179_000 picoseconds. + Weight::from_parts(25_577_519, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_372 - .saturating_add(Weight::from_parts(137_697, 0).saturating_mul(a.into())) - // Standard Error: 1_417 - .saturating_add(Weight::from_parts(14_082, 0).saturating_mul(p.into())) + // Standard Error: 1_015 + .saturating_add(Weight::from_parts(130_058, 0).saturating_mul(a.into())) + // Standard Error: 1_049 + .saturating_add(Weight::from_parts(11_423, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -136,13 +136,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `386 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 35_255_000 picoseconds. - Weight::from_parts(34_659_291, 0) + // Minimum execution time: 34_716_000 picoseconds. + Weight::from_parts(34_190_071, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_072 - .saturating_add(Weight::from_parts(126_577, 0).saturating_mul(a.into())) + // Standard Error: 1_071 + .saturating_add(Weight::from_parts(133_665, 0).saturating_mul(a.into())) // Standard Error: 1_107 - .saturating_add(Weight::from_parts(41_124, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(37_129, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -153,11 +153,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 26_245_000 picoseconds. - Weight::from_parts(26_910_616, 0) + // Minimum execution time: 25_686_000 picoseconds. + Weight::from_parts(26_496_799, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_107 - .saturating_add(Weight::from_parts(54_705, 0).saturating_mul(p.into())) + // Standard Error: 944 + .saturating_add(Weight::from_parts(53_906, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -168,11 +168,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 26_080_000 picoseconds. - Weight::from_parts(27_081_618, 0) + // Minimum execution time: 25_575_000 picoseconds. + Weight::from_parts(26_760_153, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_644 - .saturating_add(Weight::from_parts(53_919, 0).saturating_mul(p.into())) + // Standard Error: 1_536 + .saturating_add(Weight::from_parts(53_629, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -183,11 +183,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 23_191_000 picoseconds. - Weight::from_parts(23_827_934, 0) + // Minimum execution time: 23_079_000 picoseconds. + Weight::from_parts(23_711_353, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_078 - .saturating_add(Weight::from_parts(28_417, 0).saturating_mul(p.into())) + // Standard Error: 927 + .saturating_add(Weight::from_parts(27_783, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -198,11 +198,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4706` - // Minimum execution time: 27_895_000 picoseconds. - Weight::from_parts(28_599_042, 0) + // Minimum execution time: 27_453_000 picoseconds. + Weight::from_parts(28_332_832, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 953 - .saturating_add(Weight::from_parts(12_641, 0).saturating_mul(p.into())) + // Standard Error: 848 + .saturating_add(Weight::from_parts(12_522, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -213,11 +213,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 24_395_000 picoseconds. - Weight::from_parts(24_924_060, 0) + // Minimum execution time: 23_827_000 picoseconds. + Weight::from_parts(24_677_827, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 720 - .saturating_add(Weight::from_parts(27_470, 0).saturating_mul(p.into())) + // Standard Error: 832 + .saturating_add(Weight::from_parts(26_514, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_session.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs similarity index 86% rename from parachains/runtimes/assets/statemine/src/weights/pallet_session.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs index f0f02ace1eb..974ff8a7ea7 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_session.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_session @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_session.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `270` // Estimated: `3735` - // Minimum execution time: 17_623_000 picoseconds. - Weight::from_parts(17_946_000, 0) + // Minimum execution time: 17_139_000 picoseconds. + Weight::from_parts(17_476_000, 0) .saturating_add(Weight::from_parts(0, 3735)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `3707` - // Minimum execution time: 13_059_000 picoseconds. - Weight::from_parts(13_341_000, 0) + // Minimum execution time: 13_274_000 picoseconds. + Weight::from_parts(13_523_000, 0) .saturating_add(Weight::from_parts(0, 3707)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs similarity index 85% rename from parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs index c1a9be38dbd..b75a01bd596 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_timestamp @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_timestamp.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `86` // Estimated: `1493` - // Minimum execution time: 9_150_000 picoseconds. - Weight::from_parts(9_474_000, 0) + // Minimum execution time: 9_238_000 picoseconds. + Weight::from_parts(9_402_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 3_210_000 picoseconds. - Weight::from_parts(3_330_000, 0) + // Minimum execution time: 3_257_000 picoseconds. + Weight::from_parts(3_355_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs similarity index 86% rename from parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs index fe9d2d1399e..af83bfd80d7 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_uniques` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_uniques @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_uniques.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +56,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3643` - // Minimum execution time: 30_269_000 picoseconds. - Weight::from_parts(30_661_000, 0) + // Minimum execution time: 30_515_000 picoseconds. + Weight::from_parts(31_278_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3643` - // Minimum execution time: 14_801_000 picoseconds. - Weight::from_parts(15_041_000, 0) + // Minimum execution time: 15_330_000 picoseconds. + Weight::from_parts(15_594_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -99,15 +99,15 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `257 + a * (107 ±0) + m * (56 ±0) + n * (76 ±0)` // Estimated: `3643 + a * (2647 ±0) + m * (2662 ±0) + n * (2597 ±0)` - // Minimum execution time: 2_439_268_000 picoseconds. - Weight::from_parts(2_450_670_000, 0) + // Minimum execution time: 2_526_402_000 picoseconds. + Weight::from_parts(2_544_290_000, 0) .saturating_add(Weight::from_parts(0, 3643)) - // Standard Error: 24_972 - .saturating_add(Weight::from_parts(6_281_799, 0).saturating_mul(n.into())) - // Standard Error: 24_972 - .saturating_add(Weight::from_parts(245_622, 0).saturating_mul(m.into())) - // Standard Error: 24_972 - .saturating_add(Weight::from_parts(345_135, 0).saturating_mul(a.into())) + // Standard Error: 25_802 + .saturating_add(Weight::from_parts(6_307_284, 0).saturating_mul(n.into())) + // Standard Error: 25_802 + .saturating_add(Weight::from_parts(273_658, 0).saturating_mul(m.into())) + // Standard Error: 25_802 + .saturating_add(Weight::from_parts(340_604, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into()))) @@ -132,8 +132,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 36_449_000 picoseconds. - Weight::from_parts(36_816_000, 0) + // Minimum execution time: 35_998_000 picoseconds. + Weight::from_parts(36_435_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -150,8 +150,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 37_704_000 picoseconds. - Weight::from_parts(38_102_000, 0) + // Minimum execution time: 37_271_000 picoseconds. + Weight::from_parts(37_693_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -168,8 +168,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 26_986_000 picoseconds. - Weight::from_parts(27_427_000, 0) + // Minimum execution time: 26_992_000 picoseconds. + Weight::from_parts(27_281_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -183,11 +183,11 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `738 + i * (76 ±0)` // Estimated: `3643 + i * (2597 ±0)` - // Minimum execution time: 15_664_000 picoseconds. - Weight::from_parts(15_788_000, 0) + // Minimum execution time: 15_478_000 picoseconds. + Weight::from_parts(15_798_000, 0) .saturating_add(Weight::from_parts(0, 3643)) - // Standard Error: 12_408 - .saturating_add(Weight::from_parts(15_388_354, 0).saturating_mul(i.into())) + // Standard Error: 12_942 + .saturating_add(Weight::from_parts(15_284_761, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -202,8 +202,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 19_399_000 picoseconds. - Weight::from_parts(19_658_000, 0) + // Minimum execution time: 19_046_000 picoseconds. + Weight::from_parts(19_341_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -216,8 +216,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 19_300_000 picoseconds. - Weight::from_parts(19_511_000, 0) + // Minimum execution time: 19_005_000 picoseconds. + Weight::from_parts(19_192_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -228,8 +228,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 14_407_000 picoseconds. - Weight::from_parts(14_748_000, 0) + // Minimum execution time: 14_558_000 picoseconds. + Weight::from_parts(14_813_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -240,8 +240,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 14_376_000 picoseconds. - Weight::from_parts(14_785_000, 0) + // Minimum execution time: 14_384_000 picoseconds. + Weight::from_parts(14_805_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -256,8 +256,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `356` // Estimated: `3643` - // Minimum execution time: 22_832_000 picoseconds. - Weight::from_parts(23_065_000, 0) + // Minimum execution time: 22_520_000 picoseconds. + Weight::from_parts(22_963_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -268,8 +268,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 15_379_000 picoseconds. - Weight::from_parts(15_798_000, 0) + // Minimum execution time: 15_163_000 picoseconds. + Weight::from_parts(15_578_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -282,8 +282,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 17_345_000 picoseconds. - Weight::from_parts(17_747_000, 0) + // Minimum execution time: 17_315_000 picoseconds. + Weight::from_parts(17_642_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -298,8 +298,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `3652` - // Minimum execution time: 40_047_000 picoseconds. - Weight::from_parts(40_494_000, 0) + // Minimum execution time: 40_657_000 picoseconds. + Weight::from_parts(41_034_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -314,8 +314,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `756` // Estimated: `3652` - // Minimum execution time: 39_254_000 picoseconds. - Weight::from_parts(39_689_000, 0) + // Minimum execution time: 38_680_000 picoseconds. + Weight::from_parts(39_441_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -328,8 +328,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3652` - // Minimum execution time: 31_189_000 picoseconds. - Weight::from_parts(31_431_000, 0) + // Minimum execution time: 31_491_000 picoseconds. + Weight::from_parts(32_036_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -342,8 +342,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `559` // Estimated: `3652` - // Minimum execution time: 31_868_000 picoseconds. - Weight::from_parts(32_476_000, 0) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(32_360_000, 0) .saturating_add(Weight::from_parts(0, 3652)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -356,8 +356,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 32_587_000 picoseconds. - Weight::from_parts(32_913_000, 0) + // Minimum execution time: 32_255_000 picoseconds. + Weight::from_parts(32_755_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -370,8 +370,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3643` - // Minimum execution time: 30_951_000 picoseconds. - Weight::from_parts(31_269_000, 0) + // Minimum execution time: 30_564_000 picoseconds. + Weight::from_parts(30_891_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -384,8 +384,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3643` - // Minimum execution time: 20_550_000 picoseconds. - Weight::from_parts(20_880_000, 0) + // Minimum execution time: 20_366_000 picoseconds. + Weight::from_parts(20_801_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -398,8 +398,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `461` // Estimated: `3643` - // Minimum execution time: 20_593_000 picoseconds. - Weight::from_parts(20_816_000, 0) + // Minimum execution time: 20_186_000 picoseconds. + Weight::from_parts(20_559_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -410,8 +410,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3517` - // Minimum execution time: 16_290_000 picoseconds. - Weight::from_parts(16_841_000, 0) + // Minimum execution time: 16_362_000 picoseconds. + Weight::from_parts(16_847_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -424,8 +424,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3643` - // Minimum execution time: 17_538_000 picoseconds. - Weight::from_parts(17_775_000, 0) + // Minimum execution time: 17_174_000 picoseconds. + Weight::from_parts(17_660_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -438,8 +438,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `259` // Estimated: `3587` - // Minimum execution time: 17_311_000 picoseconds. - Weight::from_parts(17_495_000, 0) + // Minimum execution time: 16_902_000 picoseconds. + Weight::from_parts(17_128_000, 0) .saturating_add(Weight::from_parts(0, 3587)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -456,8 +456,8 @@ impl pallet_uniques::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `540` // Estimated: `3643` - // Minimum execution time: 37_556_000 picoseconds. - Weight::from_parts(38_050_000, 0) + // Minimum execution time: 37_646_000 picoseconds. + Weight::from_parts(38_137_000, 0) .saturating_add(Weight::from_parts(0, 3643)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs similarity index 73% rename from parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs index 585bb7d7807..8ad72fdbe63 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=statemint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_utility @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/pallet_utility.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_223_000 picoseconds. - Weight::from_parts(9_533_894, 0) + // Minimum execution time: 7_055_000 picoseconds. + Weight::from_parts(8_255_115, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_912 - .saturating_add(Weight::from_parts(4_539_292, 0).saturating_mul(c.into())) + // Standard Error: 2_747 + .saturating_add(Weight::from_parts(5_854_057, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_345_000 picoseconds. - Weight::from_parts(5_436_000, 0) + // Minimum execution time: 5_786_000 picoseconds. + Weight::from_parts(5_957_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_096_000 picoseconds. - Weight::from_parts(10_872_600, 0) + // Minimum execution time: 7_240_000 picoseconds. + Weight::from_parts(4_766_480, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_654 - .saturating_add(Weight::from_parts(4_834_319, 0).saturating_mul(c.into())) + // Standard Error: 3_095 + .saturating_add(Weight::from_parts(6_006_569, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_519_000 picoseconds. - Weight::from_parts(9_776_000, 0) + // Minimum execution time: 9_657_000 picoseconds. + Weight::from_parts(9_876_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_149_000 picoseconds. - Weight::from_parts(17_125_597, 0) + // Minimum execution time: 7_207_000 picoseconds. + Weight::from_parts(7_858_719, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_120 - .saturating_add(Weight::from_parts(4_553_744, 0).saturating_mul(c.into())) + // Standard Error: 3_234 + .saturating_add(Weight::from_parts(5_844_542, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs similarity index 88% rename from parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs index aa43df9de84..f1acce89ed2 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs @@ -17,16 +17,16 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_xcm @@ -35,7 +35,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -62,8 +62,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 30_683_000 picoseconds. - Weight::from_parts(31_228_000, 0) + // Minimum execution time: 27_828_000 picoseconds. + Weight::from_parts(28_310_000, 0) .saturating_add(Weight::from_parts(0, 3540)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1489` - // Minimum execution time: 29_299_000 picoseconds. - Weight::from_parts(29_857_000, 0) + // Minimum execution time: 24_586_000 picoseconds. + Weight::from_parts(25_199_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -85,8 +85,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1489` - // Minimum execution time: 22_639_000 picoseconds. - Weight::from_parts(23_057_000, 0) + // Minimum execution time: 18_948_000 picoseconds. + Weight::from_parts(19_444_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -104,8 +104,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_678_000 picoseconds. - Weight::from_parts(12_002_000, 0) + // Minimum execution time: 10_214_000 picoseconds. + Weight::from_parts(10_359_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -115,8 +115,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_702_000 picoseconds. - Weight::from_parts(3_927_000, 0) + // Minimum execution time: 3_159_000 picoseconds. + Weight::from_parts(3_401_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -140,8 +140,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3540` - // Minimum execution time: 37_617_000 picoseconds. - Weight::from_parts(38_443_000, 0) + // Minimum execution time: 33_325_000 picoseconds. + Weight::from_parts(34_039_000, 0) .saturating_add(Weight::from_parts(0, 3540)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -164,8 +164,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `257` // Estimated: `3722` - // Minimum execution time: 39_333_000 picoseconds. - Weight::from_parts(40_174_000, 0) + // Minimum execution time: 34_466_000 picoseconds. + Weight::from_parts(35_152_000, 0) .saturating_add(Weight::from_parts(0, 3722)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -176,8 +176,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_857_000 picoseconds. - Weight::from_parts(4_158_000, 0) + // Minimum execution time: 3_264_000 picoseconds. + Weight::from_parts(3_401_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -187,8 +187,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `129` // Estimated: `11019` - // Minimum execution time: 17_929_000 picoseconds. - Weight::from_parts(18_175_000, 0) + // Minimum execution time: 17_297_000 picoseconds. + Weight::from_parts(17_629_000, 0) .saturating_add(Weight::from_parts(0, 11019)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -199,8 +199,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `133` // Estimated: `11023` - // Minimum execution time: 17_241_000 picoseconds. - Weight::from_parts(17_618_000, 0) + // Minimum execution time: 16_621_000 picoseconds. + Weight::from_parts(17_120_000, 0) .saturating_add(Weight::from_parts(0, 11023)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -211,8 +211,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `13505` - // Minimum execution time: 18_013_000 picoseconds. - Weight::from_parts(18_485_000, 0) + // Minimum execution time: 17_529_000 picoseconds. + Weight::from_parts(18_034_000, 0) .saturating_add(Weight::from_parts(0, 13505)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -232,8 +232,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `142` // Estimated: `6082` - // Minimum execution time: 30_736_000 picoseconds. - Weight::from_parts(31_215_000, 0) + // Minimum execution time: 30_737_000 picoseconds. + Weight::from_parts(31_591_000, 0) .saturating_add(Weight::from_parts(0, 6082)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -244,8 +244,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `172` // Estimated: `8587` - // Minimum execution time: 9_005_000 picoseconds. - Weight::from_parts(9_289_000, 0) + // Minimum execution time: 8_892_000 picoseconds. + Weight::from_parts(9_269_000, 0) .saturating_add(Weight::from_parts(0, 8587)) .saturating_add(T::DbWeight::get().reads(3)) } @@ -255,8 +255,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `11030` - // Minimum execution time: 17_506_000 picoseconds. - Weight::from_parts(17_811_000, 0) + // Minimum execution time: 17_017_000 picoseconds. + Weight::from_parts(17_452_000, 0) .saturating_add(Weight::from_parts(0, 11030)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -277,8 +277,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `146` // Estimated: `11036` - // Minimum execution time: 37_343_000 picoseconds. - Weight::from_parts(37_774_000, 0) + // Minimum execution time: 36_407_000 picoseconds. + Weight::from_parts(37_027_000, 0) .saturating_add(Weight::from_parts(0, 11036)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/assets/westmint/src/weights/paritydb_weights.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/paritydb_weights.rs similarity index 100% rename from parachains/runtimes/assets/westmint/src/weights/paritydb_weights.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/paritydb_weights.rs diff --git a/parachains/runtimes/assets/westmint/src/weights/rocksdb_weights.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/rocksdb_weights.rs similarity index 100% rename from parachains/runtimes/assets/westmint/src/weights/rocksdb_weights.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/rocksdb_weights.rs diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs similarity index 98% rename from parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs index c35e421cc24..aebbf68cf3c 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs @@ -56,8 +56,8 @@ impl WeighMultiAssets for MultiAssets { } } -pub struct StatemineXcmWeight(core::marker::PhantomData); -impl XcmWeightInfo for StatemineXcmWeight { +pub struct AssetHubWestendXcmWeight(core::marker::PhantomData); +impl XcmWeightInfo for AssetHubWestendXcmWeight { fn withdraw_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) } diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs similarity index 87% rename from parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index d80e9ec335c..19ac1f044b1 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,17 +17,17 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // ./artifacts/polkadot-parachain // benchmark // pallet // --template=./templates/xcm-bench-template.hbs -// --chain=statemint-dev +// --chain=asset-hub-westend-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_xcm_benchmarks::fungible @@ -36,7 +36,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemint/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -54,8 +54,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 25_798_000 picoseconds. - Weight::from_parts(26_063_000, 3593) + // Minimum execution time: 25_496_000 picoseconds. + Weight::from_parts(25_876_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 48_637_000 picoseconds. - Weight::from_parts(49_176_000, 6196) + // Minimum execution time: 49_292_000 picoseconds. + Weight::from_parts(50_180_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -86,10 +86,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `210` // Estimated: `6196` - // Minimum execution time: 69_969_000 picoseconds. - Weight::from_parts(70_663_000, 6196) + // Minimum execution time: 71_420_000 picoseconds. + Weight::from_parts(72_513_000, 6196) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -97,8 +97,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_909_000 picoseconds. - Weight::from_parts(4_060_000, 0) + // Minimum execution time: 3_711_000 picoseconds. + Weight::from_parts(3_818_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -106,8 +106,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 26_306_000 picoseconds. - Weight::from_parts(26_822_000, 3593) + // Minimum execution time: 26_293_000 picoseconds. + Weight::from_parts(26_737_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -127,10 +127,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `38` + // Measured: `109` // Estimated: `3593` - // Minimum execution time: 48_829_000 picoseconds. - Weight::from_parts(49_277_000, 3593) + // Minimum execution time: 50_188_000 picoseconds. + Weight::from_parts(50_712_000, 3593) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -148,10 +148,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 28_753_000 picoseconds. - Weight::from_parts(29_256_000, 3503) + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 29_852_000 picoseconds. + Weight::from_parts(30_308_000, 3574) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs similarity index 80% rename from parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs rename to parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 2d4ce9ab570..5c79d3b2a5a 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,10 +17,10 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024 // Executed Command: // target/production/polkadot-parachain @@ -34,10 +34,10 @@ // --heap-pages=4096 // --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_xcm_benchmarks::generic -// --chain=westmint-dev +// --chain=asset-hub-westend-dev // --header=./file_header.txt // --template=./templates/xcm-bench-template.hbs -// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/ +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -67,8 +67,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 346_394_000 picoseconds. - Weight::from_parts(350_270_000, 3574) + // Minimum execution time: 343_461_000 picoseconds. + Weight::from_parts(348_335_000, 3574) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -76,8 +76,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_961_000 picoseconds. - Weight::from_parts(4_107_000, 0) + // Minimum execution time: 3_681_000 picoseconds. + Weight::from_parts(3_879_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) @@ -85,58 +85,58 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3568` - // Minimum execution time: 10_701_000 picoseconds. - Weight::from_parts(11_032_000, 3568) + // Minimum execution time: 10_554_000 picoseconds. + Weight::from_parts(10_845_000, 3568) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_944_000 picoseconds. - Weight::from_parts(13_289_000, 0) + // Minimum execution time: 13_168_000 picoseconds. + Weight::from_parts(13_581_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_222_000 picoseconds. - Weight::from_parts(4_366_000, 0) + // Minimum execution time: 4_046_000 picoseconds. + Weight::from_parts(4_283_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_625_000 picoseconds. - Weight::from_parts(2_734_000, 0) + // Minimum execution time: 2_552_000 picoseconds. + Weight::from_parts(2_630_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_704_000 picoseconds. - Weight::from_parts(2_759_000, 0) + // Minimum execution time: 2_557_000 picoseconds. + Weight::from_parts(2_714_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_608_000 picoseconds. - Weight::from_parts(2_668_000, 0) + // Minimum execution time: 2_509_000 picoseconds. + Weight::from_parts(2_583_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_518_000 picoseconds. - Weight::from_parts(3_612_000, 0) + // Minimum execution time: 3_429_000 picoseconds. + Weight::from_parts(3_609_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_607_000 picoseconds. - Weight::from_parts(2_661_000, 0) + // Minimum execution time: 2_524_000 picoseconds. + Weight::from_parts(2_602_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -156,8 +156,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 27_012_000 picoseconds. - Weight::from_parts(27_677_000, 3574) + // Minimum execution time: 27_356_000 picoseconds. + Weight::from_parts(27_839_000, 3574) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -167,8 +167,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `160` // Estimated: `3625` - // Minimum execution time: 15_768_000 picoseconds. - Weight::from_parts(16_080_000, 3625) + // Minimum execution time: 15_675_000 picoseconds. + Weight::from_parts(15_995_000, 3625) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,8 +176,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_575_000 picoseconds. - Weight::from_parts(2_675_000, 0) + // Minimum execution time: 2_542_000 picoseconds. + Weight::from_parts(2_594_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -197,8 +197,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 30_215_000 picoseconds. - Weight::from_parts(30_714_000, 3574) + // Minimum execution time: 30_302_000 picoseconds. + Weight::from_parts(30_830_000, 3574) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -208,8 +208,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_803_000 picoseconds. - Weight::from_parts(4_927_000, 0) + // Minimum execution time: 4_720_000 picoseconds. + Weight::from_parts(4_891_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -230,8 +230,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 387_266_000 picoseconds. - Weight::from_parts(391_770_000, 3574) + // Minimum execution time: 383_395_000 picoseconds. + Weight::from_parts(392_319_000, 3574) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -239,36 +239,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 118_603_000 picoseconds. - Weight::from_parts(120_201_000, 0) + // Minimum execution time: 120_259_000 picoseconds. + Weight::from_parts(120_965_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_815_000 picoseconds. - Weight::from_parts(12_240_000, 0) + // Minimum execution time: 11_649_000 picoseconds. + Weight::from_parts(11_897_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_671_000 picoseconds. - Weight::from_parts(2_776_000, 0) + // Minimum execution time: 2_629_000 picoseconds. + Weight::from_parts(2_752_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_624_000 picoseconds. - Weight::from_parts(2_709_000, 0) + // Minimum execution time: 2_487_000 picoseconds. + Weight::from_parts(2_570_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_816_000 picoseconds. - Weight::from_parts(2_898_000, 0) + // Minimum execution time: 2_662_000 picoseconds. + Weight::from_parts(2_760_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -288,8 +288,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 31_286_000 picoseconds. - Weight::from_parts(31_716_000, 3574) + // Minimum execution time: 31_294_000 picoseconds. + Weight::from_parts(31_914_000, 3574) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -297,8 +297,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_208_000 picoseconds. - Weight::from_parts(5_321_000, 0) + // Minimum execution time: 5_224_000 picoseconds. + Weight::from_parts(5_385_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -318,8 +318,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 27_724_000 picoseconds. - Weight::from_parts(28_739_000, 3574) + // Minimum execution time: 27_691_000 picoseconds. + Weight::from_parts(28_186_000, 3574) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -327,47 +327,45 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_711_000 picoseconds. - Weight::from_parts(2_788_000, 0) + // Minimum execution time: 2_508_000 picoseconds. + Weight::from_parts(2_651_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_660_000 picoseconds. - Weight::from_parts(2_757_000, 0) + // Minimum execution time: 2_557_000 picoseconds. + Weight::from_parts(2_618_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_698_000 picoseconds. - Weight::from_parts(2_804_000, 0) + // Minimum execution time: 2_481_000 picoseconds. + Weight::from_parts(2_552_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: BridgeTransfer AllowedUniversalAliases (r:1 w:0) - // Proof: BridgeTransfer AllowedUniversalAliases (max_values: None, max_size: Some(2419), added: 4894, mode: MaxEncodedLen) pub fn universal_origin() -> Weight { // Proof Size summary in bytes: - // Measured: `158` - // Estimated: `5884` - // Minimum execution time: 9_692_000 picoseconds. - Weight::from_parts(9_998_000, 5884) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `0` + // Estimated: `1489` + // Minimum execution time: 4_831_000 picoseconds. + Weight::from_parts(4_997_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_566_000 picoseconds. - Weight::from_parts(2_668_000, 0) + // Minimum execution time: 2_545_000 picoseconds. + Weight::from_parts(2_662_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_754_000 picoseconds. - Weight::from_parts(2_847_000, 0) + // Minimum execution time: 2_724_000 picoseconds. + Weight::from_parts(2_863_000, 0) } } diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs similarity index 74% rename from parachains/runtimes/assets/westmint/src/xcm_config.rs rename to parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs index ad195251f67..bb6515c1ff6 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs @@ -14,20 +14,18 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, BridgeTransfer, - ForeignAssets, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ForeignAssets, + ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; use assets_common::matching::{ - FromSiblingParachain, IsDifferentGlobalConsensusConcreteAsset, IsForeignConcreteAsset, - StartsWith, StartsWithExplicitGlobalConsensus, + FromSiblingParachain, IsForeignConcreteAsset, StartsWith, StartsWithExplicitGlobalConsensus, }; use frame_support::{ match_types, parameter_types, - traits::{ConstU32, Contains, Everything, PalletInfoAccess}, + traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess}, }; use frame_system::EnsureRoot; -use pallet_bridge_transfer::impls::{AllowedUniversalAliasesOf, IsAllowedReserveOf}; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; use polkadot_parachain::primitives::Sibling; @@ -40,8 +38,8 @@ use xcm_builder::{ GlobalConsensusParachainConvertsFor, IsConcrete, LocalMint, NativeAsset, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UnpaidRemoteExporter, - UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, + SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, + WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -193,6 +191,14 @@ impl Contains for SafeCallFilter { } } + // Allow to change dedicated storage items (called by governance-like) + match call { + RuntimeCall::System(frame_system::Call::set_storage { items }) + if items.iter().any(|(k, _)| k.eq(&bridging::AssetHubKusamaLocalMaxFee::key())) => + return true, + _ => (), + }; + matches!( call, RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | @@ -340,7 +346,7 @@ impl Contains for SafeCallFilter { pallet_uniques::Call::set_collection_max_supply { .. } | pallet_uniques::Call::set_price { .. } | pallet_uniques::Call::buy_item { .. }, - ) | RuntimeCall::BridgeTransfer(..) + ) ) } } @@ -382,12 +388,9 @@ impl xcm_executor::Config for XcmConfig { type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; - // Westmint is acting _as_ a reserve location for WND and assets created under `pallet-assets`. + // Asset Hub acting _as_ a reserve location for WND and assets created under `pallet-assets`. // For WND, users must use teleport where allowed (e.g. with the Relay Chain). - type IsReserve = IsAllowedReserveOf< - Runtime, - IsDifferentGlobalConsensusConcreteAsset, - >; + type IsReserve = bridging::IsTrustedBridgedReserveLocationForConcreteAsset; // We allow: // - teleportation of WND // - teleportation of sibling parachain's assets (as ForeignCreators) @@ -398,7 +401,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = WeightInfoBounds< - crate::weights::xcm::WestmintXcmWeight, + crate::weights::xcm::AssetHubWestendXcmWeight, RuntimeCall, MaxInstructions, >; @@ -426,9 +429,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = (); type MessageExporter = (); - type UniversalAliases = AllowedUniversalAliasesOf; + type UniversalAliases = bridging::BridgedUniversalAliases; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -458,7 +462,7 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = WeightInfoBounds< - crate::weights::xcm::WestmintXcmWeight, + crate::weights::xcm::AssetHubWestendXcmWeight, RuntimeCall, MaxInstructions, >; @@ -500,128 +504,186 @@ impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { } } -/// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus -pub type BridgeXcmSender = UnpaidRemoteExporter; - -/// Benchmarks helper for over-bridge transfer pallet. -#[cfg(feature = "runtime-benchmarks")] -pub struct BridgeTransferBenchmarksHelper; - -#[cfg(feature = "runtime-benchmarks")] -impl BridgeTransferBenchmarksHelper { - /// Parachain at the other side of the bridge that we're connected to. - fn allowed_target_location() -> MultiLocation { - MultiLocation::new(2, X2(GlobalConsensus(Kusama), Parachain(1000))) +/// All configuration related to bridging +pub mod bridging { + use super::*; + use pallet_bridge_transfer_primitives::{ + AssetFilter, BridgeConfig, BridgesConfig, BridgesConfigAdapter, BridgesConfigBuilder, + MaybePaidLocation, MultiLocationFilter, ReserveLocation, + }; + use sp_std::collections::btree_set::BTreeSet; + use xcm_builder::UnpaidRemoteExporter; + + parameter_types! { + // used for local testing + pub BridgeHubParaId: u32 = 1002; + pub BridgeHub: MultiLocation = MultiLocation::new(1, X1(Parachain(BridgeHubParaId::get()))); + pub const KusamaLocalNetwork: NetworkId = NetworkId::Kusama; + pub AssetHubKusamaLocal: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(KusamaLocalNetwork::get()), Parachain(1000))); + // Initial value, this will be adjusted by governance motion on deployment with some more accurate value + pub storage AssetHubKusamaLocalMaxFee: Option = Some((MultiLocation::parent(), 1_000_000).into()); + pub KsmLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(KusamaLocalNetwork::get()))); + + // Setup bridges configuration + // Allows to transfer only WND to AssetHubKusama + // (hard-coded version - on-chain configuration will come later as separate feature) + pub Bridges: BridgesConfig = BridgesConfigBuilder::default() + // add exporter for Kusama + .add_or_panic( + KusamaLocalNetwork::get(), + BridgeConfig::new( + MaybePaidLocation { + location: BridgeHub::get(), + // Noe fees needed because we use `UnpaidRemoteExporter` and BridgeHubKusama allows unpaid execution for local system parachains + maybe_fee: None, + } + ).add_target_location( + // add target location as AssetHubKusamaLocal + MaybePaidLocation { + location: AssetHubKusamaLocal::get(), + maybe_fee: AssetHubKusamaLocalMaxFee::get(), + }, + Some(AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow transfer WND + .add_equals(WestendLocation::get()) + )) + ) + ) + .build(); + + // Setup trusted bridged reserve locations + pub BridgedReserves: sp_std::vec::Vec = sp_std::vec![ + // trust assets from AssetHubKusamaLocal + ( + AssetHubKusamaLocal::get(), + AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + // allow receive KSM + .add_equals(KsmLocation::get()) + ) + ) + ]; + + /// Universal aliases + pub BridgedUniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter( + sp_std::vec![ + (BridgeHub::get(), GlobalConsensus(KusamaLocalNetwork::get())) + ] + ); } - /// Max fee we are willing to pay on the bridged side - fn allowed_target_location_max_fee() -> Option { - Some((MultiLocation::parent(), 50_000_000_000_u128).into()) + impl Contains<(MultiLocation, Junction)> for BridgedUniversalAliases { + fn contains(alias: &(MultiLocation, Junction)) -> bool { + BridgedUniversalAliases::get().contains(alias) + } } - /// Identifier of the sibling bridge-hub parachain. - fn bridge_hub_para_id() -> u32 { - 1002 - } + /// Bridge router, which wraps and sends xcm to BridgeHub to be delivered to the different GlobalConsensus + pub type BridgeXcmSender = + UnpaidRemoteExporter, XcmRouter, UniversalLocation>; + + /// Reserve locations filter for `xcm_executor::Config::IsReserve`. + pub type IsTrustedBridgedReserveLocationForConcreteAsset = + pallet_bridge_transfer::features::IsTrustedBridgedReserveLocationForConcreteAsset< + UniversalLocation, + BridgedReserves, + >; } +#[cfg(feature = "runtime-benchmarks")] +use pallet_bridge_transfer_primitives::{MaybePaidLocation, ReachableDestination}; + +/// Benchmarks helper for over-bridge transfer pallet. +#[cfg(feature = "runtime-benchmarks")] +pub struct BridgeTransferBenchmarksHelper; #[cfg(feature = "runtime-benchmarks")] impl pallet_bridge_transfer::BenchmarkHelper for BridgeTransferBenchmarksHelper { - fn bridge_config() -> Option<(NetworkId, pallet_bridge_transfer::BridgeConfig)> { - Some(( - Kusama, - pallet_bridge_transfer::BridgeConfig { - bridge_location: (Parent, Parachain(Self::bridge_hub_para_id())).into(), - // Right now `UnpaidRemoteExporter` is used to send XCM messages and it requires - // fee to be `None`. If we're going to change that (are we?), then we should replace - // this `None` with `Some(Self::make_asset(crate::ExistentialDeposit::get()))` - bridge_location_fee: None, - allowed_target_location: Self::allowed_target_location(), - max_target_location_fee: Self::allowed_target_location_max_fee(), - }, - )) - } + fn desired_bridged_location() -> Option<(NetworkId, ReachableDestination)> { + let bridged_network = bridging::KusamaLocalNetwork::get(); + let target_location = bridging::AssetHubKusamaLocal::get(); + let target_location_fee = bridging::AssetHubKusamaLocalMaxFee::get(); + let target_location_account = target_location + .clone() + .appended_with(AccountId32 { + network: Some(bridged_network), + id: AccountId::from([42u8; 32]).into(), + }) + .expect("Correct target_location_account"); - fn universal_alias() -> Option<(xcm::VersionedMultiLocation, Junction)> { Some(( - xcm::VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: X1(Parachain(Self::bridge_hub_para_id())), - }), - GlobalConsensus(Kusama), + bridging::KusamaLocalNetwork::get(), + ReachableDestination { + bridge: MaybePaidLocation { + location: bridging::BridgeHub::get(), + // Right now `UnpaidRemoteExporter` is used to send XCM messages and it requires + // fee to be `None`. If we're going to change that (are we?), then we should replace + // this `None` with `Some(Self::make_asset(crate::ExistentialDeposit::get()))` + maybe_fee: None, + }, + target: MaybePaidLocation { + location: target_location, + maybe_fee: target_location_fee, + }, + target_destination: target_location_account, + }, )) } - fn reserve_location() -> Option { - Some(xcm::VersionedMultiLocation::V3(MultiLocation { - parents: 2, - interior: X2(GlobalConsensus(Kusama), Parachain(1000)), - })) - } - - fn prepare_asset_transfer( + fn prepare_asset_transfer_for( + desired_bridged_location: (NetworkId, ReachableDestination), + assumed_reserve_account: MultiLocation, ) -> Option<(RuntimeOrigin, xcm::VersionedMultiAssets, xcm::VersionedMultiLocation)> { use frame_support::traits::Currency; + let (_, desired_bridged_location) = desired_bridged_location; // our `BridgeXcmSender` assumes that the HRMP channel is opened between this - // parachain and the sibling bridge-hub parachain + // parachain and the sibling bridge-hub parachain. + // we expect local bridge-hub + let bridge_hub_para_id = match desired_bridged_location.bridge.location { + MultiLocation { parents: 1, interior: X1(Parachain(bridge_hub_para_id)) } => + bridge_hub_para_id, + _ => panic!("Cannot resolve bridge_hub_para_id"), + }; cumulus_pallet_parachain_system::Pallet::::open_outbound_hrmp_channel_for_benchmarks( - Self::bridge_hub_para_id().into(), + bridge_hub_para_id.into(), ); // sender account let sender_account = AccountId::from([42u8; 32]); + // reserve account + use xcm_executor::traits::ConvertLocation; + let assumed_reserve_account = + LocationToAccountId::convert_location(&assumed_reserve_account) + .expect("Correct AccountId"); - // We need root origin to create asset - let minimum_asset_balance = 3333333_u128; - let local_asset_id = 1; - frame_support::assert_ok!(Assets::force_create( - RuntimeOrigin::root(), - local_asset_id.into(), - sender_account.clone().into(), - true, - minimum_asset_balance - )); - - // We mint enough asset for the account to exist for assets - frame_support::assert_ok!(Assets::mint( - RuntimeOrigin::signed(sender_account.clone()), - local_asset_id.into(), - sender_account.clone().into(), - minimum_asset_balance * 4 - )); - - // deposit enough funds to the sender account + // deposit enough (ED) funds to the sender and reserve account let existential_deposit = crate::ExistentialDeposit::get(); let _ = Balances::deposit_creating(&sender_account, existential_deposit * 10); + let _ = Balances::deposit_creating(&assumed_reserve_account, existential_deposit * 10); - // finally - prepare assets and destination (pallet_assets is worse than pallet_balances) - use xcm_executor::traits::Convert; - let asset_id_location = assets_common::AssetIdForTrustBackedAssetsConvert::< - TrustBackedAssetsPalletLocation, - >::reverse_ref(local_asset_id) - .unwrap(); - let asset: MultiAsset = (Concrete(asset_id_location), minimum_asset_balance * 2).into(); + // finally - prepare assets + // lets consider our worst case scenario - reserve based transfer with relay chain tokens + let asset: MultiAsset = (Concrete(WestendLocation::get()), existential_deposit * 2).into(); - let assets = xcm::VersionedMultiAssets::V3(asset.into()); - let destination = xcm::VersionedMultiLocation::V3(Self::allowed_target_location()); + let assets = xcm::VersionedMultiAssets::from(MultiAssets::from(asset)); + let destination = + xcm::VersionedMultiLocation::from(desired_bridged_location.target_destination); Some((RuntimeOrigin::signed(sender_account), assets, destination)) } +} - fn prepare_ping_transfer() -> Option<(RuntimeOrigin, xcm::VersionedMultiLocation)> { - // our `BridgeXcmSender` assumes that the HRMP channel is opened between this - // parachain and the sibling bridge-hub parachain - cumulus_pallet_parachain_system::Pallet::::open_outbound_hrmp_channel_for_benchmarks( - Self::bridge_hub_para_id().into(), +#[cfg(feature = "runtime-benchmarks")] +impl BridgeTransferBenchmarksHelper { + pub fn prepare_universal_alias() -> Option<(MultiLocation, Junction)> { + let alias = bridging::BridgedUniversalAliases::get().into_iter().find_map( + |(location, junction)| match bridging::BridgeHub::get().eq(&location) { + true => Some((location, junction)), + false => None, + }, ); - - // sender account - let sender_account = AccountId::from([42u8; 32]); - - // finally - prepare destination - let destination = xcm::VersionedMultiLocation::V3(Self::allowed_target_location()); - - Some((RuntimeOrigin::signed(sender_account), destination)) + assert!(alias.is_some(), "we expect here BridgeHub to KusamaLocal mapping at least"); + Some(alias.unwrap()) } } diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs similarity index 84% rename from parachains/runtimes/assets/westmint/tests/tests.rs rename to parachains/runtimes/assets/asset-hub-westend/tests/tests.rs index da4636be0a6..6adf0514e4d 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs @@ -1,14 +1,23 @@ -use asset_test_utils::{CollatorSessionKeys, ExtBuilder, RuntimeHelper, XcmReceivedFrom}; -use codec::{Decode, DecodeLimit, Encode}; -use cumulus_primitives_utility::ChargeWeightInFungibles; -use frame_support::{ - assert_noop, assert_ok, sp_io, - traits::fungibles::InspectEnumerable, - weights::{Weight, WeightToFee as WeightToFeeT}, -}; -use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance}; -use std::convert::Into; -pub use westmint_runtime::{ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests for the Westmint (Westend Assets Hub) chain. + +pub use asset_hub_westend_runtime::{ constants::fee::WeightToFee, xcm_config::{ CheckingAccount, LocationToAccountId, TrustBackedAssetsPalletLocation, XcmConfig, @@ -16,16 +25,27 @@ pub use westmint_runtime::{ AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, ParachainSystem, Runtime, SessionKeys, System, TrustBackedAssetsInstance, XcmpQueue, }; -use westmint_runtime::{ +use asset_hub_westend_runtime::{ xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, ForeignCreatorsSovereignAccountOf, - WestendLocation, + bridging, AssetFeeAsExistentialDepositMultiplierFeeCharger, + ForeignCreatorsSovereignAccountOf, WestendLocation, }, MetadataDepositBase, MetadataDepositPerByte, RuntimeCall, RuntimeEvent, }; +use asset_test_utils::{CollatorSessionKeys, ExtBuilder, RuntimeHelper, XcmReceivedFrom}; +use codec::{Decode, DecodeLimit, Encode}; +use cumulus_primitives_utility::ChargeWeightInFungibles; +use frame_support::{ + assert_noop, assert_ok, sp_io, + traits::fungibles::InspectEnumerable, + weights::{Weight, WeightToFee as WeightToFeeT}, +}; +use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance}; +use sp_runtime::traits::MaybeEquivalence; +use std::convert::Into; use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH}; use xcm_executor::{ - traits::{Convert, Identity, JustTry, WeightTrader}, + traits::{Identity, JustTry, WeightTrader}, XcmExecutor, }; @@ -76,7 +96,7 @@ fn test_asset_xcm_trader() { // get asset id as multilocation let asset_multilocation = - AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(); + AssetIdForTrustBackedAssetsConvert::convert_back(&local_asset_id).unwrap(); // Set Alice as block author, who will receive fees RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); @@ -159,7 +179,7 @@ fn test_asset_xcm_trader_with_refund() { // We are going to buy 4e9 weight let bought = Weight::from_parts(4_000_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); // lets calculate amount needed let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -229,7 +249,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { // We are going to buy 5e9 weight let bought = Weight::from_parts(500_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -279,7 +299,7 @@ fn test_that_buying_ed_refund_does_not_refund() { let bought = Weight::from_parts(500_000_000u64, 0); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -354,7 +374,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { // lets calculate amount needed let asset_amount_needed = WeightToFee::weight_to_fee(&bought); - let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap(); let asset: MultiAsset = (asset_multilocation, asset_amount_needed).into(); @@ -469,13 +489,13 @@ fn test_assets_balances_api_works() { ))); // check trusted asset assert!(result.inner().iter().any(|asset| asset.eq(&( - AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), + AssetIdForTrustBackedAssetsConvert::convert_back(&local_asset_id).unwrap(), minimum_asset_balance ) .into()))); // check foreign asset assert!(result.inner().iter().any(|asset| asset.eq(&( - Identity::reverse_ref(foreign_asset_id_multilocation).unwrap(), + Identity::convert_back(&foreign_asset_id_multilocation).unwrap(), 6 * foreign_asset_minimum_asset_balance ) .into()))); @@ -610,31 +630,58 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p }) ); +fn bridging_to_asset_hub_kusama() -> asset_test_utils::test_cases_over_bridge::TestBridgingConfig { + asset_test_utils::test_cases_over_bridge::TestBridgingConfig { + bridged_network: bridging::KusamaLocalNetwork::get(), + local_bridge_hub_para_id: bridging::BridgeHubParaId::get(), + local_bridge_hub_location: pallet_bridge_transfer_primitives::MaybePaidLocation { + location: bridging::BridgeHub::get(), + maybe_fee: None, + }, + bridged_target_location: pallet_bridge_transfer_primitives::MaybePaidLocation { + location: bridging::AssetHubKusamaLocal::get(), + maybe_fee: bridging::AssetHubKusamaLocalMaxFee::get(), + }, + } +} + #[test] -fn can_governance_change_bridge_transfer_out_configuration() { - asset_test_utils::test_cases::can_governance_change_bridge_transfer_out_configuration::< +fn transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works() { + asset_test_utils::test_cases_over_bridge::transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works::< Runtime, XcmConfig, + ParachainSystem, + XcmpQueue, + LocationToAccountId, >( collator_session_keys(), - Box::new(|call| RuntimeCall::BridgeTransfer(call).encode()), + ExistentialDeposit::get(), + AccountId::from(ALICE), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { Ok(RuntimeEvent::BridgeTransfer(event)) => Some(event), _ => None, } }), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), + _ => None, + } + }), + bridging_to_asset_hub_kusama ) } #[test] -fn initiate_transfer_asset_via_bridge_for_native_asset_works() { - asset_test_utils::test_cases::initiate_transfer_asset_via_bridge_for_native_asset_works::< +fn transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works() { + asset_test_utils::test_cases_over_bridge::transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works::< Runtime, XcmConfig, ParachainSystem, XcmpQueue, LocationToAccountId, + ForeignAssetsInstance, >( collator_session_keys(), ExistentialDeposit::get(), @@ -651,33 +698,37 @@ fn initiate_transfer_asset_via_bridge_for_native_asset_works() { _ => None, } }), + bridging_to_asset_hub_kusama ) } #[test] -fn can_governance_change_bridge_transfer_in_configuration() { - asset_test_utils::test_cases::can_governance_change_bridge_transfer_in_configuration::< +fn receive_reserve_asset_deposited_from_different_consensus_over_bridge_works() { + asset_test_utils::test_cases_over_bridge::receive_reserve_asset_deposited_from_different_consensus_over_bridge_works::< Runtime, XcmConfig, + LocationToAccountId, + ForeignAssetsInstance, >( collator_session_keys(), - Box::new(|call| RuntimeCall::BridgeTransfer(call).encode()), + ExistentialDeposit::get(), + AccountId::from(BOB), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { - Ok(RuntimeEvent::BridgeTransfer(event)) => Some(event), + Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), _ => None, } }), + bridging_to_asset_hub_kusama, ) } #[test] -fn receive_reserve_asset_deposited_from_different_consensus_works() { - asset_test_utils::test_cases::receive_reserve_asset_deposited_from_different_consensus_works::< +fn withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works() { + asset_test_utils::test_cases_over_bridge::withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works::< Runtime, XcmConfig, LocationToAccountId, - ForeignAssetsInstance, >( collator_session_keys(), ExistentialDeposit::get(), @@ -688,6 +739,7 @@ fn receive_reserve_asset_deposited_from_different_consensus_works() { _ => None, } }), + bridging_to_asset_hub_kusama, ) } @@ -716,3 +768,28 @@ fn plain_receive_teleported_asset_works() { assert_eq!(outcome.ensure_complete(), Ok(())); }) } + +#[test] +fn change_asset_hub_kusama_local_max_fee_by_governance_works() { + asset_test_utils::test_cases::change_storage_constant_by_governance_works::< + Runtime, + bridging::AssetHubKusamaLocalMaxFee, + Option, + >( + collator_session_keys(), + 1000, + Box::new(|call| RuntimeCall::System(call).encode()), + || { + ( + bridging::AssetHubKusamaLocalMaxFee::key().to_vec(), + bridging::AssetHubKusamaLocalMaxFee::get(), + ) + }, + |old_value| match old_value { + Some(MultiAsset { id, fun: Fungible(old_amount) }) => + Some(MultiAsset { id: *id, fun: Fungible(old_amount * 2) }), + Some(_) => None, + None => Some(MultiAsset::from((Here, 123456))), + }, + ) +} diff --git a/parachains/runtimes/assets/common/Cargo.toml b/parachains/runtimes/assets/common/Cargo.toml index db9d5674dad..e1ec1b451d8 100644 --- a/parachains/runtimes/assets/common/Cargo.toml +++ b/parachains/runtimes/assets/common/Cargo.toml @@ -8,12 +8,13 @@ description = "Assets common utilities" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } # Substrate frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Polkadot pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -38,6 +39,7 @@ std = [ "cumulus-primitives-core/std", "sp-api/std", "sp-std/std", + "sp-runtime/std", "pallet-xcm/std", "xcm/std", "xcm-builder/std", diff --git a/parachains/runtimes/assets/common/src/foreign_creators.rs b/parachains/runtimes/assets/common/src/foreign_creators.rs index dbdf4301d66..00f336f9c68 100644 --- a/parachains/runtimes/assets/common/src/foreign_creators.rs +++ b/parachains/runtimes/assets/common/src/foreign_creators.rs @@ -18,16 +18,16 @@ use frame_support::traits::{ }; use pallet_xcm::{EnsureXcm, Origin as XcmOrigin}; use xcm::latest::MultiLocation; -use xcm_executor::traits::Convert; +use xcm_executor::traits::ConvertLocation; -// `EnsureOriginWithArg` impl for `CreateOrigin` that allows only XCM origins that are locations -// containing the class location. +/// `EnsureOriginWithArg` impl for `CreateOrigin` that allows only XCM origins that are locations +/// containing the class location. pub struct ForeignCreators( sp_std::marker::PhantomData<(IsForeign, AccountOf, AccountId)>, ); impl< IsForeign: ContainsPair, - AccountOf: Convert, + AccountOf: ConvertLocation, AccountId: Clone, RuntimeOrigin: From + OriginTrait + Clone, > EnsureOriginWithArg @@ -46,7 +46,7 @@ where if !IsForeign::contains(asset_location, &origin_location) { return Err(origin) } - AccountOf::convert(origin_location).map_err(|_| origin) + AccountOf::convert_location(&origin_location).ok_or(origin) } #[cfg(feature = "runtime-benchmarks")] diff --git a/parachains/runtimes/assets/common/src/fungible_conversion.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs index 8ffb44b086b..00f0c40d611 100644 --- a/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -17,10 +17,11 @@ use crate::runtime_api::FungiblesAccessError; use frame_support::traits::Contains; +use sp_runtime::traits::MaybeEquivalence; use sp_std::{borrow::Borrow, vec::Vec}; use xcm::latest::{MultiAsset, MultiLocation}; use xcm_builder::{ConvertedConcreteId, MatchedConvertedConcreteId}; -use xcm_executor::traits::{Convert, MatchesFungibles}; +use xcm_executor::traits::MatchesFungibles; /// Converting any [`(AssetId, Balance)`] to [`MultiAsset`] pub trait MultiAssetConverter: @@ -28,8 +29,8 @@ pub trait MultiAssetConverter: where AssetId: Clone, Balance: Clone, - ConvertAssetId: Convert, - ConvertBalance: Convert, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, { fn convert_ref( value: impl Borrow<(AssetId, Balance)>, @@ -39,8 +40,8 @@ where impl< AssetId: Clone, Balance: Clone, - ConvertAssetId: Convert, - ConvertBalance: Convert, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, > MultiAssetConverter for ConvertedConcreteId { @@ -48,12 +49,12 @@ impl< value: impl Borrow<(AssetId, Balance)>, ) -> Result { let (asset_id, balance) = value.borrow(); - match ConvertAssetId::reverse_ref(asset_id) { - Ok(asset_id_as_multilocation) => match ConvertBalance::reverse_ref(balance) { - Ok(amount) => Ok((asset_id_as_multilocation, amount).into()), - Err(_) => Err(FungiblesAccessError::AmountToBalanceConversionFailed), + match ConvertAssetId::convert_back(asset_id) { + Some(asset_id_as_multilocation) => match ConvertBalance::convert_back(balance) { + Some(amount) => Ok((asset_id_as_multilocation, amount).into()), + None => Err(FungiblesAccessError::AmountToBalanceConversionFailed), }, - Err(_) => Err(FungiblesAccessError::AssetIdConversionFailed), + None => Err(FungiblesAccessError::AssetIdConversionFailed), } } } @@ -62,8 +63,8 @@ impl< AssetId: Clone, Balance: Clone, MatchAssetId: Contains, - ConvertAssetId: Convert, - ConvertBalance: Convert, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, > MultiAssetConverter for MatchedConvertedConcreteId { @@ -71,12 +72,12 @@ impl< value: impl Borrow<(AssetId, Balance)>, ) -> Result { let (asset_id, balance) = value.borrow(); - match ConvertAssetId::reverse_ref(asset_id) { - Ok(asset_id_as_multilocation) => match ConvertBalance::reverse_ref(balance) { - Ok(amount) => Ok((asset_id_as_multilocation, amount).into()), - Err(_) => Err(FungiblesAccessError::AmountToBalanceConversionFailed), + match ConvertAssetId::convert_back(asset_id) { + Some(asset_id_as_multilocation) => match ConvertBalance::convert_back(balance) { + Some(amount) => Ok((asset_id_as_multilocation, amount).into()), + None => Err(FungiblesAccessError::AmountToBalanceConversionFailed), }, - Err(_) => Err(FungiblesAccessError::AssetIdConversionFailed), + None => Err(FungiblesAccessError::AssetIdConversionFailed), } } } @@ -88,8 +89,8 @@ pub fn convert<'a, AssetId, Balance, ConvertAssetId, ConvertBalance, Converter>( where AssetId: Clone + 'a, Balance: Clone + 'a, - ConvertAssetId: Convert, - ConvertBalance: Convert, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, Converter: MultiAssetConverter, { items.map(Converter::convert_ref).collect() diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index 8a321ad97aa..bdd127c9143 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -80,8 +80,9 @@ pub type ForeignAssetsConvertedConcreteId::reverse_ref( - local_asset_id + AssetIdForTrustBackedAssetsConvert::::convert_back( + &local_asset_id ) .unwrap(), expected_reverse_ref ); assert_eq!( - AssetIdForTrustBackedAssetsConvert::::convert_ref( - expected_reverse_ref + AssetIdForTrustBackedAssetsConvert::::convert( + &expected_reverse_ref ) .unwrap(), local_asset_id diff --git a/parachains/runtimes/assets/common/src/matching.rs b/parachains/runtimes/assets/common/src/matching.rs index ea6ae888e48..964f25cda35 100644 --- a/parachains/runtimes/assets/common/src/matching.rs +++ b/parachains/runtimes/assets/common/src/matching.rs @@ -82,25 +82,3 @@ impl> ContainsPair } } } - -/// Accepts an asset if it is from different global consensus than self plus `parents > 1` -pub struct IsDifferentGlobalConsensusConcreteAsset( - sp_std::marker::PhantomData, -); -impl> ContainsPair - for IsDifferentGlobalConsensusConcreteAsset -{ - fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { - log::trace!(target: "xcm::contains", "IsDifferentGlobalConsensusConcreteAsset asset: {:?}, origin: {:?}", asset, origin); - match asset { - MultiAsset { id: Concrete(asset_location), .. } if asset_location.parents > 1 => - match asset_location.first_interior() { - Some(GlobalConsensus(asset_consensus)) - if asset_consensus != &SelfGlobalConsensus::get() => - true, - _ => false, - }, - _ => false, - } - } -} diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_bridge_transfer.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_bridge_transfer.rs deleted file mode 100644 index bafff1fbf0c..00000000000 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_bridge_transfer.rs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 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_bridge_transfer` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 - -// Executed Command: -// target/production/polkadot-parachain -// benchmark -// pallet -// --steps=50 -// --repeat=20 -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json -// --pallet=pallet_bridge_transfer -// --chain=statemine-dev -// --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/ - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_bridge_transfer`. -pub struct WeightInfo(PhantomData); -impl pallet_bridge_transfer::WeightInfo for WeightInfo { - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BridgeTransfer AllowedExporters (r:1 w:0) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Storage: Assets Asset (r:1 w:1) - /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) - /// Storage: Assets Account (r:2 w:2) - /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) - /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) - fn transfer_asset_via_bridge() -> Weight { - // Proof Size summary in bytes: - // Measured: `750` - // Estimated: `6208` - // Minimum execution time: 155_987_000 picoseconds. - Weight::from_parts(156_876_000, 0) - .saturating_add(Weight::from_parts(0, 6208)) - .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(8)) - } - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BridgeTransfer AllowedExporters (r:1 w:0) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) - /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) - fn ping_via_bridge() -> Weight { - // Proof Size summary in bytes: - // Measured: `347` - // Estimated: `6002` - // Minimum execution time: 66_830_000 picoseconds. - Weight::from_parts(67_314_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: BridgeTransfer AllowedExporters (r:1 w:1) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn add_exporter_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `6002` - // Minimum execution time: 16_697_000 picoseconds. - Weight::from_parts(16_997_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedExporters (r:1 w:1) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - fn remove_exporter_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `6002` - // Minimum execution time: 13_282_000 picoseconds. - Weight::from_parts(13_616_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedExporters (r:1 w:1) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - fn update_exporter_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `6002` - // Minimum execution time: 16_726_000 picoseconds. - Weight::from_parts(17_111_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedUniversalAliases (r:1 w:1) - /// Proof: BridgeTransfer AllowedUniversalAliases (max_values: None, max_size: Some(2419), added: 4894, mode: MaxEncodedLen) - fn add_universal_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `5884` - // Minimum execution time: 12_078_000 picoseconds. - Weight::from_parts(12_421_000, 0) - .saturating_add(Weight::from_parts(0, 5884)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedUniversalAliases (r:1 w:1) - /// Proof: BridgeTransfer AllowedUniversalAliases (max_values: None, max_size: Some(2419), added: 4894, mode: MaxEncodedLen) - fn remove_universal_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `158` - // Estimated: `5884` - // Minimum execution time: 15_011_000 picoseconds. - Weight::from_parts(15_361_000, 0) - .saturating_add(Weight::from_parts(0, 5884)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedReserveLocations (r:1 w:1) - /// Proof: BridgeTransfer AllowedReserveLocations (max_values: Some(1), max_size: Some(4817), added: 5312, mode: MaxEncodedLen) - fn add_reserve_location() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `6302` - // Minimum execution time: 11_927_000 picoseconds. - Weight::from_parts(12_308_000, 0) - .saturating_add(Weight::from_parts(0, 6302)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedReserveLocations (r:1 w:1) - /// Proof: BridgeTransfer AllowedReserveLocations (max_values: Some(1), max_size: Some(4817), added: 5312, mode: MaxEncodedLen) - fn remove_reserve_location() -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `6302` - // Minimum execution time: 14_002_000 picoseconds. - Weight::from_parts(14_406_000, 0) - .saturating_add(Weight::from_parts(0, 6302)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/parachains/runtimes/assets/test-utils/Cargo.toml b/parachains/runtimes/assets/test-utils/Cargo.toml index 9f951b06c96..c29db54b46b 100644 --- a/parachains/runtimes/assets/test-utils/Cargo.toml +++ b/parachains/runtimes/assets/test-utils/Cargo.toml @@ -3,7 +3,7 @@ name = "asset-test-utils" version = "1.0.0" authors = ["Parity Technologies "] edition = "2021" -description = "Statemint parachain runtime" +description = "Test utils for Asset Hub runtimes." [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } @@ -32,6 +32,7 @@ cumulus-primitives-parachain-inherent = { path = "../../../../primitives/paracha cumulus-test-relay-sproof-builder = { path = "../../../../test/relay-sproof-builder", default-features = false } parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false } pallet-bridge-transfer = { path = "../../../pallets/bridge-transfer", default-features = false } +pallet-bridge-transfer-primitives = { path = "../../../pallets/bridge-transfer/primitives", default-features = false } parachains-runtimes-test-utils = { path = "../../test-utils", default-features = false } # Polkadot @@ -75,6 +76,7 @@ std = [ "xcm-builder/std", "xcm-executor/std", "pallet-bridge-transfer/std", + "pallet-bridge-transfer-primitives/std", "cumulus-pallet-xcmp-queue/std", "cumulus-pallet-dmp-queue/std", ] diff --git a/parachains/runtimes/assets/test-utils/src/lib.rs b/parachains/runtimes/assets/test-utils/src/lib.rs index 9a24867592e..bd5e6e7deb4 100644 --- a/parachains/runtimes/assets/test-utils/src/lib.rs +++ b/parachains/runtimes/assets/test-utils/src/lib.rs @@ -17,4 +17,5 @@ //! Module contains predefined test-case scenarios for `Runtime` with various assets. pub mod test_cases; +pub mod test_cases_over_bridge; pub use parachains_runtimes_test_utils::*; diff --git a/parachains/runtimes/assets/test-utils/src/test_cases.rs b/parachains/runtimes/assets/test-utils/src/test_cases.rs index 8d58da85b74..d6ba51bad26 100644 --- a/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -16,26 +16,25 @@ //! Module contains predefined test-case scenarios for `Runtime` with various assets. use codec::Encode; -use cumulus_primitives_core::XcmpMessageSource; use frame_support::{ assert_noop, assert_ok, - traits::{ - fungibles::InspectEnumerable, Contains, Currency, Get, OriginTrait, ProcessMessageError, - }, + traits::{fungibles::InspectEnumerable, Get, OriginTrait}, weights::Weight, }; use parachains_common::Balance; use parachains_runtimes_test_utils::{ - assert_metadata, assert_total, mock_open_hrmp_channel, AccountIdOf, BalanceOf, - CollatorSessionKeys, ExtBuilder, RuntimeHelper, ValidatorIdOf, XcmReceivedFrom, + assert_metadata, assert_total, AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, + RuntimeHelper, ValidatorIdOf, XcmReceivedFrom, }; use sp_runtime::{ - traits::{StaticLookup, Zero}, + traits::{MaybeEquivalence, StaticLookup, Zero}, DispatchError, Saturating, }; -use xcm::{latest::prelude::*, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation}; -use xcm_builder::{CreateMatcher, MatchXcm}; -use xcm_executor::{traits::Convert, XcmExecutor}; +use xcm::latest::prelude::*; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; + +// Re-export +pub use parachains_runtimes_test_utils::change_storage_constant_by_governance_works; /// Test-case makes sure that `Runtime` can receive native asset from relay chain /// and can teleport it back and to the other parachains @@ -312,7 +311,7 @@ pub fn teleports_for_foreign_assets_works< >, WeightToFee: frame_support::weights::WeightToFee, ::Balance: From + Into, - SovereignAccountOf: Convert>, + SovereignAccountOf: ConvertLocation>, >::AssetId: From + Into, >::AssetIdParameter: @@ -334,7 +333,8 @@ pub fn teleports_for_foreign_assets_works< // foreign creator, which can be sibling parachain to match ForeignCreators let foreign_creator = MultiLocation { parents: 1, interior: X1(Parachain(foreign_para_id)) }; - let foreign_creator_as_account_id = SovereignAccountOf::convert(foreign_creator).expect(""); + let foreign_creator_as_account_id = + SovereignAccountOf::convert_location(&foreign_creator).expect(""); // we want to buy execution with local relay chain currency let buy_execution_fee_amount = @@ -748,7 +748,7 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works< From<::AccountId>, AssetsPalletInstance: 'static, AssetId: Clone + Copy, - AssetIdConverter: Convert, + AssetIdConverter: MaybeEquivalence, { ExtBuilder::::default() .with_collators(collator_session_keys.collators()) @@ -763,7 +763,7 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works< .execute_with(|| { // create some asset class let asset_minimum_asset_balance = 3333333_u128; - let asset_id_as_multilocation = AssetIdConverter::reverse_ref(asset_id).unwrap(); + let asset_id_as_multilocation = AssetIdConverter::convert_back(&asset_id).unwrap(); assert_ok!(>::force_create( RuntimeHelper::::root_origin(), asset_id.into(), @@ -1007,7 +1007,7 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor XcmConfig: xcm_executor::Config, WeightToFee: frame_support::weights::WeightToFee, ::Balance: From + Into, - SovereignAccountOf: Convert>, + SovereignAccountOf: ConvertLocation>, >::AssetId: From + Into, >::AssetIdParameter: @@ -1020,16 +1020,17 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor From<::AccountId>, ForeignAssetsPalletInstance: 'static, AssetId: Clone + Copy, - AssetIdConverter: Convert, + AssetIdConverter: MaybeEquivalence, { // foreign parachain with the same consenus currency as asset let foreign_asset_id_multilocation = MultiLocation { parents: 1, interior: X2(Parachain(2222), GeneralIndex(1234567)) }; - let asset_id = AssetIdConverter::convert(foreign_asset_id_multilocation).unwrap(); + let asset_id = AssetIdConverter::convert(&foreign_asset_id_multilocation).unwrap(); // foreign creator, which can be sibling parachain to match ForeignCreators let foreign_creator = MultiLocation { parents: 1, interior: X1(Parachain(2222)) }; - let foreign_creator_as_account_id = SovereignAccountOf::convert(foreign_creator).expect(""); + let foreign_creator_as_account_id = + SovereignAccountOf::convert_location(&foreign_creator).expect(""); // we want to buy execution with local relay chain currency let buy_execution_fee_amount = @@ -1209,7 +1210,7 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor // lets try create asset for different parachain(3333) (foreign_creator(2222) can create just his assets) let foreign_asset_id_multilocation = MultiLocation { parents: 1, interior: X2(Parachain(3333), GeneralIndex(1234567)) }; - let asset_id = AssetIdConverter::convert(foreign_asset_id_multilocation).unwrap(); + let asset_id = AssetIdConverter::convert(&foreign_asset_id_multilocation).unwrap(); // prepare data for xcm::Transact(create) let foreign_asset_create = runtime_call_encode(pallet_assets::Call::< @@ -1299,733 +1300,3 @@ macro_rules! include_create_and_manage_foreign_assets_for_local_consensus_parach } } ); - -/// Test-case makes sure that `Runtime` can manage `bridge_transfer out` configuration by governance -pub fn can_governance_change_bridge_transfer_out_configuration( - collator_session_keys: CollatorSessionKeys, - runtime_call_encode: Box) -> Vec>, - unwrap_pallet_bridge_transfer_event: Box< - dyn Fn(Vec) -> Option>, - >, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + cumulus_pallet_dmp_queue::Config - + pallet_bridge_transfer::Config, - AccountIdOf: Into<[u8; 32]>, - ValidatorIdOf: From>, - BalanceOf: From, - XcmConfig: xcm_executor::Config, -{ - ExtBuilder::::default() - .with_collators(collator_session_keys.collators()) - .with_session_keys(collator_session_keys.session_keys()) - .with_tracing() - .with_safe_xcm_version(3) - .build() - .execute_with(|| { - // bridge cfg data - let bridged_network = ByGenesis([9; 32]); - let bridge_config = pallet_bridge_transfer::BridgeConfig { - bridge_location: (Parent, Parachain(1013)).into(), - bridge_location_fee: None, - allowed_target_location: MultiLocation::new( - 2, - X2(GlobalConsensus(bridged_network), Parachain(1000)), - ), - max_target_location_fee: None, - }; - - // check no cfg - assert!(pallet_bridge_transfer::Pallet::::allowed_exporters(&bridged_network) - .is_none()); - - // governance can add exporter config - assert_ok!(RuntimeHelper::::execute_as_governance( - runtime_call_encode( - pallet_bridge_transfer::Call::::add_exporter_config { - bridged_network, - bridge_config: Box::new(bridge_config.clone()), - } - ), - <::WeightInfo as pallet_bridge_transfer::weights::WeightInfo>::add_exporter_config() - ) - .ensure_complete()); - - assert!(>::events() - .into_iter() - .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())) - .any(|e| matches!(e, pallet_bridge_transfer::Event::BridgeAdded))); - { - let cfg = - pallet_bridge_transfer::Pallet::::allowed_exporters(&bridged_network); - assert!(cfg.is_some()); - let cfg = cfg.unwrap(); - assert_eq!(cfg.bridge_location, bridge_config.bridge_location); - assert_eq!(cfg.bridge_location_fee, None); - assert_eq!(cfg.allowed_target_location, bridge_config.allowed_target_location); - assert_eq!(cfg.max_target_location_fee, None); - } - - // governance can update bridge config - let new_bridge_location_fee: MultiAsset = - (Concrete(MultiLocation::parent()), 1_000).into(); - let new_target_location_fee: MultiAsset = - (Concrete(MultiLocation::parent()), 1_000_000).into(); - assert_ok!(RuntimeHelper::::execute_as_governance( - runtime_call_encode( - pallet_bridge_transfer::Call::::update_exporter_config { - bridged_network, - bridge_location_fee: Some(Box::new(VersionedMultiAsset::V3( - new_bridge_location_fee.clone() - ))), - target_location_fee: Some(Box::new(VersionedMultiAsset::V3( - new_target_location_fee.clone() - ))), - } - ), - <::WeightInfo as pallet_bridge_transfer::weights::WeightInfo>::update_exporter_config() - ) - .ensure_complete()); - assert!(>::events() - .into_iter() - .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())) - .any(|e| matches!(e, pallet_bridge_transfer::Event::BridgeUpdated))); - { - let cfg = - pallet_bridge_transfer::Pallet::::allowed_exporters(&bridged_network); - assert!(cfg.is_some()); - let cfg = cfg.unwrap(); - assert_eq!(cfg.bridge_location, bridge_config.bridge_location); - assert_eq!(cfg.bridge_location_fee, Some(new_bridge_location_fee)); - assert_eq!(cfg.allowed_target_location, bridge_config.allowed_target_location); - assert_eq!(cfg.max_target_location_fee, Some(new_target_location_fee)); - } - - // governance can remove bridge config - assert_ok!(RuntimeHelper::::execute_as_governance( - runtime_call_encode( - pallet_bridge_transfer::Call::::remove_exporter_config { bridged_network } - ), - <::WeightInfo as pallet_bridge_transfer::weights::WeightInfo>::remove_exporter_config() - ) - .ensure_complete()); - assert!(pallet_bridge_transfer::Pallet::::allowed_exporters(&bridged_network) - .is_none()); - assert!(>::events() - .into_iter() - .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())) - .any(|e| matches!(e, pallet_bridge_transfer::Event::BridgeRemoved))); - }) -} - -/// Test-case makes sure that `Runtime` can manage `bridge_transfer in` configuration by governance -pub fn can_governance_change_bridge_transfer_in_configuration( - collator_session_keys: CollatorSessionKeys, - runtime_call_encode: Box) -> Vec>, - unwrap_pallet_bridge_transfer_event: Box< - dyn Fn(Vec) -> Option>, - >, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + cumulus_pallet_dmp_queue::Config - + pallet_bridge_transfer::Config, - AccountIdOf: Into<[u8; 32]>, - ValidatorIdOf: From>, - BalanceOf: From, - XcmConfig: xcm_executor::Config, -{ - ExtBuilder::::default() - .with_collators(collator_session_keys.collators()) - .with_session_keys(collator_session_keys.session_keys()) - .with_tracing() - .with_safe_xcm_version(3) - .build() - .execute_with(|| { - // bridge cfg data - let bridge_location = (Parent, Parachain(1013)).into(); - let alias_junction = GlobalConsensus(ByGenesis([9; 32])); - - // check before - assert!( - !pallet_bridge_transfer::impls::AllowedUniversalAliasesOf::::contains(&( - bridge_location, - alias_junction - )) - ); - - // governance can add bridge config - assert_ok!(RuntimeHelper::::execute_as_governance( - runtime_call_encode( - pallet_bridge_transfer::Call::::add_universal_alias { - location: Box::new(VersionedMultiLocation::V3(bridge_location.clone())), - junction: alias_junction, - } - ), - <::WeightInfo as pallet_bridge_transfer::weights::WeightInfo>::add_universal_alias() - ) - .ensure_complete()); - assert!(>::events() - .into_iter() - .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())) - .any(|e| matches!(e, pallet_bridge_transfer::Event::UniversalAliasAdded))); - - // check after - assert!(pallet_bridge_transfer::impls::AllowedUniversalAliasesOf::::contains( - &(bridge_location, alias_junction) - )); - }) -} - -/// Test-case makes sure that `Runtime` can initiate transfer of assets via bridge -pub fn initiate_transfer_asset_via_bridge_for_native_asset_works< - Runtime, - XcmConfig, - HrmpChannelOpener, - HrmpChannelSource, - LocationToAccountId, ->( - collator_session_keys: CollatorSessionKeys, - existential_deposit: BalanceOf, - alice_account: AccountIdOf, - unwrap_pallet_bridge_transfer_event: Box< - dyn Fn(Vec) -> Option>, - >, - unwrap_xcmp_queue_event: Box< - dyn Fn(Vec) -> Option>, - >, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + pallet_bridge_transfer::Config - + cumulus_pallet_xcmp_queue::Config, - AccountIdOf: Into<[u8; 32]>, - ValidatorIdOf: From>, - BalanceOf: From, - ::Balance: From + Into, - XcmConfig: xcm_executor::Config, - LocationToAccountId: Convert>, - ::AccountId: - Into<<::RuntimeOrigin as OriginTrait>::AccountId>, - <::Lookup as StaticLookup>::Source: - From<::AccountId>, - HrmpChannelOpener: frame_support::inherent::ProvideInherent< - Call = cumulus_pallet_parachain_system::Call, - >, - HrmpChannelSource: XcmpMessageSource, -{ - let runtime_para_id = 1000; - ExtBuilder::::default() - .with_collators(collator_session_keys.collators()) - .with_session_keys(collator_session_keys.session_keys()) - .with_tracing() - .with_safe_xcm_version(3) - .with_para_id(runtime_para_id.into()) - .build() - .execute_with(|| { - // prepare bridge config - let bridged_network = ByGenesis([6; 32]); - let bridge_hub_para_id = 1013; - let bridge_hub_location = (Parent, Parachain(bridge_hub_para_id)).into(); - let target_location_from_different_consensus = - MultiLocation::new(2, X2(GlobalConsensus(bridged_network), Parachain(1000))); - let target_location_fee: MultiAsset = (MultiLocation::parent(), 1_000_000).into(); - let bridge_config = pallet_bridge_transfer::BridgeConfig { - bridge_location: bridge_hub_location, - bridge_location_fee: None, - allowed_target_location: target_location_from_different_consensus, - max_target_location_fee: Some(target_location_fee.clone()), - }; - let reserve_account = - LocationToAccountId::convert_ref(&target_location_from_different_consensus) - .expect("Sovereign account for reserves"); - let balance_to_transfer = 1000_u128; - let native_asset = MultiLocation::parent(); - - // open HRMP to bridge hub - mock_open_hrmp_channel::( - runtime_para_id.into(), - bridge_hub_para_id.into(), - ); - - // drip ED to account - let alice_account_init_balance = existential_deposit + balance_to_transfer.into(); - let _ = >::deposit_creating( - &alice_account, - alice_account_init_balance.clone(), - ); - // SA of target location needs to have at least ED, anyway making reserve fails - let _ = >::deposit_creating( - &reserve_account, - existential_deposit, - ); - - // we just check here, that user remains enough balances after withdraw - // and also we check if `balance_to_transfer` is more than `existential_deposit`, - assert!( - (>::free_balance(&alice_account) - - balance_to_transfer.into()) >= - existential_deposit - ); - // SA has just ED - assert_eq!( - >::free_balance(&reserve_account), - existential_deposit - ); - - // insert bridge config - assert_ok!(>::add_exporter_config( - RuntimeHelper::::root_origin(), - bridged_network, - Box::new(bridge_config), - )); - - // local native asset (pallet_balances) - let assets = MultiAssets::from(MultiAsset { - fun: Fungible(balance_to_transfer.into()), - id: Concrete(native_asset), - }); - - // destination is (some) account from different consensus - let target_destination_account = target_location_from_different_consensus - .clone() - .appended_with(AccountId32 { - network: Some(bridged_network), - id: sp_runtime::AccountId32::new([3; 32]).into(), - }) - .unwrap(); - - // trigger asset transfer - assert_ok!(>::transfer_asset_via_bridge( - RuntimeHelper::::origin_of(alice_account.clone()), - Box::new(VersionedMultiAssets::from(assets.clone())), - Box::new(VersionedMultiLocation::from(target_destination_account.clone())), - )); - - // check alice account decreased - assert_eq!( - >::free_balance(&alice_account), - alice_account_init_balance - balance_to_transfer.into() - ); - // check reserve account increased - assert_eq!( - >::free_balance(&reserve_account), - existential_deposit + balance_to_transfer.into() - ); - - // check events - let mut bridge_transfer_events = >::events() - .into_iter() - .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())); - assert!(bridge_transfer_events.any(|r| matches!( - r, - pallet_bridge_transfer::Event::ReserveAssetsDeposited { .. } - ))); - let transfer_initiated_event = bridge_transfer_events.find_map(|e| match e { - pallet_bridge_transfer::Event::TransferInitiated { - message_id, - forwarded_message_id, - sender_cost, - } => Some((message_id, forwarded_message_id, sender_cost)), - _ => None, - }); - assert!(transfer_initiated_event.is_some()); - let (message_id, forwarded_message_id, sender_cost) = transfer_initiated_event.unwrap(); - // we expect UnpaidRemoteExporter - assert!(sender_cost.is_none()); - - // check that xcm was sent - let xcm_sent_message_hash = >::events() - .into_iter() - .filter_map(|e| unwrap_xcmp_queue_event(e.event.encode())) - .find_map(|e| match e { - cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { message_hash } => - Some(message_hash), - _ => None, - }); - - // read xcm - let xcm_sent = - RuntimeHelper::::take_xcm(bridge_hub_para_id.into()).unwrap(); - println!("xcm_sent: {:?}", xcm_sent); - assert_eq!( - xcm_sent_message_hash, - Some(xcm_sent.using_encoded(sp_io::hashing::blake2_256)) - ); - let mut xcm_sent: Xcm<()> = xcm_sent.try_into().expect("versioned xcm"); - - // check sent XCM ExportMessage to bridge-hub - assert!(xcm_sent - .0 - .matcher() - .match_next_inst(|instr| match instr { - // first instruction is UNpai (because we have explicit unpaid execution on bridge-hub now) - UnpaidExecution { weight_limit, check_origin } - if weight_limit == &Unlimited && check_origin.is_none() => - Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains UnpaidExecution") - .match_next_inst(|instr| match instr { - // second instruction is ExportMessage - ExportMessage { network, destination, xcm: inner_xcm } => { - assert_eq!(network, &bridged_network); - let (_, target_location_junctions_without_global_consensus) = - target_location_from_different_consensus - .interior - .clone() - .split_global() - .expect("split works"); - assert_eq!( - destination, - &target_location_junctions_without_global_consensus - ); - - let mut reanchored_assets = assets.clone(); - reanchored_assets - .reanchor( - &target_location_from_different_consensus, - XcmConfig::UniversalLocation::get(), - ) - .expect("reanchored assets"); - let mut reanchored_destination_account = target_destination_account.clone(); - reanchored_destination_account - .reanchor( - &target_location_from_different_consensus, - XcmConfig::UniversalLocation::get(), - ) - .expect("reanchored destination account"); - let universal_location_as_sovereign_account_on_target = - ::UniversalLocation::get() - .invert_target(&target_location_from_different_consensus) - .expect("invert_target Universal Location"); - - // match inner xcm - assert!(inner_xcm - .0 - .matcher() - .match_next_inst(|next_instr| match next_instr { - WithdrawAsset(fees) - if fees == &MultiAssets::from(target_location_fee.clone()) => - Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains WithdrawAsset") - .match_next_inst(|next_instr| match next_instr { - BuyExecution { ref fees, ref weight_limit } - if fees == &target_location_fee && - weight_limit == &Unlimited => - Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains BuyExecution") - .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { - ReserveAssetDeposited(ref deposited) - if deposited.eq(&reanchored_assets) => - Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains ReserveAssetDeposited") - .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { - DepositAsset { assets: filter, ref beneficiary } - if filter == - &MultiAssetFilter::from(reanchored_assets.clone()) && - beneficiary.eq(&reanchored_destination_account) => - Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains DepositAsset") - .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { - RefundSurplus => Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains RefundSurplus") - .match_next_inst(|inner_xcm_instr| { - match inner_xcm_instr { - DepositAsset { assets: filter, ref beneficiary } - if filter == - &MultiAssetFilter::from( - target_location_fee.clone(), - ) && beneficiary.eq( - &universal_location_as_sovereign_account_on_target, - ) => - Ok(()), - _ => Err(ProcessMessageError::BadFormat), - } - }) - .expect("contains DepositAsset") - .match_next_inst(|instr| match instr { - SetTopic(ref topic) if topic.eq(&message_id) => Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains SetTopic") - .assert_remaining_insts(0) - .is_ok()); - Ok(()) - }, - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains ExportMessage") - .match_next_inst(|instr| match instr { - SetTopic(ref topic) if topic.eq(&forwarded_message_id) => Ok(()), - _ => Err(ProcessMessageError::BadFormat), - }) - .expect("contains SetTopic") - .assert_remaining_insts(0) - .is_ok()); - }) -} - -/// Test-case makes sure that `Runtime` can process `ReserveAssetDeposited`. -pub fn receive_reserve_asset_deposited_from_different_consensus_works< - Runtime, - XcmConfig, - LocationToAccountId, - ForeignAssetsPalletInstance, ->( - collator_session_keys: CollatorSessionKeys, - existential_deposit: BalanceOf, - target_account: AccountIdOf, - unwrap_pallet_xcm_event: Box) -> Option>>, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + cumulus_pallet_xcmp_queue::Config - + pallet_assets::Config - + pallet_bridge_transfer::Config, - AccountIdOf: Into<[u8; 32]>, - ValidatorIdOf: From>, - BalanceOf: From, - ::AccountId: - Into<<::RuntimeOrigin as OriginTrait>::AccountId>, - <::Lookup as StaticLookup>::Source: - From<::AccountId>, - XcmConfig: xcm_executor::Config, - >::AssetId: - From + Into, - >::AssetIdParameter: - From + Into, - >::Balance: - From + Into, - LocationToAccountId: Convert>, - ForeignAssetsPalletInstance: 'static, -{ - let remote_network_id = ByGenesis([7; 32]); - let remote_parachain_as_origin = MultiLocation { - parents: 2, - interior: X2(GlobalConsensus(remote_network_id), Parachain(1000)), - }; - let foreign_asset_id_multilocation = - MultiLocation { parents: 2, interior: X1(GlobalConsensus(remote_network_id)) }; - let buy_execution_fee_amount = 50000000000; - let reserve_asset_deposisted = 100_000_000; - - let local_bridge_hub_multilocation = - MultiLocation { parents: 1, interior: X1(Parachain(1014)) }; - - ExtBuilder::::default() - .with_collators(collator_session_keys.collators()) - .with_session_keys(collator_session_keys.session_keys()) - .with_balances(vec![(target_account.clone(), existential_deposit)]) - .with_tracing() - .build() - .execute_with(|| { - // drip SA for remote global parachain origin - let remote_parachain_sovereign_account = - LocationToAccountId::convert_ref(remote_parachain_as_origin) - .expect("Sovereign account works"); - assert_ok!(>::force_set_balance( - RuntimeHelper::::root_origin(), - remote_parachain_sovereign_account.clone().into(), - existential_deposit + buy_execution_fee_amount.into(), - )); - - // setup bridge transfer configuration - // add allowed univeral alias for remote network - assert_ok!(>::add_universal_alias( - RuntimeHelper::::root_origin(), - Box::new(VersionedMultiLocation::V3(local_bridge_hub_multilocation)), - GlobalConsensus(remote_network_id) - )); - // add allowed reserve location - assert_ok!(>::add_reserve_location( - RuntimeHelper::::root_origin(), - Box::new(VersionedMultiLocation::V3(remote_parachain_as_origin)) - )); - - // create foreign asset - let asset_minimum_asset_balance = 1_000_000_u128; - assert_ok!( - >::force_create( - RuntimeHelper::::root_origin(), - foreign_asset_id_multilocation.clone().into(), - remote_parachain_sovereign_account.clone().into(), - false, - asset_minimum_asset_balance.into() - ) - ); - - // we assume here that BuyExecution fee goes to staking pot - let staking_pot_account_id = >::account_id(); - let local_bridge_hub_multilocation_as_account_id = - LocationToAccountId::convert_ref(&local_bridge_hub_multilocation) - .expect("Correct AccountId"); - - // check before - let remote_parachain_sovereign_account_balance_before = - >::free_balance( - &remote_parachain_sovereign_account, - ); - assert_eq!( - remote_parachain_sovereign_account_balance_before, - existential_deposit + buy_execution_fee_amount.into() - ); - assert_eq!( - >::free_balance(&target_account), - existential_deposit - ); - assert_eq!( - >::free_balance( - &local_bridge_hub_multilocation_as_account_id - ), - 0.into() - ); - assert_eq!( - >::free_balance(&staking_pot_account_id), - 0.into() - ); - assert_eq!( - >::balance( - foreign_asset_id_multilocation.into(), - &target_account - ), - 0.into() - ); - - // xcm - let xcm = Xcm(vec![ - UniversalOrigin(GlobalConsensus(remote_network_id)), - DescendOrigin(X1(Parachain(1000))), - // buying execution as sovereign account `remote_parachain_sovereign_account` in *native asset on receiving runtime* - WithdrawAsset(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(buy_execution_fee_amount), - }])), - BuyExecution { - fees: MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(buy_execution_fee_amount), - }, - weight_limit: Unlimited, - }, - // reserve deposited - assets transferred through bridge - *native asset on sending runtime* - ReserveAssetDeposited(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { - parents: 2, - interior: X1(GlobalConsensus(remote_network_id)), - }), - fun: Fungible(reserve_asset_deposisted), - }])), - DepositAsset { - assets: Definite(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { - parents: 2, - interior: X1(GlobalConsensus(remote_network_id)), - }), - fun: Fungible(reserve_asset_deposisted), - }])), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountId32 { - network: None, - id: target_account.clone().into(), - }), - }, - }, - // return unspent weight back to SA of caller - RefundSurplus, - DepositAsset { - assets: Definite(MultiAssets::from(vec![MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(buy_execution_fee_amount), - }])), - beneficiary: remote_parachain_as_origin, - }, - ]); - - // origin as BridgeHub - let origin = local_bridge_hub_multilocation; - - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - - // execute xcm as XcmpQueue would do - let outcome = XcmExecutor::::execute_xcm( - origin, - xcm, - hash, - RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), - ); - assert_eq!(outcome.ensure_complete(), Ok(())); - - // check after - let staking_pot_balance = - >::free_balance(&staking_pot_account_id); - assert_eq!( - >::free_balance( - &remote_parachain_sovereign_account - ), - remote_parachain_sovereign_account_balance_before - staking_pot_balance - ); - assert_eq!( - >::free_balance(&target_account), - existential_deposit - ); - assert_eq!( - >::free_balance( - &local_bridge_hub_multilocation_as_account_id - ), - 0.into() - ); - assert_ne!( - >::free_balance(&staking_pot_account_id), - 0.into() - ); - assert_eq!( - >::balance( - foreign_asset_id_multilocation.into(), - &target_account - ), - reserve_asset_deposisted.into() - ); - - // check NO asset trap occurred - assert_eq!( - false, - >::events() - .into_iter() - .filter_map(|e| unwrap_pallet_xcm_event(e.event.encode())) - .any(|e| matches!(e, pallet_xcm::Event::AssetsTrapped { .. })) - ); - }) -} diff --git a/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs b/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs new file mode 100644 index 00000000000..9e552fcf9cb --- /dev/null +++ b/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs @@ -0,0 +1,1116 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Module contains predefined test-case scenarios for `Runtime` with various assets over bridge transfer. + +use codec::Encode; +use cumulus_primitives_core::XcmpMessageSource; +use frame_support::{ + assert_ok, + traits::{Currency, Get, OriginTrait, ProcessMessageError}, +}; +use pallet_bridge_transfer_primitives::MaybePaidLocation; +use parachains_common::Balance; +use parachains_runtimes_test_utils::{ + mock_open_hrmp_channel, AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, RuntimeHelper, + ValidatorIdOf, XcmReceivedFrom, +}; +use sp_runtime::traits::StaticLookup; +use xcm::{latest::prelude::*, VersionedMultiAssets, VersionedMultiLocation}; +use xcm_builder::{CreateMatcher, MatchXcm}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; + +pub struct TestBridgingConfig { + pub bridged_network: NetworkId, + pub local_bridge_hub_para_id: u32, + pub local_bridge_hub_location: MaybePaidLocation, + pub bridged_target_location: MaybePaidLocation, +} + +/// Test-case makes sure that `Runtime` can initiate transfer of assets via bridge - `TransferKind::ReserveBased` +pub fn transfer_asset_via_bridge_initiate_reserve_based_for_native_asset_works< + Runtime, + XcmConfig, + HrmpChannelOpener, + HrmpChannelSource, + LocationToAccountId, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + alice_account: AccountIdOf, + unwrap_pallet_bridge_transfer_event: Box< + dyn Fn(Vec) -> Option>, + >, + unwrap_xcmp_queue_event: Box< + dyn Fn(Vec) -> Option>, + >, + ensure_configuration: fn() -> TestBridgingConfig, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + pallet_bridge_transfer::Config + + cumulus_pallet_xcmp_queue::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + ::Balance: From + Into, + XcmConfig: xcm_executor::Config, + LocationToAccountId: ConvertLocation>, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + HrmpChannelOpener: frame_support::inherent::ProvideInherent< + Call = cumulus_pallet_parachain_system::Call, + >, + HrmpChannelSource: XcmpMessageSource, +{ + let runtime_para_id = 1000; + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_tracing() + .with_safe_xcm_version(3) + .with_para_id(runtime_para_id.into()) + .build() + .execute_with(|| { + // prepare bridge config + let TestBridgingConfig { + bridged_network, + local_bridge_hub_para_id, + bridged_target_location: + MaybePaidLocation { + location: target_location_from_different_consensus, + maybe_fee: target_location_fee, + }, + .. + } = ensure_configuration(); + + // we expect paid target execution + let target_location_fee = target_location_fee.unwrap(); + + let reserve_account = + LocationToAccountId::convert_location(&target_location_from_different_consensus) + .expect("Sovereign account for reserves"); + let balance_to_transfer = 1000_u128; + let native_asset = MultiLocation::parent(); + + // open HRMP to bridge hub + mock_open_hrmp_channel::( + runtime_para_id.into(), + local_bridge_hub_para_id.into(), + ); + + // drip ED to account + let alice_account_init_balance = existential_deposit + balance_to_transfer.into(); + let _ = >::deposit_creating( + &alice_account, + alice_account_init_balance, + ); + // SA of target location needs to have at least ED, anyway making reserve fails + let _ = >::deposit_creating( + &reserve_account, + existential_deposit, + ); + + // we just check here, that user remains enough balances after withdraw + // and also we check if `balance_to_transfer` is more than `existential_deposit`, + assert!( + (>::free_balance(&alice_account) - + balance_to_transfer.into()) >= + existential_deposit + ); + // SA has just ED + assert_eq!( + >::free_balance(&reserve_account), + existential_deposit + ); + + // local native asset (pallet_balances) + let assets = MultiAssets::from(MultiAsset { + fun: Fungible(balance_to_transfer.into()), + id: Concrete(native_asset), + }); + + // destination is (some) account from different consensus + let target_destination_account = target_location_from_different_consensus + .appended_with(AccountId32 { + network: Some(bridged_network), + id: sp_runtime::AccountId32::new([3; 32]).into(), + }) + .unwrap(); + + // trigger asset transfer + assert_ok!(>::transfer_asset_via_bridge( + RuntimeHelper::::origin_of(alice_account.clone()), + Box::new(VersionedMultiAssets::from(assets.clone())), + Box::new(VersionedMultiLocation::from(target_destination_account)), + )); + + // check alice account decreased + assert_eq!( + >::free_balance(&alice_account), + alice_account_init_balance - balance_to_transfer.into() + ); + // check reserve account increased + assert_eq!( + >::free_balance(&reserve_account), + existential_deposit + balance_to_transfer.into() + ); + + // check events + let mut bridge_transfer_events = >::events() + .into_iter() + .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())); + assert!(bridge_transfer_events.any(|r| matches!( + r, + pallet_bridge_transfer::Event::ReserveAssetsDeposited { .. } + ))); + let transfer_initiated_event = bridge_transfer_events.find_map(|e| match e { + pallet_bridge_transfer::Event::TransferInitiated { + message_id, + forwarded_message_id, + sender_cost, + } => Some((message_id, forwarded_message_id, sender_cost)), + _ => None, + }); + assert!(transfer_initiated_event.is_some()); + let (message_id, forwarded_message_id, sender_cost) = transfer_initiated_event.unwrap(); + // we expect UnpaidRemoteExporter + assert!(sender_cost.is_none()); + + // check that xcm was sent + let xcm_sent_message_hash = >::events() + .into_iter() + .filter_map(|e| unwrap_xcmp_queue_event(e.event.encode())) + .find_map(|e| match e { + cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { message_hash } => + Some(message_hash), + _ => None, + }); + + // read xcm + let xcm_sent = + RuntimeHelper::::take_xcm(local_bridge_hub_para_id.into()) + .unwrap(); + println!("xcm_sent: {:?}", xcm_sent); + assert_eq!( + xcm_sent_message_hash, + Some(xcm_sent.using_encoded(sp_io::hashing::blake2_256)) + ); + let mut xcm_sent: Xcm<()> = xcm_sent.try_into().expect("versioned xcm"); + + // check sent XCM ExportMessage to bridge-hub + assert!(xcm_sent + .0 + .matcher() + .match_next_inst(|instr| match instr { + // first instruction is UNpai (because we have explicit unpaid execution on bridge-hub now) + UnpaidExecution { weight_limit, check_origin } + if weight_limit == &Unlimited && check_origin.is_none() => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains UnpaidExecution") + .match_next_inst(|instr| match instr { + // second instruction is ExportMessage + ExportMessage { network, destination, xcm: inner_xcm } => { + assert_eq!(network, &bridged_network); + let (_, target_location_junctions_without_global_consensus) = + target_location_from_different_consensus + .interior + .split_global() + .expect("split works"); + assert_eq!( + destination, + &target_location_junctions_without_global_consensus + ); + + let mut reanchored_assets = assets.clone(); + reanchored_assets + .reanchor( + &target_location_from_different_consensus, + XcmConfig::UniversalLocation::get(), + ) + .expect("reanchored assets"); + let mut reanchored_destination_account = target_destination_account; + reanchored_destination_account + .reanchor( + &target_location_from_different_consensus, + XcmConfig::UniversalLocation::get(), + ) + .expect("reanchored destination account"); + let universal_location_as_sovereign_account_on_target = + ::UniversalLocation::get() + .invert_target(&target_location_from_different_consensus) + .expect("invert_target Universal Location"); + + // match inner xcm + assert!(inner_xcm + .0 + .matcher() + .match_next_inst(|next_instr| match next_instr { + WithdrawAsset(fees) + if fees == &MultiAssets::from(target_location_fee.clone()) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains WithdrawAsset") + .match_next_inst(|next_instr| match next_instr { + BuyExecution { ref fees, ref weight_limit } + if fees == &target_location_fee && + weight_limit == &Unlimited => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains BuyExecution") + .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { + ReserveAssetDeposited(ref deposited) + if deposited.eq(&reanchored_assets) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains ReserveAssetDeposited") + .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { + DepositAsset { assets: filter, ref beneficiary } + if filter == + &MultiAssetFilter::from(reanchored_assets.clone()) && + beneficiary.eq(&reanchored_destination_account) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains DepositAsset") + .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { + RefundSurplus => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains RefundSurplus") + .match_next_inst(|inner_xcm_instr| { + match inner_xcm_instr { + DepositAsset { assets: filter, ref beneficiary } + if filter == + &MultiAssetFilter::from( + target_location_fee.clone(), + ) && beneficiary.eq( + &universal_location_as_sovereign_account_on_target, + ) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + } + }) + .expect("contains DepositAsset") + .match_next_inst(|instr| match instr { + SetTopic(ref topic) if topic.eq(&message_id) => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains SetTopic") + .assert_remaining_insts(0) + .is_ok()); + Ok(()) + }, + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains ExportMessage") + .match_next_inst(|instr| match instr { + SetTopic(ref topic) if topic.eq(&forwarded_message_id) => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains SetTopic") + .assert_remaining_insts(0) + .is_ok()); + }) +} + +/// Test-case makes sure that `Runtime` can initiate transfer of assets via bridge - `TransferKind::WithdrawReserve` +pub fn transfer_asset_via_bridge_initiate_withdraw_reserve_for_native_asset_works< + Runtime, + XcmConfig, + HrmpChannelOpener, + HrmpChannelSource, + LocationToAccountId, + ForeignAssetsPalletInstance, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + alice_account: AccountIdOf, + unwrap_pallet_bridge_transfer_event: Box< + dyn Fn(Vec) -> Option>, + >, + unwrap_xcmp_queue_event: Box< + dyn Fn(Vec) -> Option>, + >, + ensure_configuration: fn() -> TestBridgingConfig, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + pallet_assets::Config + + pallet_bridge_transfer::Config + + cumulus_pallet_xcmp_queue::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + ::Balance: From + Into, + XcmConfig: xcm_executor::Config, + LocationToAccountId: ConvertLocation>, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + HrmpChannelOpener: frame_support::inherent::ProvideInherent< + Call = cumulus_pallet_parachain_system::Call, + >, + HrmpChannelSource: XcmpMessageSource, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: + From + Into, + ForeignAssetsPalletInstance: 'static, +{ + let runtime_para_id = 1000; + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_tracing() + .with_safe_xcm_version(3) + .with_para_id(runtime_para_id.into()) + .build() + .execute_with(|| { + // prepare bridge config + let TestBridgingConfig { + bridged_network, + local_bridge_hub_para_id, + bridged_target_location: + MaybePaidLocation { + location: target_location_from_different_consensus, + maybe_fee: target_location_fee, + }, + .. + } = ensure_configuration(); + + // we expect paid target execution + let target_location_fee = target_location_fee.unwrap(); + + let foreign_asset_id_multilocation = + MultiLocation::new(2, X1(GlobalConsensus(bridged_network))); + + let reserve_account = + LocationToAccountId::convert_location(&target_location_from_different_consensus) + .expect("Sovereign account for reserves"); + let balance_to_transfer = 1000_u128; + let asset_minimum_asset_balance = 1_000_000_u128; + + // open HRMP to bridge hub + mock_open_hrmp_channel::( + runtime_para_id.into(), + local_bridge_hub_para_id.into(), + ); + + // drip ED to account + let _ = >::deposit_creating( + &alice_account, + existential_deposit, + ); + // SA of target location needs to have at least ED, anyway making reserve fails + let _ = >::deposit_creating( + &reserve_account, + existential_deposit, + ); + + // user already received native tokens from bridged chain, which are stored in `ForeignAssets` + { + //1. create foreign asset + assert_ok!( + >::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_multilocation.into(), + reserve_account.clone().into(), + false, + asset_minimum_asset_balance.into() + ) + ); + + // 2. drip asset to alice + assert_ok!(>::mint( + RuntimeHelper::::origin_of(reserve_account.clone()), + foreign_asset_id_multilocation.into(), + alice_account.clone().into(), + (asset_minimum_asset_balance + balance_to_transfer).into() + )); + } + + assert_eq!( + >::free_balance(&alice_account), + existential_deposit + ); + assert_eq!( + >::free_balance(&reserve_account), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + alice_account.clone() + ), + (asset_minimum_asset_balance + balance_to_transfer).into() + ); + + // lets withdraw previously reserve asset deposited from `ForeignAssets` + let assets = MultiAssets::from(MultiAsset { + fun: Fungible(balance_to_transfer.into()), + id: Concrete(foreign_asset_id_multilocation), + }); + + // destination is (some) account from different consensus + let target_destination_account = target_location_from_different_consensus + .appended_with(AccountId32 { + network: Some(bridged_network), + id: sp_runtime::AccountId32::new([3; 32]).into(), + }) + .unwrap(); + + // trigger asset transfer + assert_ok!(>::transfer_asset_via_bridge( + RuntimeHelper::::origin_of(alice_account.clone()), + Box::new(VersionedMultiAssets::from(assets.clone())), + Box::new(VersionedMultiLocation::from(target_destination_account)), + )); + + // check alice account (balances not changed) + assert_eq!( + >::free_balance(&alice_account), + existential_deposit + ); + // check reserve account (balances not changed) + assert_eq!( + >::free_balance(&reserve_account), + existential_deposit + ); + // `ForeignAssets` for alice account is decressed + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + alice_account.clone() + ), + asset_minimum_asset_balance.into() + ); + + // check events + let mut bridge_transfer_events = >::events() + .into_iter() + .filter_map(|e| unwrap_pallet_bridge_transfer_event(e.event.encode())); + assert!(bridge_transfer_events + .any(|r| matches!(r, pallet_bridge_transfer::Event::AssetsWithdrawn { .. }))); + let transfer_initiated_event = bridge_transfer_events.find_map(|e| match e { + pallet_bridge_transfer::Event::TransferInitiated { + message_id, + forwarded_message_id, + sender_cost, + } => Some((message_id, forwarded_message_id, sender_cost)), + _ => None, + }); + assert!(transfer_initiated_event.is_some()); + let (message_id, forwarded_message_id, sender_cost) = transfer_initiated_event.unwrap(); + // we expect UnpaidRemoteExporter + assert!(sender_cost.is_none()); + + // check that xcm was sent + let xcm_sent_message_hash = >::events() + .into_iter() + .filter_map(|e| unwrap_xcmp_queue_event(e.event.encode())) + .find_map(|e| match e { + cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { message_hash } => + Some(message_hash), + _ => None, + }); + + // read xcm + let xcm_sent = + RuntimeHelper::::take_xcm(local_bridge_hub_para_id.into()) + .unwrap(); + println!("xcm_sent: {:?}", xcm_sent); + assert_eq!( + xcm_sent_message_hash, + Some(xcm_sent.using_encoded(sp_io::hashing::blake2_256)) + ); + let mut xcm_sent: Xcm<()> = xcm_sent.try_into().expect("versioned xcm"); + + // check sent XCM ExportMessage to bridge-hub + assert!(xcm_sent + .0 + .matcher() + .match_next_inst(|instr| match instr { + // first instruction is UNpai (because we have explicit unpaid execution on bridge-hub now) + UnpaidExecution { weight_limit, check_origin } + if weight_limit == &Unlimited && check_origin.is_none() => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains UnpaidExecution") + .match_next_inst(|instr| match instr { + // second instruction is ExportMessage + ExportMessage { network, destination, xcm: inner_xcm } => { + assert_eq!(network, &bridged_network); + let (_, target_location_junctions_without_global_consensus) = + target_location_from_different_consensus + .interior + .split_global() + .expect("split works"); + assert_eq!( + destination, + &target_location_junctions_without_global_consensus + ); + + let mut reanchored_assets = assets.clone(); + reanchored_assets + .reanchor( + &target_location_from_different_consensus, + XcmConfig::UniversalLocation::get(), + ) + .expect("reanchored assets"); + let mut reanchored_destination_account = target_destination_account; + reanchored_destination_account + .reanchor( + &target_location_from_different_consensus, + XcmConfig::UniversalLocation::get(), + ) + .expect("reanchored destination account"); + let universal_location_as_sovereign_account_on_target = + ::UniversalLocation::get() + .invert_target(&target_location_from_different_consensus) + .expect("invert_target Universal Location"); + + // match inner xcm + assert!(inner_xcm + .0 + .matcher() + .match_next_inst(|next_instr| match next_instr { + WithdrawAsset(fees) + if fees == &MultiAssets::from(target_location_fee.clone()) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains WithdrawAsset") + .match_next_inst(|next_instr| match next_instr { + BuyExecution { ref fees, ref weight_limit } + if fees == &target_location_fee && + weight_limit == &Unlimited => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains BuyExecution") + .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { + WithdrawAsset(ref deposited) + if deposited.eq(&reanchored_assets) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains WithdrawAsset") + .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { + DepositAsset { assets: filter, ref beneficiary } + if filter == + &MultiAssetFilter::from(reanchored_assets.clone()) && + beneficiary.eq(&reanchored_destination_account) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains DepositAsset") + .match_next_inst(|inner_xcm_instr| match inner_xcm_instr { + RefundSurplus => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains RefundSurplus") + .match_next_inst(|inner_xcm_instr| { + match inner_xcm_instr { + DepositAsset { assets: filter, ref beneficiary } + if filter == + &MultiAssetFilter::from( + target_location_fee.clone(), + ) && beneficiary.eq( + &universal_location_as_sovereign_account_on_target, + ) => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + } + }) + .expect("contains DepositAsset") + .match_next_inst(|instr| match instr { + SetTopic(ref topic) if topic.eq(&message_id) => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains SetTopic") + .assert_remaining_insts(0) + .is_ok()); + Ok(()) + }, + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains ExportMessage") + .match_next_inst(|instr| match instr { + SetTopic(ref topic) if topic.eq(&forwarded_message_id) => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("contains SetTopic") + .assert_remaining_insts(0) + .is_ok()); + }) +} + +/// Test-case makes sure that `Runtime` can process `ReserveAssetDeposited`. +pub fn receive_reserve_asset_deposited_from_different_consensus_over_bridge_works< + Runtime, + XcmConfig, + LocationToAccountId, + ForeignAssetsPalletInstance, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + target_account: AccountIdOf, + unwrap_pallet_xcm_event: Box) -> Option>>, + ensure_configuration: fn() -> TestBridgingConfig, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + cumulus_pallet_xcmp_queue::Config + + pallet_assets::Config + + pallet_bridge_transfer::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + XcmConfig: xcm_executor::Config, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: + From + Into, + LocationToAccountId: ConvertLocation>, + ForeignAssetsPalletInstance: 'static, +{ + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![(target_account.clone(), existential_deposit)]) + .with_tracing() + .build() + .execute_with(|| { + // prepare bridge config + let TestBridgingConfig { + bridged_network: remote_network_id, + local_bridge_hub_location: + MaybePaidLocation { location: local_bridge_hub_location, .. }, + bridged_target_location: + MaybePaidLocation { location: remote_parachain_as_origin, .. }, + .. + } = ensure_configuration(); + + let foreign_asset_id_multilocation = + MultiLocation { parents: 2, interior: X1(GlobalConsensus(remote_network_id)) }; + + let buy_execution_fee_amount = 50000000000; + let reserve_asset_deposisted = 100_000_000; + + // drip SA for remote global parachain origin + let remote_parachain_sovereign_account = + LocationToAccountId::convert_location(&remote_parachain_as_origin) + .expect("Sovereign account works"); + assert_ok!(>::force_set_balance( + RuntimeHelper::::root_origin(), + remote_parachain_sovereign_account.clone().into(), + existential_deposit + buy_execution_fee_amount.into(), + )); + + // create foreign asset + let asset_minimum_asset_balance = 1_000_000_u128; + assert_ok!( + >::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_multilocation.into(), + remote_parachain_sovereign_account.clone().into(), + false, + asset_minimum_asset_balance.into() + ) + ); + + // we assume here that BuyExecution fee goes to staking pot + let staking_pot_account_id = >::account_id(); + assert_ok!(>::force_set_balance( + RuntimeHelper::::root_origin(), + staking_pot_account_id.clone().into(), + existential_deposit, + )); + + let local_bridge_hub_multilocation_as_account_id = + LocationToAccountId::convert_location(&local_bridge_hub_location) + .expect("Correct AccountId"); + + // check before + let remote_parachain_sovereign_account_balance_before = + >::free_balance( + &remote_parachain_sovereign_account, + ); + assert_eq!( + remote_parachain_sovereign_account_balance_before, + existential_deposit + buy_execution_fee_amount.into() + ); + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + assert_eq!( + >::free_balance( + &local_bridge_hub_multilocation_as_account_id + ), + 0.into() + ); + assert_eq!( + >::free_balance(&staking_pot_account_id), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &target_account + ), + 0.into() + ); + + // xcm + let xcm = Xcm(vec![ + UniversalOrigin(GlobalConsensus(remote_network_id)), + DescendOrigin(X1(Parachain(1000))), + // buying execution as sovereign account `remote_parachain_sovereign_account` in *native asset on receiving runtime* + WithdrawAsset(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(buy_execution_fee_amount), + }])), + BuyExecution { + fees: MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(buy_execution_fee_amount), + }, + weight_limit: Unlimited, + }, + // reserve deposited - assets transferred through bridge - *native asset on sending runtime* + ReserveAssetDeposited(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { + parents: 2, + interior: X1(GlobalConsensus(remote_network_id)), + }), + fun: Fungible(reserve_asset_deposisted), + }])), + DepositAsset { + assets: Definite(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { + parents: 2, + interior: X1(GlobalConsensus(remote_network_id)), + }), + fun: Fungible(reserve_asset_deposisted), + }])), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: target_account.clone().into(), + }), + }, + }, + // return unspent weight back to SA of caller + RefundSurplus, + DepositAsset { + assets: Definite(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(buy_execution_fee_amount), + }])), + beneficiary: remote_parachain_as_origin, + }, + ]); + + // origin as BridgeHub + let origin = local_bridge_hub_location; + + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + // execute xcm as XcmpQueue would do + let outcome = XcmExecutor::::execute_xcm( + origin, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ); + assert_eq!(outcome.ensure_complete(), Ok(())); + + // check after + let expected_buy_execution_fee = + >::free_balance(&staking_pot_account_id) - + existential_deposit; + assert_eq!( + >::free_balance( + &remote_parachain_sovereign_account + ), + remote_parachain_sovereign_account_balance_before - expected_buy_execution_fee + ); + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + assert_eq!( + >::free_balance( + &local_bridge_hub_multilocation_as_account_id + ), + 0.into() + ); + assert_ne!( + >::free_balance(&staking_pot_account_id), + 0.into() + ); + assert_eq!( + >::balance( + foreign_asset_id_multilocation.into(), + &target_account + ), + reserve_asset_deposisted.into() + ); + + // check NO asset trap occurred + assert_eq!( + false, + >::events() + .into_iter() + .filter_map(|e| unwrap_pallet_xcm_event(e.event.encode())) + .any(|e| matches!(e, pallet_xcm::Event::AssetsTrapped { .. })) + ); + }) +} + +/// Test-case makes sure that `Runtime` can process reserve withdraw which was sent over bridge. +pub fn withdraw_reserve_asset_deposited_from_different_consensus_over_bridge_works< + Runtime, + XcmConfig, + LocationToAccountId, +>( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + target_account: AccountIdOf, + unwrap_pallet_xcm_event: Box) -> Option>>, + ensure_configuration: fn() -> TestBridgingConfig, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + cumulus_pallet_xcmp_queue::Config + + pallet_bridge_transfer::Config, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + XcmConfig: xcm_executor::Config, + LocationToAccountId: ConvertLocation>, +{ + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![(target_account.clone(), existential_deposit)]) + .with_tracing() + .build() + .execute_with(|| { + // prepare bridge config + let TestBridgingConfig { + bridged_network: remote_network_id, + local_bridge_hub_location: + MaybePaidLocation { location: local_bridge_hub_location, .. }, + bridged_target_location: + MaybePaidLocation { location: remote_parachain_as_origin, .. }, + .. + } = ensure_configuration(); + + let buy_execution_fee_amount = 50000000000; + let reserve_asset_deposisted = 100_000_000; + + // add reserved assets to SA for remote global parachain origin (this is how reserve was done, when reserve_asset_deposisted was transferred out) + let remote_parachain_sovereign_account = + LocationToAccountId::convert_location(&remote_parachain_as_origin) + .expect("Sovereign account works"); + assert_ok!(>::force_set_balance( + RuntimeHelper::::root_origin(), + remote_parachain_sovereign_account.clone().into(), + existential_deposit + + buy_execution_fee_amount.into() + + reserve_asset_deposisted.into(), + )); + + // we assume here that BuyExecution fee goes to staking pot + let staking_pot_account_id = >::account_id(); + assert_ok!(>::force_set_balance( + RuntimeHelper::::root_origin(), + staking_pot_account_id.clone().into(), + existential_deposit, + )); + + let local_bridge_hub_multilocation_as_account_id = + LocationToAccountId::convert_location(&local_bridge_hub_location) + .expect("Correct AccountId"); + + // check before + let remote_parachain_sovereign_account_balance_before = + >::free_balance( + &remote_parachain_sovereign_account, + ); + assert_eq!( + remote_parachain_sovereign_account_balance_before, + existential_deposit + + buy_execution_fee_amount.into() + + reserve_asset_deposisted.into() + ); + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + assert_eq!( + >::free_balance( + &local_bridge_hub_multilocation_as_account_id + ), + 0.into() + ); + assert_eq!( + >::free_balance(&staking_pot_account_id), + existential_deposit + ); + + // xcm + let xcm = Xcm(vec![ + UniversalOrigin(GlobalConsensus(remote_network_id)), + DescendOrigin(X1(Parachain(1000))), + // buying execution as sovereign account `remote_parachain_sovereign_account` in *native asset on receiving runtime* + WithdrawAsset(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(buy_execution_fee_amount), + }])), + BuyExecution { + fees: MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(buy_execution_fee_amount), + }, + weight_limit: Unlimited, + }, + // we are returning reserve deposited - assets transferred through bridge - *native asset on receiving runtime* + WithdrawAsset(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(reserve_asset_deposisted), + }])), + DepositAsset { + assets: Definite(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(reserve_asset_deposisted), + }])), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountId32 { + network: None, + id: target_account.clone().into(), + }), + }, + }, + // return unspent weight back to SA of caller + RefundSurplus, + DepositAsset { + assets: Definite(MultiAssets::from(vec![MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(buy_execution_fee_amount), + }])), + beneficiary: remote_parachain_as_origin, + }, + ]); + + // origin as BridgeHub + let origin = local_bridge_hub_location; + + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + // execute xcm as XcmpQueue would do + let outcome = XcmExecutor::::execute_xcm( + origin, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ); + assert_eq!(outcome.ensure_complete(), Ok(())); + + // check after + let expected_buy_execution_fee = + >::free_balance(&staking_pot_account_id) - + existential_deposit; + // check if SA reserve was withdrawn + assert_eq!( + >::free_balance( + &remote_parachain_sovereign_account + ), + remote_parachain_sovereign_account_balance_before - + expected_buy_execution_fee - + reserve_asset_deposisted.into() + ); + // here target_account received reserve + assert_eq!( + >::free_balance(&target_account), + existential_deposit + reserve_asset_deposisted.into() + ); + assert_eq!( + >::free_balance( + &local_bridge_hub_multilocation_as_account_id + ), + 0.into() + ); + assert_ne!( + >::free_balance(&staking_pot_account_id), + 0.into() + ); + + // check NO asset trap occurred + assert_eq!( + false, + >::events() + .into_iter() + .filter_map(|e| unwrap_pallet_xcm_event(e.event.encode())) + .any(|e| matches!(e, pallet_xcm::Event::AssetsTrapped { .. })) + ); + }) +} diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_bridge_transfer.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_bridge_transfer.rs deleted file mode 100644 index e6ec448388c..00000000000 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_bridge_transfer.rs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 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_bridge_transfer` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 - -// Executed Command: -// target/production/polkadot-parachain -// benchmark -// pallet -// --steps=50 -// --repeat=20 -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json -// --pallet=pallet_bridge_transfer -// --chain=westmint-dev -// --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/ - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_bridge_transfer`. -pub struct WeightInfo(PhantomData); -impl pallet_bridge_transfer::WeightInfo for WeightInfo { - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BridgeTransfer AllowedExporters (r:1 w:0) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Storage: Assets Asset (r:1 w:1) - /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) - /// Storage: Assets Account (r:2 w:2) - /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) - /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) - fn transfer_asset_via_bridge() -> Weight { - // Proof Size summary in bytes: - // Measured: `732` - // Estimated: `6208` - // Minimum execution time: 151_961_000 picoseconds. - Weight::from_parts(153_658_000, 0) - .saturating_add(Weight::from_parts(0, 6208)) - .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(8)) - } - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BridgeTransfer AllowedExporters (r:1 w:0) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - /// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1) - /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) - /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) - /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) - fn ping_via_bridge() -> Weight { - // Proof Size summary in bytes: - // Measured: `381` - // Estimated: `6002` - // Minimum execution time: 64_672_000 picoseconds. - Weight::from_parts(65_698_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: BridgeTransfer AllowedExporters (r:1 w:1) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn add_exporter_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `6002` - // Minimum execution time: 16_205_000 picoseconds. - Weight::from_parts(16_584_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedExporters (r:1 w:1) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - fn remove_exporter_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `6002` - // Minimum execution time: 13_171_000 picoseconds. - Weight::from_parts(13_598_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedExporters (r:1 w:1) - /// Proof: BridgeTransfer AllowedExporters (max_values: None, max_size: Some(2537), added: 5012, mode: MaxEncodedLen) - fn update_exporter_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `6002` - // Minimum execution time: 16_666_000 picoseconds. - Weight::from_parts(16_847_000, 0) - .saturating_add(Weight::from_parts(0, 6002)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedUniversalAliases (r:1 w:1) - /// Proof: BridgeTransfer AllowedUniversalAliases (max_values: None, max_size: Some(2419), added: 4894, mode: MaxEncodedLen) - fn add_universal_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `5884` - // Minimum execution time: 11_874_000 picoseconds. - Weight::from_parts(12_188_000, 0) - .saturating_add(Weight::from_parts(0, 5884)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedUniversalAliases (r:1 w:1) - /// Proof: BridgeTransfer AllowedUniversalAliases (max_values: None, max_size: Some(2419), added: 4894, mode: MaxEncodedLen) - fn remove_universal_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `158` - // Estimated: `5884` - // Minimum execution time: 15_103_000 picoseconds. - Weight::from_parts(15_497_000, 0) - .saturating_add(Weight::from_parts(0, 5884)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedReserveLocations (r:1 w:1) - /// Proof: BridgeTransfer AllowedReserveLocations (max_values: Some(1), max_size: Some(4817), added: 5312, mode: MaxEncodedLen) - fn add_reserve_location() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `6302` - // Minimum execution time: 11_624_000 picoseconds. - Weight::from_parts(11_983_000, 0) - .saturating_add(Weight::from_parts(0, 6302)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: BridgeTransfer AllowedReserveLocations (r:1 w:1) - /// Proof: BridgeTransfer AllowedReserveLocations (max_values: Some(1), max_size: Some(4817), added: 5312, mode: MaxEncodedLen) - fn remove_reserve_location() -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `6302` - // Minimum execution time: 13_568_000 picoseconds. - Weight::from_parts(13_867_000, 0) - .saturating_add(Weight::from_parts(0, 6302)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_nft_fractionalization.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_nft_fractionalization.rs deleted file mode 100644 index d8db24f50e6..00000000000 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_nft_fractionalization.rs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 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_nfts` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 - -// Executed Command: -// ./artifacts/polkadot-parachain -// benchmark -// pallet -// --chain=westmint-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet_nft_fractionalization -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/assets/westmint/src/weights/pallet_nft_fractionalization.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_nfts`. -pub struct WeightInfo(PhantomData); -impl pallet_nft_fractionalization::WeightInfo for WeightInfo { - fn fractionalize() -> Weight { - // Minimum execution time: 44_312 nanoseconds. - Weight::from_parts(25_147_000, 3549) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - fn unify() -> Weight { - // Minimum execution time: 31_654 nanoseconds. - Weight::from_parts(25_147_000, 3549) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } -} diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md index d457bc770ea..b187f1da2db 100644 --- a/parachains/runtimes/bridge-hubs/README.md +++ b/parachains/runtimes/bridge-hubs/README.md @@ -78,7 +78,7 @@ cargo build --release -p substrate-relay cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay --- -# 5. Build polkadot-parachain-mint binary with statemine/westmint for moving assets +# 5. Build polkadot-parachain-mint binary with `asset-hub-kusama`/`asset-hub-westend` for moving assets cd # TODO:check-parameter - change this when merged to master git checkout -b bko-transfer-asset-via-bridge --track origin/bko-transfer-asset-via-bridge @@ -195,26 +195,26 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ #### Local zombienet run -1. allow bridge transfer on statemine/westmint (governance-like): +1. allow bridge transfer on kusama/westend asset hubs (governance-like): ``` ./scripts/bridges_rococo_wococo.sh allow-transfers-local ``` -2. do (asset) transfer from statemine to westmint +2. do (asset) transfer from kusama's asset hub to westend's asset hub: ``` - ./scripts/bridges_rococo_wococo.sh transfer-asset-from-statemine-local + ./scripts/bridges_rococo_wococo.sh transfer-asset-from-asset-hub-kusama-local ``` -3. do (ping) transfer from statemine to westmint +3. do (ping) transfer from kusama's asset hub to westend's asset hub ``` - ./scripts/bridges_rococo_wococo.sh ping-via-bridge-from-statemine-local + ./scripts/bridges_rococo_wococo.sh ping-via-bridge-from-asset-hub-kusama-local ``` - open explorers: (see zombienets) - - Statemine (see events `xcmpQueue.XcmpMessageSent`, `bridgeTransfer.ReserveAssetsDeposited`, `bridgeTransfer.TransferInitiated`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9910#/explorer + - Kusama Asset Hub (see events `xcmpQueue.XcmpMessageSent`, `bridgeTransfer.ReserveAssetsDeposited`, `bridgeTransfer.TransferInitiated`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9910#/explorer - BridgeHubRococo (see `bridgeWococoMessages.MessageAccepted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer - BridgeHubWococo (see `bridgeRococoMessages.MessagesReceived`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer - - Westmint (see `xcmpQueue.Success` for `transfer-asset` and `xcmpQueue.Fail` for `ping-via-bridge`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9010#/explorer + - Westend Asset Hub (see `xcmpQueue.Success` for `transfer-asset` and `xcmpQueue.Fail` for `ping-via-bridge`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9010#/explorer - BridgeHubRococo (see `bridgeWococoMessages.MessagesDelivered`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer #### Live Rockmine2 to Wockmint @@ -222,9 +222,9 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ``` cd - ./scripts/bridges_rococo_wococo.sh transfer-asset-from-statemine-rococo + ./scripts/bridges_rococo_wococo.sh transfer-asset-from-asset-hub-rococo or - ./scripts/bridges_rococo_wococo.sh ping-via-bridge-from-statemine-rococo + ./scripts/bridges_rococo_wococo.sh ping-via-bridge-from-asset-hub-rococo ``` - open explorers: diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index 4853ad2eb60..1d2e31c70ff 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -11,9 +11,9 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1" } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true, features = ["derive"] } +serde = { version = "1.0.164", optional = true, features = ["derive"] } smallvec = "1.8.1" # Substrate diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 86964af6ced..0493156be6f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -46,7 +46,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, + traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -342,6 +342,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -573,6 +574,29 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + impl cumulus_primitives_core::CollectCollationInfo for Runtime { fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { ParachainSystem::collect_collation_info(header) @@ -714,6 +738,10 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Err(BenchmarkError::Skip) } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs index caf5ce9f44e..23ed6b013f7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_497_000 picoseconds. - Weight::from_parts(5_680_000, 0) + // Minimum execution time: 5_561_000 picoseconds. + Weight::from_parts(5_800_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_600_000 picoseconds. - Weight::from_parts(5_855_000, 0) + // Minimum execution time: 5_664_000 picoseconds. + Weight::from_parts(5_826_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs index 94ac23e26eb..111a86a5666 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 53_880_000 picoseconds. - Weight::from_parts(54_466_000, 0) + // Minimum execution time: 63_775_000 picoseconds. + Weight::from_parts(64_181_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 41_306_000 picoseconds. - Weight::from_parts(41_665_000, 0) + // Minimum execution time: 47_986_000 picoseconds. + Weight::from_parts(48_308_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 16_599_000 picoseconds. - Weight::from_parts(16_864_000, 0) + // Minimum execution time: 18_083_000 picoseconds. + Weight::from_parts(18_380_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 23_502_000 picoseconds. - Weight::from_parts(24_050_000, 0) + // Minimum execution time: 26_341_000 picoseconds. + Weight::from_parts(26_703_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 55_856_000 picoseconds. - Weight::from_parts(56_352_000, 0) + // Minimum execution time: 66_227_000 picoseconds. + Weight::from_parts(67_321_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 49_975_000 picoseconds. - Weight::from_parts(50_428_000, 0) + // Minimum execution time: 59_472_000 picoseconds. + Weight::from_parts(60_842_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 19_123_000 picoseconds. - Weight::from_parts(19_504_000, 0) + // Minimum execution time: 21_497_000 picoseconds. + Weight::from_parts(21_684_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 18_190_000 picoseconds. - Weight::from_parts(18_547_000, 0) + // Minimum execution time: 20_385_000 picoseconds. + Weight::from_parts(20_587_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 10_152 - .saturating_add(Weight::from_parts(14_418_366, 0).saturating_mul(u.into())) + // Standard Error: 10_001 + .saturating_add(Weight::from_parts(16_801_557, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs index 1d48699a2e8..59a867d8ab2 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `214 + b * (78 ±0)` // Estimated: `1203 + b * (2554 ±0)` - // Minimum execution time: 15_037_000 picoseconds. - Weight::from_parts(15_261_610, 0) + // Minimum execution time: 14_702_000 picoseconds. + Weight::from_parts(14_995_989, 0) .saturating_add(Weight::from_parts(0, 1203)) - // Standard Error: 3_033 - .saturating_add(Weight::from_parts(2_590_070, 0).saturating_mul(b.into())) + // Standard Error: 2_975 + .saturating_add(Weight::from_parts(2_630_139, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_317_000 picoseconds. - Weight::from_parts(7_493_000, 0) + // Minimum execution time: 6_916_000 picoseconds. + Weight::from_parts(7_224_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_580_000 picoseconds. - Weight::from_parts(7_821_000, 0) + // Minimum execution time: 7_035_000 picoseconds. + Weight::from_parts(7_334_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1104 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 42_783_000 picoseconds. - Weight::from_parts(35_128_208, 0) + // Minimum execution time: 42_377_000 picoseconds. + Weight::from_parts(34_785_115, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_291 - .saturating_add(Weight::from_parts(109_890, 0).saturating_mul(c.into())) + // Standard Error: 1_226 + .saturating_add(Weight::from_parts(101_867, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `428 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 34_135_000 picoseconds. - Weight::from_parts(23_714_718, 0) + // Minimum execution time: 33_648_000 picoseconds. + Weight::from_parts(24_533_176, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_293 - .saturating_add(Weight::from_parts(108_542, 0).saturating_mul(c.into())) + // Standard Error: 1_388 + .saturating_add(Weight::from_parts(103_733, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `155` // Estimated: `6196` - // Minimum execution time: 44_345_000 picoseconds. - Weight::from_parts(44_853_000, 0) + // Minimum execution time: 44_705_000 picoseconds. + Weight::from_parts(45_288_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22815 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2602 ±0)` - // Minimum execution time: 16_932_000 picoseconds. - Weight::from_parts(17_022_000, 0) + // Minimum execution time: 16_845_000 picoseconds. + Weight::from_parts(16_962_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 901_942 - .saturating_add(Weight::from_parts(31_973_621, 0).saturating_mul(c.into())) + // Standard Error: 858_960 + .saturating_add(Weight::from_parts(30_464_644, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs index f6a3b504a67..ac7f2efb023 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_985_000 picoseconds. - Weight::from_parts(12_506_234, 0) + // Minimum execution time: 11_056_000 picoseconds. + Weight::from_parts(11_510_137, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2 - .saturating_add(Weight::from_parts(601, 0).saturating_mul(z.into())) + // Standard Error: 1 + .saturating_add(Weight::from_parts(528, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 41_586_000 picoseconds. - Weight::from_parts(35_547_263, 0) + // Minimum execution time: 41_105_000 picoseconds. + Weight::from_parts(34_947_072, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 376 - .saturating_add(Weight::from_parts(69_533, 0).saturating_mul(s.into())) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_289, 0).saturating_mul(z.into())) + // Standard Error: 499 + .saturating_add(Weight::from_parts(67_375, 0).saturating_mul(s.into())) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_227, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 27_819_000 picoseconds. - Weight::from_parts(21_900_751, 0) + // Minimum execution time: 26_640_000 picoseconds. + Weight::from_parts(21_515_344, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 292 - .saturating_add(Weight::from_parts(65_723, 0).saturating_mul(s.into())) - // Standard Error: 2 - .saturating_add(Weight::from_parts(1_301, 0).saturating_mul(z.into())) + // Standard Error: 943 + .saturating_add(Weight::from_parts(58_769, 0).saturating_mul(s.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(1_233, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `388 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 46_840_000 picoseconds. - Weight::from_parts(39_004_058, 0) + // Minimum execution time: 45_875_000 picoseconds. + Weight::from_parts(38_052_994, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 490 - .saturating_add(Weight::from_parts(86_465, 0).saturating_mul(s.into())) + // Standard Error: 507 + .saturating_add(Weight::from_parts(82_957, 0).saturating_mul(s.into())) // Standard Error: 4 - .saturating_add(Weight::from_parts(1_317, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_277, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 32_549_000 picoseconds. - Weight::from_parts(33_945_862, 0) + // Minimum execution time: 32_359_000 picoseconds. + Weight::from_parts(33_845_761, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 599 - .saturating_add(Weight::from_parts(74_298, 0).saturating_mul(s.into())) + // Standard Error: 623 + .saturating_add(Weight::from_parts(69_809, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 19_264_000 picoseconds. - Weight::from_parts(20_336_652, 0) + // Minimum execution time: 18_791_000 picoseconds. + Weight::from_parts(20_017_375, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 420 - .saturating_add(Weight::from_parts(67_305, 0).saturating_mul(s.into())) + // Standard Error: 466 + .saturating_add(Weight::from_parts(64_780, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 33_469_000 picoseconds. - Weight::from_parts(35_060_138, 0) + // Minimum execution time: 33_132_000 picoseconds. + Weight::from_parts(34_485_734, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 575 - .saturating_add(Weight::from_parts(72_357, 0).saturating_mul(s.into())) + // Standard Error: 601 + .saturating_add(Weight::from_parts(70_191, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs index 653161034d9..215267bb090 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `297` // Estimated: `3762` - // Minimum execution time: 17_971_000 picoseconds. - Weight::from_parts(18_440_000, 0) + // Minimum execution time: 17_809_000 picoseconds. + Weight::from_parts(18_215_000, 0) .saturating_add(Weight::from_parts(0, 3762)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `279` // Estimated: `3744` - // Minimum execution time: 13_516_000 picoseconds. - Weight::from_parts(13_855_000, 0) + // Minimum execution time: 13_565_000 picoseconds. + Weight::from_parts(13_841_000, 0) .saturating_add(Weight::from_parts(0, 3744)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs index a7e0a69ca71..4b86e3bc416 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `49` // Estimated: `1493` - // Minimum execution time: 7_754_000 picoseconds. - Weight::from_parts(7_961_000, 0) + // Minimum execution time: 7_796_000 picoseconds. + Weight::from_parts(8_128_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 3_099_000 picoseconds. - Weight::from_parts(3_194_000, 0) + // Minimum execution time: 3_268_000 picoseconds. + Weight::from_parts(3_351_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs index b9ab2ec61e5..e54fee154f0 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_486_000 picoseconds. - Weight::from_parts(4_952_171, 0) + // Minimum execution time: 7_032_000 picoseconds. + Weight::from_parts(7_713_695, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_744 - .saturating_add(Weight::from_parts(4_878_827, 0).saturating_mul(c.into())) + // Standard Error: 2_526 + .saturating_add(Weight::from_parts(4_329_716, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_441_000 picoseconds. - Weight::from_parts(5_550_000, 0) + // Minimum execution time: 4_961_000 picoseconds. + Weight::from_parts(5_064_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_417_000 picoseconds. - Weight::from_parts(3_647_457, 0) + // Minimum execution time: 6_955_000 picoseconds. + Weight::from_parts(17_856_282, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_303 - .saturating_add(Weight::from_parts(5_198_660, 0).saturating_mul(c.into())) + // Standard Error: 3_463 + .saturating_add(Weight::from_parts(4_554_734, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_828_000 picoseconds. - Weight::from_parts(10_044_000, 0) + // Minimum execution time: 8_841_000 picoseconds. + Weight::from_parts(9_004_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_599_000 picoseconds. - Weight::from_parts(7_657_000, 0) + // Minimum execution time: 6_737_000 picoseconds. + Weight::from_parts(7_653_355, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_773 - .saturating_add(Weight::from_parts(4_893_962, 0).saturating_mul(c.into())) + // Standard Error: 3_915 + .saturating_add(Weight::from_parts(4_372_646, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs index ec1fd4a40d3..1c721a37230 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -62,8 +62,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `38` // Estimated: `3503` - // Minimum execution time: 27_316_000 picoseconds. - Weight::from_parts(27_658_000, 0) + // Minimum execution time: 25_931_000 picoseconds. + Weight::from_parts(26_340_000, 0) .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1489` - // Minimum execution time: 29_202_000 picoseconds. - Weight::from_parts(29_681_000, 0) + // Minimum execution time: 25_691_000 picoseconds. + Weight::from_parts(25_971_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -105,8 +105,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_266_000 picoseconds. - Weight::from_parts(10_449_000, 0) + // Minimum execution time: 9_572_000 picoseconds. + Weight::from_parts(9_924_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -116,8 +116,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_095_000 picoseconds. - Weight::from_parts(3_171_000, 0) + // Minimum execution time: 2_997_000 picoseconds. + Weight::from_parts(3_136_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -141,8 +141,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `38` // Estimated: `3503` - // Minimum execution time: 31_614_000 picoseconds. - Weight::from_parts(32_390_000, 0) + // Minimum execution time: 30_271_000 picoseconds. + Weight::from_parts(30_819_000, 0) .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -165,8 +165,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `220` // Estimated: `3685` - // Minimum execution time: 33_334_000 picoseconds. - Weight::from_parts(33_789_000, 0) + // Minimum execution time: 32_302_000 picoseconds. + Weight::from_parts(32_807_000, 0) .saturating_add(Weight::from_parts(0, 3685)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -177,8 +177,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_178_000 picoseconds. - Weight::from_parts(3_261_000, 0) + // Minimum execution time: 2_960_000 picoseconds. + Weight::from_parts(3_094_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -188,8 +188,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `95` // Estimated: `10985` - // Minimum execution time: 14_687_000 picoseconds. - Weight::from_parts(15_004_000, 0) + // Minimum execution time: 14_877_000 picoseconds. + Weight::from_parts(15_296_000, 0) .saturating_add(Weight::from_parts(0, 10985)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -200,8 +200,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `99` // Estimated: `10989` - // Minimum execution time: 14_595_000 picoseconds. - Weight::from_parts(14_813_000, 0) + // Minimum execution time: 14_835_000 picoseconds. + Weight::from_parts(15_115_000, 0) .saturating_add(Weight::from_parts(0, 10989)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -212,8 +212,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `13471` - // Minimum execution time: 14_926_000 picoseconds. - Weight::from_parts(15_337_000, 0) + // Minimum execution time: 15_368_000 picoseconds. + Weight::from_parts(15_596_000, 0) .saturating_add(Weight::from_parts(0, 13471)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -233,8 +233,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `6046` - // Minimum execution time: 28_680_000 picoseconds. - Weight::from_parts(29_159_000, 0) + // Minimum execution time: 28_025_000 picoseconds. + Weight::from_parts(28_524_000, 0) .saturating_add(Weight::from_parts(0, 6046)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -245,8 +245,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `136` // Estimated: `8551` - // Minimum execution time: 8_124_000 picoseconds. - Weight::from_parts(8_299_000, 0) + // Minimum execution time: 8_166_000 picoseconds. + Weight::from_parts(8_314_000, 0) .saturating_add(Weight::from_parts(0, 8551)) .saturating_add(T::DbWeight::get().reads(3)) } @@ -256,8 +256,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `10996` - // Minimum execution time: 14_755_000 picoseconds. - Weight::from_parts(15_136_000, 0) + // Minimum execution time: 14_871_000 picoseconds. + Weight::from_parts(15_374_000, 0) .saturating_add(Weight::from_parts(0, 10996)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -278,8 +278,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `112` // Estimated: `11002` - // Minimum execution time: 34_250_000 picoseconds. - Weight::from_parts(34_888_000, 0) + // Minimum execution time: 33_611_000 picoseconds. + Weight::from_parts(34_008_000, 0) .saturating_add(Weight::from_parts(0, 11002)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index c15e866ce9f..69a338953ec 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 25_169_000 picoseconds. - Weight::from_parts(25_584_000, 3593) + // Minimum execution time: 23_309_000 picoseconds. + Weight::from_parts(23_777_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `6196` - // Minimum execution time: 50_714_000 picoseconds. - Weight::from_parts(51_324_000, 6196) + // Minimum execution time: 48_808_000 picoseconds. + Weight::from_parts(49_427_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -88,8 +88,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `223` // Estimated: `6196` - // Minimum execution time: 74_593_000 picoseconds. - Weight::from_parts(75_347_000, 6196) + // Minimum execution time: 71_204_000 picoseconds. + Weight::from_parts(72_121_000, 6196) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -97,8 +97,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_485_000 picoseconds. - Weight::from_parts(4_562_000, 0) + // Minimum execution time: 3_559_000 picoseconds. + Weight::from_parts(3_616_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -106,8 +106,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 27_136_000 picoseconds. - Weight::from_parts(27_387_000, 3593) + // Minimum execution time: 25_042_000 picoseconds. + Weight::from_parts(25_630_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -129,8 +129,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `122` // Estimated: `3593` - // Minimum execution time: 53_591_000 picoseconds. - Weight::from_parts(54_268_000, 3593) + // Minimum execution time: 49_030_000 picoseconds. + Weight::from_parts(49_828_000, 3593) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -150,8 +150,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 30_062_000 picoseconds. - Weight::from_parts(30_771_000, 3535) + // Minimum execution time: 27_142_000 picoseconds. + Weight::from_parts(27_416_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 0b4b1174160..af6375385fc 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -64,8 +64,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 34_626_000 picoseconds. - Weight::from_parts(35_122_000, 3535) + // Minimum execution time: 30_210_000 picoseconds. + Weight::from_parts(30_864_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -73,8 +73,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_405_000 picoseconds. - Weight::from_parts(3_503_000, 0) + // Minimum execution time: 2_808_000 picoseconds. + Weight::from_parts(2_848_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) @@ -82,58 +82,58 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `3497` - // Minimum execution time: 11_296_000 picoseconds. - Weight::from_parts(11_550_000, 3497) + // Minimum execution time: 10_353_000 picoseconds. + Weight::from_parts(10_569_000, 3497) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_932_000 picoseconds. - Weight::from_parts(14_220_000, 0) + // Minimum execution time: 12_074_000 picoseconds. + Weight::from_parts(12_280_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_640_000 picoseconds. - Weight::from_parts(3_732_000, 0) + // Minimum execution time: 3_080_000 picoseconds. + Weight::from_parts(3_161_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_195_000 picoseconds. - Weight::from_parts(3_298_000, 0) + // Minimum execution time: 2_649_000 picoseconds. + Weight::from_parts(2_732_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_217_000 picoseconds. - Weight::from_parts(3_304_000, 0) + // Minimum execution time: 2_652_000 picoseconds. + Weight::from_parts(2_749_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_237_000 picoseconds. - Weight::from_parts(3_273_000, 0) + // Minimum execution time: 2_642_000 picoseconds. + Weight::from_parts(2_704_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_292_000 picoseconds. - Weight::from_parts(4_373_000, 0) + // Minimum execution time: 3_438_000 picoseconds. + Weight::from_parts(3_508_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_198_000 picoseconds. - Weight::from_parts(3_271_000, 0) + // Minimum execution time: 2_626_000 picoseconds. + Weight::from_parts(2_701_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -151,8 +151,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 27_178_000 picoseconds. - Weight::from_parts(28_171_000, 3535) + // Minimum execution time: 24_737_000 picoseconds. + Weight::from_parts(25_106_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -162,8 +162,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `90` // Estimated: `3555` - // Minimum execution time: 16_146_000 picoseconds. - Weight::from_parts(16_496_000, 3555) + // Minimum execution time: 14_712_000 picoseconds. + Weight::from_parts(14_976_000, 3555) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,8 +171,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_189_000 picoseconds. - Weight::from_parts(3_298_000, 0) + // Minimum execution time: 2_689_000 picoseconds. + Weight::from_parts(2_739_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -190,8 +190,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `38` // Estimated: `3503` - // Minimum execution time: 27_844_000 picoseconds. - Weight::from_parts(28_113_000, 3503) + // Minimum execution time: 26_478_000 picoseconds. + Weight::from_parts(26_695_000, 3503) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -201,8 +201,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_563_000 picoseconds. - Weight::from_parts(5_718_000, 0) + // Minimum execution time: 4_811_000 picoseconds. + Weight::from_parts(5_062_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -221,8 +221,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 30_296_000 picoseconds. - Weight::from_parts(30_843_000, 3535) + // Minimum execution time: 26_945_000 picoseconds. + Weight::from_parts(28_093_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -230,36 +230,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_340_000 picoseconds. - Weight::from_parts(5_390_000, 0) + // Minimum execution time: 4_144_000 picoseconds. + Weight::from_parts(4_217_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_312_000 picoseconds. - Weight::from_parts(3_411_000, 0) + // Minimum execution time: 2_726_000 picoseconds. + Weight::from_parts(2_802_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_294_000 picoseconds. - Weight::from_parts(3_374_000, 0) + // Minimum execution time: 2_719_000 picoseconds. + Weight::from_parts(2_790_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_197_000 picoseconds. - Weight::from_parts(3_261_000, 0) + // Minimum execution time: 2_660_000 picoseconds. + Weight::from_parts(2_742_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_465_000 picoseconds. - Weight::from_parts(3_541_000, 0) + // Minimum execution time: 2_874_000 picoseconds. + Weight::from_parts(2_940_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -277,8 +277,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 29_942_000 picoseconds. - Weight::from_parts(30_426_000, 3535) + // Minimum execution time: 27_235_000 picoseconds. + Weight::from_parts(27_811_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -286,8 +286,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_454_000 picoseconds. - Weight::from_parts(5_906_000, 0) + // Minimum execution time: 4_807_000 picoseconds. + Weight::from_parts(4_918_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -305,8 +305,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 27_744_000 picoseconds. - Weight::from_parts(28_116_000, 3535) + // Minimum execution time: 24_698_000 picoseconds. + Weight::from_parts(25_077_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -314,35 +314,35 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_204_000 picoseconds. - Weight::from_parts(3_352_000, 0) + // Minimum execution time: 2_613_000 picoseconds. + Weight::from_parts(2_703_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_180_000 picoseconds. - Weight::from_parts(3_245_000, 0) + // Minimum execution time: 2_602_000 picoseconds. + Weight::from_parts(2_661_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_195_000 picoseconds. - Weight::from_parts(3_299_000, 0) + // Minimum execution time: 2_557_000 picoseconds. + Weight::from_parts(2_655_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_185_000 picoseconds. - Weight::from_parts(3_279_000, 0) + // Minimum execution time: 2_724_000 picoseconds. + Weight::from_parts(2_760_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_308_000 picoseconds. - Weight::from_parts(3_463_000, 0) + // Minimum execution time: 2_764_000 picoseconds. + Weight::from_parts(2_872_000, 0) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index ed72909f0cb..4326e35de2b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -210,6 +210,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 4e14a964363..90a56c74633 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -11,9 +11,9 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1" } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true, features = ["derive"] } +serde = { version = "1.0.164", optional = true, features = ["derive"] } smallvec = "1.8.1" # Substrate diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index fd284576da0..aab18b4c67f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -46,7 +46,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, + traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -342,6 +342,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -573,6 +574,29 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + impl cumulus_primitives_core::CollectCollationInfo for Runtime { fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { ParachainSystem::collect_collation_info(header) @@ -714,6 +738,10 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Err(BenchmarkError::Skip) } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs index 6a04ee76325..1c64eec8a6b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_425_000 picoseconds. - Weight::from_parts(5_556_000, 0) + // Minimum execution time: 5_621_000 picoseconds. + Weight::from_parts(5_845_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_504_000 picoseconds. - Weight::from_parts(5_706_000, 0) + // Minimum execution time: 5_776_000 picoseconds. + Weight::from_parts(5_992_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs index bcfe953f358..4a919cd0907 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 52_090_000 picoseconds. - Weight::from_parts(52_437_000, 0) + // Minimum execution time: 59_580_000 picoseconds. + Weight::from_parts(60_317_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 39_798_000 picoseconds. - Weight::from_parts(40_230_000, 0) + // Minimum execution time: 45_490_000 picoseconds. + Weight::from_parts(45_910_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 16_110_000 picoseconds. - Weight::from_parts(16_386_000, 0) + // Minimum execution time: 17_353_000 picoseconds. + Weight::from_parts(17_676_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 22_460_000 picoseconds. - Weight::from_parts(23_030_000, 0) + // Minimum execution time: 25_017_000 picoseconds. + Weight::from_parts(25_542_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 53_769_000 picoseconds. - Weight::from_parts(54_256_000, 0) + // Minimum execution time: 61_161_000 picoseconds. + Weight::from_parts(61_665_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 48_582_000 picoseconds. - Weight::from_parts(49_294_000, 0) + // Minimum execution time: 55_422_000 picoseconds. + Weight::from_parts(55_880_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 19_364_000 picoseconds. - Weight::from_parts(19_571_000, 0) + // Minimum execution time: 20_477_000 picoseconds. + Weight::from_parts(20_871_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 17_815_000 picoseconds. - Weight::from_parts(17_974_000, 0) + // Minimum execution time: 19_501_000 picoseconds. + Weight::from_parts(19_726_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 10_230 - .saturating_add(Weight::from_parts(14_059_882, 0).saturating_mul(u.into())) + // Standard Error: 9_495 + .saturating_add(Weight::from_parts(15_658_957, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs index bae3a058100..424da202302 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `214 + b * (78 ±0)` // Estimated: `1203 + b * (2554 ±0)` - // Minimum execution time: 14_646_000 picoseconds. - Weight::from_parts(15_408_953, 0) + // Minimum execution time: 14_426_000 picoseconds. + Weight::from_parts(14_971_974, 0) .saturating_add(Weight::from_parts(0, 1203)) - // Standard Error: 3_120 - .saturating_add(Weight::from_parts(2_562_646, 0).saturating_mul(b.into())) + // Standard Error: 2_914 + .saturating_add(Weight::from_parts(2_604_699, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_277_000 picoseconds. - Weight::from_parts(7_557_000, 0) + // Minimum execution time: 6_977_000 picoseconds. + Weight::from_parts(7_246_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_684_000 picoseconds. - Weight::from_parts(7_883_000, 0) + // Minimum execution time: 7_191_000 picoseconds. + Weight::from_parts(7_416_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1104 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 42_488_000 picoseconds. - Weight::from_parts(34_515_606, 0) + // Minimum execution time: 42_275_000 picoseconds. + Weight::from_parts(33_742_215, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_249 - .saturating_add(Weight::from_parts(103_597, 0).saturating_mul(c.into())) + // Standard Error: 1_291 + .saturating_add(Weight::from_parts(103_381, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `428 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 33_698_000 picoseconds. - Weight::from_parts(22_802_769, 0) + // Minimum execution time: 33_404_000 picoseconds. + Weight::from_parts(22_612_617, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_317 - .saturating_add(Weight::from_parts(107_072, 0).saturating_mul(c.into())) + // Standard Error: 1_341 + .saturating_add(Weight::from_parts(105_669, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `155` // Estimated: `6196` - // Minimum execution time: 43_472_000 picoseconds. - Weight::from_parts(44_218_000, 0) + // Minimum execution time: 44_415_000 picoseconds. + Weight::from_parts(44_732_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22815 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2602 ±0)` - // Minimum execution time: 17_280_000 picoseconds. - Weight::from_parts(17_471_000, 0) + // Minimum execution time: 16_765_000 picoseconds. + Weight::from_parts(16_997_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 866_180 - .saturating_add(Weight::from_parts(30_755_948, 0).saturating_mul(c.into())) + // Standard Error: 860_677 + .saturating_add(Weight::from_parts(30_463_094, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs index 7e5c5efcf3f..8cbc0652035 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_575_000 picoseconds. - Weight::from_parts(12_064_176, 0) + // Minimum execution time: 11_337_000 picoseconds. + Weight::from_parts(11_960_522, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(500, 0).saturating_mul(z.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(504, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 40_911_000 picoseconds. - Weight::from_parts(34_976_854, 0) + // Minimum execution time: 41_128_000 picoseconds. + Weight::from_parts(35_215_592, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 418 - .saturating_add(Weight::from_parts(65_759, 0).saturating_mul(s.into())) + // Standard Error: 429 + .saturating_add(Weight::from_parts(65_959, 0).saturating_mul(s.into())) // Standard Error: 4 - .saturating_add(Weight::from_parts(1_190, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_230, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 26_906_000 picoseconds. - Weight::from_parts(21_462_377, 0) + // Minimum execution time: 26_878_000 picoseconds. + Weight::from_parts(21_448_577, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 351 - .saturating_add(Weight::from_parts(59_241, 0).saturating_mul(s.into())) + // Standard Error: 354 + .saturating_add(Weight::from_parts(60_286, 0).saturating_mul(s.into())) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_204, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_236, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `388 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 45_289_000 picoseconds. - Weight::from_parts(37_925_050, 0) + // Minimum execution time: 45_716_000 picoseconds. + Weight::from_parts(38_332_947, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 675 - .saturating_add(Weight::from_parts(81_154, 0).saturating_mul(s.into())) - // Standard Error: 6 - .saturating_add(Weight::from_parts(1_237, 0).saturating_mul(z.into())) + // Standard Error: 554 + .saturating_add(Weight::from_parts(81_026, 0).saturating_mul(s.into())) + // Standard Error: 5 + .saturating_add(Weight::from_parts(1_265, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 31_995_000 picoseconds. - Weight::from_parts(33_377_255, 0) + // Minimum execution time: 32_089_000 picoseconds. + Weight::from_parts(33_664_508, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 571 - .saturating_add(Weight::from_parts(69_665, 0).saturating_mul(s.into())) + // Standard Error: 487 + .saturating_add(Weight::from_parts(67_443, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 18_656_000 picoseconds. - Weight::from_parts(19_906_362, 0) + // Minimum execution time: 18_631_000 picoseconds. + Weight::from_parts(19_909_964, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 431 - .saturating_add(Weight::from_parts(62_284, 0).saturating_mul(s.into())) + // Standard Error: 434 + .saturating_add(Weight::from_parts(62_989, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 32_875_000 picoseconds. - Weight::from_parts(34_341_729, 0) + // Minimum execution time: 32_486_000 picoseconds. + Weight::from_parts(34_303_784, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 924 - .saturating_add(Weight::from_parts(72_829, 0).saturating_mul(s.into())) + // Standard Error: 585 + .saturating_add(Weight::from_parts(69_979, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs index c97705a6794..dceb8f0e80d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `297` // Estimated: `3762` - // Minimum execution time: 17_610_000 picoseconds. - Weight::from_parts(18_124_000, 0) + // Minimum execution time: 17_353_000 picoseconds. + Weight::from_parts(18_005_000, 0) .saturating_add(Weight::from_parts(0, 3762)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `279` // Estimated: `3744` - // Minimum execution time: 13_143_000 picoseconds. - Weight::from_parts(13_552_000, 0) + // Minimum execution time: 13_039_000 picoseconds. + Weight::from_parts(13_341_000, 0) .saturating_add(Weight::from_parts(0, 3744)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs index 4b5d0156670..638e28c9591 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `49` // Estimated: `1493` - // Minimum execution time: 7_574_000 picoseconds. - Weight::from_parts(7_792_000, 0) + // Minimum execution time: 7_986_000 picoseconds. + Weight::from_parts(8_134_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 3_081_000 picoseconds. - Weight::from_parts(3_148_000, 0) + // Minimum execution time: 3_257_000 picoseconds. + Weight::from_parts(3_366_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs index 816c705a772..ddea5102eff 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_261_000 picoseconds. - Weight::from_parts(8_284_145, 0) + // Minimum execution time: 6_697_000 picoseconds. + Weight::from_parts(11_859_145, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_294 - .saturating_add(Weight::from_parts(4_497_661, 0).saturating_mul(c.into())) + // Standard Error: 3_146 + .saturating_add(Weight::from_parts(4_300_555, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_294_000 picoseconds. - Weight::from_parts(5_475_000, 0) + // Minimum execution time: 4_979_000 picoseconds. + Weight::from_parts(5_066_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_042_000 picoseconds. - Weight::from_parts(5_814_168, 0) + // Minimum execution time: 6_741_000 picoseconds. + Weight::from_parts(15_928_547, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_914 - .saturating_add(Weight::from_parts(4_802_976, 0).saturating_mul(c.into())) + // Standard Error: 3_310 + .saturating_add(Weight::from_parts(4_527_996, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_260_000 picoseconds. - Weight::from_parts(9_406_000, 0) + // Minimum execution time: 8_717_000 picoseconds. + Weight::from_parts(8_909_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_109_000 picoseconds. - Weight::from_parts(3_793_543, 0) + // Minimum execution time: 6_814_000 picoseconds. + Weight::from_parts(13_920_831, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_940 - .saturating_add(Weight::from_parts(4_479_763, 0).saturating_mul(c.into())) + // Standard Error: 7_605 + .saturating_add(Weight::from_parts(4_306_193, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs index fdbde818da9..bab6a3e3adf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -62,8 +62,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `38` // Estimated: `3503` - // Minimum execution time: 25_921_000 picoseconds. - Weight::from_parts(26_233_000, 0) + // Minimum execution time: 25_783_000 picoseconds. + Weight::from_parts(26_398_000, 0) .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1489` - // Minimum execution time: 26_254_000 picoseconds. - Weight::from_parts(26_615_000, 0) + // Minimum execution time: 25_511_000 picoseconds. + Weight::from_parts(26_120_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -105,8 +105,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_756_000 picoseconds. - Weight::from_parts(9_989_000, 0) + // Minimum execution time: 9_707_000 picoseconds. + Weight::from_parts(9_874_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -116,8 +116,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_147_000 picoseconds. - Weight::from_parts(3_248_000, 0) + // Minimum execution time: 3_073_000 picoseconds. + Weight::from_parts(3_183_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -141,8 +141,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `38` // Estimated: `3503` - // Minimum execution time: 31_089_000 picoseconds. - Weight::from_parts(31_503_000, 0) + // Minimum execution time: 30_999_000 picoseconds. + Weight::from_parts(31_641_000, 0) .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -165,8 +165,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `220` // Estimated: `3685` - // Minimum execution time: 33_219_000 picoseconds. - Weight::from_parts(33_708_000, 0) + // Minimum execution time: 33_036_000 picoseconds. + Weight::from_parts(33_596_000, 0) .saturating_add(Weight::from_parts(0, 3685)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -177,8 +177,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_042_000 picoseconds. - Weight::from_parts(3_175_000, 0) + // Minimum execution time: 3_035_000 picoseconds. + Weight::from_parts(3_154_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -188,8 +188,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `95` // Estimated: `10985` - // Minimum execution time: 15_040_000 picoseconds. - Weight::from_parts(15_455_000, 0) + // Minimum execution time: 14_805_000 picoseconds. + Weight::from_parts(15_120_000, 0) .saturating_add(Weight::from_parts(0, 10985)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -200,8 +200,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `99` // Estimated: `10989` - // Minimum execution time: 14_999_000 picoseconds. - Weight::from_parts(15_417_000, 0) + // Minimum execution time: 14_572_000 picoseconds. + Weight::from_parts(14_909_000, 0) .saturating_add(Weight::from_parts(0, 10989)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -212,8 +212,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `13471` - // Minimum execution time: 15_694_000 picoseconds. - Weight::from_parts(15_916_000, 0) + // Minimum execution time: 15_341_000 picoseconds. + Weight::from_parts(15_708_000, 0) .saturating_add(Weight::from_parts(0, 13471)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -233,8 +233,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `6046` - // Minimum execution time: 28_164_000 picoseconds. - Weight::from_parts(28_489_000, 0) + // Minimum execution time: 27_840_000 picoseconds. + Weight::from_parts(28_248_000, 0) .saturating_add(Weight::from_parts(0, 6046)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -245,8 +245,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `136` // Estimated: `8551` - // Minimum execution time: 8_273_000 picoseconds. - Weight::from_parts(8_471_000, 0) + // Minimum execution time: 8_245_000 picoseconds. + Weight::from_parts(8_523_000, 0) .saturating_add(Weight::from_parts(0, 8551)) .saturating_add(T::DbWeight::get().reads(3)) } @@ -256,8 +256,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `10996` - // Minimum execution time: 15_009_000 picoseconds. - Weight::from_parts(15_459_000, 0) + // Minimum execution time: 14_780_000 picoseconds. + Weight::from_parts(15_173_000, 0) .saturating_add(Weight::from_parts(0, 10996)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -278,8 +278,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `112` // Estimated: `11002` - // Minimum execution time: 33_647_000 picoseconds. - Weight::from_parts(34_065_000, 0) + // Minimum execution time: 33_422_000 picoseconds. + Weight::from_parts(34_076_000, 0) .saturating_add(Weight::from_parts(0, 11002)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index e91a3d7f59f..8934d0df0fc 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 23_577_000 picoseconds. - Weight::from_parts(24_152_000, 3593) + // Minimum execution time: 23_363_000 picoseconds. + Weight::from_parts(23_663_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `6196` - // Minimum execution time: 49_336_000 picoseconds. - Weight::from_parts(49_673_000, 6196) + // Minimum execution time: 49_093_000 picoseconds. + Weight::from_parts(49_719_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -88,8 +88,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `223` // Estimated: `6196` - // Minimum execution time: 72_360_000 picoseconds. - Weight::from_parts(72_916_000, 6196) + // Minimum execution time: 74_134_000 picoseconds. + Weight::from_parts(74_719_000, 6196) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -97,8 +97,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_838_000 picoseconds. - Weight::from_parts(3_928_000, 0) + // Minimum execution time: 3_726_000 picoseconds. + Weight::from_parts(3_881_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -106,8 +106,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 26_214_000 picoseconds. - Weight::from_parts(26_718_000, 3593) + // Minimum execution time: 25_903_000 picoseconds. + Weight::from_parts(26_150_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -129,8 +129,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `122` // Estimated: `3593` - // Minimum execution time: 52_341_000 picoseconds. - Weight::from_parts(52_801_000, 3593) + // Minimum execution time: 51_084_000 picoseconds. + Weight::from_parts(51_859_000, 3593) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -150,8 +150,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 28_785_000 picoseconds. - Weight::from_parts(29_133_000, 3535) + // Minimum execution time: 28_038_000 picoseconds. + Weight::from_parts(28_438_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 3cf25c1e8f8..fbec8baa2d5 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-polkadot-dev"), DB CACHE: 1024 @@ -64,8 +64,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 31_194_000 picoseconds. - Weight::from_parts(31_563_000, 3535) + // Minimum execution time: 30_819_000 picoseconds. + Weight::from_parts(31_157_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -73,8 +73,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_905_000 picoseconds. - Weight::from_parts(3_006_000, 0) + // Minimum execution time: 2_869_000 picoseconds. + Weight::from_parts(2_920_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) @@ -82,58 +82,58 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `3497` - // Minimum execution time: 10_292_000 picoseconds. - Weight::from_parts(10_503_000, 3497) + // Minimum execution time: 10_268_000 picoseconds. + Weight::from_parts(10_496_000, 3497) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_198_000 picoseconds. - Weight::from_parts(12_445_000, 0) + // Minimum execution time: 11_990_000 picoseconds. + Weight::from_parts(12_206_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_199_000 picoseconds. - Weight::from_parts(3_286_000, 0) + // Minimum execution time: 3_170_000 picoseconds. + Weight::from_parts(3_308_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_780_000 picoseconds. - Weight::from_parts(2_847_000, 0) + // Minimum execution time: 2_650_000 picoseconds. + Weight::from_parts(2_783_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_787_000 picoseconds. - Weight::from_parts(2_835_000, 0) + // Minimum execution time: 2_681_000 picoseconds. + Weight::from_parts(2_829_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_822_000 picoseconds. - Weight::from_parts(2_853_000, 0) + // Minimum execution time: 2_622_000 picoseconds. + Weight::from_parts(2_688_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_671_000 picoseconds. - Weight::from_parts(3_746_000, 0) + // Minimum execution time: 3_385_000 picoseconds. + Weight::from_parts(3_538_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_748_000 picoseconds. - Weight::from_parts(2_818_000, 0) + // Minimum execution time: 2_630_000 picoseconds. + Weight::from_parts(2_720_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -151,8 +151,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 24_294_000 picoseconds. - Weight::from_parts(24_640_000, 3535) + // Minimum execution time: 24_446_000 picoseconds. + Weight::from_parts(24_854_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -162,8 +162,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `90` // Estimated: `3555` - // Minimum execution time: 14_359_000 picoseconds. - Weight::from_parts(14_550_000, 3555) + // Minimum execution time: 14_713_000 picoseconds. + Weight::from_parts(15_010_000, 3555) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,8 +171,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_792_000 picoseconds. - Weight::from_parts(2_884_000, 0) + // Minimum execution time: 2_702_000 picoseconds. + Weight::from_parts(2_744_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -190,8 +190,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `38` // Estimated: `3503` - // Minimum execution time: 25_925_000 picoseconds. - Weight::from_parts(26_130_000, 3503) + // Minimum execution time: 25_955_000 picoseconds. + Weight::from_parts(26_632_000, 3503) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -201,8 +201,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_004_000 picoseconds. - Weight::from_parts(5_141_000, 0) + // Minimum execution time: 4_965_000 picoseconds. + Weight::from_parts(5_168_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -221,8 +221,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 27_163_000 picoseconds. - Weight::from_parts(27_722_000, 3535) + // Minimum execution time: 27_707_000 picoseconds. + Weight::from_parts(28_081_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -230,36 +230,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_430_000 picoseconds. - Weight::from_parts(4_492_000, 0) + // Minimum execution time: 4_215_000 picoseconds. + Weight::from_parts(4_362_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_870_000 picoseconds. - Weight::from_parts(2_998_000, 0) + // Minimum execution time: 2_843_000 picoseconds. + Weight::from_parts(2_957_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_845_000 picoseconds. - Weight::from_parts(2_893_000, 0) + // Minimum execution time: 2_751_000 picoseconds. + Weight::from_parts(2_809_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_753_000 picoseconds. - Weight::from_parts(2_816_000, 0) + // Minimum execution time: 2_674_000 picoseconds. + Weight::from_parts(2_737_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_992_000 picoseconds. - Weight::from_parts(3_068_000, 0) + // Minimum execution time: 2_891_000 picoseconds. + Weight::from_parts(2_952_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -277,8 +277,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 27_324_000 picoseconds. - Weight::from_parts(27_656_000, 3535) + // Minimum execution time: 28_600_000 picoseconds. + Weight::from_parts(29_001_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -286,8 +286,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_830_000 picoseconds. - Weight::from_parts(4_903_000, 0) + // Minimum execution time: 4_748_000 picoseconds. + Weight::from_parts(4_813_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -305,8 +305,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `70` // Estimated: `3535` - // Minimum execution time: 24_428_000 picoseconds. - Weight::from_parts(24_732_000, 3535) + // Minimum execution time: 25_483_000 picoseconds. + Weight::from_parts(25_737_000, 3535) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -314,35 +314,35 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_779_000 picoseconds. - Weight::from_parts(2_822_000, 0) + // Minimum execution time: 2_755_000 picoseconds. + Weight::from_parts(2_817_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_789_000 picoseconds. - Weight::from_parts(2_873_000, 0) + // Minimum execution time: 2_700_000 picoseconds. + Weight::from_parts(2_773_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_819_000 picoseconds. - Weight::from_parts(2_904_000, 0) + // Minimum execution time: 2_670_000 picoseconds. + Weight::from_parts(2_711_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_788_000 picoseconds. - Weight::from_parts(2_887_000, 0) + // Minimum execution time: 2_710_000 picoseconds. + Weight::from_parts(2_762_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_006_000 picoseconds. - Weight::from_parts(3_078_000, 0) + // Minimum execution time: 2_839_000 picoseconds. + Weight::from_parts(2_931_000, 0) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 804c7455b5a..118b0c6d71b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -211,6 +211,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index cce740cd617..02ddf9931e8 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -11,9 +11,9 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1" } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true, features = ["derive"] } +serde = { version = "1.0.164", optional = true, features = ["derive"] } smallvec = "1.8.1" # Substrate diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 50bedefa9fd..7088d051228 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -49,7 +49,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU64, ConstU8, Everything}, + traits::{ConstBool, ConstU32, ConstU64, ConstU8, Everything}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -350,6 +350,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -856,6 +857,29 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + impl cumulus_primitives_core::CollectCollationInfo for Runtime { fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { ParachainSystem::collect_collation_info(header) @@ -1084,6 +1108,10 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Ok((RelayLocation::get(), NetworkId::Wococo, X1(Parachain(100)))) } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs index 41db3176f35..e19856309a5 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_293_000 picoseconds. - Weight::from_parts(5_572_000, 0) + // Minimum execution time: 5_593_000 picoseconds. + Weight::from_parts(5_807_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 5_449_000 picoseconds. - Weight::from_parts(5_627_000, 0) + // Minimum execution time: 5_586_000 picoseconds. + Weight::from_parts(5_790_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs index bba8bf0318e..86833064547 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 54_781_000 picoseconds. - Weight::from_parts(55_287_000, 0) + // Minimum execution time: 60_129_000 picoseconds. + Weight::from_parts(60_835_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 41_473_000 picoseconds. - Weight::from_parts(41_749_000, 0) + // Minimum execution time: 45_611_000 picoseconds. + Weight::from_parts(46_099_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 16_997_000 picoseconds. - Weight::from_parts(17_207_000, 0) + // Minimum execution time: 18_068_000 picoseconds. + Weight::from_parts(18_638_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 23_998_000 picoseconds. - Weight::from_parts(24_245_000, 0) + // Minimum execution time: 26_141_000 picoseconds. + Weight::from_parts(26_609_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 56_390_000 picoseconds. - Weight::from_parts(56_963_000, 0) + // Minimum execution time: 61_259_000 picoseconds. + Weight::from_parts(62_144_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 50_769_000 picoseconds. - Weight::from_parts(51_077_000, 0) + // Minimum execution time: 55_871_000 picoseconds. + Weight::from_parts(56_355_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 19_617_000 picoseconds. - Weight::from_parts(19_827_000, 0) + // Minimum execution time: 21_540_000 picoseconds. + Weight::from_parts(22_236_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 18_453_000 picoseconds. - Weight::from_parts(18_528_000, 0) + // Minimum execution time: 19_616_000 picoseconds. + Weight::from_parts(19_838_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 10_749 - .saturating_add(Weight::from_parts(14_321_237, 0).saturating_mul(u.into())) + // Standard Error: 10_829 + .saturating_add(Weight::from_parts(15_803_166, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs new file mode 100644 index 00000000000..2465d52cbe6 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs @@ -0,0 +1,81 @@ +// Copyright 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_bridge_grandpa` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=bridge-hub-rococo-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_bridge_grandpa +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_bridge_grandpa`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_grandpa::WeightInfo for WeightInfo { + /// Storage: BridgeRococoGrandpa PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BridgeRococoGrandpa BestFinalized (r:1 w:1) + /// Proof: BridgeRococoGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added: 531, mode: MaxEncodedLen) + /// Storage: BridgeRococoGrandpa CurrentAuthoritySet (r:1 w:0) + /// Proof: BridgeRococoGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(50250), added: 50745, mode: MaxEncodedLen) + /// Storage: BridgeRococoGrandpa ImportedHashesPointer (r:1 w:1) + /// Proof: BridgeRococoGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BridgeRococoGrandpa ImportedHashes (r:1 w:1) + /// Proof: BridgeRococoGrandpa ImportedHashes (max_values: Some(1024), max_size: Some(36), added: 1521, mode: MaxEncodedLen) + /// Storage: BridgeRococoGrandpa ImportedHeaders (r:0 w:2) + /// Proof: BridgeRococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 838]`. + /// The range of component `v` is `[50, 100]`. + /// The range of component `p` is `[1, 838]`. + /// The range of component `v` is `[50, 100]`. + fn submit_finality_proof(p: u32, v: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `231 + p * (60 ±0)` + // Estimated: `51735` + // Minimum execution time: 241_332_000 picoseconds. + Weight::from_parts(69_790_821, 0) + .saturating_add(Weight::from_parts(0, 51735)) + // Standard Error: 6_013 + .saturating_add(Weight::from_parts(47_580_554, 0).saturating_mul(p.into())) + // Standard Error: 100_298 + .saturating_add(Weight::from_parts(1_213_475, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs new file mode 100644 index 00000000000..f5ab0edddde --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs @@ -0,0 +1,231 @@ +// Copyright 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_bridge_messages` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=bridge-hub-rococo-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_bridge_messages +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_bridge_messages`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_messages::WeightInfo for WeightInfo { + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages InboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn receive_single_message_proof() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `52645` + // Minimum execution time: 43_187_000 picoseconds. + Weight::from_parts(43_681_000, 0) + .saturating_add(Weight::from_parts(0, 52645)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages InboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn receive_two_messages_proof() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `52645` + // Minimum execution time: 54_131_000 picoseconds. + Weight::from_parts(54_813_000, 0) + .saturating_add(Weight::from_parts(0, 52645)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages InboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn receive_single_message_proof_with_outbound_lane_state() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `52645` + // Minimum execution time: 48_120_000 picoseconds. + Weight::from_parts(48_733_000, 0) + .saturating_add(Weight::from_parts(0, 52645)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages InboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen) + fn receive_single_message_proof_1_kb() -> Weight { + // Proof Size summary in bytes: + // Measured: `335` + // Estimated: `52645` + // Minimum execution time: 41_028_000 picoseconds. + Weight::from_parts(41_635_000, 0) + .saturating_add(Weight::from_parts(0, 52645)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages InboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen) + fn receive_single_message_proof_16_kb() -> Weight { + // Proof Size summary in bytes: + // Measured: `335` + // Estimated: `52645` + // Minimum execution time: 68_499_000 picoseconds. + Weight::from_parts(69_263_000, 0) + .saturating_add(Weight::from_parts(0, 52645)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages OutboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen) + /// Storage: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0) + /// Proof Skipped: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0) + /// Storage: BridgeRelayers RelayerRewards (r:1 w:1) + /// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) + fn receive_delivery_proof_for_single_message() -> Weight { + // Proof Size summary in bytes: + // Measured: `339` + // Estimated: `3804` + // Minimum execution time: 32_277_000 picoseconds. + Weight::from_parts(32_880_000, 0) + .saturating_add(Weight::from_parts(0, 3804)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages OutboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen) + /// Storage: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0) + /// Proof Skipped: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0) + /// Storage: BridgeRelayers RelayerRewards (r:1 w:1) + /// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) + fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight { + // Proof Size summary in bytes: + // Measured: `339` + // Estimated: `3804` + // Minimum execution time: 32_504_000 picoseconds. + Weight::from_parts(33_085_000, 0) + .saturating_add(Weight::from_parts(0, 3804)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages OutboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen) + /// Storage: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0) + /// Proof Skipped: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0) + /// Storage: BridgeRelayers RelayerRewards (r:2 w:2) + /// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) + fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight { + // Proof Size summary in bytes: + // Measured: `339` + // Estimated: `6086` + // Minimum execution time: 34_963_000 picoseconds. + Weight::from_parts(35_473_000, 0) + .saturating_add(Weight::from_parts(0, 6086)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0) + /// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0) + /// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// Storage: BridgeRococoMessages InboundLanes (r:1 w:1) + /// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem RelevantMessagingState (r:1 w:0) + /// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1) + /// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured) + /// The range of component `i` is `[128, 2048]`. + /// The range of component `i` is `[128, 2048]`. + fn receive_single_message_proof_with_dispatch(i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `635` + // Estimated: `52645` + // Minimum execution time: 129_978_000 picoseconds. + Weight::from_parts(98_246_356, 0) + .saturating_add(Weight::from_parts(0, 52645)) + // Standard Error: 2_554 + .saturating_add(Weight::from_parts(544_728, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs new file mode 100644 index 00000000000..d77c43e729f --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs @@ -0,0 +1,113 @@ +// Copyright 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_bridge_parachains` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=bridge-hub-rococo-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_bridge_parachains +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_bridge_parachains`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_parachains::WeightInfo for WeightInfo { + /// Storage: BridgeWococoParachain PalletOperatingMode (r:1 w:0) + /// Proof: BridgeWococoParachain PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BridgeWococoGrandpa ImportedHeaders (r:1 w:0) + /// Proof: BridgeWococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ParasInfo (r:1 w:1) + /// Proof: BridgeWococoParachain ParasInfo (max_values: Some(1), max_size: Some(60), added: 555, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ImportedParaHashes (r:1 w:1) + /// Proof: BridgeWococoParachain ImportedParaHashes (max_values: Some(64), max_size: Some(64), added: 1054, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ImportedParaHeads (r:0 w:1) + /// Proof: BridgeWococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 2]`. + /// The range of component `p` is `[1, 2]`. + fn submit_parachain_heads_with_n_parachains(_p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `2543` + // Minimum execution time: 34_759_000 picoseconds. + Weight::from_parts(35_709_034, 0) + .saturating_add(Weight::from_parts(0, 2543)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: BridgeWococoParachain PalletOperatingMode (r:1 w:0) + /// Proof: BridgeWococoParachain PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BridgeWococoGrandpa ImportedHeaders (r:1 w:0) + /// Proof: BridgeWococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ParasInfo (r:1 w:1) + /// Proof: BridgeWococoParachain ParasInfo (max_values: Some(1), max_size: Some(60), added: 555, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ImportedParaHashes (r:1 w:1) + /// Proof: BridgeWococoParachain ImportedParaHashes (max_values: Some(64), max_size: Some(64), added: 1054, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ImportedParaHeads (r:0 w:1) + /// Proof: BridgeWococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + fn submit_parachain_heads_with_1kb_proof() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `2543` + // Minimum execution time: 36_005_000 picoseconds. + Weight::from_parts(36_492_000, 0) + .saturating_add(Weight::from_parts(0, 2543)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: BridgeWococoParachain PalletOperatingMode (r:1 w:0) + /// Proof: BridgeWococoParachain PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BridgeWococoGrandpa ImportedHeaders (r:1 w:0) + /// Proof: BridgeWococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ParasInfo (r:1 w:1) + /// Proof: BridgeWococoParachain ParasInfo (max_values: Some(1), max_size: Some(60), added: 555, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ImportedParaHashes (r:1 w:1) + /// Proof: BridgeWococoParachain ImportedParaHashes (max_values: Some(64), max_size: Some(64), added: 1054, mode: MaxEncodedLen) + /// Storage: BridgeWococoParachain ImportedParaHeads (r:0 w:1) + /// Proof: BridgeWococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen) + fn submit_parachain_heads_with_16kb_proof() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `2543` + // Minimum execution time: 62_374_000 picoseconds. + Weight::from_parts(62_977_000, 0) + .saturating_add(Weight::from_parts(0, 2543)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs index 418f1326766..e11b3e663b8 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs @@ -17,26 +17,25 @@ //! Autogenerated weights for `pallet_bridge_relayers` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// target/production/polkadot-parachain +// ./artifacts/polkadot-parachain // benchmark // pallet -// --steps=50 -// --repeat=20 -// --extrinsic=* +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled -// --heap-pages=4096 -// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_bridge_relayers -// --chain=bridge-hub-rococo-dev +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json // --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/ +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -57,8 +56,8 @@ impl pallet_bridge_relayers::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `207` // Estimated: `3593` - // Minimum execution time: 53_286_000 picoseconds. - Weight::from_parts(53_905_000, 0) + // Minimum execution time: 52_759_000 picoseconds. + Weight::from_parts(53_422_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -73,8 +72,8 @@ impl pallet_bridge_relayers::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `61` // Estimated: `4714` - // Minimum execution time: 29_145_000 picoseconds. - Weight::from_parts(29_698_000, 0) + // Minimum execution time: 29_175_000 picoseconds. + Weight::from_parts(29_659_000, 0) .saturating_add(Weight::from_parts(0, 4714)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -87,8 +86,8 @@ impl pallet_bridge_relayers::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `160` // Estimated: `4714` - // Minimum execution time: 30_298_000 picoseconds. - Weight::from_parts(30_754_000, 0) + // Minimum execution time: 30_384_000 picoseconds. + Weight::from_parts(30_799_000, 0) .saturating_add(Weight::from_parts(0, 4714)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -103,8 +102,8 @@ impl pallet_bridge_relayers::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `263` // Estimated: `4714` - // Minimum execution time: 30_109_000 picoseconds. - Weight::from_parts(30_330_000, 0) + // Minimum execution time: 29_987_000 picoseconds. + Weight::from_parts(30_365_000, 0) .saturating_add(Weight::from_parts(0, 4714)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -115,8 +114,8 @@ impl pallet_bridge_relayers::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `6` // Estimated: `3538` - // Minimum execution time: 3_016_000 picoseconds. - Weight::from_parts(3_130_000, 0) + // Minimum execution time: 3_116_000 picoseconds. + Weight::from_parts(3_207_000, 0) .saturating_add(Weight::from_parts(0, 3538)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs index b66a8635e40..a91daf3ea87 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `214 + b * (78 ±0)` // Estimated: `1203 + b * (2554 ±0)` - // Minimum execution time: 15_056_000 picoseconds. - Weight::from_parts(15_300_844, 0) + // Minimum execution time: 14_947_000 picoseconds. + Weight::from_parts(15_345_344, 0) .saturating_add(Weight::from_parts(0, 1203)) - // Standard Error: 2_903 - .saturating_add(Weight::from_parts(2_591_470, 0).saturating_mul(b.into())) + // Standard Error: 3_420 + .saturating_add(Weight::from_parts(2_667_724, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_296_000 picoseconds. - Weight::from_parts(7_526_000, 0) + // Minimum execution time: 7_011_000 picoseconds. + Weight::from_parts(7_150_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_483_000 picoseconds. - Weight::from_parts(7_694_000, 0) + // Minimum execution time: 7_348_000 picoseconds. + Weight::from_parts(7_532_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1104 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 42_882_000 picoseconds. - Weight::from_parts(34_865_364, 0) + // Minimum execution time: 43_613_000 picoseconds. + Weight::from_parts(34_987_225, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_292 - .saturating_add(Weight::from_parts(107_420, 0).saturating_mul(c.into())) + // Standard Error: 1_234 + .saturating_add(Weight::from_parts(103_999, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `428 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 34_025_000 picoseconds. - Weight::from_parts(23_170_113, 0) + // Minimum execution time: 33_921_000 picoseconds. + Weight::from_parts(23_468_920, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_333 - .saturating_add(Weight::from_parts(108_636, 0).saturating_mul(c.into())) + // Standard Error: 1_295 + .saturating_add(Weight::from_parts(104_853, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `155` // Estimated: `6196` - // Minimum execution time: 45_689_000 picoseconds. - Weight::from_parts(46_236_000, 0) + // Minimum execution time: 45_997_000 picoseconds. + Weight::from_parts(46_348_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22815 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2602 ±0)` - // Minimum execution time: 16_853_000 picoseconds. - Weight::from_parts(16_995_000, 0) + // Minimum execution time: 16_916_000 picoseconds. + Weight::from_parts(17_052_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 900_191 - .saturating_add(Weight::from_parts(31_884_166, 0).saturating_mul(c.into())) + // Standard Error: 858_664 + .saturating_add(Weight::from_parts(30_530_478, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs index deda8024527..6900fd1158d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_833_000 picoseconds. - Weight::from_parts(12_347_180, 0) + // Minimum execution time: 11_272_000 picoseconds. + Weight::from_parts(11_754_107, 0) .saturating_add(Weight::from_parts(0, 0)) // Standard Error: 1 - .saturating_add(Weight::from_parts(554, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(558, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 41_899_000 picoseconds. - Weight::from_parts(35_770_287, 0) + // Minimum execution time: 40_709_000 picoseconds. + Weight::from_parts(35_062_506, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 542 - .saturating_add(Weight::from_parts(67_778, 0).saturating_mul(s.into())) - // Standard Error: 5 - .saturating_add(Weight::from_parts(1_239, 0).saturating_mul(z.into())) + // Standard Error: 438 + .saturating_add(Weight::from_parts(66_197, 0).saturating_mul(s.into())) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_242, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 27_916_000 picoseconds. - Weight::from_parts(22_006_035, 0) + // Minimum execution time: 26_866_000 picoseconds. + Weight::from_parts(21_467_854, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 311 - .saturating_add(Weight::from_parts(63_189, 0).saturating_mul(s.into())) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_244, 0).saturating_mul(z.into())) + // Standard Error: 288 + .saturating_add(Weight::from_parts(59_217, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_250, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `388 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 46_594_000 picoseconds. - Weight::from_parts(38_993_543, 0) + // Minimum execution time: 45_324_000 picoseconds. + Weight::from_parts(39_237_937, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 498 - .saturating_add(Weight::from_parts(84_584, 0).saturating_mul(s.into())) + // Standard Error: 443 + .saturating_add(Weight::from_parts(72_357, 0).saturating_mul(s.into())) // Standard Error: 4 - .saturating_add(Weight::from_parts(1_271, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_254, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 32_894_000 picoseconds. - Weight::from_parts(33_904_403, 0) + // Minimum execution time: 32_200_000 picoseconds. + Weight::from_parts(33_433_001, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 801 - .saturating_add(Weight::from_parts(76_776, 0).saturating_mul(s.into())) + // Standard Error: 535 + .saturating_add(Weight::from_parts(72_441, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 19_290_000 picoseconds. - Weight::from_parts(20_348_418, 0) + // Minimum execution time: 19_126_000 picoseconds. + Weight::from_parts(20_322_098, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 465 - .saturating_add(Weight::from_parts(66_913, 0).saturating_mul(s.into())) + // Standard Error: 529 + .saturating_add(Weight::from_parts(58_882, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 33_275_000 picoseconds. - Weight::from_parts(34_932_596, 0) + // Minimum execution time: 33_332_000 picoseconds. + Weight::from_parts(34_711_486, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 564 - .saturating_add(Weight::from_parts(71_231, 0).saturating_mul(s.into())) + // Standard Error: 589 + .saturating_add(Weight::from_parts(70_302, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs index fd1e6b2034b..57bd6e4533a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `297` // Estimated: `3762` - // Minimum execution time: 17_753_000 picoseconds. - Weight::from_parts(18_269_000, 0) + // Minimum execution time: 17_886_000 picoseconds. + Weight::from_parts(18_456_000, 0) .saturating_add(Weight::from_parts(0, 3762)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `279` // Estimated: `3744` - // Minimum execution time: 13_403_000 picoseconds. - Weight::from_parts(13_821_000, 0) + // Minimum execution time: 13_607_000 picoseconds. + Weight::from_parts(13_655_000, 0) .saturating_add(Weight::from_parts(0, 3744)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs index 4a40dc1c75d..505c356a031 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -54,20 +54,20 @@ impl pallet_timestamp::WeightInfo for WeightInfo { /// Proof: Aura CurrentSlot (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) fn set() -> Weight { // Proof Size summary in bytes: - // Measured: `49` + // Measured: `85` // Estimated: `1493` - // Minimum execution time: 7_595_000 picoseconds. - Weight::from_parts(7_831_000, 0) + // Minimum execution time: 9_451_000 picoseconds. + Weight::from_parts(9_736_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn on_finalize() -> Weight { // Proof Size summary in bytes: - // Measured: `57` + // Measured: `94` // Estimated: `0` - // Minimum execution time: 3_169_000 picoseconds. - Weight::from_parts(3_316_000, 0) + // Minimum execution time: 3_660_000 picoseconds. + Weight::from_parts(3_776_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs index ec43ac02ac1..116ad9c7370 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_483_000 picoseconds. - Weight::from_parts(10_302_924, 0) + // Minimum execution time: 6_905_000 picoseconds. + Weight::from_parts(5_286_105, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_285 - .saturating_add(Weight::from_parts(4_760_910, 0).saturating_mul(c.into())) + // Standard Error: 3_700 + .saturating_add(Weight::from_parts(4_448_104, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_768_000 picoseconds. - Weight::from_parts(5_879_000, 0) + // Minimum execution time: 5_267_000 picoseconds. + Weight::from_parts(5_432_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_566_000 picoseconds. - Weight::from_parts(653_292, 0) + // Minimum execution time: 6_984_000 picoseconds. + Weight::from_parts(382_017, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_989 - .saturating_add(Weight::from_parts(5_103_611, 0).saturating_mul(c.into())) + // Standard Error: 3_786 + .saturating_add(Weight::from_parts(4_704_635, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_656_000 picoseconds. - Weight::from_parts(9_902_000, 0) + // Minimum execution time: 9_032_000 picoseconds. + Weight::from_parts(9_287_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_524_000 picoseconds. - Weight::from_parts(1_487_243, 0) + // Minimum execution time: 7_080_000 picoseconds. + Weight::from_parts(11_709_696, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_565 - .saturating_add(Weight::from_parts(4_841_130, 0).saturating_mul(c.into())) + // Standard Error: 3_061 + .saturating_add(Weight::from_parts(4_408_920, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs index efaf8232a35..5840da7a8e5 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -60,11 +60,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_565_000 picoseconds. - Weight::from_parts(28_064_000, 0) - .saturating_add(Weight::from_parts(0, 3503)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 29_490_000 picoseconds. + Weight::from_parts(29_921_000, 0) + .saturating_add(Weight::from_parts(0, 3540)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1489` - // Minimum execution time: 29_361_000 picoseconds. - Weight::from_parts(29_771_000, 0) + // Minimum execution time: 26_886_000 picoseconds. + Weight::from_parts(27_065_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -105,8 +105,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_098_000 picoseconds. - Weight::from_parts(10_440_000, 0) + // Minimum execution time: 10_300_000 picoseconds. + Weight::from_parts(10_564_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -116,8 +116,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_142_000 picoseconds. - Weight::from_parts(3_262_000, 0) + // Minimum execution time: 3_149_000 picoseconds. + Weight::from_parts(3_290_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -139,11 +139,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 32_356_000 picoseconds. - Weight::from_parts(32_859_000, 0) - .saturating_add(Weight::from_parts(0, 3503)) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 33_508_000 picoseconds. + Weight::from_parts(34_277_000, 0) + .saturating_add(Weight::from_parts(0, 3540)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -163,11 +163,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `220` - // Estimated: `3685` - // Minimum execution time: 33_773_000 picoseconds. - Weight::from_parts(34_410_000, 0) - .saturating_add(Weight::from_parts(0, 3685)) + // Measured: `257` + // Estimated: `3722` + // Minimum execution time: 34_455_000 picoseconds. + Weight::from_parts(34_811_000, 0) + .saturating_add(Weight::from_parts(0, 3722)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -177,8 +177,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_127_000 picoseconds. - Weight::from_parts(3_240_000, 0) + // Minimum execution time: 3_119_000 picoseconds. + Weight::from_parts(3_246_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -186,11 +186,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn migrate_supported_version() -> Weight { // Proof Size summary in bytes: - // Measured: `95` - // Estimated: `10985` - // Minimum execution time: 14_941_000 picoseconds. - Weight::from_parts(15_378_000, 0) - .saturating_add(Weight::from_parts(0, 10985)) + // Measured: `187` + // Estimated: `11077` + // Minimum execution time: 17_349_000 picoseconds. + Weight::from_parts(17_792_000, 0) + .saturating_add(Weight::from_parts(0, 11077)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -198,11 +198,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm VersionNotifiers (max_values: None, max_size: None, mode: Measured) fn migrate_version_notifiers() -> Weight { // Proof Size summary in bytes: - // Measured: `99` - // Estimated: `10989` - // Minimum execution time: 14_750_000 picoseconds. - Weight::from_parts(14_903_000, 0) - .saturating_add(Weight::from_parts(0, 10989)) + // Measured: `191` + // Estimated: `11081` + // Minimum execution time: 17_723_000 picoseconds. + Weight::from_parts(18_156_000, 0) + .saturating_add(Weight::from_parts(0, 11081)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -210,11 +210,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `13471` - // Minimum execution time: 15_360_000 picoseconds. - Weight::from_parts(15_593_000, 0) - .saturating_add(Weight::from_parts(0, 13471)) + // Measured: `198` + // Estimated: `13563` + // Minimum execution time: 17_921_000 picoseconds. + Weight::from_parts(18_408_000, 0) + .saturating_add(Weight::from_parts(0, 13563)) .saturating_add(T::DbWeight::get().reads(5)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -231,11 +231,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `6046` - // Minimum execution time: 28_886_000 picoseconds. - Weight::from_parts(29_140_000, 0) - .saturating_add(Weight::from_parts(0, 6046)) + // Measured: `142` + // Estimated: `6082` + // Minimum execution time: 31_110_000 picoseconds. + Weight::from_parts(31_902_000, 0) + .saturating_add(Weight::from_parts(0, 6082)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -243,22 +243,22 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn notify_target_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `136` - // Estimated: `8551` - // Minimum execution time: 8_045_000 picoseconds. - Weight::from_parts(8_301_000, 0) - .saturating_add(Weight::from_parts(0, 8551)) + // Measured: `172` + // Estimated: `8587` + // Minimum execution time: 8_908_000 picoseconds. + Weight::from_parts(9_173_000, 0) + .saturating_add(Weight::from_parts(0, 8587)) .saturating_add(T::DbWeight::get().reads(3)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn migrate_version_notify_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `10996` - // Minimum execution time: 14_763_000 picoseconds. - Weight::from_parts(15_186_000, 0) - .saturating_add(Weight::from_parts(0, 10996)) + // Measured: `198` + // Estimated: `11088` + // Minimum execution time: 17_495_000 picoseconds. + Weight::from_parts(18_569_000, 0) + .saturating_add(Weight::from_parts(0, 11088)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -276,11 +276,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `11002` - // Minimum execution time: 34_652_000 picoseconds. - Weight::from_parts(34_888_000, 0) - .saturating_add(Weight::from_parts(0, 11002)) + // Measured: `204` + // Estimated: `11094` + // Minimum execution time: 37_979_000 picoseconds. + Weight::from_parts(38_687_000, 0) + .saturating_add(Weight::from_parts(0, 11094)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index ad69bf08427..41696df6f4e 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 24_766_000 picoseconds. - Weight::from_parts(25_113_000, 3593) + // Minimum execution time: 24_201_000 picoseconds. + Weight::from_parts(24_429_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `6196` - // Minimum execution time: 51_440_000 picoseconds. - Weight::from_parts(51_960_000, 6196) + // Minimum execution time: 51_907_000 picoseconds. + Weight::from_parts(52_265_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -86,10 +86,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `223` + // Measured: `260` // Estimated: `6196` - // Minimum execution time: 76_002_000 picoseconds. - Weight::from_parts(76_826_000, 6196) + // Minimum execution time: 75_022_000 picoseconds. + Weight::from_parts(75_775_000, 6196) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -97,8 +97,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_644_000 picoseconds. - Weight::from_parts(4_754_000, 0) + // Minimum execution time: 3_922_000 picoseconds. + Weight::from_parts(4_020_000, 0) } // Storage: System Account (r:1 w:1) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -106,8 +106,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 27_398_000 picoseconds. - Weight::from_parts(27_947_000, 3593) + // Minimum execution time: 26_204_000 picoseconds. + Weight::from_parts(26_625_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -127,10 +127,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `122` - // Estimated: `3593` - // Minimum execution time: 54_445_000 picoseconds. - Weight::from_parts(55_026_000, 3593) + // Measured: `159` + // Estimated: `3624` + // Minimum execution time: 52_419_000 picoseconds. + Weight::from_parts(53_070_000, 3624) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -148,10 +148,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `70` - // Estimated: `3535` - // Minimum execution time: 30_770_000 picoseconds. - Weight::from_parts(31_269_000, 3535) + // Measured: `107` + // Estimated: `3572` + // Minimum execution time: 30_237_000 picoseconds. + Weight::from_parts(30_712_000, 3572) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 0b06968e441..406c947cf8d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -62,10 +62,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `70` - // Estimated: `3535` - // Minimum execution time: 34_120_000 picoseconds. - Weight::from_parts(34_618_000, 3535) + // Measured: `107` + // Estimated: `3572` + // Minimum execution time: 34_450_000 picoseconds. + Weight::from_parts(34_887_000, 3572) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -73,67 +73,67 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_285_000 picoseconds. - Weight::from_parts(3_426_000, 0) + // Minimum execution time: 2_956_000 picoseconds. + Weight::from_parts(3_034_000, 0) } // Storage: PolkadotXcm Queries (r:1 w:0) // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) pub fn query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `32` - // Estimated: `3497` - // Minimum execution time: 11_025_000 picoseconds. - Weight::from_parts(11_293_000, 3497) + // Measured: `69` + // Estimated: `3534` + // Minimum execution time: 11_185_000 picoseconds. + Weight::from_parts(11_390_000, 3534) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_451_000 picoseconds. - Weight::from_parts(13_625_000, 0) + // Minimum execution time: 12_348_000 picoseconds. + Weight::from_parts(12_692_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_578_000 picoseconds. - Weight::from_parts(3_639_000, 0) + // Minimum execution time: 3_373_000 picoseconds. + Weight::from_parts(3_510_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_123_000 picoseconds. - Weight::from_parts(3_190_000, 0) + // Minimum execution time: 2_784_000 picoseconds. + Weight::from_parts(2_845_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_176_000 picoseconds. - Weight::from_parts(3_223_000, 0) + // Minimum execution time: 2_756_000 picoseconds. + Weight::from_parts(2_829_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_142_000 picoseconds. - Weight::from_parts(3_200_000, 0) + // Minimum execution time: 2_745_000 picoseconds. + Weight::from_parts(2_823_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_308_000 picoseconds. - Weight::from_parts(4_392_000, 0) + // Minimum execution time: 3_548_000 picoseconds. + Weight::from_parts(3_654_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_114_000 picoseconds. - Weight::from_parts(3_189_000, 0) + // Minimum execution time: 2_719_000 picoseconds. + Weight::from_parts(2_831_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -149,10 +149,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `70` - // Estimated: `3535` - // Minimum execution time: 26_422_000 picoseconds. - Weight::from_parts(26_959_000, 3535) + // Measured: `107` + // Estimated: `3572` + // Minimum execution time: 27_216_000 picoseconds. + Weight::from_parts(27_535_000, 3572) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -160,10 +160,10 @@ impl WeightInfo { // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) pub fn claim_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `90` - // Estimated: `3555` - // Minimum execution time: 15_625_000 picoseconds. - Weight::from_parts(15_828_000, 3555) + // Measured: `126` + // Estimated: `3591` + // Minimum execution time: 16_144_000 picoseconds. + Weight::from_parts(16_370_000, 3591) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,8 +171,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_187_000 picoseconds. - Weight::from_parts(3_238_000, 0) + // Minimum execution time: 2_720_000 picoseconds. + Weight::from_parts(2_809_000, 0) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -188,10 +188,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_154_000 picoseconds. - Weight::from_parts(27_761_000, 3503) + // Measured: `75` + // Estimated: `3540` + // Minimum execution time: 28_006_000 picoseconds. + Weight::from_parts(28_593_000, 3540) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -201,8 +201,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_268_000 picoseconds. - Weight::from_parts(5_412_000, 0) + // Minimum execution time: 4_747_000 picoseconds. + Weight::from_parts(4_920_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -219,10 +219,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `70` - // Estimated: `3535` - // Minimum execution time: 30_515_000 picoseconds. - Weight::from_parts(31_095_000, 3535) + // Measured: `107` + // Estimated: `3572` + // Minimum execution time: 30_713_000 picoseconds. + Weight::from_parts(31_400_000, 3572) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -230,36 +230,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_148_000 picoseconds. - Weight::from_parts(5_224_000, 0) + // Minimum execution time: 4_540_000 picoseconds. + Weight::from_parts(4_624_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_220_000 picoseconds. - Weight::from_parts(3_312_000, 0) + // Minimum execution time: 2_987_000 picoseconds. + Weight::from_parts(3_097_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_226_000 picoseconds. - Weight::from_parts(3_309_000, 0) + // Minimum execution time: 2_927_000 picoseconds. + Weight::from_parts(3_042_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_095_000 picoseconds. - Weight::from_parts(3_177_000, 0) + // Minimum execution time: 2_798_000 picoseconds. + Weight::from_parts(2_886_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_349_000 picoseconds. - Weight::from_parts(3_447_000, 0) + // Minimum execution time: 3_005_000 picoseconds. + Weight::from_parts(3_104_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -275,10 +275,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `70` - // Estimated: `3535` - // Minimum execution time: 29_644_000 picoseconds. - Weight::from_parts(30_110_000, 3535) + // Measured: `107` + // Estimated: `3572` + // Minimum execution time: 31_468_000 picoseconds. + Weight::from_parts(31_948_000, 3572) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -286,8 +286,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_304_000 picoseconds. - Weight::from_parts(5_369_000, 0) + // Minimum execution time: 5_470_000 picoseconds. + Weight::from_parts(5_576_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -303,10 +303,10 @@ impl WeightInfo { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `70` - // Estimated: `3535` - // Minimum execution time: 26_617_000 picoseconds. - Weight::from_parts(27_011_000, 3535) + // Measured: `107` + // Estimated: `3572` + // Minimum execution time: 28_054_000 picoseconds. + Weight::from_parts(28_613_000, 3572) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -314,29 +314,22 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_133_000 picoseconds. - Weight::from_parts(3_229_000, 0) + // Minimum execution time: 2_832_000 picoseconds. + Weight::from_parts(2_897_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_110_000 picoseconds. - Weight::from_parts(3_203_000, 0) + // Minimum execution time: 2_808_000 picoseconds. + Weight::from_parts(2_934_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_138_000 picoseconds. - Weight::from_parts(3_201_000, 0) - } - pub fn set_fees_mode() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_116_000 picoseconds. - Weight::from_parts(3_187_000, 0) + // Minimum execution time: 2_789_000 picoseconds. + Weight::from_parts(2_853_000, 0) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -346,18 +339,30 @@ impl WeightInfo { // Proof: BridgeWococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen) // Storage: BridgeWococoMessages OutboundMessages (r:0 w:1) // Proof: BridgeWococoMessages OutboundMessages (max_values: None, max_size: Some(2621472), added: 2623947, mode: MaxEncodedLen) - pub(crate) fn export_message(x: u32, ) -> Weight { - Weight::from_parts(31_677_716_u64, 0) - // Standard Error: 4_158 - .saturating_add(Weight::from_parts(123_901, 0).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + /// The range of component `x` is `[1, 1000]`. + pub fn export_message(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `95` + // Estimated: `1529` + // Minimum execution time: 31_478_000 picoseconds. + Weight::from_parts(35_577_137, 1529) + // Standard Error: 497 + .saturating_add(Weight::from_parts(177_271, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + pub fn set_fees_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_770_000 picoseconds. + Weight::from_parts(2_871_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_364_000 picoseconds. - Weight::from_parts(3_429_000, 0) + // Minimum execution time: 2_961_000 picoseconds. + Weight::from_parts(3_103_000, 0) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index c01c34a3b38..067592c72a3 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -263,6 +263,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. diff --git a/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml b/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml index ade734b6ce2..a19d9ca37df 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml @@ -64,6 +64,8 @@ std = [ "frame-executive/std", "frame-support/std", "frame-system/std", + "bp-bridge-hub-rococo/std", + "bp-bridge-hub-wococo/std", "bp-messages/std", "bp-parachains/std", "bp-polkadot-core/std", diff --git a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs index 14792067e43..8a33279cd2b 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs +++ b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs @@ -52,6 +52,8 @@ use xcm_executor::XcmExecutor; // Re-export test_case from assets pub use asset_test_utils::include_teleports_for_native_asset_works; +// Re-export +pub use parachains_runtimes_test_utils::change_storage_constant_by_governance_works; /// Test-case makes sure that `Runtime` can process bridging initialize via governance-like call pub fn initialize_bridge_by_governance_works( @@ -113,76 +115,6 @@ pub fn initialize_bridge_by_governance_works( }) } -/// Test-case makes sure that `Runtime` can change storage constant via governance-like call -pub fn change_storage_constant_by_governance_works( - collator_session_key: CollatorSessionKeys, - runtime_para_id: u32, - runtime_call_encode: Box) -> Vec>, - storage_constant_key_value: fn() -> (Vec, StorageConstantType), - new_storage_constant_value: fn(&StorageConstantType) -> StorageConstantType, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_dmp_queue::Config - + cumulus_pallet_parachain_system::Config, - ValidatorIdOf: From>, - StorageConstant: Get, - StorageConstantType: Encode + PartialEq + std::fmt::Debug, -{ - ExtBuilder::::default() - .with_collators(collator_session_key.collators()) - .with_session_keys(collator_session_key.session_keys()) - .with_para_id(runtime_para_id.into()) - .with_tracing() - .build() - .execute_with(|| { - let (storage_constant_key, storage_constant_init_value): ( - Vec, - StorageConstantType, - ) = storage_constant_key_value(); - - // check delivery reward constant before (not stored yet, just as default value is used) - assert_eq!(StorageConstant::get(), storage_constant_init_value); - assert_eq!(sp_io::storage::get(&storage_constant_key), None); - - let new_storage_constant_value = - new_storage_constant_value(&storage_constant_init_value); - assert_ne!(new_storage_constant_value, storage_constant_init_value); - - // encode `set_storage` call - let set_storage_call = - runtime_call_encode(frame_system::Call::::set_storage { - items: vec![( - storage_constant_key.clone(), - new_storage_constant_value.encode(), - )], - }); - - // estimate - storing just 1 value - use frame_system::WeightInfo; - let require_weight_at_most = - ::SystemWeightInfo::set_storage(1); - - // execute XCM with Transact to `set_storage` as governance does - assert_ok!(RuntimeHelper::::execute_as_governance( - set_storage_call, - require_weight_at_most - ) - .ensure_complete()); - - // check delivery reward constant after (stored) - assert_eq!(StorageConstant::get(), new_storage_constant_value); - assert_eq!( - sp_io::storage::get(&storage_constant_key), - Some(new_storage_constant_value.encode().into()) - ); - }) -} - /// Test-case makes sure that `Runtime` can handle xcm `ExportMessage`: /// Checks if received XCM messages is correctly added to the message outbound queue for delivery. /// For SystemParachains we expect unpaid execution. @@ -933,7 +865,7 @@ pub mod test_data { ); /// Simulates `HaulBlobExporter` and all its wrapping and captures generated plain bytes, - /// which are transfered over bridge. + /// which are transferred over bridge. pub(crate) fn simulate_message_exporter_on_bridged_chain< SourceNetwork: Get, DestinationNetwork: Get, diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index 9ab4be51048..36d2d8cbb01 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -8,7 +8,7 @@ description = "Polkadot Collectives Parachain Runtime" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = "0.4.1" } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" @@ -36,6 +36,8 @@ pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/parityt pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-referenda = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-core-fellowship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-salary = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -103,6 +105,8 @@ runtime-benchmarks = [ "pallet-preimage/runtime-benchmarks", "pallet-referenda/runtime-benchmarks", "pallet-ranked-collective/runtime-benchmarks", + "pallet-core-fellowship/runtime-benchmarks", + "pallet-salary/runtime-benchmarks", ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", @@ -131,6 +135,8 @@ try-runtime = [ "pallet-preimage/try-runtime", "pallet-referenda/try-runtime", "pallet-ranked-collective/try-runtime", + "pallet-core-fellowship/try-runtime", + "pallet-salary/try-runtime", ] std = [ "codec/std", @@ -187,4 +193,6 @@ std = [ "pallet-referenda/std", "pallet-ranked-collective/std", "substrate-wasm-builder", + "pallet-core-fellowship/std", + "pallet-salary/std", ] diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index 836235345ef..8d0325844cc 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -16,8 +16,8 @@ pub mod account { use frame_support::PalletId; - /// Relay Chain treasury pallet id, used to convert into AccountId - pub const RELAY_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry"); + /// Polkadot treasury pallet id, used to convert into AccountId + pub const POLKADOT_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry"); /// Alliance pallet ID. /// It is used as a temporarily place to deposit a slashed imbalance /// before the teleport to the Treasury. diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 22926d1d27d..c8442c7c430 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -19,42 +19,38 @@ pub(crate) mod migration; mod origins; mod tracks; +use cumulus_primitives_core::Junction::GeneralIndex; +use frame_system::EnsureNever; pub use origins::{ - pallet_origins as pallet_fellowship_origins, Fellows, FellowshipCandidates, FellowshipExperts, - FellowshipMasters, + pallet_origins as pallet_fellowship_origins, Architects, EnsureCanPromoteTo, EnsureCanRetainAt, + EnsureFellowship, Fellows, Masters, Members, }; +use xcm_builder::{AliasesIntoAccountId32, LocatableAssetId, PayOverXcm}; use crate::{ - constants, impls::ToParentTreasury, weights, AccountId, Balance, Balances, BlockNumber, - FellowshipReferenda, GovernanceLocation, Preimage, RelayTreasuryAccount, Runtime, RuntimeCall, - RuntimeEvent, Scheduler, DAYS, + constants, impls::ToParentTreasury, weights, AccountId, Balance, Balances, FellowshipReferenda, + GovernanceLocation, PolkadotTreasuryAccount, Preimage, Runtime, RuntimeCall, RuntimeEvent, + Scheduler, DAYS, }; use frame_support::{ parameter_types, - traits::{EitherOf, MapSuccess, TryMapSuccess}, + traits::{EitherOf, EitherOfDiverse, MapSuccess}, }; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; -use polkadot_runtime_constants::xcm::body::FELLOWSHIP_ADMIN_INDEX; -use sp_arithmetic::traits::CheckedSub; -use sp_core::ConstU32; -use sp_runtime::{ - morph_types, - traits::{AccountIdConversion, ConstU16, Replace, TypedGet}, -}; +use polkadot_runtime_constants::{time::HOURS, xcm::body::FELLOWSHIP_ADMIN_INDEX}; +use sp_core::{ConstU128, ConstU32}; +use sp_runtime::traits::{AccountIdConversion, ConstU16, ConvertToValue, Replace}; use xcm::latest::BodyId; -use self::origins::EnsureFellowship; - /// The Fellowship members' ranks. pub mod ranks { use pallet_ranked_collective::Rank; - pub const CANDIDATES: Rank = 0; - pub const DAN_1: Rank = 1; + pub const DAN_1: Rank = 1; // aka Members. pub const DAN_2: Rank = 2; pub const DAN_3: Rank = 3; // aka Fellows. - pub const DAN_4: Rank = 4; - pub const DAN_5: Rank = 5; // aka Experts. + pub const DAN_4: Rank = 4; // aka Architects. + pub const DAN_5: Rank = 5; pub const DAN_6: Rank = 6; pub const DAN_7: Rank = 7; // aka Masters. pub const DAN_8: Rank = 8; @@ -62,9 +58,6 @@ pub mod ranks { } parameter_types! { - pub const AlarmInterval: BlockNumber = 1; - pub const SubmissionDeposit: Balance = 0; - pub const UndecidingTimeout: BlockNumber = 7 * DAYS; // Referenda pallet account, used to temporarily deposit slashed imbalance before teleporting. pub ReferendaPalletAccount: AccountId = constants::account::REFERENDA_PALLET_ID.into_account_truncating(); pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX); @@ -80,63 +73,146 @@ impl pallet_referenda::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; type Currency = Balances; + // Fellows can submit proposals. type SubmitOrigin = - pallet_ranked_collective::EnsureMember; - type CancelOrigin = FellowshipExperts; - type KillOrigin = FellowshipMasters; - type Slash = ToParentTreasury; + pallet_ranked_collective::EnsureMember; + type CancelOrigin = Architects; + type KillOrigin = Masters; + type Slash = ToParentTreasury; type Votes = pallet_ranked_collective::Votes; type Tally = pallet_ranked_collective::TallyOf; - type SubmissionDeposit = SubmissionDeposit; + type SubmissionDeposit = ConstU128<0>; type MaxQueued = ConstU32<100>; - type UndecidingTimeout = UndecidingTimeout; - type AlarmInterval = AlarmInterval; + type UndecidingTimeout = ConstU32<{ 7 * DAYS }>; + type AlarmInterval = ConstU32<1>; type Tracks = tracks::TracksInfo; type Preimages = Preimage; } pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; -morph_types! { - /// A `TryMorph` implementation to reduce a scalar by a particular amount, checking for - /// underflow. - pub type CheckedReduceBy: TryMorph = |r: N::Type| -> Result { - r.checked_sub(&N::get()).ok_or(()) - } where N::Type: CheckedSub; -} - impl pallet_ranked_collective::Config for Runtime { type WeightInfo = weights::pallet_ranked_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; - // Promotion is by any of: - // - Root can promote arbitrarily. - // - the FellowshipAdmin origin (i.e. token holder referendum); - // - a vote by the rank *above* the new rank. - type PromoteOrigin = EitherOf< - frame_system::EnsureRootWithSuccess>, - EitherOf< - MapSuccess< - EnsureXcm>, - Replace>, - >, - TryMapSuccess>>, - >, - >; + // Promotions and the induction of new members are serviced by `FellowshipCore` pallet instance. + type PromoteOrigin = EnsureNever; // Demotion is by any of: // - Root can demote arbitrarily. // - the FellowshipAdmin origin (i.e. token holder referendum); - // - a vote by the rank two above the current rank. type DemoteOrigin = EitherOf< - frame_system::EnsureRootWithSuccess>, - EitherOf< - MapSuccess< - EnsureXcm>, - Replace>, - >, - TryMapSuccess>>, + frame_system::EnsureRootWithSuccess>, + MapSuccess< + EnsureXcm>, + Replace>, >, >; type Polls = FellowshipReferenda; - type MinRankOfClass = sp_runtime::traits::Identity; + type MinRankOfClass = tracks::MinRankOfClass; type VoteWeight = pallet_ranked_collective::Geometric; } + +pub type FellowshipCoreInstance = pallet_core_fellowship::Instance1; + +impl pallet_core_fellowship::Config for Runtime { + type WeightInfo = weights::pallet_core_fellowship::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type Members = pallet_ranked_collective::Pallet; + type Balance = Balance; + // Parameters are set by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote among all Fellows. + type ParamsOrigin = EitherOfDiverse< + EnsureXcm>, + Fellows, + >; + // Induction (creating a candidate) is by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a single Fellow; + // - a vote among all Members. + type InductOrigin = EitherOfDiverse< + EnsureXcm>, + EitherOfDiverse< + pallet_ranked_collective::EnsureMember< + Runtime, + FellowshipCollectiveInstance, + { ranks::DAN_3 }, + >, + Members, + >, + >; + // Approval (rank-retention) of a Member's current rank is by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote by the rank two above the current rank for all retention up to the Master rank. + type ApproveOrigin = EitherOf< + MapSuccess< + EnsureXcm>, + Replace>, + >, + EnsureCanRetainAt, + >; + // Promotion is by any of: + // - Root can promote arbitrarily. + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote by the rank two above the new rank for all promotions up to the Master rank. + type PromoteOrigin = EitherOf< + MapSuccess< + EnsureXcm>, + Replace>, + >, + EnsureCanPromoteTo, + >; + type EvidenceSize = ConstU32<65536>; +} + +pub type FellowshipSalaryInstance = pallet_salary::Instance1; + +use xcm::prelude::*; + +parameter_types! { + pub AssetHub: MultiLocation = (Parent, Parachain(1000)).into(); + pub AssetHubUsdtId: AssetId = (PalletInstance(50), GeneralIndex(1984)).into(); + pub UsdtAsset: LocatableAssetId = LocatableAssetId { + location: AssetHub::get(), + asset_id: AssetHubUsdtId::get(), + }; + // The interior location on AssetHub for the paying account. This is the Fellowship Salary + // pallet instance (which sits at index 64). This sovereign account will need funding. + pub Interior: InteriorMultiLocation = PalletInstance(64).into(); +} + +const USDT_UNITS: u128 = 1_000_000; + +/// [`PayOverXcm`] setup to pay the Fellowship salary on the AssetHub in USDT. +pub type FellowshipSalaryPaymaster = PayOverXcm< + Interior, + crate::xcm_config::XcmRouter, + crate::PolkadotXcm, + ConstU32<{ 6 * HOURS }>, + AccountId, + (), + ConvertToValue, + AliasesIntoAccountId32<(), AccountId>, +>; + +impl pallet_salary::Config for Runtime { + type WeightInfo = weights::pallet_salary::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type Paymaster = FellowshipSalaryPaymaster; + type Members = pallet_ranked_collective::Pallet; + + #[cfg(not(feature = "runtime-benchmarks"))] + type Salary = pallet_core_fellowship::Pallet; + #[cfg(feature = "runtime-benchmarks")] + type Salary = frame_support::traits::tokens::ConvertRank< + crate::impls::benchmarks::RankToSalary, + >; + // 15 days to register for a salary payment. + type RegistrationPeriod = ConstU32<{ 15 * DAYS }>; + // 15 days to claim the salary payment. + type PayoutPeriod = ConstU32<{ 15 * DAYS }>; + // Total monthly salary budget. + type Budget = ConstU128<{ 100_000 * USDT_UNITS }>; +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs index db778f38cb4..4842f64d485 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -34,32 +34,62 @@ pub mod pallet_origins { #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)] #[pallet::origin] pub enum Origin { - /// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed). - FellowshipCandidates, - /// Origin commanded by Polkadot Fellows (3rd Dan fellows or greater). - Fellows, - /// Origin commanded by Polkadot Experts (5th Dan fellows or greater). - FellowshipExperts, - /// Origin commanded by Polkadot Masters (7th Dan fellows of greater). - FellowshipMasters, - /// Origin commanded by rank 1 of the Polkadot Fellowship and with a success of 1. - Fellowship1Dan, - /// Origin commanded by rank 2 of the Polkadot Fellowship and with a success of 2. + /// Origin aggregated through weighted votes of those with rank 1 or above; `Success` is 1. + Members, + /// Origin aggregated through weighted votes of those with rank 2 or above; `Success` is 2. Fellowship2Dan, - /// Origin commanded by rank 3 of the Polkadot Fellowship and with a success of 3. - Fellowship3Dan, - /// Origin commanded by rank 4 of the Polkadot Fellowship and with a success of 4. - Fellowship4Dan, - /// Origin commanded by rank 5 of the Polkadot Fellowship and with a success of 5. + /// Origin aggregated through weighted votes of those with rank 3 or above; `Success` is 3. + Fellows, + /// Origin aggregated through weighted votes of those with rank 4 or above; `Success` is 4. + Architects, + /// Origin aggregated through weighted votes of those with rank 5 or above; `Success` is 5. Fellowship5Dan, - /// Origin commanded by rank 6 of the Polkadot Fellowship and with a success of 6. + /// Origin aggregated through weighted votes of those with rank 6 or above; `Success` is 6. Fellowship6Dan, - /// Origin commanded by rank 7 of the Polkadot Fellowship and with a success of 7. - Fellowship7Dan, - /// Origin commanded by rank 8 of the Polkadot Fellowship and with a success of 8. + /// Origin aggregated through weighted votes of those with rank 7 or above; `Success` is 7. + Masters, + /// Origin aggregated through weighted votes of those with rank 8 or above; `Success` is 8. Fellowship8Dan, - /// Origin commanded by rank 9 of the Polkadot Fellowship and with a success of 9. + /// Origin aggregated through weighted votes of those with rank 9 or above; `Success` is 9. Fellowship9Dan, + + /// Origin aggregated through weighted votes of those with rank 3 or above when voting on + /// a fortnight-long track; `Success` is 1. + RetainAt1Dan, + /// Origin aggregated through weighted votes of those with rank 4 or above when voting on + /// a fortnight-long track; `Success` is 2. + RetainAt2Dan, + /// Origin aggregated through weighted votes of those with rank 5 or above when voting on + /// a fortnight-long track; `Success` is 3. + RetainAt3Dan, + /// Origin aggregated through weighted votes of those with rank 6 or above when voting on + /// a fortnight-long track; `Success` is 4. + RetainAt4Dan, + /// Origin aggregated through weighted votes of those with rank 7 or above when voting on + /// a fortnight-long track; `Success` is 5. + RetainAt5Dan, + /// Origin aggregated through weighted votes of those with rank 8 or above when voting on + /// a fortnight-long track; `Success` is 6. + RetainAt6Dan, + + /// Origin aggregated through weighted votes of those with rank 3 or above when voting on + /// a month-long track; `Success` is 1. + PromoteTo1Dan, + /// Origin aggregated through weighted votes of those with rank 4 or above when voting on + /// a month-long track; `Success` is 2. + PromoteTo2Dan, + /// Origin aggregated through weighted votes of those with rank 5 or above when voting on + /// a month-long track; `Success` is 3. + PromoteTo3Dan, + /// Origin aggregated through weighted votes of those with rank 6 or above when voting on + /// a month-long track; `Success` is 4. + PromoteTo4Dan, + /// Origin aggregated through weighted votes of those with rank 7 or above when voting on + /// a month-long track; `Success` is 5. + PromoteTo5Dan, + /// Origin aggregated through weighted votes of those with rank 8 or above when voting on + /// a month-long track; `Success` is 6. + PromoteTo6Dan, } macro_rules! decl_unit_ensures { @@ -93,10 +123,10 @@ pub mod pallet_origins { () => {} } decl_unit_ensures!( - FellowshipCandidates: Rank = ranks::CANDIDATES, + Members: Rank = ranks::DAN_1, Fellows: Rank = ranks::DAN_3, - FellowshipExperts: Rank = ranks::DAN_5, - FellowshipMasters: Rank = ranks::DAN_7, + Architects: Rank = ranks::DAN_4, + Masters: Rank = ranks::DAN_7, ); macro_rules! decl_ensure { @@ -132,17 +162,45 @@ pub mod pallet_origins { } } + // Fellowship origin indicating weighted voting from at least the rank of `Success` on a + // week-long track. decl_ensure! { pub type EnsureFellowship: EnsureOrigin { - Fellowship1Dan = ranks::DAN_1, + Members = ranks::DAN_1, Fellowship2Dan = ranks::DAN_2, - Fellowship3Dan = ranks::DAN_3, - Fellowship4Dan = ranks::DAN_4, + Fellows = ranks::DAN_3, + Architects = ranks::DAN_4, Fellowship5Dan = ranks::DAN_5, Fellowship6Dan = ranks::DAN_6, - Fellowship7Dan = ranks::DAN_7, + Masters = ranks::DAN_7, Fellowship8Dan = ranks::DAN_8, Fellowship9Dan = ranks::DAN_9, } } + + // Fellowship origin indicating weighted voting from at least the rank of `Success + 2` on + // a fortnight-long track; needed for Fellowship retention voting. + decl_ensure! { + pub type EnsureCanRetainAt: EnsureOrigin { + RetainAt1Dan = ranks::DAN_1, + RetainAt2Dan = ranks::DAN_2, + RetainAt3Dan = ranks::DAN_3, + RetainAt4Dan = ranks::DAN_4, + RetainAt5Dan = ranks::DAN_5, + RetainAt6Dan = ranks::DAN_6, + } + } + + // Fellowship origin indicating weighted voting from at least the rank of `Success + 2` on + // a month-long track; needed for Fellowship promotion voting. + decl_ensure! { + pub type EnsureCanPromoteTo: EnsureOrigin { + PromoteTo1Dan = ranks::DAN_1, + PromoteTo2Dan = ranks::DAN_2, + PromoteTo3Dan = ranks::DAN_3, + PromoteTo4Dan = ranks::DAN_4, + PromoteTo5Dan = ranks::DAN_5, + PromoteTo6Dan = ranks::DAN_6, + } + } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index 1f728279485..d10a5273e3f 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -16,8 +16,9 @@ //! Track configurations for Fellowship. -use crate::{Balance, BlockNumber, RuntimeOrigin, DAYS, DOLLARS, MINUTES}; -use sp_runtime::Perbill; +use crate::{Balance, BlockNumber, RuntimeOrigin, DAYS, DOLLARS, HOURS, MINUTES}; +use pallet_ranked_collective::Rank; +use sp_runtime::{traits::Convert, Perbill}; /// Referendum `TrackId` type. pub type TrackId = u16; @@ -26,57 +27,105 @@ pub type TrackId = u16; pub mod constants { use super::TrackId; - pub const CANDIDATES: TrackId = 0; + // Regular tracks (7 days) used for general operations. The required rank for voting is the + // same as that which is named (and also the track ID). pub const MEMBERS: TrackId = 1; pub const PROFICIENTS: TrackId = 2; pub const FELLOWS: TrackId = 3; - pub const SENIOR_FELLOWS: TrackId = 4; - pub const EXPERTS: TrackId = 5; - pub const SENIOR_EXPERTS: TrackId = 6; + pub const ARCHITECTS: TrackId = 4; + pub const ARCHITECTS_ADEPT: TrackId = 5; + pub const GRAND_ARCHITECTS: TrackId = 6; pub const MASTERS: TrackId = 7; - pub const SENIOR_MASTERS: TrackId = 8; + pub const MASTERS_CONSTANT: TrackId = 8; pub const GRAND_MASTERS: TrackId = 9; + + // Longer tracks (14 days) used for rank retention. These require a rank of two more than the + // grade at which they retain (as per the whitepaper). This works out as the track ID minus 8. + pub const RETAIN_AT_1DAN: TrackId = 11; + pub const RETAIN_AT_2DAN: TrackId = 12; + pub const RETAIN_AT_3DAN: TrackId = 13; + pub const RETAIN_AT_4DAN: TrackId = 14; + pub const RETAIN_AT_5DAN: TrackId = 15; + pub const RETAIN_AT_6DAN: TrackId = 16; + + // Longest tracks (30 days) used for promotions. These require a rank of two more than the + // grade to which they promote (as per the whitepaper). This works out as the track ID minus 18. + pub const PROMOTE_TO_1DAN: TrackId = 21; + pub const PROMOTE_TO_2DAN: TrackId = 22; + pub const PROMOTE_TO_3DAN: TrackId = 23; + pub const PROMOTE_TO_4DAN: TrackId = 24; + pub const PROMOTE_TO_5DAN: TrackId = 25; + pub const PROMOTE_TO_6DAN: TrackId = 26; +} + +/// Convert the track ID (defined above) into the minimum rank (i.e. fellowship Dan grade) required +/// to vote on the track. +pub struct MinRankOfClass; +impl Convert for MinRankOfClass { + fn convert(a: TrackId) -> Rank { + match a { + // Just a regular vote: the track ID is conveniently the same as the minimum rank. + regular @ 1..=9 => regular, + // A retention vote; the track ID turns out to be 8 more than the minimum required rank. + retention @ 11..=16 => retention - 8, + // A promotion vote; the track ID turns out to be 18 more than the minimum required rank. + promotion @ 21..=26 => promotion - 18, + _ => Rank::max_value(), + } + } } +const RETAIN_MAX_DECIDING: u32 = 25; +const RETAIN_DECISION_DEPOSIT: Balance = 5 * DOLLARS; +const RETAIN_PREPARE_PERIOD: BlockNumber = 0; +const RETAIN_DECISION_PERIOD: BlockNumber = 14 * DAYS; +const RETAIN_CONFIRM_PERIOD: BlockNumber = 1 * HOURS; +const RETAIN_MIN_ENACTMENT_PERIOD: BlockNumber = 0; +const RETAIN_MIN_APPROVAL: pallet_referenda::Curve = pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(60), + ceil: Perbill::from_percent(100), +}; +const RETAIN_MIN_SUPPORT: pallet_referenda::Curve = pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(10), + ceil: Perbill::from_percent(100), +}; + +const PROMOTE_MAX_DECIDING: u32 = 10; +const PROMOTE_DECISION_DEPOSIT: Balance = 5 * DOLLARS; +const PROMOTE_PREPARE_PERIOD: BlockNumber = 0; +const PROMOTE_DECISION_PERIOD: BlockNumber = 30 * DAYS; +const PROMOTE_CONFIRM_PERIOD: BlockNumber = 1 * HOURS; +const PROMOTE_MIN_ENACTMENT_PERIOD: BlockNumber = 0; +const PROMOTE_MIN_APPROVAL: pallet_referenda::Curve = pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(60), + ceil: Perbill::from_percent(100), +}; +const PROMOTE_MIN_SUPPORT: pallet_referenda::Curve = pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(10), + ceil: Perbill::from_percent(100), +}; + pub struct TracksInfo; impl pallet_referenda::TracksInfo for TracksInfo { type Id = TrackId; type RuntimeOrigin = ::PalletsOrigin; fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { use constants as tracks; - static DATA: [(TrackId, pallet_referenda::TrackInfo); 10] = [ - ( - tracks::CANDIDATES, - pallet_referenda::TrackInfo { - name: "candidates", - max_deciding: 10, - decision_deposit: 100 * DOLLARS, - prepare_period: 30 * MINUTES, - decision_period: 7 * DAYS, - confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, - min_approval: pallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(50), - ceil: Perbill::from_percent(100), - }, - min_support: pallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), - }, - }, - ), + static DATA: [(TrackId, pallet_referenda::TrackInfo); 21] = [ ( tracks::MEMBERS, pallet_referenda::TrackInfo { name: "members", max_deciding: 10, - decision_deposit: 10 * DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -85,20 +134,20 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), ( tracks::PROFICIENTS, pallet_referenda::TrackInfo { - name: "proficients", + name: "proficient members", max_deciding: 10, - decision_deposit: 10 * DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -107,7 +156,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), @@ -116,11 +165,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "fellows", max_deciding: 10, - decision_deposit: 10 * DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -129,20 +178,20 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), ( - tracks::SENIOR_FELLOWS, + tracks::ARCHITECTS, pallet_referenda::TrackInfo { - name: "senior fellows", + name: "architects", max_deciding: 10, - decision_deposit: 10 * DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -151,20 +200,20 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), ( - tracks::EXPERTS, + tracks::ARCHITECTS_ADEPT, pallet_referenda::TrackInfo { - name: "experts", + name: "architects adept", max_deciding: 10, - decision_deposit: DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -173,20 +222,20 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), ( - tracks::SENIOR_EXPERTS, + tracks::GRAND_ARCHITECTS, pallet_referenda::TrackInfo { - name: "senior experts", + name: "grand architects", max_deciding: 10, - decision_deposit: DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -195,7 +244,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), @@ -204,11 +253,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "masters", max_deciding: 10, - decision_deposit: DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -217,20 +266,20 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), ( - tracks::SENIOR_MASTERS, + tracks::MASTERS_CONSTANT, pallet_referenda::TrackInfo { - name: "senior masters", + name: "masters constant", max_deciding: 10, - decision_deposit: DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -239,7 +288,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), @@ -248,11 +297,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "grand masters", max_deciding: 10, - decision_deposit: DOLLARS, + decision_deposit: 5 * DOLLARS, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -261,10 +310,178 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, ), + ( + tracks::RETAIN_AT_1DAN, + pallet_referenda::TrackInfo { + name: "retain at I Dan", + max_deciding: RETAIN_MAX_DECIDING, + decision_deposit: RETAIN_DECISION_DEPOSIT, + prepare_period: RETAIN_PREPARE_PERIOD, + decision_period: RETAIN_DECISION_PERIOD, + confirm_period: RETAIN_CONFIRM_PERIOD, + min_enactment_period: RETAIN_MIN_ENACTMENT_PERIOD, + min_approval: RETAIN_MIN_APPROVAL, + min_support: RETAIN_MIN_SUPPORT, + }, + ), + ( + tracks::RETAIN_AT_2DAN, + pallet_referenda::TrackInfo { + name: "retain at II Dan", + max_deciding: RETAIN_MAX_DECIDING, + decision_deposit: RETAIN_DECISION_DEPOSIT, + prepare_period: RETAIN_PREPARE_PERIOD, + decision_period: RETAIN_DECISION_PERIOD, + confirm_period: RETAIN_CONFIRM_PERIOD, + min_enactment_period: RETAIN_MIN_ENACTMENT_PERIOD, + min_approval: RETAIN_MIN_APPROVAL, + min_support: RETAIN_MIN_SUPPORT, + }, + ), + ( + tracks::RETAIN_AT_3DAN, + pallet_referenda::TrackInfo { + name: "retain at III Dan", + max_deciding: RETAIN_MAX_DECIDING, + decision_deposit: RETAIN_DECISION_DEPOSIT, + prepare_period: RETAIN_PREPARE_PERIOD, + decision_period: RETAIN_DECISION_PERIOD, + confirm_period: RETAIN_CONFIRM_PERIOD, + min_enactment_period: RETAIN_MIN_ENACTMENT_PERIOD, + min_approval: RETAIN_MIN_APPROVAL, + min_support: RETAIN_MIN_SUPPORT, + }, + ), + ( + tracks::RETAIN_AT_4DAN, + pallet_referenda::TrackInfo { + name: "retain at IV Dan", + max_deciding: RETAIN_MAX_DECIDING, + decision_deposit: RETAIN_DECISION_DEPOSIT, + prepare_period: RETAIN_PREPARE_PERIOD, + decision_period: RETAIN_DECISION_PERIOD, + confirm_period: RETAIN_CONFIRM_PERIOD, + min_enactment_period: RETAIN_MIN_ENACTMENT_PERIOD, + min_approval: RETAIN_MIN_APPROVAL, + min_support: RETAIN_MIN_SUPPORT, + }, + ), + ( + tracks::RETAIN_AT_5DAN, + pallet_referenda::TrackInfo { + name: "retain at V Dan", + max_deciding: RETAIN_MAX_DECIDING, + decision_deposit: RETAIN_DECISION_DEPOSIT, + prepare_period: RETAIN_PREPARE_PERIOD, + decision_period: RETAIN_DECISION_PERIOD, + confirm_period: RETAIN_CONFIRM_PERIOD, + min_enactment_period: RETAIN_MIN_ENACTMENT_PERIOD, + min_approval: RETAIN_MIN_APPROVAL, + min_support: RETAIN_MIN_SUPPORT, + }, + ), + ( + tracks::RETAIN_AT_6DAN, + pallet_referenda::TrackInfo { + name: "retain at VI Dan", + max_deciding: RETAIN_MAX_DECIDING, + decision_deposit: RETAIN_DECISION_DEPOSIT, + prepare_period: RETAIN_PREPARE_PERIOD, + decision_period: RETAIN_DECISION_PERIOD, + confirm_period: RETAIN_CONFIRM_PERIOD, + min_enactment_period: RETAIN_MIN_ENACTMENT_PERIOD, + min_approval: RETAIN_MIN_APPROVAL, + min_support: RETAIN_MIN_SUPPORT, + }, + ), + ( + tracks::PROMOTE_TO_1DAN, + pallet_referenda::TrackInfo { + name: "promote to I Dan", + max_deciding: PROMOTE_MAX_DECIDING, + decision_deposit: PROMOTE_DECISION_DEPOSIT, + prepare_period: PROMOTE_PREPARE_PERIOD, + decision_period: PROMOTE_DECISION_PERIOD, + confirm_period: PROMOTE_CONFIRM_PERIOD, + min_enactment_period: PROMOTE_MIN_ENACTMENT_PERIOD, + min_approval: PROMOTE_MIN_APPROVAL, + min_support: PROMOTE_MIN_SUPPORT, + }, + ), + ( + tracks::PROMOTE_TO_2DAN, + pallet_referenda::TrackInfo { + name: "promote to II Dan", + max_deciding: PROMOTE_MAX_DECIDING, + decision_deposit: PROMOTE_DECISION_DEPOSIT, + prepare_period: PROMOTE_PREPARE_PERIOD, + decision_period: PROMOTE_DECISION_PERIOD, + confirm_period: PROMOTE_CONFIRM_PERIOD, + min_enactment_period: PROMOTE_MIN_ENACTMENT_PERIOD, + min_approval: PROMOTE_MIN_APPROVAL, + min_support: PROMOTE_MIN_SUPPORT, + }, + ), + ( + tracks::PROMOTE_TO_3DAN, + pallet_referenda::TrackInfo { + name: "promote to III Dan", + max_deciding: PROMOTE_MAX_DECIDING, + decision_deposit: PROMOTE_DECISION_DEPOSIT, + prepare_period: PROMOTE_PREPARE_PERIOD, + decision_period: PROMOTE_DECISION_PERIOD, + confirm_period: PROMOTE_CONFIRM_PERIOD, + min_enactment_period: PROMOTE_MIN_ENACTMENT_PERIOD, + min_approval: PROMOTE_MIN_APPROVAL, + min_support: PROMOTE_MIN_SUPPORT, + }, + ), + ( + tracks::PROMOTE_TO_4DAN, + pallet_referenda::TrackInfo { + name: "promote to IV Dan", + max_deciding: PROMOTE_MAX_DECIDING, + decision_deposit: PROMOTE_DECISION_DEPOSIT, + prepare_period: PROMOTE_PREPARE_PERIOD, + decision_period: PROMOTE_DECISION_PERIOD, + confirm_period: PROMOTE_CONFIRM_PERIOD, + min_enactment_period: PROMOTE_MIN_ENACTMENT_PERIOD, + min_approval: PROMOTE_MIN_APPROVAL, + min_support: PROMOTE_MIN_SUPPORT, + }, + ), + ( + tracks::PROMOTE_TO_5DAN, + pallet_referenda::TrackInfo { + name: "promote to V Dan", + max_deciding: PROMOTE_MAX_DECIDING, + decision_deposit: PROMOTE_DECISION_DEPOSIT, + prepare_period: PROMOTE_PREPARE_PERIOD, + decision_period: PROMOTE_DECISION_PERIOD, + confirm_period: PROMOTE_CONFIRM_PERIOD, + min_enactment_period: PROMOTE_MIN_ENACTMENT_PERIOD, + min_approval: PROMOTE_MIN_APPROVAL, + min_support: PROMOTE_MIN_SUPPORT, + }, + ), + ( + tracks::PROMOTE_TO_6DAN, + pallet_referenda::TrackInfo { + name: "promote to VI Dan", + max_deciding: PROMOTE_MAX_DECIDING, + decision_deposit: PROMOTE_DECISION_DEPOSIT, + prepare_period: PROMOTE_PREPARE_PERIOD, + decision_period: PROMOTE_DECISION_PERIOD, + confirm_period: PROMOTE_CONFIRM_PERIOD, + min_enactment_period: PROMOTE_MIN_ENACTMENT_PERIOD, + min_approval: PROMOTE_MIN_APPROVAL, + min_support: PROMOTE_MIN_SUPPORT, + }, + ), ]; &DATA[..] } @@ -283,16 +500,30 @@ impl pallet_referenda::TracksInfo for TracksInfo { } match Origin::try_from(id.clone()) { - Ok(Origin::FellowshipCandidates) => Ok(tracks::CANDIDATES), - Ok(Origin::Fellowship1Dan) => Ok(tracks::MEMBERS), + Ok(Origin::Members) => Ok(tracks::MEMBERS), Ok(Origin::Fellowship2Dan) => Ok(tracks::PROFICIENTS), - Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(tracks::FELLOWS), - Ok(Origin::Fellowship4Dan) => Ok(tracks::SENIOR_FELLOWS), - Ok(Origin::Fellowship5Dan) | Ok(Origin::FellowshipExperts) => Ok(tracks::EXPERTS), - Ok(Origin::Fellowship6Dan) => Ok(tracks::SENIOR_EXPERTS), - Ok(Origin::Fellowship7Dan | Origin::FellowshipMasters) => Ok(tracks::MASTERS), - Ok(Origin::Fellowship8Dan) => Ok(tracks::SENIOR_MASTERS), + Ok(Origin::Fellows) => Ok(tracks::FELLOWS), + Ok(Origin::Architects) => Ok(tracks::ARCHITECTS), + Ok(Origin::Fellowship5Dan) => Ok(tracks::ARCHITECTS_ADEPT), + Ok(Origin::Fellowship6Dan) => Ok(tracks::GRAND_ARCHITECTS), + Ok(Origin::Masters) => Ok(tracks::MASTERS), + Ok(Origin::Fellowship8Dan) => Ok(tracks::MASTERS_CONSTANT), Ok(Origin::Fellowship9Dan) => Ok(tracks::GRAND_MASTERS), + + Ok(Origin::RetainAt1Dan) => Ok(tracks::RETAIN_AT_1DAN), + Ok(Origin::RetainAt2Dan) => Ok(tracks::RETAIN_AT_2DAN), + Ok(Origin::RetainAt3Dan) => Ok(tracks::RETAIN_AT_3DAN), + Ok(Origin::RetainAt4Dan) => Ok(tracks::RETAIN_AT_4DAN), + Ok(Origin::RetainAt5Dan) => Ok(tracks::RETAIN_AT_5DAN), + Ok(Origin::RetainAt6Dan) => Ok(tracks::RETAIN_AT_6DAN), + + Ok(Origin::PromoteTo1Dan) => Ok(tracks::PROMOTE_TO_1DAN), + Ok(Origin::PromoteTo2Dan) => Ok(tracks::PROMOTE_TO_2DAN), + Ok(Origin::PromoteTo3Dan) => Ok(tracks::PROMOTE_TO_3DAN), + Ok(Origin::PromoteTo4Dan) => Ok(tracks::PROMOTE_TO_4DAN), + Ok(Origin::PromoteTo5Dan) => Ok(tracks::PROMOTE_TO_5DAN), + Ok(Origin::PromoteTo6Dan) => Ok(tracks::PROMOTE_TO_6DAN), + _ => Err(()), } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs index 3b45d2824d9..6ccff8bda1c 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs @@ -146,3 +146,23 @@ impl PrivilegeCmp for EqualOrGreatestRootCmp { } } } + +#[cfg(feature = "runtime-benchmarks")] +pub mod benchmarks { + use super::*; + use frame_support::traits::fungible; + use pallet_ranked_collective::Rank; + use parachains_common::{AccountId, Balance}; + use sp_runtime::traits::Convert; + + /// Rank to salary conversion helper type.` + pub struct RankToSalary(PhantomData); + impl Convert for RankToSalary + where + Fungible: fungible::Inspect, + { + fn convert(r: Rank) -> Balance { + Balance::from(r).saturating_mul(Fungible::minimum_balance()) + } + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 3aed385e404..c6712635ac2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -70,7 +70,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU16, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, + traits::{ConstBool, ConstU16, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -415,6 +415,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { @@ -477,7 +478,7 @@ parameter_types! { // The Alliance pallet account, used as a temporary place to deposit a slashed imbalance // before the teleport to the Treasury. pub AlliancePalletAccount: AccountId = constants::account::ALLIANCE_PALLET_ID.into_account_truncating(); - pub RelayTreasuryAccount: AccountId = constants::account::RELAY_TREASURY_PALLET_ID.into_account_truncating(); + pub PolkadotTreasuryAccount: AccountId = constants::account::POLKADOT_TREASURY_PALLET_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; @@ -490,7 +491,7 @@ impl pallet_alliance::Config for Runtime { type MembershipManager = RootOrAllianceTwoThirdsMajority; type AnnouncementOrigin = RootOrAllianceTwoThirdsMajority; type Currency = Balances; - type Slashed = ToParentTreasury; + type Slashed = ToParentTreasury; type InitializeMembers = AllianceMotion; type MembershipChanged = AllianceMotion; type RetirementPeriod = AllianceRetirementPeriod; @@ -599,6 +600,10 @@ construct_runtime!( // pub type FellowshipReferendaInstance = pallet_referenda::Instance1; FellowshipReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 61, FellowshipOrigins: pallet_fellowship_origins::{Origin} = 62, + // pub type FellowshipCoreInstance = pallet_core_fellowship::Instance1; + FellowshipCore: pallet_core_fellowship::::{Pallet, Call, Storage, Event} = 63, + // pub type FellowshipSalaryInstance = pallet_salary::Instance1; + FellowshipSalary: pallet_salary::::{Pallet, Call, Storage, Event} = 64, } ); @@ -667,6 +672,8 @@ mod benches { [pallet_scheduler, Scheduler] [pallet_referenda, FellowshipReferenda] [pallet_ranked_collective, FellowshipCollective] + [pallet_core_fellowship, FellowshipCore] + [pallet_salary, FellowshipSalary] ); } 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 6bbe4229967..faf56ecf4f9 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 @@ -17,7 +17,7 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 5_475_000 picoseconds. - Weight::from_parts(5_752_000, 0) + // Minimum execution time: 5_455_000 picoseconds. + Weight::from_parts(5_567_000, 0) .saturating_add(Weight::from_parts(0, 1594)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 5_467_000 picoseconds. - Weight::from_parts(5_652_000, 0) + // Minimum execution time: 5_521_000 picoseconds. + Weight::from_parts(5_646_000, 0) .saturating_add(Weight::from_parts(0, 1594)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs index 34ed36e3b62..b0e49549914 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs @@ -6,11 +6,13 @@ pub mod pallet_alliance; pub mod pallet_balances; pub mod pallet_collator_selection; pub mod pallet_collective; +pub mod pallet_core_fellowship; pub mod pallet_multisig; pub mod pallet_preimage; pub mod pallet_proxy; pub mod pallet_ranked_collective; pub mod pallet_referenda; +pub mod pallet_salary; pub mod pallet_scheduler; pub mod pallet_session; pub mod pallet_timestamp; 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 4ee8738d5af..c362497af9d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_alliance` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -65,15 +65,15 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `439 + m * (32 ±0) + p * (36 ±0)` // Estimated: `6676 + m * (32 ±0) + p * (36 ±0)` - // Minimum execution time: 30_492_000 picoseconds. - Weight::from_parts(33_119_713, 0) + // Minimum execution time: 31_379_000 picoseconds. + Weight::from_parts(33_466_627, 0) .saturating_add(Weight::from_parts(0, 6676)) - // Standard Error: 60 - .saturating_add(Weight::from_parts(285, 0).saturating_mul(b.into())) - // Standard Error: 632 - .saturating_add(Weight::from_parts(10_988, 0).saturating_mul(m.into())) - // Standard Error: 624 - .saturating_add(Weight::from_parts(140_169, 0).saturating_mul(p.into())) + // Standard Error: 62 + .saturating_add(Weight::from_parts(434, 0).saturating_mul(b.into())) + // Standard Error: 648 + .saturating_add(Weight::from_parts(12_968, 0).saturating_mul(m.into())) + // Standard Error: 640 + .saturating_add(Weight::from_parts(111_468, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) @@ -88,11 +88,11 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `868 + m * (64 ±0)` // Estimated: `6676 + m * (64 ±0)` - // Minimum execution time: 25_442_000 picoseconds. - Weight::from_parts(26_215_947, 0) + // Minimum execution time: 25_855_000 picoseconds. + Weight::from_parts(26_422_871, 0) .saturating_add(Weight::from_parts(0, 6676)) - // Standard Error: 410 - .saturating_add(Weight::from_parts(43_449, 0).saturating_mul(m.into())) + // Standard Error: 372 + .saturating_add(Weight::from_parts(37_878, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -113,13 +113,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `312 + m * (96 ±0) + p * (36 ±0)` // Estimated: `6676 + m * (97 ±0) + p * (36 ±0)` - // Minimum execution time: 35_991_000 picoseconds. - Weight::from_parts(34_605_748, 0) + // Minimum execution time: 36_596_000 picoseconds. + Weight::from_parts(34_698_463, 0) .saturating_add(Weight::from_parts(0, 6676)) - // Standard Error: 598 - .saturating_add(Weight::from_parts(38_227, 0).saturating_mul(m.into())) - // Standard Error: 583 - .saturating_add(Weight::from_parts(119_512, 0).saturating_mul(p.into())) + // Standard Error: 561 + .saturating_add(Weight::from_parts(39_490, 0).saturating_mul(m.into())) + // Standard Error: 547 + .saturating_add(Weight::from_parts(107_190, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 97).saturating_mul(m.into())) @@ -142,13 +142,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `762 + m * (96 ±0) + p * (41 ±0)` // Estimated: `6676 + m * (97 ±0) + p * (40 ±0)` - // Minimum execution time: 48_168_000 picoseconds. - Weight::from_parts(48_554_161, 0) + // Minimum execution time: 48_194_000 picoseconds. + Weight::from_parts(49_032_242, 0) .saturating_add(Weight::from_parts(0, 6676)) - // Standard Error: 1_770 - .saturating_add(Weight::from_parts(47_441, 0).saturating_mul(m.into())) - // Standard Error: 1_725 - .saturating_add(Weight::from_parts(119_704, 0).saturating_mul(p.into())) + // Standard Error: 1_783 + .saturating_add(Weight::from_parts(46_747, 0).saturating_mul(m.into())) + // Standard Error: 1_738 + .saturating_add(Weight::from_parts(114_162, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 97).saturating_mul(m.into())) @@ -174,13 +174,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `518 + m * (96 ±0) + p * (41 ±0)` // Estimated: `6676 + m * (109 ±0) + p * (43 ±0)` - // Minimum execution time: 47_356_000 picoseconds. - Weight::from_parts(48_308_769, 0) + // Minimum execution time: 46_522_000 picoseconds. + Weight::from_parts(48_725_642, 0) .saturating_add(Weight::from_parts(0, 6676)) - // Standard Error: 3_712 - .saturating_add(Weight::from_parts(99_809, 0).saturating_mul(m.into())) - // Standard Error: 3_667 - .saturating_add(Weight::from_parts(136_999, 0).saturating_mul(p.into())) + // Standard Error: 3_924 + .saturating_add(Weight::from_parts(99_493, 0).saturating_mul(m.into())) + // Standard Error: 3_876 + .saturating_add(Weight::from_parts(132_965, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 109).saturating_mul(m.into())) @@ -205,13 +205,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `417 + m * (96 ±0) + p * (36 ±0)` // Estimated: `6676 + m * (96 ±0) + p * (36 ±0)` - // Minimum execution time: 37_575_000 picoseconds. - Weight::from_parts(36_322_752, 0) + // Minimum execution time: 38_055_000 picoseconds. + Weight::from_parts(36_843_849, 0) .saturating_add(Weight::from_parts(0, 6676)) - // Standard Error: 530 - .saturating_add(Weight::from_parts(38_879, 0).saturating_mul(m.into())) - // Standard Error: 511 - .saturating_add(Weight::from_parts(119_293, 0).saturating_mul(p.into())) + // Standard Error: 571 + .saturating_add(Weight::from_parts(37_581, 0).saturating_mul(m.into())) + // Standard Error: 550 + .saturating_add(Weight::from_parts(103_926, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 96).saturating_mul(m.into())) @@ -227,13 +227,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `12` // Estimated: `12362` - // Minimum execution time: 31_194_000 picoseconds. - Weight::from_parts(19_730_185, 0) + // Minimum execution time: 30_370_000 picoseconds. + Weight::from_parts(20_600_862, 0) .saturating_add(Weight::from_parts(0, 12362)) - // Standard Error: 589 - .saturating_add(Weight::from_parts(141_552, 0).saturating_mul(m.into())) - // Standard Error: 582 - .saturating_add(Weight::from_parts(118_056, 0).saturating_mul(z.into())) + // Standard Error: 490 + .saturating_add(Weight::from_parts(122_072, 0).saturating_mul(m.into())) + // Standard Error: 484 + .saturating_add(Weight::from_parts(102_456, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -255,16 +255,16 @@ impl pallet_alliance::WeightInfo for WeightInfo { fn disband(x: u32, y: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + x * (52 ±0) + y * (53 ±0) + z * (250 ±0)` - // Estimated: `12362 + x * (2539 ±0) + y * (2539 ±0) + z * (2603 ±1)` - // Minimum execution time: 262_149_000 picoseconds. - Weight::from_parts(263_057_000, 0) + // Estimated: `12362 + x * (2539 ±0) + y * (2539 ±0) + z * (2603 ±0)` + // Minimum execution time: 282_163_000 picoseconds. + Weight::from_parts(284_996_000, 0) .saturating_add(Weight::from_parts(0, 12362)) - // Standard Error: 21_165 - .saturating_add(Weight::from_parts(497_129, 0).saturating_mul(x.into())) - // Standard Error: 21_063 - .saturating_add(Weight::from_parts(478_945, 0).saturating_mul(y.into())) - // Standard Error: 42_088 - .saturating_add(Weight::from_parts(14_786_304, 0).saturating_mul(z.into())) + // Standard Error: 23_331 + .saturating_add(Weight::from_parts(488_926, 0).saturating_mul(x.into())) + // Standard Error: 23_219 + .saturating_add(Weight::from_parts(528_274, 0).saturating_mul(y.into())) + // Standard Error: 46_396 + .saturating_add(Weight::from_parts(14_838_465, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) @@ -281,8 +281,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_181_000 picoseconds. - Weight::from_parts(10_320_000, 0) + // Minimum execution time: 9_852_000 picoseconds. + Weight::from_parts(10_129_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -292,8 +292,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `10187` - // Minimum execution time: 12_958_000 picoseconds. - Weight::from_parts(13_130_000, 0) + // Minimum execution time: 12_892_000 picoseconds. + Weight::from_parts(13_134_000, 0) .saturating_add(Weight::from_parts(0, 10187)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -304,8 +304,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `149` // Estimated: `10187` - // Minimum execution time: 13_987_000 picoseconds. - Weight::from_parts(14_205_000, 0) + // Minimum execution time: 14_019_000 picoseconds. + Weight::from_parts(14_309_000, 0) .saturating_add(Weight::from_parts(0, 10187)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -322,8 +322,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `294` // Estimated: `18048` - // Minimum execution time: 44_585_000 picoseconds. - Weight::from_parts(45_153_000, 0) + // Minimum execution time: 44_959_000 picoseconds. + Weight::from_parts(45_280_000, 0) .saturating_add(Weight::from_parts(0, 18048)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) @@ -336,8 +336,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `193` // Estimated: `18048` - // Minimum execution time: 28_059_000 picoseconds. - Weight::from_parts(28_305_000, 0) + // Minimum execution time: 28_173_000 picoseconds. + Weight::from_parts(28_414_000, 0) .saturating_add(Weight::from_parts(0, 18048)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -354,8 +354,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `236` // Estimated: `12362` - // Minimum execution time: 26_197_000 picoseconds. - Weight::from_parts(26_655_000, 0) + // Minimum execution time: 27_329_000 picoseconds. + Weight::from_parts(27_654_000, 0) .saturating_add(Weight::from_parts(0, 12362)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -374,8 +374,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `236` // Estimated: `23734` - // Minimum execution time: 33_606_000 picoseconds. - Weight::from_parts(33_898_000, 0) + // Minimum execution time: 34_347_000 picoseconds. + Weight::from_parts(34_721_000, 0) .saturating_add(Weight::from_parts(0, 23734)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -392,8 +392,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `517` // Estimated: `6676` - // Minimum execution time: 39_968_000 picoseconds. - Weight::from_parts(40_586_000, 0) + // Minimum execution time: 40_761_000 picoseconds. + Weight::from_parts(41_278_000, 0) .saturating_add(Weight::from_parts(0, 6676)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -426,8 +426,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `643` // Estimated: `18048` - // Minimum execution time: 145_826_000 picoseconds. - Weight::from_parts(149_620_000, 0) + // Minimum execution time: 143_275_000 picoseconds. + Weight::from_parts(144_436_000, 0) .saturating_add(Weight::from_parts(0, 18048)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(8)) @@ -442,13 +442,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `27187` - // Minimum execution time: 8_490_000 picoseconds. - Weight::from_parts(8_557_000, 0) + // Minimum execution time: 7_977_000 picoseconds. + Weight::from_parts(8_071_000, 0) .saturating_add(Weight::from_parts(0, 27187)) - // Standard Error: 3_473 - .saturating_add(Weight::from_parts(1_473_071, 0).saturating_mul(n.into())) - // Standard Error: 1_360 - .saturating_add(Weight::from_parts(75_402, 0).saturating_mul(l.into())) + // Standard Error: 3_235 + .saturating_add(Weight::from_parts(1_501_097, 0).saturating_mul(n.into())) + // Standard Error: 1_267 + .saturating_add(Weight::from_parts(68_685, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -462,13 +462,13 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + l * (100 ±0) + n * (289 ±0)` // Estimated: `27187` - // Minimum execution time: 8_394_000 picoseconds. - Weight::from_parts(8_467_000, 0) + // Minimum execution time: 8_100_000 picoseconds. + Weight::from_parts(8_199_000, 0) .saturating_add(Weight::from_parts(0, 27187)) - // Standard Error: 199_845 - .saturating_add(Weight::from_parts(17_213_927, 0).saturating_mul(n.into())) - // Standard Error: 78_268 - .saturating_add(Weight::from_parts(427_473, 0).saturating_mul(l.into())) + // Standard Error: 198_431 + .saturating_add(Weight::from_parts(16_683_292, 0).saturating_mul(n.into())) + // Standard Error: 77_714 + .saturating_add(Weight::from_parts(464_713, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -484,8 +484,8 @@ impl pallet_alliance::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `236` // Estimated: `18048` - // Minimum execution time: 32_255_000 picoseconds. - Weight::from_parts(32_787_000, 0) + // Minimum execution time: 32_208_000 picoseconds. + Weight::from_parts(32_841_000, 0) .saturating_add(Weight::from_parts(0, 18048)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) 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 10b566b3f41..4f851c81bf7 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 53_490_000 picoseconds. - Weight::from_parts(54_270_000, 0) + // Minimum execution time: 53_353_000 picoseconds. + Weight::from_parts(53_656_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 40_895_000 picoseconds. - Weight::from_parts(41_541_000, 0) + // Minimum execution time: 40_065_000 picoseconds. + Weight::from_parts(40_508_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 16_009_000 picoseconds. - Weight::from_parts(16_345_000, 0) + // Minimum execution time: 15_582_000 picoseconds. + Weight::from_parts(15_878_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 22_757_000 picoseconds. - Weight::from_parts(23_225_000, 0) + // Minimum execution time: 22_358_000 picoseconds. + Weight::from_parts(22_586_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 55_122_000 picoseconds. - Weight::from_parts(55_729_000, 0) + // Minimum execution time: 54_535_000 picoseconds. + Weight::from_parts(55_223_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 49_979_000 picoseconds. - Weight::from_parts(50_677_000, 0) + // Minimum execution time: 49_377_000 picoseconds. + Weight::from_parts(49_974_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 18_803_000 picoseconds. - Weight::from_parts(19_157_000, 0) + // Minimum execution time: 18_096_000 picoseconds. + Weight::from_parts(18_474_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 18_508_000 picoseconds. - Weight::from_parts(18_773_000, 0) + // Minimum execution time: 17_767_000 picoseconds. + Weight::from_parts(17_983_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 9_864 - .saturating_add(Weight::from_parts(14_451_484, 0).saturating_mul(u.into())) + // Standard Error: 10_647 + .saturating_add(Weight::from_parts(14_294_449, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) 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 73961b722fa..05843b159a7 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 @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -57,11 +57,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `178 + b * (78 ±0)` // Estimated: `1168 + b * (2554 ±0)` - // Minimum execution time: 15_467_000 picoseconds. - Weight::from_parts(15_103_183, 0) + // Minimum execution time: 14_775_000 picoseconds. + Weight::from_parts(14_379_856, 0) .saturating_add(Weight::from_parts(0, 1168)) - // Standard Error: 2_853 - .saturating_add(Weight::from_parts(2_584_332, 0).saturating_mul(b.into())) + // Standard Error: 2_763 + .saturating_add(Weight::from_parts(2_649_524, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -72,8 +72,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_562_000 picoseconds. - Weight::from_parts(7_765_000, 0) + // Minimum execution time: 7_281_000 picoseconds. + Weight::from_parts(7_438_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,8 +83,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_769_000 picoseconds. - Weight::from_parts(7_972_000, 0) + // Minimum execution time: 7_446_000 picoseconds. + Weight::from_parts(7_526_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,11 +105,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `1108 + c * (48 ±0)` // Estimated: `49487 + c * (49 ±0)` - // Minimum execution time: 42_430_000 picoseconds. - Weight::from_parts(35_423_103, 0) + // Minimum execution time: 42_510_000 picoseconds. + Weight::from_parts(34_844_518, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_209 - .saturating_add(Weight::from_parts(114_362, 0).saturating_mul(c.into())) + // Standard Error: 1_265 + .saturating_add(Weight::from_parts(105_965, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -123,11 +123,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `452 + c * (48 ±0)` // Estimated: `49487` - // Minimum execution time: 33_827_000 picoseconds. - Weight::from_parts(24_290_370, 0) + // Minimum execution time: 33_917_000 picoseconds. + Weight::from_parts(23_486_217, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 1_249 - .saturating_add(Weight::from_parts(109_487, 0).saturating_mul(c.into())) + // Standard Error: 1_289 + .saturating_add(Weight::from_parts(105_541, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,8 +141,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 43_086_000 picoseconds. - Weight::from_parts(43_643_000, 0) + // Minimum execution time: 43_818_000 picoseconds. + Weight::from_parts(44_284_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -196,11 +196,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `22721 + c * (97 ±0) + r * (116 ±0)` // Estimated: `49487 + c * (2519 ±0) + r * (2602 ±0)` - // Minimum execution time: 17_338_000 picoseconds. - Weight::from_parts(17_589_000, 0) + // Minimum execution time: 17_705_000 picoseconds. + Weight::from_parts(17_906_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 906_988 - .saturating_add(Weight::from_parts(32_054_748, 0).saturating_mul(c.into())) + // Standard Error: 862_538 + .saturating_add(Weight::from_parts(30_605_371, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs index c4a71ec894a..3ca20603204 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -63,13 +63,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15691 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 16_795_000 picoseconds. - Weight::from_parts(16_942_000, 0) + // Minimum execution time: 15_658_000 picoseconds. + Weight::from_parts(15_794_000, 0) .saturating_add(Weight::from_parts(0, 15691)) - // Standard Error: 70_459 - .saturating_add(Weight::from_parts(5_607_397, 0).saturating_mul(m.into())) - // Standard Error: 70_459 - .saturating_add(Weight::from_parts(8_290_115, 0).saturating_mul(p.into())) + // Standard Error: 68_169 + .saturating_add(Weight::from_parts(5_624_034, 0).saturating_mul(m.into())) + // Standard Error: 68_169 + .saturating_add(Weight::from_parts(8_049_725, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,13 +85,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32 + m * (32 ±0)` // Estimated: `1518 + m * (32 ±0)` - // Minimum execution time: 15_803_000 picoseconds. - Weight::from_parts(15_071_031, 0) + // Minimum execution time: 15_195_000 picoseconds. + Weight::from_parts(14_241_864, 0) .saturating_add(Weight::from_parts(0, 1518)) - // Standard Error: 21 - .saturating_add(Weight::from_parts(1_253, 0).saturating_mul(b.into())) - // Standard Error: 219 - .saturating_add(Weight::from_parts(13_241, 0).saturating_mul(m.into())) + // Standard Error: 15 + .saturating_add(Weight::from_parts(1_338, 0).saturating_mul(b.into())) + // Standard Error: 160 + .saturating_add(Weight::from_parts(13_397, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -105,13 +105,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32 + m * (32 ±0)` // Estimated: `3498 + m * (32 ±0)` - // Minimum execution time: 18_645_000 picoseconds. - Weight::from_parts(17_717_343, 0) + // Minimum execution time: 17_548_000 picoseconds. + Weight::from_parts(16_950_722, 0) .saturating_add(Weight::from_parts(0, 3498)) - // Standard Error: 21 - .saturating_add(Weight::from_parts(1_471, 0).saturating_mul(b.into())) - // Standard Error: 218 - .saturating_add(Weight::from_parts(22_238, 0).saturating_mul(m.into())) + // Standard Error: 20 + .saturating_add(Weight::from_parts(1_269, 0).saturating_mul(b.into())) + // Standard Error: 211 + .saturating_add(Weight::from_parts(22_355, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -132,15 +132,15 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `322 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3714 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 24_537_000 picoseconds. - Weight::from_parts(26_471_602, 0) + // Minimum execution time: 23_764_000 picoseconds. + Weight::from_parts(25_593_249, 0) .saturating_add(Weight::from_parts(0, 3714)) // Standard Error: 79 - .saturating_add(Weight::from_parts(2_604, 0).saturating_mul(b.into())) - // Standard Error: 829 - .saturating_add(Weight::from_parts(20_480, 0).saturating_mul(m.into())) - // Standard Error: 818 - .saturating_add(Weight::from_parts(133_262, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(2_363, 0).saturating_mul(b.into())) + // Standard Error: 824 + .saturating_add(Weight::from_parts(19_898, 0).saturating_mul(m.into())) + // Standard Error: 814 + .saturating_add(Weight::from_parts(125_190, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -155,11 +155,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `771 + m * (64 ±0)` // Estimated: `4235 + m * (64 ±0)` - // Minimum execution time: 23_195_000 picoseconds. - Weight::from_parts(23_635_543, 0) + // Minimum execution time: 22_071_000 picoseconds. + Weight::from_parts(22_842_830, 0) .saturating_add(Weight::from_parts(0, 4235)) - // Standard Error: 399 - .saturating_add(Weight::from_parts(45_089, 0).saturating_mul(m.into())) + // Standard Error: 362 + .saturating_add(Weight::from_parts(40_822, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -178,13 +178,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `360 + m * (64 ±0) + p * (36 ±0)` // Estimated: `3805 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 27_925_000 picoseconds. - Weight::from_parts(29_021_838, 0) + // Minimum execution time: 27_049_000 picoseconds. + Weight::from_parts(28_185_422, 0) .saturating_add(Weight::from_parts(0, 3805)) - // Standard Error: 582 - .saturating_add(Weight::from_parts(19_351, 0).saturating_mul(m.into())) - // Standard Error: 567 - .saturating_add(Weight::from_parts(120_374, 0).saturating_mul(p.into())) + // Standard Error: 570 + .saturating_add(Weight::from_parts(19_622, 0).saturating_mul(m.into())) + // Standard Error: 555 + .saturating_add(Weight::from_parts(115_313, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -205,15 +205,15 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `662 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `3979 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 39_972_000 picoseconds. - Weight::from_parts(40_831_166, 0) + // Minimum execution time: 37_954_000 picoseconds. + Weight::from_parts(39_281_079, 0) .saturating_add(Weight::from_parts(0, 3979)) - // Standard Error: 78 - .saturating_add(Weight::from_parts(1_568, 0).saturating_mul(b.into())) - // Standard Error: 825 - .saturating_add(Weight::from_parts(16_454, 0).saturating_mul(m.into())) - // Standard Error: 804 - .saturating_add(Weight::from_parts(132_248, 0).saturating_mul(p.into())) + // Standard Error: 81 + .saturating_add(Weight::from_parts(1_514, 0).saturating_mul(b.into())) + // Standard Error: 859 + .saturating_add(Weight::from_parts(16_260, 0).saturating_mul(m.into())) + // Standard Error: 838 + .saturating_add(Weight::from_parts(128_072, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -236,13 +236,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `458 + m * (48 ±0) + p * (36 ±0)` // Estimated: `3898 + m * (49 ±0) + p * (36 ±0)` - // Minimum execution time: 29_766_000 picoseconds. - Weight::from_parts(31_292_444, 0) + // Minimum execution time: 28_733_000 picoseconds. + Weight::from_parts(30_266_158, 0) .saturating_add(Weight::from_parts(0, 3898)) - // Standard Error: 691 - .saturating_add(Weight::from_parts(19_285, 0).saturating_mul(m.into())) - // Standard Error: 674 - .saturating_add(Weight::from_parts(123_923, 0).saturating_mul(p.into())) + // Standard Error: 726 + .saturating_add(Weight::from_parts(18_225, 0).saturating_mul(m.into())) + // Standard Error: 708 + .saturating_add(Weight::from_parts(120_048, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(m.into())) @@ -265,15 +265,15 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `682 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `3999 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 42_588_000 picoseconds. - Weight::from_parts(43_162_079, 0) + // Minimum execution time: 40_639_000 picoseconds. + Weight::from_parts(42_182_153, 0) .saturating_add(Weight::from_parts(0, 3999)) - // Standard Error: 86 - .saturating_add(Weight::from_parts(1_451, 0).saturating_mul(b.into())) - // Standard Error: 914 - .saturating_add(Weight::from_parts(18_855, 0).saturating_mul(m.into())) - // Standard Error: 891 - .saturating_add(Weight::from_parts(136_799, 0).saturating_mul(p.into())) + // Standard Error: 93 + .saturating_add(Weight::from_parts(1_433, 0).saturating_mul(b.into())) + // Standard Error: 992 + .saturating_add(Weight::from_parts(13_154, 0).saturating_mul(m.into())) + // Standard Error: 967 + .saturating_add(Weight::from_parts(129_169, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -291,11 +291,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `189 + p * (32 ±0)` // Estimated: `1674 + p * (32 ±0)` - // Minimum execution time: 14_465_000 picoseconds. - Weight::from_parts(16_635_197, 0) + // Minimum execution time: 13_821_000 picoseconds. + Weight::from_parts(15_834_740, 0) .saturating_add(Weight::from_parts(0, 1674)) - // Standard Error: 1_082 - .saturating_add(Weight::from_parts(117_250, 0).saturating_mul(p.into())) + // Standard Error: 638 + .saturating_add(Weight::from_parts(111_794, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs new file mode 100644 index 00000000000..5330755bb90 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs @@ -0,0 +1,222 @@ +// Copyright 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_core_fellowship` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-19, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/debug/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --steps=2 +// --repeat=1 +// --pallet=pallet_core_fellowship +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_core_fellowship`. +pub struct WeightInfo(PhantomData); +impl pallet_core_fellowship::WeightInfo for WeightInfo { + /// Storage: FellowshipCore Params (r:0 w:1) + /// Proof: FellowshipCore Params (max_values: Some(1), max_size: Some(364), added: 859, mode: MaxEncodedLen) + fn set_params() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 65_000_000 picoseconds. + Weight::from_parts(65_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCore Params (r:1 w:0) + /// Proof: FellowshipCore Params (max_values: Some(1), max_size: Some(364), added: 859, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:1 w:0) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCore MemberEvidence (r:1 w:1) + /// Proof: FellowshipCore MemberEvidence (max_values: None, max_size: Some(1067), added: 3542, mode: MaxEncodedLen) + fn bump_offboard() -> Weight { + // Proof Size summary in bytes: + // Measured: `1562` + // Estimated: `4532` + // Minimum execution time: 300_000_000 picoseconds. + Weight::from_parts(300_000_000, 0) + .saturating_add(Weight::from_parts(0, 4532)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCore Params (r:1 w:0) + /// Proof: FellowshipCore Params (max_values: Some(1), max_size: Some(364), added: 859, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:1 w:0) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCore MemberEvidence (r:1 w:1) + /// Proof: FellowshipCore MemberEvidence (max_values: None, max_size: Some(1067), added: 3542, mode: MaxEncodedLen) + fn bump_demote() -> Weight { + // Proof Size summary in bytes: + // Measured: `1672` + // Estimated: `4532` + // Minimum execution time: 339_000_000 picoseconds. + Weight::from_parts(339_000_000, 0) + .saturating_add(Weight::from_parts(0, 4532)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + fn set_active() -> Weight { + // Proof Size summary in bytes: + // Measured: `427` + // Estimated: `3514` + // Minimum execution time: 150_000_000 picoseconds. + Weight::from_parts(150_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IndexToId (r:0 w:1) + /// Proof: FellowshipCollective IndexToId (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:0 w:1) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + fn induct() -> Weight { + // Proof Size summary in bytes: + // Measured: `185` + // Estimated: `3514` + // Minimum execution time: 166_000_000 picoseconds. + Weight::from_parts(166_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCore Params (r:1 w:0) + /// Proof: FellowshipCore Params (max_values: Some(1), max_size: Some(364), added: 859, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCore MemberEvidence (r:1 w:1) + /// Proof: FellowshipCore MemberEvidence (max_values: None, max_size: Some(1067), added: 3542, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IndexToId (r:0 w:1) + /// Proof: FellowshipCollective IndexToId (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:0 w:1) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + fn promote() -> Weight { + // Proof Size summary in bytes: + // Measured: `1540` + // Estimated: `4532` + // Minimum execution time: 308_000_000 picoseconds. + Weight::from_parts(308_000_000, 0) + .saturating_add(Weight::from_parts(0, 4532)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCore MemberEvidence (r:0 w:1) + /// Proof: FellowshipCore MemberEvidence (max_values: None, max_size: Some(1067), added: 3542, mode: MaxEncodedLen) + fn offboard() -> Weight { + // Proof Size summary in bytes: + // Measured: `398` + // Estimated: `3514` + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(141_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + fn import() -> Weight { + // Proof Size summary in bytes: + // Measured: `352` + // Estimated: `3514` + // Minimum execution time: 131_000_000 picoseconds. + Weight::from_parts(131_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCore Member (r:1 w:1) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCore MemberEvidence (r:1 w:1) + /// Proof: FellowshipCore MemberEvidence (max_values: None, max_size: Some(1067), added: 3542, mode: MaxEncodedLen) + fn approve() -> Weight { + // Proof Size summary in bytes: + // Measured: `1518` + // Estimated: `4532` + // Minimum execution time: 198_000_000 picoseconds. + Weight::from_parts(198_000_000, 0) + .saturating_add(Weight::from_parts(0, 4532)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipCore Member (r:1 w:0) + /// Proof: FellowshipCore Member (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: FellowshipCore MemberEvidence (r:1 w:1) + /// Proof: FellowshipCore MemberEvidence (max_values: None, max_size: Some(1067), added: 3542, mode: MaxEncodedLen) + fn submit_evidence() -> Weight { + // Proof Size summary in bytes: + // Measured: `151` + // Estimated: `4532` + // Minimum execution time: 99_000_000 picoseconds. + Weight::from_parts(99_000_000, 0) + .saturating_add(Weight::from_parts(0, 4532)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} 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 92715ad62a9..30b671da4f7 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -53,11 +53,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_207_000 picoseconds. - Weight::from_parts(12_624_117, 0) + // Minimum execution time: 11_418_000 picoseconds. + Weight::from_parts(11_852_848, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(596, 0).saturating_mul(z.into())) + // Standard Error: 1 + .saturating_add(Weight::from_parts(543, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -67,13 +67,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `295 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 41_674_000 picoseconds. - Weight::from_parts(35_138_837, 0) + // Minimum execution time: 40_623_000 picoseconds. + Weight::from_parts(35_143_249, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 426 - .saturating_add(Weight::from_parts(70_175, 0).saturating_mul(s.into())) + // Standard Error: 491 + .saturating_add(Weight::from_parts(65_196, 0).saturating_mul(s.into())) // Standard Error: 4 - .saturating_add(Weight::from_parts(1_321, 0).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_244, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,13 +85,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `6811` - // Minimum execution time: 28_196_000 picoseconds. - Weight::from_parts(22_060_677, 0) + // Minimum execution time: 27_116_000 picoseconds. + Weight::from_parts(21_183_892, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 378 - .saturating_add(Weight::from_parts(71_806, 0).saturating_mul(s.into())) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_256, 0).saturating_mul(z.into())) + // Standard Error: 1_040 + .saturating_add(Weight::from_parts(68_596, 0).saturating_mul(s.into())) + // Standard Error: 10 + .saturating_add(Weight::from_parts(1_211, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,13 +105,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `418 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 47_099_000 picoseconds. - Weight::from_parts(38_806_484, 0) + // Minimum execution time: 46_053_000 picoseconds. + Weight::from_parts(38_209_438, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 540 - .saturating_add(Weight::from_parts(88_311, 0).saturating_mul(s.into())) - // Standard Error: 5 - .saturating_add(Weight::from_parts(1_354, 0).saturating_mul(z.into())) + // Standard Error: 493 + .saturating_add(Weight::from_parts(84_997, 0).saturating_mul(s.into())) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_276, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,11 +122,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `296 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 31_899_000 picoseconds. - Weight::from_parts(33_492_356, 0) + // Minimum execution time: 31_452_000 picoseconds. + Weight::from_parts(33_528_642, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 684 - .saturating_add(Weight::from_parts(79_819, 0).saturating_mul(s.into())) + // Standard Error: 656 + .saturating_add(Weight::from_parts(72_992, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,11 +137,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `6811` - // Minimum execution time: 19_002_000 picoseconds. - Weight::from_parts(20_275_891, 0) + // Minimum execution time: 18_712_000 picoseconds. + Weight::from_parts(19_965_736, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 482 - .saturating_add(Weight::from_parts(68_692, 0).saturating_mul(s.into())) + // Standard Error: 418 + .saturating_add(Weight::from_parts(61_664, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,11 +152,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `487 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 32_841_000 picoseconds. - Weight::from_parts(34_782_386, 0) + // Minimum execution time: 32_437_000 picoseconds. + Weight::from_parts(34_638_519, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 656 - .saturating_add(Weight::from_parts(73_853, 0).saturating_mul(s.into())) + // Standard Error: 688 + .saturating_add(Weight::from_parts(71_088, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs index 7c8fab57ede..f6393e3b8f8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -57,11 +57,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `143` // Estimated: `3556` - // Minimum execution time: 31_179_000 picoseconds. - Weight::from_parts(31_555_000, 0) + // Minimum execution time: 29_957_000 picoseconds. + Weight::from_parts(30_290_000, 0) .saturating_add(Weight::from_parts(0, 3556)) - // Standard Error: 4 - .saturating_add(Weight::from_parts(2_116, 0).saturating_mul(s.into())) + // Standard Error: 1 + .saturating_add(Weight::from_parts(2_011, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -74,11 +74,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 16_210_000 picoseconds. - Weight::from_parts(16_377_000, 0) + // Minimum execution time: 15_588_000 picoseconds. + Weight::from_parts(15_683_000, 0) .saturating_add(Weight::from_parts(0, 3556)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(2_089, 0).saturating_mul(s.into())) + // Standard Error: 1 + .saturating_add(Weight::from_parts(2_010, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -91,11 +91,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 15_441_000 picoseconds. - Weight::from_parts(15_607_000, 0) + // Minimum execution time: 14_686_000 picoseconds. + Weight::from_parts(14_879_000, 0) .saturating_add(Weight::from_parts(0, 3556)) // Standard Error: 1 - .saturating_add(Weight::from_parts(2_072, 0).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(2_010, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -107,8 +107,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `289` // Estimated: `3556` - // Minimum execution time: 38_302_000 picoseconds. - Weight::from_parts(39_611_000, 0) + // Minimum execution time: 38_394_000 picoseconds. + Weight::from_parts(39_215_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -121,8 +121,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 21_163_000 picoseconds. - Weight::from_parts(22_013_000, 0) + // Minimum execution time: 21_784_000 picoseconds. + Weight::from_parts(22_960_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -133,8 +133,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `188` // Estimated: `3556` - // Minimum execution time: 20_543_000 picoseconds. - Weight::from_parts(21_576_000, 0) + // Minimum execution time: 20_395_000 picoseconds. + Weight::from_parts(21_290_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -145,8 +145,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 11_317_000 picoseconds. - Weight::from_parts(11_834_000, 0) + // Minimum execution time: 11_172_000 picoseconds. + Weight::from_parts(11_691_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -157,8 +157,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3556` - // Minimum execution time: 13_495_000 picoseconds. - Weight::from_parts(13_897_000, 0) + // Minimum execution time: 12_656_000 picoseconds. + Weight::from_parts(13_325_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -169,8 +169,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 8_208_000 picoseconds. - Weight::from_parts(8_472_000, 0) + // Minimum execution time: 7_782_000 picoseconds. + Weight::from_parts(8_114_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -183,8 +183,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 19_788_000 picoseconds. - Weight::from_parts(20_692_000, 0) + // Minimum execution time: 19_963_000 picoseconds. + Weight::from_parts(20_908_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -195,8 +195,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 7_792_000 picoseconds. - Weight::from_parts(8_113_000, 0) + // Minimum execution time: 7_769_000 picoseconds. + Weight::from_parts(8_108_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -207,8 +207,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 7_869_000 picoseconds. - Weight::from_parts(8_164_000, 0) + // Minimum execution time: 7_826_000 picoseconds. + Weight::from_parts(8_146_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) 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 c5cb4f2e713..f4a19e0f7d2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -55,11 +55,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 16_925_000 picoseconds. - Weight::from_parts(17_434_407, 0) + // Minimum execution time: 16_390_000 picoseconds. + Weight::from_parts(16_916_214, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 725 - .saturating_add(Weight::from_parts(35_067, 0).saturating_mul(p.into())) + // Standard Error: 812 + .saturating_add(Weight::from_parts(31_020, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: Proxy Proxies (r:1 w:0) @@ -74,13 +74,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 38_996_000 picoseconds. - Weight::from_parts(38_697_326, 0) + // Minimum execution time: 37_748_000 picoseconds. + Weight::from_parts(37_532_718, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_269 - .saturating_add(Weight::from_parts(143_716, 0).saturating_mul(a.into())) - // Standard Error: 1_312 - .saturating_add(Weight::from_parts(36_502, 0).saturating_mul(p.into())) + // Standard Error: 1_186 + .saturating_add(Weight::from_parts(147_542, 0).saturating_mul(a.into())) + // Standard Error: 1_225 + .saturating_add(Weight::from_parts(36_909, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -94,13 +94,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_647_000 picoseconds. - Weight::from_parts(26_204_494, 0) + // Minimum execution time: 24_833_000 picoseconds. + Weight::from_parts(25_268_493, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_128 - .saturating_add(Weight::from_parts(137_913, 0).saturating_mul(a.into())) - // Standard Error: 1_166 - .saturating_add(Weight::from_parts(7_581, 0).saturating_mul(p.into())) + // Standard Error: 1_924 + .saturating_add(Weight::from_parts(136_284, 0).saturating_mul(a.into())) + // Standard Error: 1_988 + .saturating_add(Weight::from_parts(13_871, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -114,13 +114,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 25_508_000 picoseconds. - Weight::from_parts(26_110_626, 0) + // Minimum execution time: 25_026_000 picoseconds. + Weight::from_parts(25_338_402, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_155 - .saturating_add(Weight::from_parts(139_682, 0).saturating_mul(a.into())) - // Standard Error: 1_193 - .saturating_add(Weight::from_parts(8_390, 0).saturating_mul(p.into())) + // Standard Error: 1_084 + .saturating_add(Weight::from_parts(128_989, 0).saturating_mul(a.into())) + // Standard Error: 1_120 + .saturating_add(Weight::from_parts(14_139, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -136,13 +136,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `386 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 35_316_000 picoseconds. - Weight::from_parts(34_940_391, 0) + // Minimum execution time: 34_527_000 picoseconds. + Weight::from_parts(34_041_080, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_038 - .saturating_add(Weight::from_parts(143_848, 0).saturating_mul(a.into())) - // Standard Error: 1_072 - .saturating_add(Weight::from_parts(37_947, 0).saturating_mul(p.into())) + // Standard Error: 1_217 + .saturating_add(Weight::from_parts(125_156, 0).saturating_mul(a.into())) + // Standard Error: 1_257 + .saturating_add(Weight::from_parts(33_526, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -153,11 +153,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 26_890_000 picoseconds. - Weight::from_parts(27_454_486, 0) + // Minimum execution time: 25_535_000 picoseconds. + Weight::from_parts(26_198_759, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_069 - .saturating_add(Weight::from_parts(50_270, 0).saturating_mul(p.into())) + // Standard Error: 1_191 + .saturating_add(Weight::from_parts(51_592, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -168,11 +168,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 26_634_000 picoseconds. - Weight::from_parts(27_382_449, 0) + // Minimum execution time: 25_753_000 picoseconds. + Weight::from_parts(26_636_855, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_573 - .saturating_add(Weight::from_parts(65_622, 0).saturating_mul(p.into())) + // Standard Error: 1_564 + .saturating_add(Weight::from_parts(53_131, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -183,11 +183,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 23_582_000 picoseconds. - Weight::from_parts(23_977_985, 0) + // Minimum execution time: 22_815_000 picoseconds. + Weight::from_parts(23_467_561, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 2_713 - .saturating_add(Weight::from_parts(44_551, 0).saturating_mul(p.into())) + // Standard Error: 945 + .saturating_add(Weight::from_parts(24_441, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -198,11 +198,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4706` - // Minimum execution time: 28_564_000 picoseconds. - Weight::from_parts(29_496_680, 0) + // Minimum execution time: 27_184_000 picoseconds. + Weight::from_parts(27_924_432, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 5_045 - .saturating_add(Weight::from_parts(29_343, 0).saturating_mul(p.into())) + // Standard Error: 1_137 + .saturating_add(Weight::from_parts(9_619, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -213,11 +213,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 24_932_000 picoseconds. - Weight::from_parts(25_952_091, 0) + // Minimum execution time: 23_664_000 picoseconds. + Weight::from_parts(24_401_690, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 5_615 - .saturating_add(Weight::from_parts(22_027, 0).saturating_mul(p.into())) + // Standard Error: 958 + .saturating_add(Weight::from_parts(32_314, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs index aed4994c49b..db5bb953ac4 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_ranked_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -60,8 +60,8 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `109` // Estimated: `3507` - // Minimum execution time: 16_966_000 picoseconds. - Weight::from_parts(17_355_000, 0) + // Minimum execution time: 17_437_000 picoseconds. + Weight::from_parts(17_646_000, 0) .saturating_add(Weight::from_parts(0, 3507)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -79,11 +79,11 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `584 + r * (281 ±0)` // Estimated: `3519 + r * (2529 ±0)` - // Minimum execution time: 28_160_000 picoseconds. - Weight::from_parts(30_609_588, 0) + // Minimum execution time: 28_698_000 picoseconds. + Weight::from_parts(31_441_420, 0) .saturating_add(Weight::from_parts(0, 3519)) - // Standard Error: 25_389 - .saturating_add(Weight::from_parts(11_728_844, 0).saturating_mul(r.into())) + // Standard Error: 25_785 + .saturating_add(Weight::from_parts(12_450_241, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -103,11 +103,11 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `281 + r * (17 ±0)` // Estimated: `3507` - // Minimum execution time: 20_058_000 picoseconds. - Weight::from_parts(20_751_832, 0) + // Minimum execution time: 20_319_000 picoseconds. + Weight::from_parts(21_050_040, 0) .saturating_add(Weight::from_parts(0, 3507)) - // Standard Error: 3_745 - .saturating_add(Weight::from_parts(359_667, 0).saturating_mul(r.into())) + // Standard Error: 3_562 + .saturating_add(Weight::from_parts(338_796, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -124,11 +124,11 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `599 + r * (72 ±0)` // Estimated: `3519` - // Minimum execution time: 27_806_000 picoseconds. - Weight::from_parts(30_225_170, 0) + // Minimum execution time: 28_799_000 picoseconds. + Weight::from_parts(31_074_181, 0) .saturating_add(Weight::from_parts(0, 3519)) - // Standard Error: 16_870 - .saturating_add(Weight::from_parts(608_652, 0).saturating_mul(r.into())) + // Standard Error: 17_336 + .saturating_add(Weight::from_parts(614_951, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -144,8 +144,8 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `633` // Estimated: `317568` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(48_520_000, 0) + // Minimum execution time: 48_431_000 picoseconds. + Weight::from_parts(48_867_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -161,11 +161,11 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `467 + n * (50 ±0)` // Estimated: `4365 + n * (2540 ±0)` - // Minimum execution time: 15_426_000 picoseconds. - Weight::from_parts(19_278_701, 0) + // Minimum execution time: 15_419_000 picoseconds. + Weight::from_parts(19_562_203, 0) .saturating_add(Weight::from_parts(0, 4365)) - // Standard Error: 1_274 - .saturating_add(Weight::from_parts(916_410, 0).saturating_mul(n.into())) + // Standard Error: 1_399 + .saturating_add(Weight::from_parts(986_173, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs index b70c3017a38..79c7f92473e 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_referenda` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -60,8 +60,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `322` // Estimated: `159279` - // Minimum execution time: 29_980_000 picoseconds. - Weight::from_parts(30_415_000, 0) + // Minimum execution time: 29_859_000 picoseconds. + Weight::from_parts(30_332_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -74,8 +74,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `366` // Estimated: `317568` - // Minimum execution time: 54_782_000 picoseconds. - Weight::from_parts(55_250_000, 0) + // Minimum execution time: 54_652_000 picoseconds. + Weight::from_parts(54_981_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -86,15 +86,17 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn place_decision_deposit_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `1845` - // Estimated: `4365` - // Minimum execution time: 68_580_000 picoseconds. - Weight::from_parts(69_745_000, 0) - .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `2004` + // Estimated: `159279` + // Minimum execution time: 84_277_000 picoseconds. + Weight::from_parts(86_396_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) @@ -102,15 +104,17 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn place_decision_deposit_not_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `1886` - // Estimated: `4365` - // Minimum execution time: 66_900_000 picoseconds. - Weight::from_parts(69_144_000, 0) - .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `2045` + // Estimated: `159279` + // Minimum execution time: 83_603_000 picoseconds. + Weight::from_parts(85_564_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) @@ -124,8 +128,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `769` // Estimated: `317568` - // Minimum execution time: 125_600_000 picoseconds. - Weight::from_parts(129_568_000, 0) + // Minimum execution time: 124_446_000 picoseconds. + Weight::from_parts(127_196_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -136,15 +140,17 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) /// Storage: FellowshipCollective MemberCount (r:1 w:0) /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn place_decision_deposit_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `579` - // Estimated: `4365` - // Minimum execution time: 47_058_000 picoseconds. - Weight::from_parts(47_629_000, 0) - .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `634` + // Estimated: `317568` + // Minimum execution time: 67_332_000 picoseconds. + Weight::from_parts(68_060_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) @@ -152,8 +158,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `317` // Estimated: `4365` - // Minimum execution time: 32_565_000 picoseconds. - Weight::from_parts(32_857_000, 0) + // Minimum execution time: 32_800_000 picoseconds. + Weight::from_parts(33_194_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -164,8 +170,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `167` // Estimated: `4365` - // Minimum execution time: 16_655_000 picoseconds. - Weight::from_parts(16_980_000, 0) + // Minimum execution time: 16_319_000 picoseconds. + Weight::from_parts(16_595_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -178,8 +184,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `311` // Estimated: `317568` - // Minimum execution time: 39_979_000 picoseconds. - Weight::from_parts(40_199_000, 0) + // Minimum execution time: 39_829_000 picoseconds. + Weight::from_parts(40_797_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -208,8 +214,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `517` // Estimated: `317568` - // Minimum execution time: 158_717_000 picoseconds. - Weight::from_parts(159_336_000, 0) + // Minimum execution time: 157_047_000 picoseconds. + Weight::from_parts(158_391_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(6)) @@ -222,8 +228,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `4277` - // Minimum execution time: 11_107_000 picoseconds. - Weight::from_parts(11_302_000, 0) + // Minimum execution time: 11_262_000 picoseconds. + Weight::from_parts(11_561_000, 0) .saturating_add(Weight::from_parts(0, 4277)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -234,17 +240,17 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) /// Storage: FellowshipCollective MemberCount (r:1 w:0) /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:2 w:2) + /// Storage: Scheduler Agenda (r:1 w:1) /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn one_fewer_deciding_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `3896` - // Estimated: `317568` - // Minimum execution time: 237_949_000 picoseconds. - Weight::from_parts(240_956_000, 0) - .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `2385` + // Estimated: `159279` + // Minimum execution time: 70_608_000 picoseconds. + Weight::from_parts(72_409_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) @@ -252,49 +258,45 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) /// Storage: FellowshipCollective MemberCount (r:1 w:0) /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:2 w:2) + /// Storage: Scheduler Agenda (r:1 w:1) /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn one_fewer_deciding_passing() -> Weight { // Proof Size summary in bytes: - // Measured: `3896` - // Estimated: `317568` - // Minimum execution time: 240_708_000 picoseconds. - Weight::from_parts(242_646_000, 0) - .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `2385` + // Estimated: `159279` + // Minimum execution time: 73_010_000 picoseconds. + Weight::from_parts(75_118_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn nudge_referendum_requeued_insertion() -> Weight { // Proof Size summary in bytes: - // Measured: `3494` - // Estimated: `159279` - // Minimum execution time: 136_435_000 picoseconds. - Weight::from_parts(138_673_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1807` + // Estimated: `4365` + // Minimum execution time: 35_429_000 picoseconds. + Weight::from_parts(36_529_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn nudge_referendum_requeued_slide() -> Weight { // Proof Size summary in bytes: - // Measured: `3447` - // Estimated: `159279` - // Minimum execution time: 136_686_000 picoseconds. - Weight::from_parts(137_969_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1774` + // Estimated: `4365` + // Minimum execution time: 35_263_000 picoseconds. + Weight::from_parts(36_401_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) @@ -302,17 +304,15 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn nudge_referendum_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `3433` - // Estimated: `159279` - // Minimum execution time: 139_598_000 picoseconds. - Weight::from_parts(140_713_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1790` + // Estimated: `4365` + // Minimum execution time: 41_442_000 picoseconds. + Weight::from_parts(42_495_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) @@ -320,17 +320,15 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) fn nudge_referendum_not_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `3488` - // Estimated: `159279` - // Minimum execution time: 139_149_000 picoseconds. - Weight::from_parts(140_033_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1831` + // Estimated: `4365` + // Minimum execution time: 40_284_000 picoseconds. + Weight::from_parts(41_554_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) @@ -340,8 +338,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263` // Estimated: `159279` - // Minimum execution time: 27_153_000 picoseconds. - Weight::from_parts(27_344_000, 0) + // Minimum execution time: 25_964_000 picoseconds. + Weight::from_parts(26_388_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -354,8 +352,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `311` // Estimated: `159279` - // Minimum execution time: 27_327_000 picoseconds. - Weight::from_parts(27_886_000, 0) + // Minimum execution time: 26_428_000 picoseconds. + Weight::from_parts(26_997_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -366,8 +364,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `208` // Estimated: `4365` - // Minimum execution time: 19_314_000 picoseconds. - Weight::from_parts(19_667_000, 0) + // Minimum execution time: 18_565_000 picoseconds. + Weight::from_parts(18_815_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -384,8 +382,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `579` // Estimated: `159279` - // Minimum execution time: 39_377_000 picoseconds. - Weight::from_parts(39_742_000, 0) + // Minimum execution time: 39_029_000 picoseconds. + Weight::from_parts(39_327_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -402,8 +400,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `714` // Estimated: `159279` - // Minimum execution time: 66_532_000 picoseconds. - Weight::from_parts(68_794_000, 0) + // Minimum execution time: 66_856_000 picoseconds. + Weight::from_parts(69_530_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -418,8 +416,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `767` // Estimated: `159279` - // Minimum execution time: 87_398_000 picoseconds. - Weight::from_parts(90_998_000, 0) + // Minimum execution time: 87_496_000 picoseconds. + Weight::from_parts(91_067_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -434,8 +432,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `750` // Estimated: `159279` - // Minimum execution time: 87_401_000 picoseconds. - Weight::from_parts(90_985_000, 0) + // Minimum execution time: 76_994_000 picoseconds. + Weight::from_parts(90_054_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -450,8 +448,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `767` // Estimated: `159279` - // Minimum execution time: 82_591_000 picoseconds. - Weight::from_parts(86_670_000, 0) + // Minimum execution time: 83_812_000 picoseconds. + Weight::from_parts(85_760_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -466,8 +464,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `771` // Estimated: `159279` - // Minimum execution time: 55_759_000 picoseconds. - Weight::from_parts(58_177_000, 0) + // Minimum execution time: 56_903_000 picoseconds. + Weight::from_parts(58_110_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -484,8 +482,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `771` // Estimated: `317568` - // Minimum execution time: 99_521_000 picoseconds. - Weight::from_parts(106_553_000, 0) + // Minimum execution time: 101_848_000 picoseconds. + Weight::from_parts(108_838_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -500,8 +498,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `767` // Estimated: `159279` - // Minimum execution time: 87_381_000 picoseconds. - Weight::from_parts(91_501_000, 0) + // Minimum execution time: 85_974_000 picoseconds. + Weight::from_parts(87_622_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -516,8 +514,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `352` // Estimated: `4365` - // Minimum execution time: 22_378_000 picoseconds. - Weight::from_parts(22_631_000, 0) + // Minimum execution time: 21_903_000 picoseconds. + Weight::from_parts(22_357_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -530,8 +528,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `4365` - // Minimum execution time: 20_116_000 picoseconds. - Weight::from_parts(20_255_000, 0) + // Minimum execution time: 19_526_000 picoseconds. + Weight::from_parts(19_845_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs new file mode 100644 index 00000000000..89333426386 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs @@ -0,0 +1,140 @@ + +//! Autogenerated weights for `pallet_salary` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-20, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/debug/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --steps=2 +// --repeat=1 +// --pallet=pallet_salary +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_salary`. +pub struct WeightInfo(PhantomData); +impl pallet_salary::WeightInfo for WeightInfo { + /// Storage: FellowshipSalary Status (r:1 w:1) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + fn init() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `1541` + // Minimum execution time: 127_000_000 picoseconds. + Weight::from_parts(127_000_000, 0) + .saturating_add(Weight::from_parts(0, 1541)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipSalary Status (r:1 w:1) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + fn bump() -> Weight { + // Proof Size summary in bytes: + // Measured: `224` + // Estimated: `1541` + // Minimum execution time: 133_000_000 picoseconds. + Weight::from_parts(133_000_000, 0) + .saturating_add(Weight::from_parts(0, 1541)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipSalary Status (r:1 w:0) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipSalary Claimant (r:1 w:1) + /// Proof: FellowshipSalary Claimant (max_values: None, max_size: Some(78), added: 2553, mode: MaxEncodedLen) + fn induct() -> Weight { + // Proof Size summary in bytes: + // Measured: `395` + // Estimated: `3543` + // Minimum execution time: 186_000_000 picoseconds. + Weight::from_parts(186_000_000, 0) + .saturating_add(Weight::from_parts(0, 3543)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipSalary Status (r:1 w:1) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + /// Storage: FellowshipSalary Claimant (r:1 w:1) + /// Proof: FellowshipSalary Claimant (max_values: None, max_size: Some(78), added: 2553, mode: MaxEncodedLen) + fn register() -> Weight { + // Proof Size summary in bytes: + // Measured: `462` + // Estimated: `3543` + // Minimum execution time: 183_000_000 picoseconds. + Weight::from_parts(183_000_000, 0) + .saturating_add(Weight::from_parts(0, 3543)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipSalary Status (r:1 w:1) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + /// Storage: FellowshipSalary Claimant (r:1 w:1) + /// Proof: FellowshipSalary Claimant (max_values: None, max_size: Some(78), added: 2553, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `565` + // Estimated: `3593` + // Minimum execution time: 628_000_000 picoseconds. + Weight::from_parts(628_000_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipSalary Status (r:1 w:1) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + /// Storage: FellowshipSalary Claimant (r:1 w:1) + /// Proof: FellowshipSalary Claimant (max_values: None, max_size: Some(78), added: 2553, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn payout_other() -> Weight { + // Proof Size summary in bytes: + // Measured: `565` + // Estimated: `6196` + // Minimum execution time: 607_000_000 picoseconds. + Weight::from_parts(607_000_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipSalary Status (r:1 w:1) + /// Proof: FellowshipSalary Status (max_values: Some(1), max_size: Some(56), added: 551, mode: MaxEncodedLen) + /// Storage: FellowshipSalary Claimant (r:1 w:1) + /// Proof: FellowshipSalary Claimant (max_values: None, max_size: Some(78), added: 2553, mode: MaxEncodedLen) + fn check_payment() -> Weight { + // Proof Size summary in bytes: + // Measured: `308` + // Estimated: `3543` + // Minimum execution time: 100_000_000 picoseconds. + Weight::from_parts(100_000_000, 0) + .saturating_add(Weight::from_parts(0, 3543)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs index f6f6954aca3..e2f70b971e8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -54,8 +54,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `31` // Estimated: `1489` - // Minimum execution time: 3_399_000 picoseconds. - Weight::from_parts(3_512_000, 0) + // Minimum execution time: 3_408_000 picoseconds. + Weight::from_parts(3_601_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -67,11 +67,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `77 + s * (177 ±0)` // Estimated: `159279` - // Minimum execution time: 2_846_000 picoseconds. - Weight::from_parts(4_715_748, 0) + // Minimum execution time: 2_948_000 picoseconds. + Weight::from_parts(4_528_781, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 2_743 - .saturating_add(Weight::from_parts(971_622, 0).saturating_mul(s.into())) + // Standard Error: 2_863 + .saturating_add(Weight::from_parts(746_443, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -79,8 +79,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_940_000 picoseconds. - Weight::from_parts(6_087_000, 0) + // Minimum execution time: 5_613_000 picoseconds. + Weight::from_parts(5_702_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: Preimage PreimageFor (r:1 w:1) @@ -92,11 +92,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `179 + s * (1 ±0)` // Estimated: `3644 + s * (1 ±0)` - // Minimum execution time: 20_238_000 picoseconds. - Weight::from_parts(20_509_000, 0) + // Minimum execution time: 19_587_000 picoseconds. + Weight::from_parts(19_747_000, 0) .saturating_add(Weight::from_parts(0, 3644)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_271, 0).saturating_mul(s.into())) + // Standard Error: 6 + .saturating_add(Weight::from_parts(1_290, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) @@ -107,8 +107,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_274_000 picoseconds. - Weight::from_parts(7_466_000, 0) + // Minimum execution time: 7_085_000 picoseconds. + Weight::from_parts(7_298_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -116,24 +116,24 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_886_000 picoseconds. - Weight::from_parts(6_035_000, 0) + // Minimum execution time: 5_632_000 picoseconds. + Weight::from_parts(5_758_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_signed() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_994_000 picoseconds. - Weight::from_parts(3_101_000, 0) + // Minimum execution time: 2_715_000 picoseconds. + Weight::from_parts(2_847_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_unsigned() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_983_000 picoseconds. - Weight::from_parts(3_095_000, 0) + // Minimum execution time: 2_678_000 picoseconds. + Weight::from_parts(2_803_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: Scheduler Agenda (r:1 w:1) @@ -143,11 +143,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `77 + s * (177 ±0)` // Estimated: `159279` - // Minimum execution time: 12_851_000 picoseconds. - Weight::from_parts(14_995_788, 0) + // Minimum execution time: 12_364_000 picoseconds. + Weight::from_parts(13_805_689, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 3_056 - .saturating_add(Weight::from_parts(980_018, 0).saturating_mul(s.into())) + // Standard Error: 3_064 + .saturating_add(Weight::from_parts(759_823, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -160,11 +160,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `77 + s * (177 ±0)` // Estimated: `159279` - // Minimum execution time: 17_805_000 picoseconds. - Weight::from_parts(16_078_257, 0) + // Minimum execution time: 16_962_000 picoseconds. + Weight::from_parts(15_334_746, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 3_216 - .saturating_add(Weight::from_parts(1_767_117, 0).saturating_mul(s.into())) + // Standard Error: 3_173 + .saturating_add(Weight::from_parts(1_327_066, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -177,11 +177,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `468 + s * (179 ±0)` // Estimated: `159279` - // Minimum execution time: 16_210_000 picoseconds. - Weight::from_parts(20_557_445, 0) + // Minimum execution time: 15_693_000 picoseconds. + Weight::from_parts(19_926_950, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 3_292 - .saturating_add(Weight::from_parts(992_281, 0).saturating_mul(s.into())) + // Standard Error: 3_089 + .saturating_add(Weight::from_parts(760_361, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -194,11 +194,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `509 + s * (179 ±0)` // Estimated: `159279` - // Minimum execution time: 19_976_000 picoseconds. - Weight::from_parts(19_613_223, 0) + // Minimum execution time: 19_017_000 picoseconds. + Weight::from_parts(18_740_840, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 2_988 - .saturating_add(Weight::from_parts(1_765_202, 0).saturating_mul(s.into())) + // Standard Error: 2_914 + .saturating_add(Weight::from_parts(1_331_872, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } 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 cb307d61e54..43d1f3f103d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `270` // Estimated: `3735` - // Minimum execution time: 17_505_000 picoseconds. - Weight::from_parts(17_789_000, 0) + // Minimum execution time: 17_575_000 picoseconds. + Weight::from_parts(17_997_000, 0) .saturating_add(Weight::from_parts(0, 3735)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,8 +70,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `3707` - // Minimum execution time: 12_686_000 picoseconds. - Weight::from_parts(12_960_000, 0) + // Minimum execution time: 12_894_000 picoseconds. + Weight::from_parts(13_209_000, 0) .saturating_add(Weight::from_parts(0, 3707)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) 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 5b3bd10d3f1..4c51c32ef56 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `49` // Estimated: `1493` - // Minimum execution time: 8_048_000 picoseconds. - Weight::from_parts(8_313_000, 0) + // Minimum execution time: 7_694_000 picoseconds. + Weight::from_parts(7_843_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 3_226_000 picoseconds. - Weight::from_parts(3_341_000, 0) + // Minimum execution time: 3_208_000 picoseconds. + Weight::from_parts(3_295_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } 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 6bec697194f..722b334b664 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -53,18 +53,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_356_000 picoseconds. - Weight::from_parts(3_086_549, 0) + // Minimum execution time: 6_867_000 picoseconds. + Weight::from_parts(7_457_015, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_625 - .saturating_add(Weight::from_parts(4_935_275, 0).saturating_mul(c.into())) + // Standard Error: 3_324 + .saturating_add(Weight::from_parts(4_533_833, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_633_000 picoseconds. - Weight::from_parts(5_693_000, 0) + // Minimum execution time: 5_383_000 picoseconds. + Weight::from_parts(5_461_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -72,18 +72,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_312_000 picoseconds. - Weight::from_parts(3_780_731, 0) + // Minimum execution time: 6_958_000 picoseconds. + Weight::from_parts(7_234_425, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 6_353 - .saturating_add(Weight::from_parts(5_289_295, 0).saturating_mul(c.into())) + // Standard Error: 2_879 + .saturating_add(Weight::from_parts(4_769_075, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_811_000 picoseconds. - Weight::from_parts(10_039_000, 0) + // Minimum execution time: 8_885_000 picoseconds. + Weight::from_parts(9_059_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -91,10 +91,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_419_000 picoseconds. - Weight::from_parts(4_232_933, 0) + // Minimum execution time: 6_914_000 picoseconds. + Weight::from_parts(1_498_896, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_419 - .saturating_add(Weight::from_parts(4_950_293, 0).saturating_mul(c.into())) + // Standard Error: 3_750 + .saturating_add(Weight::from_parts(4_551_100, 0).saturating_mul(c.into())) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs index ce00a1db94a..fcd7b617e00 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 @@ -62,8 +62,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `111` // Estimated: `3576` - // Minimum execution time: 30_061_000 picoseconds. - Weight::from_parts(30_674_000, 0) + // Minimum execution time: 28_803_000 picoseconds. + Weight::from_parts(29_380_000, 0) .saturating_add(Weight::from_parts(0, 3576)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -74,8 +74,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1489` - // Minimum execution time: 30_473_000 picoseconds. - Weight::from_parts(30_869_000, 0) + // Minimum execution time: 27_131_000 picoseconds. + Weight::from_parts(27_471_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -105,8 +105,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_720_000 picoseconds. - Weight::from_parts(10_836_000, 0) + // Minimum execution time: 9_763_000 picoseconds. + Weight::from_parts(10_070_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -116,8 +116,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_284_000 picoseconds. - Weight::from_parts(3_349_000, 0) + // Minimum execution time: 2_982_000 picoseconds. + Weight::from_parts(3_128_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -141,8 +141,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `111` // Estimated: `3576` - // Minimum execution time: 35_075_000 picoseconds. - Weight::from_parts(35_592_000, 0) + // Minimum execution time: 33_596_000 picoseconds. + Weight::from_parts(34_253_000, 0) .saturating_add(Weight::from_parts(0, 3576)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -165,8 +165,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `294` // Estimated: `3759` - // Minimum execution time: 35_814_000 picoseconds. - Weight::from_parts(36_242_000, 0) + // Minimum execution time: 34_203_000 picoseconds. + Weight::from_parts(34_510_000, 0) .saturating_add(Weight::from_parts(0, 3759)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -177,8 +177,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_199_000 picoseconds. - Weight::from_parts(3_444_000, 0) + // Minimum execution time: 3_043_000 picoseconds. + Weight::from_parts(3_145_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -188,8 +188,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `129` // Estimated: `11019` - // Minimum execution time: 16_207_000 picoseconds. - Weight::from_parts(16_419_000, 0) + // Minimum execution time: 15_740_000 picoseconds. + Weight::from_parts(16_015_000, 0) .saturating_add(Weight::from_parts(0, 11019)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -200,8 +200,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `133` // Estimated: `11023` - // Minimum execution time: 16_204_000 picoseconds. - Weight::from_parts(16_554_000, 0) + // Minimum execution time: 15_816_000 picoseconds. + Weight::from_parts(16_084_000, 0) .saturating_add(Weight::from_parts(0, 11023)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -212,8 +212,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `13505` - // Minimum execution time: 16_935_000 picoseconds. - Weight::from_parts(17_263_000, 0) + // Minimum execution time: 16_494_000 picoseconds. + Weight::from_parts(16_815_000, 0) .saturating_add(Weight::from_parts(0, 13505)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -233,8 +233,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `178` // Estimated: `6118` - // Minimum execution time: 31_462_000 picoseconds. - Weight::from_parts(32_095_000, 0) + // Minimum execution time: 30_602_000 picoseconds. + Weight::from_parts(31_780_000, 0) .saturating_add(Weight::from_parts(0, 6118)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -245,8 +245,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `172` // Estimated: `8587` - // Minimum execution time: 8_664_000 picoseconds. - Weight::from_parts(8_835_000, 0) + // Minimum execution time: 8_638_000 picoseconds. + Weight::from_parts(8_798_000, 0) .saturating_add(Weight::from_parts(0, 8587)) .saturating_add(T::DbWeight::get().reads(3)) } @@ -256,8 +256,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `11030` - // Minimum execution time: 15_999_000 picoseconds. - Weight::from_parts(16_305_000, 0) + // Minimum execution time: 15_385_000 picoseconds. + Weight::from_parts(15_771_000, 0) .saturating_add(Weight::from_parts(0, 11030)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -278,8 +278,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `182` // Estimated: `11072` - // Minimum execution time: 37_949_000 picoseconds. - Weight::from_parts(38_524_000, 0) + // Minimum execution time: 37_257_000 picoseconds. + Weight::from_parts(37_977_000, 0) .saturating_add(Weight::from_parts(0, 11072)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index 406209a4a4c..3c95da27dd8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -187,6 +187,16 @@ impl Contains for SafeCallFilter { pallet_ranked_collective::Call::promote_member { .. } | pallet_ranked_collective::Call::demote_member { .. } | pallet_ranked_collective::Call::remove_member { .. }, + ) | RuntimeCall::FellowshipCore( + pallet_core_fellowship::Call::bump { .. } | + pallet_core_fellowship::Call::set_params { .. } | + pallet_core_fellowship::Call::set_active { .. } | + pallet_core_fellowship::Call::approve { .. } | + pallet_core_fellowship::Call::induct { .. } | + pallet_core_fellowship::Call::promote { .. } | + pallet_core_fellowship::Call::offboard { .. } | + pallet_core_fellowship::Call::submit_evidence { .. } | + pallet_core_fellowship::Call::import { .. }, ) ) } @@ -244,6 +254,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = WithOriginFilter; type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. diff --git a/parachains/runtimes/contracts/contracts-rococo/Cargo.toml b/parachains/runtimes/contracts/contracts-rococo/Cargo.toml index 37996e29586..b47227bf135 100644 --- a/parachains/runtimes/contracts/contracts-rococo/Cargo.toml +++ b/parachains/runtimes/contracts/contracts-rococo/Cargo.toml @@ -13,7 +13,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1", optional = true } -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" @@ -86,6 +86,7 @@ std = [ "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", + "frame-try-runtime/std", "kusama-runtime-constants/std", "pallet-aura/std", "pallet-authorship/std", diff --git a/parachains/runtimes/contracts/contracts-rococo/src/constants.rs b/parachains/runtimes/contracts/contracts-rococo/src/constants.rs index 4598ddaa264..1147b935aa3 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/constants.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/constants.rs @@ -76,7 +76,7 @@ pub mod fee { type Balance = Balance; fn polynomial() -> WeightToFeeCoefficients { // 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 + // in Rococo Contracts, we map to 1/10 of that, or 1/100 CENT let p = super::currency::CENTS; let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); diff --git a/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs b/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs index 8577dd64703..b049b450169 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs @@ -48,4 +48,5 @@ impl Config for Runtime { type MaxStorageKeyLen = ConstU32<128>; type UnsafeUnstableInterface = ConstBool; type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; + type Migrations = (); } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index d90c60990c4..f830492adaa 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -50,7 +50,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Everything}, + traits::{ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Everything}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -95,9 +95,16 @@ pub type SignedExtra = ( pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +/// Migrations to apply on runtime upgrade. pub type Migrations = ( + cumulus_pallet_dmp_queue::migration::Migration, + cumulus_pallet_parachain_system::migration::Migration, + cumulus_pallet_xcmp_queue::migration::Migration, + pallet_balances::migration::MigrateToTrackInactive, pallet_contracts::Migration, + pallet_multisig::migrations::v1::MigrateToV1, pallet_collator_selection::migration::v1::MigrateToV1, + pallet_xcm::migration::v1::MigrateToV1, ); type EventRecord = frame_system::EventRecord< @@ -303,6 +310,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { diff --git a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index 2f39cc6536d..cc095c9229f 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -43,6 +43,7 @@ parameter_types! { pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const ExecutiveBody: BodyId = BodyId::Executive; + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); } /// We allow root and the Relay Chain council to execute privileged collator selection operations. @@ -167,6 +168,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } /// Converts a local signed origin into an XCM multilocation. diff --git a/parachains/runtimes/glutton/glutton-kusama/Cargo.toml b/parachains/runtimes/glutton/glutton-kusama/Cargo.toml index bc502c116f3..d2a270bca13 100644 --- a/parachains/runtimes/glutton/glutton-kusama/Cargo.toml +++ b/parachains/runtimes/glutton/glutton-kusama/Cargo.toml @@ -13,6 +13,7 @@ frame-benchmarking = { git = "https://github.com/paritytech/substrate", optional frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true, default-features = false, branch = "master" } frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } pallet-glutton = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } @@ -59,6 +60,7 @@ std = [ "frame-executive/std", "frame-support/std", "frame-system/std", + "frame-system-rpc-runtime-api/std", "pallet-glutton/std", "pallet-sudo/std", "sp-api/std", diff --git a/parachains/runtimes/glutton/glutton-kusama/src/lib.rs b/parachains/runtimes/glutton/glutton-kusama/src/lib.rs index 073bd6c5751..fba081f2d66 100644 --- a/parachains/runtimes/glutton/glutton-kusama/src/lib.rs +++ b/parachains/runtimes/glutton/glutton-kusama/src/lib.rs @@ -46,15 +46,12 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); pub mod weights; pub mod xcm_config; -use codec::{Decode, Encode}; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; -use frame_support::unsigned::TransactionValidityError; -use scale_info::TypeInfo; use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; use sp_runtime::{ create_runtime_str, generic, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, DispatchInfoOf}, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -222,41 +219,6 @@ construct_runtime! { } } -/// Simple implementation which fails any transaction which is signed. -#[derive(Eq, PartialEq, Clone, Default, sp_core::RuntimeDebug, Encode, Decode, TypeInfo)] -pub struct DisallowSigned; -impl sp_runtime::traits::SignedExtension for DisallowSigned { - const IDENTIFIER: &'static str = "DisallowSigned"; - type AccountId = AccountId; - type Call = RuntimeCall; - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> sp_std::result::Result<(), sp_runtime::transaction_validity::TransactionValidityError> { - Ok(()) - } - fn pre_dispatch( - self, - who: &Self::AccountId, - call: &Self::Call, - info: &DispatchInfoOf, - len: usize, - ) -> Result { - self.validate(who, call, info, len).map(|_| ()) - } - fn validate( - &self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &sp_runtime::traits::DispatchInfoOf, - _len: usize, - ) -> TransactionValidity { - let i = sp_runtime::transaction_validity::InvalidTransaction::BadProof; - Err(sp_runtime::transaction_validity::TransactionValidityError::Invalid(i)) - } -} - /// Index of a transaction in the chain. pub type Index = u32; /// A hash of some data used by the chain. @@ -274,7 +236,15 @@ pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. -pub type SignedExtra = DisallowSigned; +pub type SignedExtra = ( + pallet_sudo::CheckOnlySudoAccount, + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, +); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; @@ -382,6 +352,12 @@ impl_runtime_apis! { } } + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Index { + System::account_nonce(account) + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( diff --git a/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs b/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs index 083ca592491..a09880f8cdc 100644 --- a/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs +++ b/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs @@ -83,6 +83,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/starters/shell/src/xcm_config.rs b/parachains/runtimes/starters/shell/src/xcm_config.rs index 8a7b3f21339..b1fcfc5c8f6 100644 --- a/parachains/runtimes/starters/shell/src/xcm_config.rs +++ b/parachains/runtimes/starters/shell/src/xcm_config.rs @@ -83,6 +83,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/parachains/runtimes/test-utils/src/lib.rs b/parachains/runtimes/test-utils/src/lib.rs index 8ff85438b3f..10fbffcf0e0 100644 --- a/parachains/runtimes/test-utils/src/lib.rs +++ b/parachains/runtimes/test-utils/src/lib.rs @@ -20,8 +20,10 @@ use cumulus_primitives_core::{AbridgedHrmpChannel, ParaId, PersistedValidationDa use cumulus_primitives_parachain_inherent::ParachainInherentData; use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use frame_support::{ + assert_ok, dispatch::{DispatchResult, RawOrigin, UnfilteredDispatchable}, inherent::{InherentData, ProvideInherent}, + pallet_prelude::Get, traits::{GenesisBuild, OriginTrait}, weights::Weight, }; @@ -327,7 +329,6 @@ pub enum XcmReceivedFrom { impl RuntimeHelper { pub fn xcm_max_weight(from: XcmReceivedFrom) -> Weight { - use frame_support::traits::Get; match from { XcmReceivedFrom::Parent => ParachainSystem::ReservedDmpWeight::get(), XcmReceivedFrom::Sibling => ParachainSystem::ReservedXcmpWeight::get(), @@ -478,3 +479,73 @@ impl } } } + +/// Test-case makes sure that `Runtime` can change storage constant via governance-like call +pub fn change_storage_constant_by_governance_works( + collator_session_key: CollatorSessionKeys, + runtime_para_id: u32, + runtime_call_encode: Box) -> Vec>, + storage_constant_key_value: fn() -> (Vec, StorageConstantType), + new_storage_constant_value: fn(&StorageConstantType) -> StorageConstantType, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_dmp_queue::Config + + cumulus_pallet_parachain_system::Config, + ValidatorIdOf: From>, + StorageConstant: Get, + StorageConstantType: Encode + PartialEq + std::fmt::Debug, +{ + ExtBuilder::::default() + .with_collators(collator_session_key.collators()) + .with_session_keys(collator_session_key.session_keys()) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + let (storage_constant_key, storage_constant_init_value): ( + Vec, + StorageConstantType, + ) = storage_constant_key_value(); + + // check constant before (not stored yet, just as default value is used) + assert_eq!(StorageConstant::get(), storage_constant_init_value); + assert_eq!(sp_io::storage::get(&storage_constant_key), None); + + let new_storage_constant_value = + new_storage_constant_value(&storage_constant_init_value); + assert_ne!(new_storage_constant_value, storage_constant_init_value); + + // encode `set_storage` call + let set_storage_call = + runtime_call_encode(frame_system::Call::::set_storage { + items: vec![( + storage_constant_key.clone(), + new_storage_constant_value.encode(), + )], + }); + + // estimate - storing just 1 value + use frame_system::WeightInfo; + let require_weight_at_most = + ::SystemWeightInfo::set_storage(1); + + // execute XCM with Transact to `set_storage` as governance does + assert_ok!(RuntimeHelper::::execute_as_governance( + set_storage_call, + require_weight_at_most + ) + .ensure_complete()); + + // check constant after (stored) + assert_eq!(StorageConstant::get(), new_storage_constant_value); + assert_eq!( + sp_io::storage::get(&storage_constant_key), + Some(new_storage_constant_value.encode().into()) + ); + }) +} diff --git a/parachains/runtimes/testing/penpal/Cargo.toml b/parachains/runtimes/testing/penpal/Cargo.toml index 679a252c362..bc4175a1764 100644 --- a/parachains/runtimes/testing/penpal/Cargo.toml +++ b/parachains/runtimes/testing/penpal/Cargo.toml @@ -17,7 +17,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1", optional = true } -log = { version = "0.4.16", default-features = false } +log = { version = "0.4.19", default-features = false } scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index 8ba89c803ce..a0be623d2d9 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright 2019-2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -14,11 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -//! The Penpal runtime is designed as a test runtime that can be created using an arbitrary parachain id. -//! (and as such multiple parachains can be on the same relay node - though make sure you have enough relay -//! nodes running to support this or you will get the not scheduled on a core error message.) +//! The PenPal runtime is designed as a test runtime that can be created with an arbitrary `ParaId`, +//! such that multiple instances of the parachain can be on the same parent relay. Ensure that you +//! have enough nodes running to support this or you will get scheduling errors. //! -//! The penpal runtime's primary use is as a partner when testing statemine/t with reserve asset transfers. +//! The PenPal runtime's primary use is for testing interactions between System parachains and +//! other chains that are not trusted teleporters. + #![cfg_attr(not(feature = "std"), no_std)] // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] @@ -36,7 +38,7 @@ use frame_support::{ dispatch::DispatchClass, pallet_prelude::Weight, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, Everything}, + traits::{AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, Everything}, weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, FeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -504,6 +506,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index d005cc664a3..a8b33bfcd50 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -19,8 +19,8 @@ //! This configuration dictates how the Penpal chain will communicate with other chains. //! //! One of the main uses of the penpal chain will be to be a benefactor of reserve asset transfers -//! 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. +//! with Asset Hub 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, AllPalletsWithSystem, AssetId as AssetIdPalletAssets, Assets, Balance, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, @@ -94,7 +94,7 @@ pub type FungiblesTransactor = FungiblesAdapter< ConvertedConcreteId< AssetIdPalletAssets, Balance, - AsPrefixedGeneralIndex, + AsPrefixedGeneralIndex, JustTry, >, // Convert an XCM MultiLocation into a local account id: @@ -256,15 +256,16 @@ impl ContainsPair for MultiNativeAsset { } parameter_types! { - pub CommonGoodAssetsLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000))); + /// The location that this chain recognizes as the Relay network's Asset Hub. + pub SystemAssetHubLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000))); // ALWAYS ensure that the index in PalletInstance stays up-to-date with - // Statemint's Assets pallet index - pub CommonGoodAssetsPalletLocation: MultiLocation = + // the Relay Chain's Asset Hub's Assets pallet index + pub SystemAssetHubAssetsPalletLocation: MultiLocation = MultiLocation::new(1, X2(Parachain(1000), PalletInstance(50))); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); } -pub type Reserves = (NativeAsset, AssetsFrom); +pub type Reserves = (NativeAsset, AssetsFrom); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { @@ -293,6 +294,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } /// No local origins on this chain are allowed to dispatch XCM sends/executions. diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 3060093b532..fa6dd20f66a 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -42,8 +42,8 @@ pub use frame_support::{ dispatch::DispatchClass, match_types, parameter_types, traits::{ - AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, IsInVec, - Nothing, Randomness, + AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, + IsInVec, Nothing, Randomness, }, weights::{ constants::{ @@ -321,7 +321,11 @@ pub type FungiblesTransactor = FungiblesAdapter< ConvertedConcreteId< AssetIdForTrustBackedAssets, u64, - AsPrefixedGeneralIndex, + AsPrefixedGeneralIndex< + SystemAssetHubAssetsPalletLocation, + AssetIdForTrustBackedAssets, + JustTry, + >, JustTry, >, // Convert an XCM MultiLocation into a local account id: @@ -370,11 +374,13 @@ parameter_types! { } match_types! { + // The parent or the parent's unit plurality. pub type ParentOrParentsUnitPlurality: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } }; - pub type Statemint: impl Contains = { + // The location recognized as the Relay network's Asset Hub. + pub type AssetHub: impl Contains = { MultiLocation { parents: 1, interior: X1(Parachain(1000)) } }; } @@ -382,9 +388,10 @@ match_types! { pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, + // Parent & its unit plurality gets free execution. AllowExplicitUnpaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution - AllowExplicitUnpaidExecutionFrom, + // The network's Asset Hub gets free execution. + AllowExplicitUnpaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, // Subscriptions for version tracking are OK. @@ -393,14 +400,14 @@ pub type Barrier = ( parameter_types! { pub MaxAssetsIntoHolding: u32 = 64; - pub StatemintLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000))); + pub SystemAssetHubLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000))); // ALWAYS ensure that the index in PalletInstance stays up-to-date with - // Statemint's Assets pallet index - pub StatemintAssetsPalletLocation: MultiLocation = + // the Relay Chain's Asset Hub's Assets pallet index + pub SystemAssetHubAssetsPalletLocation: MultiLocation = MultiLocation::new(1, X2(Parachain(1000), PalletInstance(50))); } -pub type Reserves = (NativeAsset, AssetsFrom); +pub type Reserves = (NativeAsset, AssetsFrom); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { @@ -428,6 +435,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -546,6 +554,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } construct_runtime! { diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index d596cb6cdd8..d0e9485cf93 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -12,12 +12,12 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.68" -clap = { version = "4.3.0", features = ["derive"] } +clap = { version = "4.3.3", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = "0.3.28" hex-literal = "0.4.1" -log = "0.4.17" -serde = { version = "1.0.163", features = ["derive"] } +log = "0.4.19" +serde = { version = "1.0.164", features = ["derive"] } serde_json = "1.0.96" # Local @@ -25,9 +25,9 @@ rococo-parachain-runtime = { path = "../parachains/runtimes/testing/rococo-parac shell-runtime = { path = "../parachains/runtimes/starters/shell" } glutton-runtime = { path = "../parachains/runtimes/glutton/glutton-kusama" } seedling-runtime = { path = "../parachains/runtimes/starters/seedling" } -statemint-runtime = { path = "../parachains/runtimes/assets/statemint" } -statemine-runtime = { path = "../parachains/runtimes/assets/statemine" } -westmint-runtime = { path = "../parachains/runtimes/assets/westmint" } +asset-hub-polkadot-runtime = { path = "../parachains/runtimes/assets/asset-hub-polkadot" } +asset-hub-kusama-runtime = { path = "../parachains/runtimes/assets/asset-hub-kusama" } +asset-hub-westend-runtime = { path = "../parachains/runtimes/assets/asset-hub-westend" } collectives-polkadot-runtime = { path = "../parachains/runtimes/collectives/collectives-polkadot" } contracts-rococo-runtime = { path = "../parachains/runtimes/contracts/contracts-rococo" } bridge-hub-rococo-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-rococo" } @@ -99,8 +99,8 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate" [dev-dependencies] assert_cmd = "2.0" nix = { version = "0.26.1", features = ["signal"] } -tempfile = "3.5.0" -tokio = { version = "1.28.1", features = ["macros", "time", "parking_lot"] } +tempfile = "3.6.0" +tokio = { version = "1.28.2", 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"] } @@ -109,9 +109,9 @@ polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "maste default = [] runtime-benchmarks = [ "polkadot-service/runtime-benchmarks", - "statemint-runtime/runtime-benchmarks", - "statemine-runtime/runtime-benchmarks", - "westmint-runtime/runtime-benchmarks", + "asset-hub-polkadot-runtime/runtime-benchmarks", + "asset-hub-kusama-runtime/runtime-benchmarks", + "asset-hub-westend-runtime/runtime-benchmarks", "bridge-hub-rococo-runtime/runtime-benchmarks", "bridge-hub-kusama-runtime/runtime-benchmarks", "bridge-hub-polkadot-runtime/runtime-benchmarks", @@ -122,9 +122,9 @@ runtime-benchmarks = [ "penpal-runtime/runtime-benchmarks", ] try-runtime = [ - "statemint-runtime/try-runtime", - "statemine-runtime/try-runtime", - "westmint-runtime/try-runtime", + "asset-hub-polkadot-runtime/try-runtime", + "asset-hub-kusama-runtime/try-runtime", + "asset-hub-westend-runtime/try-runtime", "shell-runtime/try-runtime", "try-runtime-cli/try-runtime", ] diff --git a/polkadot-parachain/src/chain_spec/statemint.rs b/polkadot-parachain/src/chain_spec/asset_hubs.rs similarity index 71% rename from polkadot-parachain/src/chain_spec/statemint.rs rename to polkadot-parachain/src/chain_spec/asset_hubs.rs index e12a5d12e17..9188431bdf5 100644 --- a/polkadot-parachain/src/chain_spec/statemint.rs +++ b/polkadot-parachain/src/chain_spec/asset_hubs.rs @@ -19,61 +19,66 @@ use crate::chain_spec::{ }; use cumulus_primitives_core::ParaId; use hex_literal::hex; -use parachains_common::{AccountId, AuraId, Balance as StatemintBalance, StatemintAuraId}; +use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance as AssetHubBalance}; use sc_service::ChainType; use sp_core::{crypto::UncheckedInto, sr25519}; /// Specialized `ChainSpec` for the normal parachain runtime. -pub type StatemintChainSpec = - sc_service::GenericChainSpec; -pub type StatemineChainSpec = - sc_service::GenericChainSpec; -pub type WestmintChainSpec = - sc_service::GenericChainSpec; +pub type AssetHubPolkadotChainSpec = + sc_service::GenericChainSpec; +pub type AssetHubKusamaChainSpec = + sc_service::GenericChainSpec; +pub type AssetHubWestendChainSpec = + sc_service::GenericChainSpec; -const STATEMINT_ED: StatemintBalance = statemint_runtime::constants::currency::EXISTENTIAL_DEPOSIT; -const STATEMINE_ED: StatemintBalance = statemine_runtime::constants::currency::EXISTENTIAL_DEPOSIT; -const WESTMINT_ED: StatemintBalance = westmint_runtime::constants::currency::EXISTENTIAL_DEPOSIT; +const ASSET_HUB_POLKADOT_ED: AssetHubBalance = + asset_hub_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT; +const ASSET_HUB_KUSAMA_ED: AssetHubBalance = + asset_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT; +const ASSET_HUB_WESTEND_ED: AssetHubBalance = + asset_hub_westend_runtime::constants::currency::EXISTENTIAL_DEPOSIT; /// Generate the session keys from individual elements. /// /// The input must be a tuple of individual keys (a single arg for now since we have just one key). -pub fn statemint_session_keys(keys: StatemintAuraId) -> statemint_runtime::SessionKeys { - statemint_runtime::SessionKeys { aura: keys } +pub fn asset_hub_polkadot_session_keys( + keys: AssetHubPolkadotAuraId, +) -> asset_hub_polkadot_runtime::SessionKeys { + asset_hub_polkadot_runtime::SessionKeys { aura: keys } } /// Generate the session keys from individual elements. /// /// The input must be a tuple of individual keys (a single arg for now since we have just one key). -pub fn statemine_session_keys(keys: AuraId) -> statemine_runtime::SessionKeys { - statemine_runtime::SessionKeys { aura: keys } +pub fn asset_hub_kusama_session_keys(keys: AuraId) -> asset_hub_kusama_runtime::SessionKeys { + asset_hub_kusama_runtime::SessionKeys { aura: keys } } /// Generate the session keys from individual elements. /// /// The input must be a tuple of individual keys (a single arg for now since we have just one key). -pub fn westmint_session_keys(keys: AuraId) -> westmint_runtime::SessionKeys { - westmint_runtime::SessionKeys { aura: keys } +pub fn asset_hub_westend_session_keys(keys: AuraId) -> asset_hub_westend_runtime::SessionKeys { + asset_hub_westend_runtime::SessionKeys { aura: keys } } -pub fn statemint_development_config() -> StatemintChainSpec { +pub fn asset_hub_polkadot_development_config() -> AssetHubPolkadotChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("ss58Format".into(), 0.into()); properties.insert("tokenSymbol".into(), "DOT".into()); properties.insert("tokenDecimals".into(), 10.into()); - StatemintChainSpec::from_genesis( + AssetHubPolkadotChainSpec::from_genesis( // Name - "Statemint Development", + "Polkadot Asset Hub Development", // ID - "statemint_dev", + "asset-hub-polkadot-dev", ChainType::Local, move || { - statemint_genesis( + asset_hub_polkadot_genesis( // initial collators. vec![( get_account_id_from_seed::("Alice"), - get_collator_keys_from_seed::("Alice"), + get_collator_keys_from_seed::("Alice"), )], vec![ get_account_id_from_seed::("Alice"), @@ -93,29 +98,29 @@ pub fn statemint_development_config() -> StatemintChainSpec { ) } -pub fn statemint_local_config() -> StatemintChainSpec { +pub fn asset_hub_polkadot_local_config() -> AssetHubPolkadotChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("ss58Format".into(), 0.into()); properties.insert("tokenSymbol".into(), "DOT".into()); properties.insert("tokenDecimals".into(), 10.into()); - StatemintChainSpec::from_genesis( + AssetHubPolkadotChainSpec::from_genesis( // Name - "Statemint Local", + "Polkadot Asset Hub Local", // ID - "statemint_local", + "asset-hub-polkadot-local", ChainType::Local, move || { - statemint_genesis( + asset_hub_polkadot_genesis( // initial collators. vec![ ( get_account_id_from_seed::("Alice"), - get_collator_keys_from_seed::("Alice"), + get_collator_keys_from_seed::("Alice"), ), ( get_account_id_from_seed::("Bob"), - get_collator_keys_from_seed::("Bob"), + get_collator_keys_from_seed::("Bob"), ), ], vec![ @@ -145,20 +150,20 @@ pub fn statemint_local_config() -> StatemintChainSpec { } // Not used for syncing, but just to determine the genesis values set for the upgrade from shell. -pub fn statemint_config() -> StatemintChainSpec { +pub fn asset_hub_polkadot_config() -> AssetHubPolkadotChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("ss58Format".into(), 0.into()); properties.insert("tokenSymbol".into(), "DOT".into()); properties.insert("tokenDecimals".into(), 10.into()); - StatemintChainSpec::from_genesis( + AssetHubPolkadotChainSpec::from_genesis( // Name - "Statemint", + "Polkadot Asset Hub", // ID - "statemint", + "asset-hub-polkadot", ChainType::Live, move || { - statemint_genesis( + asset_hub_polkadot_genesis( // initial collators. vec![ ( @@ -204,34 +209,38 @@ pub fn statemint_config() -> StatemintChainSpec { ) } -fn statemint_genesis( - invulnerables: Vec<(AccountId, StatemintAuraId)>, +fn asset_hub_polkadot_genesis( + invulnerables: Vec<(AccountId, AssetHubPolkadotAuraId)>, endowed_accounts: Vec, id: ParaId, -) -> statemint_runtime::GenesisConfig { - statemint_runtime::GenesisConfig { - system: statemint_runtime::SystemConfig { - code: statemint_runtime::WASM_BINARY +) -> asset_hub_polkadot_runtime::GenesisConfig { + asset_hub_polkadot_runtime::GenesisConfig { + system: asset_hub_polkadot_runtime::SystemConfig { + code: asset_hub_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), }, - balances: statemint_runtime::BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, STATEMINT_ED * 4096)).collect(), + balances: asset_hub_polkadot_runtime::BalancesConfig { + balances: endowed_accounts + .iter() + .cloned() + .map(|k| (k, ASSET_HUB_POLKADOT_ED * 4096)) + .collect(), }, - parachain_info: statemint_runtime::ParachainInfoConfig { parachain_id: id }, - collator_selection: statemint_runtime::CollatorSelectionConfig { + parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: STATEMINT_ED * 16, + candidacy_bond: ASSET_HUB_POLKADOT_ED * 16, ..Default::default() }, - session: statemint_runtime::SessionConfig { + session: asset_hub_polkadot_runtime::SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - statemint_session_keys(aura), // session keys + acc.clone(), // account id + acc, // validator id + asset_hub_polkadot_session_keys(aura), // session keys ) }) .collect(), @@ -241,26 +250,26 @@ fn statemint_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), - polkadot_xcm: statemint_runtime::PolkadotXcmConfig { + polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, } } -pub fn statemine_development_config() -> StatemineChainSpec { +pub fn asset_hub_kusama_development_config() -> AssetHubKusamaChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("ss58Format".into(), 2.into()); properties.insert("tokenSymbol".into(), "KSM".into()); properties.insert("tokenDecimals".into(), 12.into()); - StatemineChainSpec::from_genesis( + AssetHubKusamaChainSpec::from_genesis( // Name - "Statemine Development", + "Kusama Asset Hub Development", // ID - "statemine_dev", + "asset-hub-kusama-dev", ChainType::Local, move || { - statemine_genesis( + asset_hub_kusama_genesis( // initial collators. vec![( get_account_id_from_seed::("Alice"), @@ -284,20 +293,20 @@ pub fn statemine_development_config() -> StatemineChainSpec { ) } -pub fn statemine_local_config() -> StatemineChainSpec { +pub fn asset_hub_kusama_local_config() -> AssetHubKusamaChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("ss58Format".into(), 2.into()); properties.insert("tokenSymbol".into(), "KSM".into()); properties.insert("tokenDecimals".into(), 12.into()); - StatemineChainSpec::from_genesis( + AssetHubKusamaChainSpec::from_genesis( // Name - "Statemine Local", + "Kusama Asset Hub Local", // ID - "statemine_local", + "asset-hub-kusama-local", ChainType::Local, move || { - statemine_genesis( + asset_hub_kusama_genesis( // initial collators. vec![ ( @@ -335,20 +344,20 @@ pub fn statemine_local_config() -> StatemineChainSpec { ) } -pub fn statemine_config() -> StatemineChainSpec { +pub fn asset_hub_kusama_config() -> AssetHubKusamaChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("ss58Format".into(), 2.into()); properties.insert("tokenSymbol".into(), "KSM".into()); properties.insert("tokenDecimals".into(), 12.into()); - StatemineChainSpec::from_genesis( + AssetHubKusamaChainSpec::from_genesis( // Name - "Statemine", + "Kusama Asset Hub", // ID - "statemine", + "asset-hub-kusama", ChainType::Live, move || { - statemine_genesis( + asset_hub_kusama_genesis( // initial collators. vec![ ( @@ -389,38 +398,38 @@ pub fn statemine_config() -> StatemineChainSpec { ) } -fn statemine_genesis( +fn asset_hub_kusama_genesis( invulnerables: Vec<(AccountId, AuraId)>, endowed_accounts: Vec, id: ParaId, -) -> statemine_runtime::GenesisConfig { - statemine_runtime::GenesisConfig { - system: statemine_runtime::SystemConfig { - code: statemine_runtime::WASM_BINARY +) -> asset_hub_kusama_runtime::GenesisConfig { + asset_hub_kusama_runtime::GenesisConfig { + system: asset_hub_kusama_runtime::SystemConfig { + code: asset_hub_kusama_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), }, - balances: statemine_runtime::BalancesConfig { + balances: asset_hub_kusama_runtime::BalancesConfig { balances: endowed_accounts .iter() .cloned() - .map(|k| (k, STATEMINE_ED * 524_288)) + .map(|k| (k, ASSET_HUB_KUSAMA_ED * 524_288)) .collect(), }, - parachain_info: statemine_runtime::ParachainInfoConfig { parachain_id: id }, - collator_selection: statemine_runtime::CollatorSelectionConfig { + parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: STATEMINE_ED * 16, + candidacy_bond: ASSET_HUB_KUSAMA_ED * 16, ..Default::default() }, - session: statemine_runtime::SessionConfig { + session: asset_hub_kusama_runtime::SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - statemine_session_keys(aura), // session keys + acc.clone(), // account id + acc, // validator id + asset_hub_kusama_session_keys(aura), // session keys ) }) .collect(), @@ -428,25 +437,25 @@ fn statemine_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), - polkadot_xcm: statemine_runtime::PolkadotXcmConfig { + polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, } } -pub fn westmint_development_config() -> WestmintChainSpec { +pub fn asset_hub_westend_development_config() -> AssetHubWestendChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("tokenSymbol".into(), "WND".into()); properties.insert("tokenDecimals".into(), 12.into()); - WestmintChainSpec::from_genesis( + AssetHubWestendChainSpec::from_genesis( // Name - "Westmint Development", + "Westend Asset Hub Development", // ID - "westmint_dev", + "asset-hub-westend-dev", ChainType::Local, move || { - westmint_genesis( + asset_hub_westend_genesis( // initial collators. vec![( get_account_id_from_seed::("Alice"), @@ -470,19 +479,19 @@ pub fn westmint_development_config() -> WestmintChainSpec { ) } -pub fn westmint_local_config() -> WestmintChainSpec { +pub fn asset_hub_westend_local_config() -> AssetHubWestendChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("tokenSymbol".into(), "WND".into()); properties.insert("tokenDecimals".into(), 12.into()); - WestmintChainSpec::from_genesis( + AssetHubWestendChainSpec::from_genesis( // Name - "Westmint Local", + "Westend Asset Hub Local", // ID - "westmint_local", + "asset-hub-westend-local", ChainType::Local, move || { - westmint_genesis( + asset_hub_westend_genesis( // initial collators. vec![ ( @@ -520,19 +529,19 @@ pub fn westmint_local_config() -> WestmintChainSpec { ) } -pub fn westmint_config() -> WestmintChainSpec { +pub fn asset_hub_westend_config() -> AssetHubWestendChainSpec { let mut properties = sc_chain_spec::Properties::new(); properties.insert("tokenSymbol".into(), "WND".into()); properties.insert("tokenDecimals".into(), 12.into()); - WestmintChainSpec::from_genesis( + AssetHubWestendChainSpec::from_genesis( // Name - "Westmint", + "Westend Asset Hub", // ID - "westmint", + "asset-hub-westend", ChainType::Live, move || { - westmint_genesis( + asset_hub_westend_genesis( // initial collators. vec![ ( @@ -573,34 +582,38 @@ pub fn westmint_config() -> WestmintChainSpec { ) } -fn westmint_genesis( +fn asset_hub_westend_genesis( invulnerables: Vec<(AccountId, AuraId)>, endowed_accounts: Vec, id: ParaId, -) -> westmint_runtime::GenesisConfig { - westmint_runtime::GenesisConfig { - system: westmint_runtime::SystemConfig { - code: westmint_runtime::WASM_BINARY +) -> asset_hub_westend_runtime::GenesisConfig { + asset_hub_westend_runtime::GenesisConfig { + system: asset_hub_westend_runtime::SystemConfig { + code: asset_hub_westend_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), }, - balances: westmint_runtime::BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, WESTMINT_ED * 4096)).collect(), + balances: asset_hub_westend_runtime::BalancesConfig { + balances: endowed_accounts + .iter() + .cloned() + .map(|k| (k, ASSET_HUB_WESTEND_ED * 4096)) + .collect(), }, - parachain_info: westmint_runtime::ParachainInfoConfig { parachain_id: id }, - collator_selection: westmint_runtime::CollatorSelectionConfig { + parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: WESTMINT_ED * 16, + candidacy_bond: ASSET_HUB_WESTEND_ED * 16, ..Default::default() }, - session: westmint_runtime::SessionConfig { + session: asset_hub_westend_runtime::SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - westmint_session_keys(aura), // session keys + acc.clone(), // account id + acc, // validator id + asset_hub_westend_session_keys(aura), // session keys ) }) .collect(), @@ -610,7 +623,7 @@ fn westmint_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), - polkadot_xcm: westmint_runtime::PolkadotXcmConfig { + polkadot_xcm: asset_hub_westend_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, } diff --git a/polkadot-parachain/src/chain_spec/mod.rs b/polkadot-parachain/src/chain_spec/mod.rs index f53552768f3..d7014a9f43c 100644 --- a/polkadot-parachain/src/chain_spec/mod.rs +++ b/polkadot-parachain/src/chain_spec/mod.rs @@ -20,6 +20,7 @@ use serde::{Deserialize, Serialize}; use sp_core::{Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; +pub mod asset_hubs; pub mod bridge_hubs; pub mod collectives; pub mod contracts; @@ -28,7 +29,6 @@ pub mod penpal; pub mod rococo_parachain; pub mod seedling; pub mod shell; -pub mod statemint; /// The default XCM version to set in genesis config. const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; diff --git a/polkadot-parachain/src/cli.rs b/polkadot-parachain/src/cli.rs index 790951fb3b1..7be61810a7d 100644 --- a/polkadot-parachain/src/cli.rs +++ b/polkadot-parachain/src/cli.rs @@ -66,10 +66,10 @@ pub enum Subcommand { const AFTER_HELP_EXAMPLE: &str = color_print::cstr!( r#"Examples: - polkadot-parachain --chain statemint --sync warp -- --chain polkadot --sync warp - Launch a warp-syncing full node of the statemint parachain on the polkadot relay chain. - polkadot-parachain --chain statemint --sync warp --relay-chain-rpc-url ws://rpc.example.com -- --chain polkadot - Launch a warp-syncing full node of the statemint parachain on the polkadot relay chain. + polkadot-parachain --chain asset-hub-polkadot --sync warp -- --chain polkadot --sync warp + Launch a warp-syncing full node of the Asset Hub parachain on the Polkadot Relay Chain. + polkadot-parachain --chain asset-hub-polkadot --sync warp --relay-chain-rpc-url ws://rpc.example.com -- --chain polkadot + Launch a warp-syncing full node of the Asset Hub parachain on the Polkadot Relay Chain. Uses ws://rpc.example.com as remote relay chain node. "# ); diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index ab13c00099b..f59a58aa367 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -18,9 +18,10 @@ use crate::{ chain_spec, cli::{Cli, RelayChainCli, Subcommand}, service::{ - new_partial, Block, BridgeHubKusamaRuntimeExecutor, BridgeHubPolkadotRuntimeExecutor, - BridgeHubRococoRuntimeExecutor, CollectivesPolkadotRuntimeExecutor, GluttonRuntimeExecutor, - StatemineRuntimeExecutor, StatemintRuntimeExecutor, WestmintRuntimeExecutor, + new_partial, AssetHubKusamaExecutor, AssetHubPolkadotRuntimeExecutor, + AssetHubWestendExecutor, Block, BridgeHubKusamaRuntimeExecutor, + BridgeHubPolkadotRuntimeExecutor, BridgeHubRococoRuntimeExecutor, + CollectivesPolkadotRuntimeExecutor, GluttonRuntimeExecutor, }, }; use codec::Encode; @@ -28,7 +29,7 @@ use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use log::{info, warn}; -use parachains_common::{AuraId, StatemintAuraId}; +use parachains_common::{AssetHubPolkadotAuraId, AuraId}; use sc_cli::{ ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli, @@ -47,9 +48,9 @@ enum Runtime { Default, Shell, Seedling, - Statemint, - Statemine, - Westmint, + AssetHubPolkadot, + AssetHubKusama, + AssetHubWestend, Penpal(ParaId), ContractsRococo, CollectivesPolkadot, @@ -93,12 +94,12 @@ fn runtime(id: &str) -> Runtime { Runtime::Shell } else if id.starts_with("seedling") { Runtime::Seedling - } else if id.starts_with("statemint") { - Runtime::Statemint - } else if id.starts_with("statemine") { - Runtime::Statemine - } else if id.starts_with("westmint") { - Runtime::Westmint + } else if id.starts_with("asset-hub-polkadot") | id.starts_with("statemint") { + Runtime::AssetHubPolkadot + } else if id.starts_with("asset-hub-kusama") | id.starts_with("statemine") { + Runtime::AssetHubKusama + } else if id.starts_with("asset-hub-westend") | id.starts_with("westmint") { + Runtime::AssetHubWestend } else if id.starts_with("penpal") { Runtime::Penpal(para_id.unwrap_or(ParaId::new(0))) } else if id.starts_with("contracts-rococo") { @@ -143,35 +144,47 @@ fn load_spec(id: &str) -> std::result::Result, String> { "shell" => Box::new(chain_spec::shell::get_shell_chain_spec()), "seedling" => Box::new(chain_spec::seedling::get_seedling_chain_spec()), - // -- Statemint - "statemint-dev" => Box::new(chain_spec::statemint::statemint_development_config()), - "statemint-local" => Box::new(chain_spec::statemint::statemint_local_config()), + // -- Asset Hub Polkadot + "asset-hub-polkadot-dev" | "statemint-dev" => + Box::new(chain_spec::asset_hubs::asset_hub_polkadot_development_config()), + "asset-hub-polkadot-local" | "statemint-local" => + Box::new(chain_spec::asset_hubs::asset_hub_polkadot_local_config()), // the chain spec as used for generating the upgrade genesis values - "statemint-genesis" => Box::new(chain_spec::statemint::statemint_config()), + "asset-hub-polkadot-genesis" | "statemint-genesis" => + Box::new(chain_spec::asset_hubs::asset_hub_polkadot_config()), // the shell-based chain spec as used for syncing - "statemint" => Box::new(chain_spec::statemint::StatemintChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/statemint.json")[..], - )?), + "asset-hub-polkadot" | "statemint" => + Box::new(chain_spec::asset_hubs::AssetHubPolkadotChainSpec::from_json_bytes( + &include_bytes!("../../parachains/chain-specs/asset-hub-polkadot.json")[..], + )?), - // -- Statemine - "statemine-dev" => Box::new(chain_spec::statemint::statemine_development_config()), - "statemine-local" => Box::new(chain_spec::statemint::statemine_local_config()), + // -- Asset Hub Kusama + "asset-hub-kusama-dev" | "statemine-dev" => + Box::new(chain_spec::asset_hubs::asset_hub_kusama_development_config()), + "asset-hub-kusama-local" | "statemine-local" => + Box::new(chain_spec::asset_hubs::asset_hub_kusama_local_config()), // the chain spec as used for generating the upgrade genesis values - "statemine-genesis" => Box::new(chain_spec::statemint::statemine_config()), + "asset-hub-kusama-genesis" | "statemine-genesis" => + Box::new(chain_spec::asset_hubs::asset_hub_kusama_config()), // the shell-based chain spec as used for syncing - "statemine" => Box::new(chain_spec::statemint::StatemineChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/statemine.json")[..], - )?), + "asset-hub-kusama" | "statemine" => + Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_bytes( + &include_bytes!("../../parachains/chain-specs/asset-hub-kusama.json")[..], + )?), - // -- Westmint - "westmint-dev" => Box::new(chain_spec::statemint::westmint_development_config()), - "westmint-local" => Box::new(chain_spec::statemint::westmint_local_config()), + // -- Asset Hub Westend + "asset-hub-westend-dev" | "westmint-dev" => + Box::new(chain_spec::asset_hubs::asset_hub_westend_development_config()), + "asset-hub-westend-local" | "westmint-local" => + Box::new(chain_spec::asset_hubs::asset_hub_westend_local_config()), // the chain spec as used for generating the upgrade genesis values - "westmint-genesis" => Box::new(chain_spec::statemint::westmint_config()), + "asset-hub-westend-genesis" | "westmint-genesis" => + Box::new(chain_spec::asset_hubs::asset_hub_westend_config()), // the shell-based chain spec as used for syncing - "westmint" => Box::new(chain_spec::statemint::WestmintChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/westmint.json")[..], - )?), + "asset-hub-westend" | "westmint" => + Box::new(chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_bytes( + &include_bytes!("../../parachains/chain-specs/asset-hub-westend.json")[..], + )?), // -- Polkadot Collectives "collectives-polkadot-dev" => @@ -239,12 +252,14 @@ fn load_spec(id: &str) -> std::result::Result, String> { path => { let path: PathBuf = path.into(); match path.runtime() { - Runtime::Statemint => - Box::new(chain_spec::statemint::StatemintChainSpec::from_json_file(path)?), - Runtime::Statemine => - Box::new(chain_spec::statemint::StatemineChainSpec::from_json_file(path)?), - Runtime::Westmint => - Box::new(chain_spec::statemint::WestmintChainSpec::from_json_file(path)?), + Runtime::AssetHubPolkadot => Box::new( + chain_spec::asset_hubs::AssetHubPolkadotChainSpec::from_json_file(path)?, + ), + Runtime::AssetHubKusama => + Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_file(path)?), + Runtime::AssetHubWestend => Box::new( + chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_file(path)?, + ), Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => Box::new( chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_file(path)?, ), @@ -338,9 +353,9 @@ impl SubstrateCli for Cli { fn native_runtime_version(chain_spec: &Box) -> &'static RuntimeVersion { match chain_spec.runtime() { - Runtime::Statemint => &statemint_runtime::VERSION, - Runtime::Statemine => &statemine_runtime::VERSION, - Runtime::Westmint => &westmint_runtime::VERSION, + Runtime::AssetHubPolkadot => &asset_hub_polkadot_runtime::VERSION, + Runtime::AssetHubKusama => &asset_hub_kusama_runtime::VERSION, + Runtime::AssetHubWestend => &asset_hub_westend_runtime::VERSION, Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => &collectives_polkadot_runtime::VERSION, Runtime::Shell => &shell_runtime::VERSION, @@ -399,24 +414,24 @@ impl SubstrateCli for RelayChainCli { macro_rules! construct_benchmark_partials { ($config:expr, |$partials:ident| $code:expr) => { match $config.chain_spec.runtime() { - Runtime::Statemine => { - let $partials = new_partial::( + Runtime::AssetHubKusama => { + let $partials = new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, )?; $code }, - Runtime::Westmint => { - let $partials = new_partial::( + Runtime::AssetHubWestend => { + let $partials = new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, )?; $code }, - Runtime::Statemint => { - let $partials = new_partial::( + Runtime::AssetHubPolkadot => { + let $partials = new_partial::( &$config, - crate::service::aura_build_import_queue::<_, StatemintAuraId>, + crate::service::aura_build_import_queue::<_, AssetHubPolkadotAuraId>, )?; $code }, @@ -436,9 +451,9 @@ macro_rules! construct_async_run { (|$components:ident, $cli:ident, $cmd:ident, $config:ident| $( $code:tt )* ) => {{ let runner = $cli.create_runner($cmd)?; match runner.config().chain_spec.runtime() { - Runtime::Westmint => { + Runtime::AssetHubWestend => { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, )?; @@ -446,9 +461,9 @@ macro_rules! construct_async_run { { $( $code )* }.map(|v| (v, task_manager)) }) }, - Runtime::Statemine => { + Runtime::AssetHubKusama => { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, )?; @@ -456,11 +471,11 @@ macro_rules! construct_async_run { { $( $code )* }.map(|v| (v, task_manager)) }) }, - Runtime::Statemint => { + Runtime::AssetHubPolkadot => { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, - crate::service::aura_build_import_queue::<_, StatemintAuraId>, + crate::service::aura_build_import_queue::<_, AssetHubPolkadotAuraId>, )?; let task_manager = $components.task_manager; { $( $code )* }.map(|v| (v, task_manager)) @@ -674,11 +689,11 @@ pub fn run() -> Result<()> { if cfg!(feature = "runtime-benchmarks") { runner.sync_run(|config| { match config.chain_spec.runtime() { - Runtime::Statemine => - cmd.run::(config), - Runtime::Westmint => cmd.run::(config), - Runtime::Statemint => - cmd.run::(config), + Runtime::AssetHubKusama => + cmd.run::(config), + Runtime::AssetHubWestend => cmd.run::(config), + Runtime::AssetHubPolkadot => + cmd.run::(config), Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => cmd.run::(config), Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { @@ -762,25 +777,25 @@ pub fn run() -> Result<()> { let info_provider = timestamp_with_aura_info(6000); match runner.config().chain_spec.runtime() { - Runtime::Statemine => runner.async_run(|_| { + Runtime::AssetHubKusama => runner.async_run(|_| { Ok(( - cmd.run::, _>(Some( + cmd.run::, _>(Some( info_provider, )), task_manager, )) }), - Runtime::Westmint => runner.async_run(|_| { + Runtime::AssetHubWestend => runner.async_run(|_| { Ok(( - cmd.run::, _>(Some( + cmd.run::, _>(Some( info_provider, )), task_manager, )) }), - Runtime::Statemint => runner.async_run(|_| { + Runtime::AssetHubPolkadot => runner.async_run(|_| { Ok(( - cmd.run::, _>(Some( + cmd.run::, _>(Some( info_provider, )), task_manager, @@ -858,6 +873,38 @@ pub fn run() -> Result<()> { let collator_options = cli.run.collator_options(); runner.run_node_until_exit(|config| async move { + // If Statemint (Statemine, Westmint, Rockmine) DB exists and we're using the + // asset-hub chain spec, then rename the base path to the new chain ID. In the case + // that both file paths exist, the node will exit, as the user must decide (by + // deleting one path) the information that they want to use as their DB. + let old_name = match config.chain_spec.id() { + "asset-hub-polkadot" => Some("statemint"), + "asset-hub-kusama" => Some("statemine"), + "asset-hub-westend" => Some("westmint"), + "asset-hub-rococo" => Some("rockmine"), + _ => None, + }; + + if let Some(old_name) = old_name { + let new_path = config.base_path.config_dir(config.chain_spec.id()); + let old_path = config.base_path.config_dir(old_name); + + if old_path.exists() && new_path.exists() { + return Err(format!( + "Found legacy {} path {} and new asset-hub path {}. Delete one path such that only one exists.", + old_name, old_path.display(), new_path.display() + ).into()) + } + + if old_path.exists() { + std::fs::rename(old_path.clone(), new_path.clone())?; + info!( + "Statemint renamed to Asset Hub. The filepath with associated data on disk has been renamed from {} to {}.", + old_path.display(), new_path.display() + ); + } + } + let hwbench = (!cli.no_hardware_benchmarks).then_some( config.database.path().map(|database_path| { let _ = std::fs::create_dir_all(database_path); @@ -900,22 +947,22 @@ pub fn run() -> Result<()> { } match config.chain_spec.runtime() { - Runtime::Statemint => crate::service::start_generic_aura_node::< - statemint_runtime::RuntimeApi, - StatemintAuraId, + Runtime::AssetHubPolkadot => crate::service::start_generic_aura_node::< + asset_hub_polkadot_runtime::RuntimeApi, + AssetHubPolkadotAuraId, >(config, polkadot_config, collator_options, id, hwbench) .await .map(|r| r.0) .map_err(Into::into), - Runtime::Statemine => crate::service::start_generic_aura_node::< - statemine_runtime::RuntimeApi, + Runtime::AssetHubKusama => crate::service::start_generic_aura_node::< + asset_hub_kusama_runtime::RuntimeApi, AuraId, >(config, polkadot_config, collator_options, id, hwbench) .await .map(|r| r.0) .map_err(Into::into), - Runtime::Westmint => crate::service::start_generic_aura_node::< - westmint_runtime::RuntimeApi, + Runtime::AssetHubWestend => crate::service::start_generic_aura_node::< + asset_hub_westend_runtime::RuntimeApi, AuraId, >(config, polkadot_config, collator_options, id, hwbench) .await @@ -1257,9 +1304,9 @@ mod tests { let path = store_configuration( &temp_dir, - Box::new(crate::chain_spec::statemint::statemine_local_config()), + Box::new(crate::chain_spec::asset_hubs::asset_hub_kusama_local_config()), ); - assert_eq!(Runtime::Statemine, path.runtime()); + assert_eq!(Runtime::AssetHubKusama, path.runtime()); let path = store_configuration( &temp_dir, diff --git a/polkadot-parachain/src/service.rs b/polkadot-parachain/src/service.rs index b4cc4ce4981..b493f3589ed 100644 --- a/polkadot-parachain/src/service.rs +++ b/polkadot-parachain/src/service.rs @@ -86,52 +86,52 @@ impl sc_executor::NativeExecutionDispatch for ShellRuntimeExecutor { } } -// Native Statemint executor instance. -pub struct StatemintRuntimeExecutor; +/// Native Asset Hub Polkadot (Statemint) executor instance. +pub struct AssetHubPolkadotRuntimeExecutor; -impl sc_executor::NativeExecutionDispatch for StatemintRuntimeExecutor { +impl sc_executor::NativeExecutionDispatch for AssetHubPolkadotRuntimeExecutor { type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; fn dispatch(method: &str, data: &[u8]) -> Option> { - statemint_runtime::api::dispatch(method, data) + asset_hub_polkadot_runtime::api::dispatch(method, data) } fn native_version() -> sc_executor::NativeVersion { - statemint_runtime::native_version() + asset_hub_polkadot_runtime::native_version() } } -/// Native Statemine executor instance. -pub struct StatemineRuntimeExecutor; +/// Native Asset Hub Kusama (Statemine) executor instance. +pub struct AssetHubKusamaExecutor; -impl sc_executor::NativeExecutionDispatch for StatemineRuntimeExecutor { +impl sc_executor::NativeExecutionDispatch for AssetHubKusamaExecutor { type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; fn dispatch(method: &str, data: &[u8]) -> Option> { - statemine_runtime::api::dispatch(method, data) + asset_hub_kusama_runtime::api::dispatch(method, data) } fn native_version() -> sc_executor::NativeVersion { - statemine_runtime::native_version() + asset_hub_kusama_runtime::native_version() } } -/// Native Westmint executor instance. -pub struct WestmintRuntimeExecutor; +/// Native Asset Hub Westend (Westmint) executor instance. +pub struct AssetHubWestendExecutor; -impl sc_executor::NativeExecutionDispatch for WestmintRuntimeExecutor { +impl sc_executor::NativeExecutionDispatch for AssetHubWestendExecutor { type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; fn dispatch(method: &str, data: &[u8]) -> Option> { - westmint_runtime::api::dispatch(method, data) + asset_hub_westend_runtime::api::dispatch(method, data) } fn native_version() -> sc_executor::NativeVersion { - westmint_runtime::native_version() + asset_hub_westend_runtime::native_version() } } -// Native Polkadot Collectives executor instance. +/// Native Polkadot Collectives executor instance. pub struct CollectivesPolkadotRuntimeExecutor; impl sc_executor::NativeExecutionDispatch for CollectivesPolkadotRuntimeExecutor { @@ -146,7 +146,7 @@ impl sc_executor::NativeExecutionDispatch for CollectivesPolkadotRuntimeExecutor } } -// Native BridgeHubPolkadot executor instance. +/// Native BridgeHubPolkadot executor instance. pub struct BridgeHubPolkadotRuntimeExecutor; impl sc_executor::NativeExecutionDispatch for BridgeHubPolkadotRuntimeExecutor { @@ -161,7 +161,7 @@ impl sc_executor::NativeExecutionDispatch for BridgeHubPolkadotRuntimeExecutor { } } -// Native BridgeHubKusama executor instance. +/// Native BridgeHubKusama executor instance. pub struct BridgeHubKusamaRuntimeExecutor; impl sc_executor::NativeExecutionDispatch for BridgeHubKusamaRuntimeExecutor { @@ -176,7 +176,7 @@ impl sc_executor::NativeExecutionDispatch for BridgeHubKusamaRuntimeExecutor { } } -// Native BridgeHubRococo executor instance. +/// Native BridgeHubRococo executor instance. pub struct BridgeHubRococoRuntimeExecutor; impl sc_executor::NativeExecutionDispatch for BridgeHubRococoRuntimeExecutor { @@ -191,7 +191,7 @@ impl sc_executor::NativeExecutionDispatch for BridgeHubRococoRuntimeExecutor { } } -// Native contracts executor instance. +/// Native contracts executor instance. pub struct ContractsRococoRuntimeExecutor; impl sc_executor::NativeExecutionDispatch for ContractsRococoRuntimeExecutor { @@ -1068,7 +1068,7 @@ where } } -/// Build the import queue for Statemint and other Aura-based runtimes. +/// Build the import queue for Aura-based runtimes. pub fn aura_build_import_queue( client: Arc>, block_import: ParachainBlockImport, @@ -1134,8 +1134,7 @@ where Ok(BasicQueue::new(verifier, Box::new(block_import), None, &spawner, registry)) } -/// Start an aura powered parachain node. -/// (collective-polkadot and statemine/t use this) +/// Start an aura powered parachain node. Asset Hub and Collectives use this. pub async fn start_generic_aura_node( parachain_config: Configuration, polkadot_config: Configuration, diff --git a/polkadot-parachain/tests/benchmark_storage_works.rs b/polkadot-parachain/tests/benchmark_storage_works.rs index b1c05609217..df3078b4dab 100644 --- a/polkadot-parachain/tests/benchmark_storage_works.rs +++ b/polkadot-parachain/tests/benchmark_storage_works.rs @@ -8,7 +8,7 @@ use std::{ use tempfile::tempdir; /// The runtimes that this command supports. -static RUNTIMES: [&str; 3] = ["westmint", "statemine", "statemint"]; +static RUNTIMES: [&str; 3] = ["asset-hub-westend", "asset-hub-kusama", "asset-hub-polkadot"]; /// The `benchmark storage` command works for the dev runtimes. #[test] diff --git a/primitives/utility/Cargo.toml b/primitives/utility/Cargo.toml index 58d5ee23c8e..2e6367ee2b9 100644 --- a/primitives/utility/Cargo.toml +++ b/primitives/utility/Cargo.toml @@ -6,7 +6,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 } +log = { version = "0.4.19", default-features = false } # Substrate frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index be9aa9b8348..29d06905925 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -8,9 +8,9 @@ __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ${__dir}/benchmarks-ci.sh collectives collectives-polkadot target/$target $steps $repeat -${__dir}/benchmarks-ci.sh assets statemine target/$target $steps $repeat -${__dir}/benchmarks-ci.sh assets statemint target/$target $steps $repeat -${__dir}/benchmarks-ci.sh assets westmint target/$target $steps $repeat +${__dir}/benchmarks-ci.sh assets asset-hub-kusama target/$target $steps $repeat +${__dir}/benchmarks-ci.sh assets asset-hub-polkadot target/$target $steps $repeat +${__dir}/benchmarks-ci.sh assets asset-hub-westend target/$target $steps $repeat ${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-polkadot target/$target $steps $repeat ${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-kusama target/$target $steps $repeat diff --git a/scripts/bridges_rococo_wococo.sh b/scripts/bridges_rococo_wococo.sh index 2d918e244a9..1117ed68109 100755 --- a/scripts/bridges_rococo_wococo.sh +++ b/scripts/bridges_rococo_wococo.sh @@ -2,10 +2,10 @@ # Address: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # AccountId: [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] -STATEMINE_ACCOUNT_SEED_FOR_LOCAL="//Alice" +ASSET_HUB_KUSAMA_ACCOUNT_SEED_FOR_LOCAL="//Alice" # Address: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # AccountId: [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] -WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" +ASSET_HUB_WOCOCO_ACCOUNT_SEED_FOR_LOCAL="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" # SovereignAccount for `MultiLocation { parents: 2, interior: X2(GlobalConsensus(Rococo), Parachain(1000)) }` => 5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ # @@ -16,23 +16,23 @@ WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGK # MultiLocation { parents: 2, interior: X2(GlobalConsensus(Kusama), Parachain(1000)) }).unwrap() # ).to_ss58check_with_version(42_u16.into()) # ); -ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT="5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ" +ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT="5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ" # Address: GegTpZJMyzkntLN7NJhRfHDk4GWukLbGSsag6PHrLSrCK4h -ROCKMINE2_ACCOUNT_SEED_FOR_ROCOCO="scatter feed race company oxygen trip extra elbow slot bundle auto canoe" +ASSET_HUB2_ROCOCO_1000_SOVEREIGN_ACCOUNT="scatter feed race company oxygen trip extra elbow slot bundle auto canoe" # Adress: 5Ge7YcbctWCP1CccugzxWDn9hFnTxvTh3bL6PNy4ubNJmp7Y / H9jCvwVWsDJkrS4gPp1QB99qr4hmbGsVyAqn3F2PPaoWyU3 # AccountId: [202, 107, 198, 135, 15, 25, 193, 165, 172, 73, 137, 218, 115, 177, 204, 0, 5, 155, 215, 86, 208, 51, 50, 130, 190, 110, 184, 143, 124, 50, 160, 20] -WOCKMINT_ACCOUNT_ADDRESS_FOR_ROCOCO="5Ge7YcbctWCP1CccugzxWDn9hFnTxvTh3bL6PNy4ubNJmp7Y" -WOCKMINT_ACCOUNT_SEED_FOR_WOCOCO="tone spirit magnet sunset cannon poverty forget lock river east blouse random" +ASSET_HUB_WOCOCO_ACCOUNT_ADDRESS_FOR_ROCOCO="5Ge7YcbctWCP1CccugzxWDn9hFnTxvTh3bL6PNy4ubNJmp7Y" +ASSET_HUB_WOCOCO_ACCOUNT_SEED_FOR_WOCOCO="tone spirit magnet sunset cannon poverty forget lock river east blouse random" function address_to_account_id_bytes() { local address=$1 local output=$2 echo "address_to_account_id_bytes - address: $address, output: $output" - if [ $address == "$WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL" ]; then + if [ $address == "$ASSET_HUB_WOCOCO_ACCOUNT_SEED_FOR_LOCAL" ]; then jq --null-input '[212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125]' > $output - elif [ $address == "$WOCKMINT_ACCOUNT_ADDRESS_FOR_ROCOCO" ]; then + elif [ $address == "$ASSET_HUB_WOCOCO_ACCOUNT_ADDRESS_FOR_ROCOCO" ]; then jq --null-input '[202, 107, 198, 135, 15, 25, 193, 165, 172, 73, 137, 218, 115, 177, 204, 0, 5, 155, 215, 86, 208, 51, 50, 130, 190, 110, 184, 143, 124, 50, 160, 20]' > $output else echo -n "Sorry, unknown address: $address - please, add bytes here or function for that!" @@ -382,7 +382,7 @@ function remove_assets_transfer_send() { } # TODO: we need to fill sovereign account for bridge-hub, because, small ammouts does not match ExistentialDeposit, so no reserve pass -# SA for BH: MultiLocation { parents: 1, interior: X1(Parachain(1013)) } - 5Eg2fntRRwLinojmk3sh5xscp7F3S6Zzm5oDVtoLTALKiypR on Statemine +# SA for BH: MultiLocation { parents: 1, interior: X1(Parachain(1013)) } - 5Eg2fntRRwLinojmk3sh5xscp7F3S6Zzm5oDVtoLTALKiypR on Kusama Asset Hub function transfer_asset_via_bridge() { local url=$1 @@ -583,12 +583,12 @@ case "$1" in run_relay ;; allow-transfers-local) - # this allows send transfers on statemine (by governance-like) - ./$0 "allow-transfer-on-statemine-local" - # this allows receive transfers on westmint (by governance-like) - ./$0 "allow-transfer-on-westmint-local" + # this allows send transfers on asset hub kusama local (by governance-like) + ./$0 "allow-transfer-on-asset-hub-kusama-local" + # this allows receive transfers on asset hub westend local (by governance-like) + ./$0 "allow-transfer-on-asset-hub-westend-local" ;; - allow-transfer-on-statemine-local) + allow-transfer-on-asset-hub-kusama-local) ensure_polkadot_js_api allow_assets_transfer_send \ "ws://127.0.0.1:9942" \ @@ -598,7 +598,7 @@ case "$1" in 1013 \ "Wococo" 1000 ;; - allow-transfer-on-westmint-local) + allow-transfer-on-asset-hub-westend-local) ensure_polkadot_js_api allow_assets_transfer_receive \ "ws://127.0.0.1:9945" \ @@ -611,18 +611,18 @@ case "$1" in transfer_balance \ "ws://127.0.0.1:9010" \ "//Alice" \ - "$ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT" \ + "$ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT" \ $((1000000000 + 50000000000 * 20)) # ExistentialDeposit + maxTargetLocationFee * 20 - # create foreign assets for native Statemine token (yes, Kusama, because we are using Statemine runtime on rococo) + # create foreign assets for native Kusama token (yes, Kusama, because we are using Kusama Asset Hub runtime on rococo) force_create_foreign_asset \ "ws://127.0.0.1:9945" \ "//Alice" \ 1000 \ "ws://127.0.0.1:9010" \ "Kusama" \ - "$ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT" + "$ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT" ;; - remove-assets-transfer-from-statemine-local) + remove-assets-transfer-from-asset-hub-kusama-local) ensure_polkadot_js_api remove_assets_transfer_send \ "ws://127.0.0.1:9942" \ @@ -631,43 +631,43 @@ case "$1" in "ws://127.0.0.1:9910" \ "Wococo" ;; - transfer-asset-from-statemine-local) + transfer-asset-from-asset-hub-kusama-local) ensure_polkadot_js_api transfer_asset_via_bridge \ "ws://127.0.0.1:9910" \ - "$STATEMINE_ACCOUNT_SEED_FOR_LOCAL" \ - "$WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL" \ + "$ASSET_HUB_KUSAMA_ACCOUNT_SEED_FOR_LOCAL" \ + "$ASSET_HUB_WOCOCO_ACCOUNT_SEED_FOR_LOCAL" \ "Wococo" ;; - ping-via-bridge-from-statemine-local) + ping-via-bridge-from-asset-hub-kusama-local) ensure_polkadot_js_api ping_via_bridge \ "ws://127.0.0.1:9910" \ - "$STATEMINE_ACCOUNT_SEED_FOR_LOCAL" \ - "$WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL" \ + "$ASSET_HUB_KUSAMA_ACCOUNT_SEED_FOR_LOCAL" \ + "$ASSET_HUB_WOCOCO_ACCOUNT_SEED_FOR_LOCAL" \ "Wococo" ;; - transfer-asset-from-statemine-rococo) + transfer-asset-from-asset-hub-rococo) ensure_polkadot_js_api transfer_asset_via_bridge \ "wss://ws-rococo-rockmine2-collator-node-0.parity-testnet.parity.io" \ - "$ROCKMINE2_ACCOUNT_SEED_FOR_ROCOCO" \ - "$WOCKMINT_ACCOUNT_ADDRESS_FOR_ROCOCO" \ + "$ASSET_HUB2_ROCOCO_1000_SOVEREIGN_ACCOUNT" \ + "$ASSET_HUB_WOCOCO_ACCOUNT_ADDRESS_FOR_ROCOCO" \ "Wococo" ;; - ping-via-bridge-from-statemine-rococo) + ping-via-bridge-from-asset-hub-rococo) ensure_polkadot_js_api ping_via_bridge \ "wss://ws-rococo-rockmine2-collator-node-0.parity-testnet.parity.io" \ - "${ROCKMINE2_ACCOUNT_SEED_FOR_ROCOCO}" \ - "$WOCKMINT_ACCOUNT_ADDRESS_FOR_ROCOCO" \ + "${ASSET_HUB2_ROCOCO_1000_SOVEREIGN_ACCOUNT}" \ + "$ASSET_HUB_WOCOCO_ACCOUNT_ADDRESS_FOR_ROCOCO" \ "Wococo" ;; drip) transfer_balance \ "ws://127.0.0.1:9010" \ "//Alice" \ - "$ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT" \ + "$ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT" \ $((1000000000 + 50000000000 * 20)) ;; stop) @@ -682,14 +682,14 @@ case "$1" in Local (zombienet) run: - run-relay - allow-transfers-local - - allow-transfer-on-statemine-local - - allow-transfer-on-westmint-local - - remove-assets-transfer-from-statemine-local - - transfer-asset-from-statemine-local - - ping-via-bridge-from-statemine-local + - allow-transfer-on-asset-hub-kusama-local + - allow-transfer-on-asset-hub-westend-local + - remove-assets-transfer-from-asset-hub-kusama-local + - transfer-asset-from-asset-hub-kusama-local + - ping-via-bridge-from-asset-hub-kusama-local Live Rococo/Wococo run: - - transfer-asset-from-statemine-rococo - - ping-via-bridge-from-statemine-rococo"; + - transfer-asset-from-asset-hub-rococo + - ping-via-bridge-from-asset-hub-rococo"; exit 1 ;; esac diff --git a/scripts/ci/gitlab/pipeline/benchmarks.yml b/scripts/ci/gitlab/pipeline/benchmarks.yml index d1fdd64c341..011e750a735 100644 --- a/scripts/ci/gitlab/pipeline/benchmarks.yml +++ b/scripts/ci/gitlab/pipeline/benchmarks.yml @@ -22,13 +22,13 @@ benchmarks-assets: before_script: - !reference [.docker-env, before_script] script: - - ./scripts/benchmarks-ci.sh assets statemine ./artifacts - - ./scripts/benchmarks-ci.sh assets statemint ./artifacts - - ./scripts/benchmarks-ci.sh assets westmint ./artifacts + - ./scripts/benchmarks-ci.sh assets asset-hub-kusama ./artifacts + - ./scripts/benchmarks-ci.sh assets asset-hub-polkadot ./artifacts + - ./scripts/benchmarks-ci.sh assets asset-hub-westend ./artifacts - export CURRENT_TIME=$(date '+%s') - - export BRANCHNAME="weights-statemint-${CI_COMMIT_BRANCH}-${CURRENT_TIME}" + - export BRANCHNAME="weights-asset-hub-polkadot-${CI_COMMIT_BRANCH}-${CURRENT_TIME}" - !reference [.git-commit-push, script] - - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for statemine/t" "$BRANCHNAME" + - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for asset-hub-kusama/t" "$BRANCHNAME" - rm -f ./artifacts/polkadot-parachain - rm -f ./artifacts/test-parachain after_script: diff --git a/scripts/create_glutton_spec.sh b/scripts/create_glutton_spec.sh index 571a84b57a0..c5158392f52 100755 --- a/scripts/create_glutton_spec.sh +++ b/scripts/create_glutton_spec.sh @@ -5,11 +5,11 @@ # - Use the `polkadot-parachain` binary; # - Use `rococo` as the parent Relay Chain; # - Generate `ParaId`s from 1,300 to 1,370, inclusive; -# - Set the Sudo key to `G7Z5mTmTQsjEGBVqVGDZyR9m7RoHNZJk6JeykyfKQ3vmBiR`; -# - Set `compute`, `storage`, and `trash_data_count` set to 50%, 50%, and 5,120, respectively; +# - Set the Sudo key to `GZ9YSgtib4kEMxWcpWfnXa1cnrumspTCTZSaNWWmMkJbWqW`; +# - Set `compute`, `storage`, and `trash_data_count` set to 50%, 131%, and 5,120, respectively; # - And save the results in `output-dir`. # -# ./scripts/create_glutton_spec.sh ./target/release/polkadot-parachain rococo 1300 1370 G7Z5mTmTQsjEGBVqVGDZyR9m7RoHNZJk6JeykyfKQ3vmBiR 500000000 500000000 5120 output-dir +# ./scripts/create_glutton_spec.sh ./target/release/polkadot-parachain rococo 1300 1370 GZ9YSgtib4kEMxWcpWfnXa1cnrumspTCTZSaNWWmMkJbWqW 500000000 1310000000 5120 output-dir usage() { echo Usage: @@ -68,8 +68,8 @@ for (( para_id=$from_para_id; para_id<=$to_para_id; para_id++ )); do | jq --argjson para_id $para_id '.para_id = $para_id' \ | jq --arg sudo $sudo '.genesis.runtime.sudo.key = $sudo' \ | jq --argjson para_id $para_id '.genesis.runtime.parachainInfo.parachainId = $para_id' \ - | jq --argjson compute $compute '.genesis.runtime.glutton.compute = $compute' \ - | jq --argjson storage $storage '.genesis.runtime.glutton.storage = $storage' \ + | jq --arg compute $compute '.genesis.runtime.glutton.compute = $compute' \ + | jq --arg storage $storage '.genesis.runtime.glutton.storage = $storage' \ | jq --argjson trash_data_count $trash_data_count '.genesis.runtime.glutton.trashDataCount = $trash_data_count' \ > $output_para_dir/glutton-$relay_chain-$para_id-spec.json diff --git a/scripts/generate_genesis_value.sh b/scripts/generate_genesis_value.sh index 07e9fca59d7..178e15fb8a9 100755 --- a/scripts/generate_genesis_value.sh +++ b/scripts/generate_genesis_value.sh @@ -58,7 +58,7 @@ if [[ "$rpc_endpoint" =~ "localhost" ]]; then check_collator echo -e "Make sure you have a collator running with the correct version at $rpc_endpoint." echo -e "If you don't, NOW is the time to start it with:" - echo -e "target/release/polkadot-parachain --chain parachains/chain-specs/shell-statemint.json --tmp\n" + echo -e "target/release/polkadot-parachain --chain parachains/chain-specs/shell.json --tmp\n" read -p "You can abort with CTRL+C if this is not correct, otherwise press ENTER " fi diff --git a/scripts/parachains_integration_tests.sh b/scripts/parachains_integration_tests.sh index ed920f430fc..2a06b930e22 100755 --- a/scripts/parachains_integration_tests.sh +++ b/scripts/parachains_integration_tests.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash tests=( - statemine - statemint + asset-hub-kusama + asset-hub-polkadot ) rm -R logs &> /dev/null diff --git a/test/client/src/lib.rs b/test/client/src/lib.rs index cbf0459b816..b8c69fa6a76 100644 --- a/test/client/src/lib.rs +++ b/test/client/src/lib.rs @@ -22,11 +22,10 @@ use runtime::{ Balance, Block, BlockHashCount, GenesisConfig, Runtime, RuntimeCall, Signature, SignedExtra, SignedPayload, UncheckedExtrinsic, VERSION, }; -use sc_executor::{HeapAllocStrategy, WasmExecutionMethod, WasmExecutor}; +use sc_executor::HeapAllocStrategy; use sc_executor_common::runtime_blob::RuntimeBlob; -use sc_service::client; use sp_blockchain::HeaderBackend; -use sp_core::storage::Storage; +use sp_core::{sr25519, Pair}; use sp_io::TestExternalities; use sp_runtime::{generic::Era, BuildStorage, SaturatedConversion}; @@ -77,11 +76,22 @@ pub type Client = client::Client; /// Parameters of test-client builder with test-runtime. #[derive(Default)] -pub struct GenesisParameters; +pub struct GenesisParameters { + pub endowed_accounts: Vec, +} impl substrate_test_client::GenesisInit for GenesisParameters { fn genesis_storage(&self) -> Storage { - genesis_config().build_storage().unwrap() + if self.endowed_accounts.is_empty() { + genesis_config().build_storage().unwrap() + } else { + cumulus_test_service::testnet_genesis( + cumulus_test_service::get_account_id_from_seed::("Alice"), + self.endowed_accounts.clone(), + ) + .build_storage() + .unwrap() + } } } @@ -115,19 +125,26 @@ impl DefaultTestClientBuilderExt for TestClientBuilder { } fn genesis_config() -> GenesisConfig { - cumulus_test_service::local_testnet_genesis() + cumulus_test_service::testnet_genesis_with_default_endowed(Default::default()) } -/// Generate an extrinsic from the provided function call, origin and [`Client`]. -pub fn generate_extrinsic( +/// Create an unsigned extrinsic from a runtime call. +pub fn generate_unsigned(function: impl Into) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_unsigned(function.into()) +} + +/// Create a signed extrinsic from a runtime call and sign +/// with the given key pair. +pub fn generate_extrinsic_with_pair( client: &Client, - origin: sp_keyring::AccountKeyring, + origin: sp_core::sr25519::Pair, function: impl Into, + nonce: Option, ) -> UncheckedExtrinsic { let current_block_hash = client.info().best_hash; let current_block = client.info().best_number.saturated_into(); let genesis_block = client.hash(0).unwrap().unwrap(); - let nonce = 0; + let nonce = nonce.unwrap_or_default(); let period = BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64; let tip = 0; @@ -158,6 +175,15 @@ pub fn generate_extrinsic( ) } +/// Generate an extrinsic from the provided function call, origin and [`Client`]. +pub fn generate_extrinsic( + client: &Client, + origin: sp_keyring::AccountKeyring, + function: impl Into, +) -> UncheckedExtrinsic { + generate_extrinsic_with_pair(client, origin.into(), function, None) +} + /// Transfer some token from one account to another using a provided test [`Client`]. pub fn transfer( client: &Client, diff --git a/test/runtime/Cargo.toml b/test/runtime/Cargo.toml index 6f829c27492..130ffcdc298 100644 --- a/test/runtime/Cargo.toml +++ b/test/runtime/Cargo.toml @@ -16,6 +16,7 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate" pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-glutton = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -50,6 +51,7 @@ std = [ "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment/std", + "pallet-glutton/std", "sp-api/std", "sp-block-builder/std", "sp-core/std", diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index 7633da1ea54..25841acb11b 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -57,8 +57,12 @@ pub use frame_support::{ }, StorageValue, }; -use frame_system::limits::{BlockLength, BlockWeights}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; pub use pallet_balances::Call as BalancesCall; +pub use pallet_glutton::Call as GluttonCall; pub use pallet_sudo::Call as SudoCall; pub use pallet_timestamp::Call as TimestampCall; #[cfg(any(feature = "std", test))] @@ -265,6 +269,12 @@ impl pallet_sudo::Config for Runtime { type WeightInfo = pallet_sudo::weights::SubstrateWeight; } +impl pallet_glutton::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type AdminOrigin = EnsureRoot; + type WeightInfo = pallet_glutton::weights::SubstrateWeight; +} + impl cumulus_pallet_parachain_system::Config for Runtime { type SelfParaId = ParachainId; type RuntimeEvent = RuntimeEvent; @@ -296,6 +306,7 @@ construct_runtime! { Sudo: pallet_sudo, TransactionPayment: pallet_transaction_payment, TestPallet: test_pallet, + Glutton: pallet_glutton, } } diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 1ad45f57fa1..72599f6a439 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -10,15 +10,16 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.68" -clap = { version = "4.3.0", features = ["derive"] } +clap = { version = "4.3.3", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } criterion = { version = "0.5.1", features = [ "async_tokio" ] } jsonrpsee = { version = "0.16.2", features = ["server"] } rand = "0.8.5" -serde = { version = "1.0.163", features = ["derive"] } -tokio = { version = "1.28.1", features = ["macros"] } +serde = { version = "1.0.164", features = ["derive"] } +tokio = { version = "1.28.2", features = ["macros"] } tracing = "0.1.37" -url = "2.3.1" +url = "2.4.0" +tempfile = "3.6.0" # Substrate frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -39,14 +40,19 @@ sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "mas sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-executor-wasmtime = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-executor-common = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } @@ -70,10 +76,18 @@ cumulus-test-relay-validation-worker-provider = { path = "../relay-validation-wo cumulus-test-runtime = { path = "../runtime" } cumulus-relay-chain-minimal-node = { path = "../../client/relay-chain-minimal-node" } cumulus-client-pov-recovery = { path = "../../client/pov-recovery" } +cumulus-test-relay-sproof-builder = { path = "../relay-sproof-builder" } +cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" } [dev-dependencies] futures = "0.3.28" portpicker = "0.1.1" +rococo-parachain-runtime = { path = "../../parachains/runtimes/testing/rococo-parachain" } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" } +cumulus-test-client = { path = "../client" } # Polkadot dependencies polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch = "master" } @@ -88,3 +102,27 @@ runtime-benchmarks = ["polkadot-test-service/runtime-benchmarks"] [[bench]] name = "transaction_throughput" harness = false + +[[bench]] +name = "block_import" +harness = false + +[[bench]] +name = "block_production" +harness = false + +[[bench]] +name = "block_production_glutton" +harness = false + +[[bench]] +name = "block_import_glutton" +harness = false + +[[bench]] +name = "validate_block" +harness = false + +[[bench]] +name = "validate_block_glutton" +harness = false diff --git a/test/service/benches/block_import.rs b/test/service/benches/block_import.rs new file mode 100644 index 00000000000..b79598b1530 --- /dev/null +++ b/test/service/benches/block_import.rs @@ -0,0 +1,79 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput}; + +use sc_client_api::UsageProvider; + +use core::time::Duration; +use cumulus_primitives_core::ParaId; + +use sc_block_builder::{BlockBuilderProvider, RecordProof}; +use sp_api::{Core, ProvideRuntimeApi}; +use sp_keyring::Sr25519Keyring::Alice; + +use cumulus_test_service::bench_utils as utils; + +fn benchmark_block_import(c: &mut Criterion) { + sp_tracing::try_init_simple(); + + let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed"); + let para_id = ParaId::from(100); + let tokio_handle = runtime.handle(); + + // Create enough accounts to fill the block with transactions. + // Each account should only be included in one transfer. + let (src_accounts, dst_accounts, account_ids) = utils::create_benchmark_accounts(); + + let alice = runtime.block_on( + cumulus_test_service::TestNodeBuilder::new(para_id, tokio_handle.clone(), Alice) + // Preload all accounts with funds for the transfers + .endowed_accounts(account_ids) + .build(), + ); + + let client = alice.client; + + let (max_transfer_count, extrinsics) = + utils::create_benchmarking_transfer_extrinsics(&client, &src_accounts, &dst_accounts); + + let parent_hash = client.usage_info().chain.best_hash; + let mut block_builder = + client.new_block_at(parent_hash, Default::default(), RecordProof::No).unwrap(); + for extrinsic in extrinsics { + block_builder.push(extrinsic).unwrap(); + } + let benchmark_block = block_builder.build().unwrap(); + + let mut group = c.benchmark_group("Block import"); + group.sample_size(20); + group.measurement_time(Duration::from_secs(120)); + group.throughput(Throughput::Elements(max_transfer_count as u64)); + + group.bench_function(format!("(transfers = {}) block import", max_transfer_count), |b| { + b.iter_batched( + || benchmark_block.block.clone(), + |block| { + client.runtime_api().execute_block(parent_hash, block).unwrap(); + }, + BatchSize::SmallInput, + ) + }); +} + +criterion_group!(benches, benchmark_block_import); +criterion_main!(benches); diff --git a/test/service/benches/block_import_glutton.rs b/test/service/benches/block_import_glutton.rs new file mode 100644 index 00000000000..b49db9f449e --- /dev/null +++ b/test/service/benches/block_import_glutton.rs @@ -0,0 +1,94 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; + +use sc_client_api::UsageProvider; +use sp_api::{Core, ProvideRuntimeApi}; +use sp_arithmetic::{ + traits::{One, Zero}, + FixedPointNumber, +}; + +use core::time::Duration; +use cumulus_primitives_core::ParaId; + +use sc_block_builder::{BlockBuilderProvider, RecordProof}; +use sp_keyring::Sr25519Keyring::Alice; + +use cumulus_test_service::bench_utils as utils; + +fn benchmark_block_import(c: &mut Criterion) { + sp_tracing::try_init_simple(); + + let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed"); + let para_id = ParaId::from(100); + let tokio_handle = runtime.handle(); + + let alice = runtime.block_on( + cumulus_test_service::TestNodeBuilder::new(para_id, tokio_handle.clone(), Alice).build(), + ); + let client = alice.client; + + let mut group = c.benchmark_group("Block import"); + group.sample_size(20); + group.measurement_time(Duration::from_secs(120)); + + let mut initialize_glutton_pallet = true; + for (compute_ratio, storage_ratio) in &[(One::one(), Zero::zero()), (One::one(), One::one())] { + let block = utils::set_glutton_parameters( + &client, + initialize_glutton_pallet, + compute_ratio, + storage_ratio, + ); + initialize_glutton_pallet = false; + + runtime.block_on(utils::import_block(&client, &block, false)); + + // Build the block we will use for benchmarking + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + let mut block_builder = + client.new_block_at(parent_hash, Default::default(), RecordProof::No).unwrap(); + block_builder + .push(utils::extrinsic_set_validation_data(parent_header.clone()).clone()) + .unwrap(); + block_builder.push(utils::extrinsic_set_time(&client)).unwrap(); + let benchmark_block = block_builder.build().unwrap(); + + group.bench_function( + format!( + "(compute = {:?} %, storage = {:?} %) block import", + compute_ratio.saturating_mul_int(100), + storage_ratio.saturating_mul_int(100) + ), + |b| { + b.iter_batched( + || benchmark_block.block.clone(), + |block| { + client.runtime_api().execute_block(parent_hash, block).unwrap(); + }, + BatchSize::SmallInput, + ) + }, + ); + } +} + +criterion_group!(benches, benchmark_block_import); +criterion_main!(benches); diff --git a/test/service/benches/block_production.rs b/test/service/benches/block_production.rs new file mode 100644 index 00000000000..1b868d73630 --- /dev/null +++ b/test/service/benches/block_production.rs @@ -0,0 +1,111 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput}; + +use sc_client_api::UsageProvider; + +use core::time::Duration; +use cumulus_primitives_core::ParaId; +use sc_block_builder::{BlockBuilderProvider, RecordProof}; + +use sp_keyring::Sr25519Keyring::Alice; + +use cumulus_test_service::bench_utils as utils; + +fn benchmark_block_production(c: &mut Criterion) { + sp_tracing::try_init_simple(); + + let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed"); + let tokio_handle = runtime.handle(); + + // Create enough accounts to fill the block with transactions. + // Each account should only be included in one transfer. + let (src_accounts, dst_accounts, account_ids) = utils::create_benchmark_accounts(); + + let para_id = ParaId::from(100); + let alice = runtime.block_on( + cumulus_test_service::TestNodeBuilder::new(para_id, tokio_handle.clone(), Alice) + // Preload all accounts with funds for the transfers + .endowed_accounts(account_ids) + .build(), + ); + let client = alice.client; + + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + let set_validation_data_extrinsic = utils::extrinsic_set_validation_data(parent_header); + + let mut block_builder = client.new_block(Default::default()).unwrap(); + block_builder.push(utils::extrinsic_set_time(&client)).unwrap(); + block_builder.push(set_validation_data_extrinsic).unwrap(); + let built_block = block_builder.build().unwrap(); + + runtime.block_on(utils::import_block(&client, &built_block.block, false)); + + let (max_transfer_count, extrinsics) = + utils::create_benchmarking_transfer_extrinsics(&client, &src_accounts, &dst_accounts); + + let mut group = c.benchmark_group("Block production"); + + group.sample_size(20); + group.measurement_time(Duration::from_secs(120)); + group.throughput(Throughput::Elements(max_transfer_count as u64)); + + let best_hash = client.chain_info().best_hash; + + group.bench_function( + format!("(proof = true, transfers = {}) block production", max_transfer_count), + |b| { + b.iter_batched( + || extrinsics.clone(), + |extrinsics| { + let mut block_builder = client + .new_block_at(best_hash, Default::default(), RecordProof::Yes) + .unwrap(); + for extrinsic in extrinsics { + block_builder.push(extrinsic).unwrap(); + } + block_builder.build().unwrap() + }, + BatchSize::SmallInput, + ) + }, + ); + + group.bench_function( + format!("(proof = false, transfers = {}) block production", max_transfer_count), + |b| { + b.iter_batched( + || extrinsics.clone(), + |extrinsics| { + let mut block_builder = client + .new_block_at(best_hash, Default::default(), RecordProof::No) + .unwrap(); + for extrinsic in extrinsics { + block_builder.push(extrinsic).unwrap(); + } + block_builder.build().unwrap() + }, + BatchSize::SmallInput, + ) + }, + ); +} + +criterion_group!(benches, benchmark_block_production); +criterion_main!(benches); diff --git a/test/service/benches/block_production_glutton.rs b/test/service/benches/block_production_glutton.rs new file mode 100644 index 00000000000..92a368c88c8 --- /dev/null +++ b/test/service/benches/block_production_glutton.rs @@ -0,0 +1,116 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; + +use sc_client_api::UsageProvider; +use sp_arithmetic::{ + traits::{One, Zero}, + FixedPointNumber, +}; + +use core::time::Duration; +use cumulus_primitives_core::ParaId; + +use sc_block_builder::{BlockBuilderProvider, RecordProof}; + +use sp_keyring::Sr25519Keyring::Alice; + +use cumulus_test_service::bench_utils as utils; + +fn benchmark_block_production_compute(c: &mut Criterion) { + sp_tracing::try_init_simple(); + + let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed"); + let tokio_handle = runtime.handle(); + + let para_id = ParaId::from(100); + let alice = runtime.block_on( + cumulus_test_service::TestNodeBuilder::new(para_id, tokio_handle.clone(), Alice).build(), + ); + let client = alice.client; + + let mut group = c.benchmark_group("Block production"); + + group.sample_size(20); + group.measurement_time(Duration::from_secs(120)); + + let mut initialize_glutton_pallet = true; + for (compute_ratio, storage_ratio) in &[(One::one(), Zero::zero()), (One::one(), One::one())] { + let block = utils::set_glutton_parameters( + &client, + initialize_glutton_pallet, + compute_ratio, + storage_ratio, + ); + runtime.block_on(utils::import_block(&client, &block, false)); + initialize_glutton_pallet = false; + + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + let set_validation_data_extrinsic = utils::extrinsic_set_validation_data(parent_header); + let set_time_extrinsic = utils::extrinsic_set_time(&client); + let best_hash = client.chain_info().best_hash; + + group.bench_function( + format!( + "(compute = {:?} %, storage = {:?} %) block import", + compute_ratio.saturating_mul_int(100), + storage_ratio.saturating_mul_int(100) + ), + |b| { + b.iter_batched( + || (set_validation_data_extrinsic.clone(), set_time_extrinsic.clone()), + |(validation_data, time)| { + let mut block_builder = client + .new_block_at(best_hash, Default::default(), RecordProof::Yes) + .unwrap(); + block_builder.push(validation_data).unwrap(); + block_builder.push(time).unwrap(); + block_builder.build().unwrap() + }, + BatchSize::SmallInput, + ) + }, + ); + + group.bench_function( + format!( + "(compute = {:?} %, storage = {:?} %) block import", + compute_ratio.saturating_mul_int(100), + storage_ratio.saturating_mul_int(100) + ), + |b| { + b.iter_batched( + || (set_validation_data_extrinsic.clone(), set_time_extrinsic.clone()), + |(validation_data, time)| { + let mut block_builder = client + .new_block_at(best_hash, Default::default(), RecordProof::No) + .unwrap(); + block_builder.push(validation_data).unwrap(); + block_builder.push(time).unwrap(); + block_builder.build().unwrap() + }, + BatchSize::SmallInput, + ) + }, + ); + } +} + +criterion_group!(benches, benchmark_block_production_compute); +criterion_main!(benches); diff --git a/test/service/benches/validate_block.rs b/test/service/benches/validate_block.rs new file mode 100644 index 00000000000..3f4c39e5aa9 --- /dev/null +++ b/test/service/benches/validate_block.rs @@ -0,0 +1,163 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use codec::{Decode, Encode}; +use core::time::Duration; +use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput}; +use cumulus_primitives_core::{relay_chain::AccountId, PersistedValidationData, ValidationParams}; +use cumulus_test_client::{ + generate_extrinsic_with_pair, BuildParachainBlockData, InitBlockBuilder, TestClientBuilder, + ValidationResult, +}; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use cumulus_test_runtime::{BalancesCall, Block, Header, UncheckedExtrinsic}; +use cumulus_test_service::bench_utils as utils; +use polkadot_primitives::HeadData; +use sc_block_builder::BlockBuilderProvider; +use sc_client_api::UsageProvider; +use sc_executor_common::wasm_runtime::WasmModule; + +use sp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed}; + +use sp_core::{sr25519, Pair}; + +use sp_runtime::{ + traits::Header as HeaderT, + transaction_validity::{InvalidTransaction, TransactionValidityError}, +}; + +fn create_extrinsics( + client: &cumulus_test_client::Client, + src_accounts: &[sr25519::Pair], + dst_accounts: &[sr25519::Pair], +) -> (usize, Vec) { + // Add as many tranfer extrinsics as possible into a single block. + let mut block_builder = client.new_block(Default::default()).unwrap(); + let mut max_transfer_count = 0; + let mut extrinsics = Vec::new(); + + for (src, dst) in src_accounts.iter().zip(dst_accounts.iter()) { + let extrinsic: UncheckedExtrinsic = generate_extrinsic_with_pair( + client, + src.clone(), + BalancesCall::transfer_keep_alive { dest: AccountId::from(dst.public()), value: 10000 }, + None, + ); + + match block_builder.push(extrinsic.clone()) { + Ok(_) => {}, + Err(ApplyExtrinsicFailed(Validity(TransactionValidityError::Invalid( + InvalidTransaction::ExhaustsResources, + )))) => break, + Err(error) => panic!("{}", error), + } + + extrinsics.push(extrinsic); + max_transfer_count += 1; + } + + (max_transfer_count, extrinsics) +} + +fn benchmark_block_validation(c: &mut Criterion) { + sp_tracing::try_init_simple(); + // Create enough accounts to fill the block with transactions. + // Each account should only be included in one transfer. + let (src_accounts, dst_accounts, account_ids) = utils::create_benchmark_accounts(); + + let mut test_client_builder = TestClientBuilder::with_default_backend() + .set_execution_strategy(sc_client_api::ExecutionStrategy::AlwaysWasm); + let genesis_init = test_client_builder.genesis_init_mut(); + *genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts: account_ids }; + let client = test_client_builder.build_with_native_executor(None).0; + + let (max_transfer_count, extrinsics) = create_extrinsics(&client, &src_accounts, &dst_accounts); + + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + let validation_data = PersistedValidationData { + relay_parent_number: 1, + parent_head: parent_header.encode().into(), + ..Default::default() + }; + + let mut block_builder = client.init_block_builder(Some(validation_data), Default::default()); + for extrinsic in extrinsics { + block_builder.push(extrinsic).unwrap(); + } + + let parachain_block = block_builder.build_parachain_block(*parent_header.state_root()); + + let proof_size_in_kb = parachain_block.storage_proof().encode().len() as f64 / 1024f64; + let runtime = utils::get_wasm_module(); + + let sproof_builder: RelayStateSproofBuilder = Default::default(); + let (relay_parent_storage_root, _) = sproof_builder.into_state_root_and_proof(); + let encoded_params = ValidationParams { + block_data: cumulus_test_client::BlockData(parachain_block.encode()), + parent_head: HeadData(parent_header.encode()), + relay_parent_number: 1, + relay_parent_storage_root, + } + .encode(); + + // This is not strictly necessary for this benchmark, but + // let us make sure that the result of `validate_block` is what + // we expect. + verify_expected_result(&runtime, &encoded_params, parachain_block.into_block()); + + let mut group = c.benchmark_group("Block validation"); + group.sample_size(20); + group.measurement_time(Duration::from_secs(120)); + group.throughput(Throughput::Elements(max_transfer_count as u64)); + + group.bench_function( + format!( + "(transfers = {}, proof_size = {}kb) block validation", + max_transfer_count, proof_size_in_kb + ), + |b| { + b.iter_batched( + || runtime.new_instance().unwrap(), + |mut instance| { + instance.call_export("validate_block", &encoded_params).unwrap(); + }, + BatchSize::SmallInput, + ) + }, + ); +} + +fn verify_expected_result( + runtime: &Box, + encoded_params: &[u8], + parachain_block: Block, +) { + let res = runtime + .new_instance() + .unwrap() + .call_export("validate_block", encoded_params) + .expect("Call `validate_block`."); + let validation_result = + ValidationResult::decode(&mut &res[..]).expect("Decode `ValidationResult`."); + let header = + Header::decode(&mut &validation_result.head_data.0[..]).expect("Decodes `Header`."); + assert_eq!(parachain_block.header, header); +} + +criterion_group!(benches, benchmark_block_validation); +criterion_main!(benches); diff --git a/test/service/benches/validate_block_glutton.rs b/test/service/benches/validate_block_glutton.rs new file mode 100644 index 00000000000..5f5fda07168 --- /dev/null +++ b/test/service/benches/validate_block_glutton.rs @@ -0,0 +1,211 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use codec::{Decode, Encode}; +use core::time::Duration; +use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; +use cumulus_primitives_core::{relay_chain::AccountId, PersistedValidationData, ValidationParams}; +use cumulus_test_client::{ + generate_extrinsic_with_pair, BuildParachainBlockData, Client, InitBlockBuilder, + ParachainBlockData, TestClientBuilder, ValidationResult, +}; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use cumulus_test_runtime::{Block, GluttonCall, Header, SudoCall}; +use polkadot_primitives::HeadData; +use sc_client_api::UsageProvider; +use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, StateAction}; +use sc_executor_common::wasm_runtime::WasmModule; +use sp_api::ProvideRuntimeApi; + +use frame_system_rpc_runtime_api::AccountNonceApi; +use sp_arithmetic::{ + traits::{One, Zero}, + FixedU64, +}; +use sp_consensus::BlockOrigin; +use sp_keyring::Sr25519Keyring::Alice; +use sp_runtime::traits::Header as HeaderT; + +use cumulus_test_service::bench_utils as utils; + +async fn import_block( + mut client: &cumulus_test_client::Client, + built: cumulus_test_runtime::Block, + import_existing: bool, +) { + let mut params = BlockImportParams::new(BlockOrigin::File, built.header.clone()); + params.body = Some(built.extrinsics.clone()); + params.state_action = StateAction::Execute; + params.fork_choice = Some(ForkChoiceStrategy::LongestChain); + params.import_existing = import_existing; + let import_result = client.import_block(params).await; + assert!(matches!(import_result, Ok(ImportResult::Imported(_)))); +} + +fn benchmark_block_validation(c: &mut Criterion) { + sp_tracing::try_init_simple(); + let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed"); + + let endowed_accounts = vec![AccountId::from(Alice.public())]; + let mut test_client_builder = TestClientBuilder::with_default_backend() + .set_execution_strategy(sc_client_api::ExecutionStrategy::NativeElseWasm); + let genesis_init = test_client_builder.genesis_init_mut(); + *genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts }; + + let client = test_client_builder.build_with_native_executor(None).0; + + let mut group = c.benchmark_group("Block validation"); + group.sample_size(20); + group.measurement_time(Duration::from_secs(120)); + + // In the first iteration we want to initialize the glutton pallet. + let mut is_first = true; + for (compute_ratio, storage_ratio) in &[(One::one(), Zero::zero()), (One::one(), One::one())] { + let parachain_block = + set_glutton_parameters(&client, is_first, compute_ratio, storage_ratio); + is_first = false; + + runtime.block_on(import_block(&client, parachain_block.clone().into_block(), false)); + + // Build benchmark block + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + let validation_data = PersistedValidationData { + relay_parent_number: 1, + parent_head: parent_header.encode().into(), + ..Default::default() + }; + let block_builder = client.init_block_builder(Some(validation_data), Default::default()); + let parachain_block = block_builder.build_parachain_block(*parent_header.state_root()); + + let proof_size_in_kb = parachain_block.storage_proof().encode().len() as f64 / 1024f64; + runtime.block_on(import_block(&client, parachain_block.clone().into_block(), false)); + let runtime = utils::get_wasm_module(); + + let sproof_builder: RelayStateSproofBuilder = Default::default(); + let (relay_parent_storage_root, _) = sproof_builder.clone().into_state_root_and_proof(); + let encoded_params = ValidationParams { + block_data: cumulus_test_client::BlockData(parachain_block.clone().encode()), + parent_head: HeadData(parent_header.encode()), + relay_parent_number: 1, + relay_parent_storage_root, + } + .encode(); + + // This is not strictly necessary for this benchmark, but + // let us make sure that the result of `validate_block` is what + // we expect. + verify_expected_result(&runtime, &encoded_params, parachain_block.into_block()); + + group.bench_function( + format!( + "(compute = {:?}, storage = {:?}, proof_size = {}kb) block validation", + compute_ratio, storage_ratio, proof_size_in_kb + ), + |b| { + b.iter_batched( + || runtime.new_instance().unwrap(), + |mut instance| { + instance.call_export("validate_block", &encoded_params).unwrap(); + }, + BatchSize::SmallInput, + ) + }, + ); + } +} + +fn verify_expected_result(runtime: &Box, encoded_params: &[u8], block: Block) { + let res = runtime + .new_instance() + .unwrap() + .call_export("validate_block", encoded_params) + .expect("Call `validate_block`."); + let validation_result = + ValidationResult::decode(&mut &res[..]).expect("Decode `ValidationResult`."); + let header = + Header::decode(&mut &validation_result.head_data.0[..]).expect("Decodes `Header`."); + assert_eq!(block.header, header); +} + +fn set_glutton_parameters( + client: &Client, + initialize: bool, + compute_ratio: &FixedU64, + storage_ratio: &FixedU64, +) -> ParachainBlockData { + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + + let mut last_nonce = client + .runtime_api() + .account_nonce(parent_hash, Alice.into()) + .expect("Fetching account nonce works; qed"); + + let validation_data = PersistedValidationData { + relay_parent_number: 1, + parent_head: parent_header.encode().into(), + ..Default::default() + }; + + let mut extrinsics = vec![]; + if initialize { + extrinsics.push(generate_extrinsic_with_pair( + client, + Alice.into(), + SudoCall::sudo { + call: Box::new( + GluttonCall::initialize_pallet { new_count: 5000, witness_count: None }.into(), + ), + }, + Some(last_nonce), + )); + last_nonce += 1; + } + + let set_compute = generate_extrinsic_with_pair( + client, + Alice.into(), + SudoCall::sudo { + call: Box::new(GluttonCall::set_compute { compute: *compute_ratio }.into()), + }, + Some(last_nonce), + ); + last_nonce += 1; + extrinsics.push(set_compute); + + let set_storage = generate_extrinsic_with_pair( + client, + Alice.into(), + SudoCall::sudo { + call: Box::new(GluttonCall::set_storage { storage: *storage_ratio }.into()), + }, + Some(last_nonce), + ); + extrinsics.push(set_storage); + + let mut block_builder = client.init_block_builder(Some(validation_data), Default::default()); + + for extrinsic in extrinsics { + block_builder.push(extrinsic).unwrap(); + } + + block_builder.build_parachain_block(*parent_header.state_root()) +} + +criterion_group!(benches, benchmark_block_validation); +criterion_main!(benches); diff --git a/test/service/src/bench_utils.rs b/test/service/src/bench_utils.rs new file mode 100644 index 00000000000..172c9e50419 --- /dev/null +++ b/test/service/src/bench_utils.rs @@ -0,0 +1,261 @@ +// This file is part of Cumulus. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use codec::Encode; + +use crate::{construct_extrinsic, Client as TestClient}; +use cumulus_primitives_core::{relay_chain::AccountId, PersistedValidationData}; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use cumulus_test_runtime::{ + BalancesCall, GluttonCall, NodeBlock, SudoCall, UncheckedExtrinsic, WASM_BINARY, +}; +use frame_system_rpc_runtime_api::AccountNonceApi; +use polkadot_primitives::HeadData; +use sc_block_builder::BlockBuilderProvider; +use sc_client_api::UsageProvider; +use sc_consensus::{ + block_import::{BlockImportParams, ForkChoiceStrategy}, + BlockImport, ImportResult, StateAction, +}; +use sc_executor::DEFAULT_HEAP_ALLOC_STRATEGY; +use sc_executor_common::runtime_blob::RuntimeBlob; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed}; +use sp_consensus::BlockOrigin; +use sp_core::{sr25519, Pair}; +use sp_keyring::Sr25519Keyring::Alice; +use sp_runtime::{ + transaction_validity::{InvalidTransaction, TransactionValidityError}, + AccountId32, FixedU64, OpaqueExtrinsic, +}; + +/// Accounts to use for transfer transactions. Enough for 5000 transactions. +const NUM_ACCOUNTS: usize = 10000; + +/// Create accounts by deriving from Alice +pub fn create_benchmark_accounts() -> (Vec, Vec, Vec) { + let accounts: Vec = (0..NUM_ACCOUNTS) + .map(|idx| { + Pair::from_string(&format!("{}/{}", Alice.to_seed(), idx), None) + .expect("Creates account pair") + }) + .collect(); + let account_ids = accounts + .iter() + .map(|account| AccountId::from(account.public())) + .collect::>(); + let (src_accounts, dst_accounts) = accounts.split_at(NUM_ACCOUNTS / 2); + (src_accounts.to_vec(), dst_accounts.to_vec(), account_ids) +} + +/// Create a timestamp extrinsic ahead by `MinimumPeriod` of the last known timestamp +pub fn extrinsic_set_time(client: &TestClient) -> OpaqueExtrinsic { + let best_number = client.usage_info().chain.best_number; + + let timestamp = best_number as u64 * cumulus_test_runtime::MinimumPeriod::get(); + cumulus_test_runtime::UncheckedExtrinsic { + signature: None, + function: cumulus_test_runtime::RuntimeCall::Timestamp(pallet_timestamp::Call::set { + now: timestamp, + }), + } + .into() +} + +/// Create a set validation data extrinsic +pub fn extrinsic_set_validation_data( + parent_header: cumulus_test_runtime::Header, +) -> OpaqueExtrinsic { + let sproof_builder = RelayStateSproofBuilder { para_id: 100.into(), ..Default::default() }; + let parent_head = HeadData(parent_header.encode()); + let (relay_parent_storage_root, relay_chain_state) = sproof_builder.into_state_root_and_proof(); + let data = ParachainInherentData { + validation_data: PersistedValidationData { + parent_head, + relay_parent_number: 10, + relay_parent_storage_root, + max_pov_size: 10000, + }, + relay_chain_state, + downward_messages: Default::default(), + horizontal_messages: Default::default(), + }; + + cumulus_test_runtime::UncheckedExtrinsic { + signature: None, + function: cumulus_test_runtime::RuntimeCall::ParachainSystem( + cumulus_pallet_parachain_system::Call::set_validation_data { data }, + ), + } + .into() +} + +/// Import block into the given client and make sure the import was successful +pub async fn import_block(mut client: &TestClient, block: &NodeBlock, import_existing: bool) { + let mut params = BlockImportParams::new(BlockOrigin::File, block.header.clone()); + params.body = Some(block.extrinsics.clone()); + params.state_action = StateAction::Execute; + params.fork_choice = Some(ForkChoiceStrategy::LongestChain); + params.import_existing = import_existing; + let import_result = client.import_block(params).await; + assert!( + matches!(import_result, Ok(ImportResult::Imported(_))), + "Unexpected block import result: {:?}!", + import_result + ); +} + +/// Creates transfer extrinsics pair-wise from elements of `src_accounts` to `dst_accounts`. +pub fn create_benchmarking_transfer_extrinsics( + client: &TestClient, + src_accounts: &[sr25519::Pair], + dst_accounts: &[sr25519::Pair], +) -> (usize, Vec) { + // Add as many transfer extrinsics as possible into a single block. + let mut block_builder = client.new_block(Default::default()).unwrap(); + let mut max_transfer_count = 0; + let mut extrinsics = Vec::new(); + // Every block needs one timestamp extrinsic. + let time_ext = extrinsic_set_time(client); + extrinsics.push(time_ext); + + // Every block needs tone set_validation_data extrinsic. + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + let set_validation_data_extrinsic = extrinsic_set_validation_data(parent_header); + extrinsics.push(set_validation_data_extrinsic); + + for (src, dst) in src_accounts.iter().zip(dst_accounts.iter()) { + let extrinsic: UncheckedExtrinsic = construct_extrinsic( + client, + BalancesCall::transfer_keep_alive { dest: AccountId::from(dst.public()), value: 10000 }, + src.clone(), + Some(0), + ); + + match block_builder.push(extrinsic.clone().into()) { + Ok(_) => {}, + Err(ApplyExtrinsicFailed(Validity(TransactionValidityError::Invalid( + InvalidTransaction::ExhaustsResources, + )))) => break, + Err(error) => panic!("{}", error), + } + + extrinsics.push(extrinsic.into()); + max_transfer_count += 1; + } + + if max_transfer_count >= src_accounts.len() { + panic!("Block could fit more transfers, increase NUM_ACCOUNTS to generate more accounts."); + } + + (max_transfer_count, extrinsics) +} + +/// Prepare cumulus test runtime for execution +pub fn get_wasm_module() -> Box { + let blob = RuntimeBlob::uncompress_if_needed( + WASM_BINARY.expect("You need to build the WASM binaries to run the benchmark!"), + ) + .unwrap(); + + let config = sc_executor_wasmtime::Config { + allow_missing_func_imports: true, + cache_path: None, + semantics: sc_executor_wasmtime::Semantics { + heap_alloc_strategy: DEFAULT_HEAP_ALLOC_STRATEGY, + instantiation_strategy: sc_executor::WasmtimeInstantiationStrategy::PoolingCopyOnWrite, + deterministic_stack_limit: None, + canonicalize_nans: false, + parallel_compilation: true, + wasm_multi_value: false, + wasm_bulk_memory: false, + wasm_reference_types: false, + wasm_simd: false, + }, + }; + Box::new( + sc_executor_wasmtime::create_runtime::(blob, config) + .expect("Unable to create wasm module."), + ) +} + +/// Create a block containing setup extrinsics for the glutton pallet. +pub fn set_glutton_parameters( + client: &TestClient, + initialize: bool, + compute_ratio: &FixedU64, + storage_ratio: &FixedU64, +) -> NodeBlock { + let parent_hash = client.usage_info().chain.best_hash; + let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap(); + + let mut last_nonce = client + .runtime_api() + .account_nonce(parent_hash, Alice.into()) + .expect("Fetching account nonce works; qed"); + + let mut extrinsics = vec![]; + if initialize { + // Initialize the pallet + extrinsics.push(construct_extrinsic( + client, + SudoCall::sudo { + call: Box::new( + GluttonCall::initialize_pallet { new_count: 5000, witness_count: None }.into(), + ), + }, + Alice.into(), + Some(last_nonce), + )); + last_nonce += 1; + } + + // Set compute weight that should be consumed per block + let set_compute = construct_extrinsic( + client, + SudoCall::sudo { + call: Box::new(GluttonCall::set_compute { compute: *compute_ratio }.into()), + }, + Alice.into(), + Some(last_nonce), + ); + last_nonce += 1; + extrinsics.push(set_compute); + + // Set storage weight that should be consumed per block + let set_storage = construct_extrinsic( + client, + SudoCall::sudo { + call: Box::new(GluttonCall::set_storage { storage: *storage_ratio }.into()), + }, + Alice.into(), + Some(last_nonce), + ); + extrinsics.push(set_storage); + + let mut block_builder = client.new_block(Default::default()).unwrap(); + block_builder.push(extrinsic_set_time(client)).unwrap(); + block_builder.push(extrinsic_set_validation_data(parent_header)).unwrap(); + for extrinsic in extrinsics { + block_builder.push(extrinsic.into()).unwrap(); + } + + let built_block = block_builder.build().unwrap(); + built_block.block +} diff --git a/test/service/src/chain_spec.rs b/test/service/src/chain_spec.rs index 5ae77084b6c..84604dffc64 100644 --- a/test/service/src/chain_spec.rs +++ b/test/service/src/chain_spec.rs @@ -80,12 +80,22 @@ where } /// Get the chain spec for a specific parachain ID. -pub fn get_chain_spec(id: ParaId) -> ChainSpec { +/// The given accounts are initialized with funds in addition +/// to the default known accounts. +pub fn get_chain_spec_with_extra_endowed( + id: ParaId, + extra_endowed_accounts: Vec, +) -> ChainSpec { ChainSpec::from_genesis( "Local Testnet", "local_testnet", ChainType::Local, - move || GenesisExt { runtime_genesis_config: local_testnet_genesis(), para_id: id }, + move || GenesisExt { + runtime_genesis_config: testnet_genesis_with_default_endowed( + extra_endowed_accounts.clone(), + ), + para_id: id, + }, Vec::new(), None, None, @@ -95,28 +105,36 @@ pub fn get_chain_spec(id: ParaId) -> ChainSpec { ) } +/// Get the chain spec for a specific parachain ID. +pub fn get_chain_spec(id: ParaId) -> ChainSpec { + get_chain_spec_with_extra_endowed(id, Default::default()) +} + /// Local testnet genesis for testing. -pub fn local_testnet_genesis() -> cumulus_test_runtime::GenesisConfig { - testnet_genesis( +pub fn testnet_genesis_with_default_endowed( + mut extra_endowed_accounts: Vec, +) -> cumulus_test_runtime::GenesisConfig { + let mut endowed = vec![ get_account_id_from_seed::("Alice"), - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Charlie"), - get_account_id_from_seed::("Dave"), - get_account_id_from_seed::("Eve"), - get_account_id_from_seed::("Ferdie"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - get_account_id_from_seed::("Charlie//stash"), - get_account_id_from_seed::("Dave//stash"), - get_account_id_from_seed::("Eve//stash"), - get_account_id_from_seed::("Ferdie//stash"), - ], - ) + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ]; + endowed.append(&mut extra_endowed_accounts); + + testnet_genesis(get_account_id_from_seed::("Alice"), endowed) } -fn testnet_genesis( +/// Creates a local testnet genesis with endowed accounts. +pub fn testnet_genesis( root_key: AccountId, endowed_accounts: Vec, ) -> cumulus_test_runtime::GenesisConfig { @@ -126,6 +144,7 @@ fn testnet_genesis( .expect("WASM binary was not build, please build it!") .to_vec(), }, + glutton: Default::default(), parachain_system: Default::default(), balances: cumulus_test_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index c97339f7fe9..e45ba47f6eb 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -18,9 +18,13 @@ #![warn(missing_docs)] +/// Utilities used for benchmarking +pub mod bench_utils; + pub mod chain_spec; mod genesis; +use runtime::AccountId; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use std::{ future::Future, @@ -62,8 +66,8 @@ use sc_service::{ BlocksPruning, DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, NetworkConfiguration, OffchainWorkerConfig, PruningMode, WasmExecutionMethod, }, - BasePath, ChainSpec, Configuration, Error as ServiceError, PartialComponents, Role, - RpcHandlers, TFullBackend, TFullClient, TaskManager, + BasePath, ChainSpec as ChainSpecService, Configuration, Error as ServiceError, + PartialComponents, Role, RpcHandlers, TFullBackend, TFullClient, TaskManager, }; use sp_arithmetic::traits::SaturatedConversion; use sp_blockchain::HeaderBackend; @@ -501,6 +505,7 @@ pub struct TestNodeBuilder { storage_update_func_relay_chain: Option>, consensus: Consensus, relay_chain_full_node_url: Vec, + endowed_accounts: Vec, } impl TestNodeBuilder { @@ -523,6 +528,7 @@ impl TestNodeBuilder { storage_update_func_relay_chain: None, consensus: Consensus::RelayChain, relay_chain_full_node_url: vec![], + endowed_accounts: Default::default(), } } @@ -629,6 +635,12 @@ impl TestNodeBuilder { self } + /// Accounts which will have an initial balance. + pub fn endowed_accounts(mut self, accounts: Vec) -> TestNodeBuilder { + self.endowed_accounts = accounts; + self + } + /// Build the [`TestNode`]. pub async fn build(self) -> TestNode { let parachain_config = node_config( @@ -639,6 +651,7 @@ impl TestNodeBuilder { self.parachain_nodes_exclusive, self.para_id, self.collator_key.is_some(), + self.endowed_accounts, ) .expect("could not generate Configuration"); @@ -692,12 +705,14 @@ pub fn node_config( nodes_exlusive: bool, para_id: ParaId, is_collator: bool, + endowed_accounts: Vec, ) -> Result { let base_path = BasePath::new_temp_dir()?; let root = base_path.path().join(format!("cumulus_test_service_{}", key)); 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)); + let mut spec = + Box::new(chain_spec::get_chain_spec_with_extra_endowed(para_id, endowed_accounts)); let mut storage = spec.as_storage_builder().build_storage().expect("could not build storage"); @@ -740,14 +755,15 @@ pub fn node_config( state_pruning: Some(PruningMode::ArchiveAll), blocks_pruning: BlocksPruning::KeepAll, chain_spec: spec, - wasm_method: WasmExecutionMethod::default(), - // NOTE: we enforce the use of the native runtime to make the errors more debuggable + wasm_method: WasmExecutionMethod::Compiled { + instantiation_strategy: sc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite, + }, execution_strategies: ExecutionStrategies { - syncing: sc_client_api::ExecutionStrategy::NativeWhenPossible, - importing: sc_client_api::ExecutionStrategy::NativeWhenPossible, - block_construction: sc_client_api::ExecutionStrategy::NativeWhenPossible, - offchain_worker: sc_client_api::ExecutionStrategy::NativeWhenPossible, - other: sc_client_api::ExecutionStrategy::NativeWhenPossible, + syncing: sc_client_api::ExecutionStrategy::AlwaysWasm, + importing: sc_client_api::ExecutionStrategy::AlwaysWasm, + block_construction: sc_client_api::ExecutionStrategy::AlwaysWasm, + offchain_worker: sc_client_api::ExecutionStrategy::AlwaysWasm, + other: sc_client_api::ExecutionStrategy::AlwaysWasm, }, rpc_addr: None, rpc_max_connections: Default::default(), diff --git a/xcm/xcm-emulator/Cargo.toml b/xcm/xcm-emulator/Cargo.toml index dbbf07be098..01b9f6d6043 100644 --- a/xcm/xcm-emulator/Cargo.toml +++ b/xcm/xcm-emulator/Cargo.toml @@ -10,7 +10,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0" } paste = "1.0.5" quote = "1.0.28" casey = "0.4.0" -log = { version = "0.4.17", default-features = false } +log = { version = "0.4.19", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/xcm/xcm-emulator/README.md b/xcm/xcm-emulator/README.md index aa1bd3d5406..d188c99eecf 100644 --- a/xcm/xcm-emulator/README.md +++ b/xcm/xcm-emulator/README.md @@ -2,7 +2,7 @@ XCM-Emulator is a tool to emulate XCM program execution using pre-configured runtimes, including those used to run on live -networks, such as Kusama, Polkadot, Statemine et cetera. +networks, such as Kusama, Polkadot, Asset Hubs, et cetera. This allows for testing cross-chain message passing and verifying outcomes, weights, and side-effects. It is faster than spinning up a zombienet and as all the chains are in one process debugging using Clion is easy. diff --git a/xcm/xcm-emulator/src/lib.rs b/xcm/xcm-emulator/src/lib.rs index a31d7c5b7e5..068c99e5a47 100644 --- a/xcm/xcm-emulator/src/lib.rs +++ b/xcm/xcm-emulator/src/lib.rs @@ -195,6 +195,7 @@ pub trait Parachain: XcmpMessageHandler + DmpMessageHandler { macro_rules! decl_test_relay_chains { ( $( + #[api_version($api_version:tt)] pub struct $name:ident { genesis = $genesis:expr, on_init = $on_init:expr, @@ -280,7 +281,7 @@ macro_rules! decl_test_relay_chains { } } - $crate::__impl_test_ext_for_relay_chain!($name, $genesis, $on_init); + $crate::__impl_test_ext_for_relay_chain!($name, $genesis, $on_init, $api_version); )+ }; } @@ -288,13 +289,13 @@ macro_rules! decl_test_relay_chains { #[macro_export] macro_rules! __impl_test_ext_for_relay_chain { // entry point: generate ext name - ($name:ident, $genesis:expr, $on_init:expr) => { + ($name:ident, $genesis:expr, $on_init:expr, $api_version:tt) => { $crate::paste::paste! { - $crate::__impl_test_ext_for_relay_chain!(@impl $name, $genesis, $on_init, []); + $crate::__impl_test_ext_for_relay_chain!(@impl $name, $genesis, $on_init, [], []); } }; // impl - (@impl $name:ident, $genesis:expr, $on_init:expr, $ext_name:ident) => { + (@impl $name:ident, $genesis:expr, $on_init:expr, $api_version:ident, $ext_name:ident) => { thread_local! { pub static $ext_name: $crate::RefCell<$crate::sp_io::TestExternalities> = $crate::RefCell::new(<$name>::build_new_ext($genesis)); @@ -330,7 +331,7 @@ macro_rules! __impl_test_ext_for_relay_chain { // send messages if needed $ext_name.with(|v| { v.borrow_mut().execute_with(|| { - use $crate::polkadot_primitives::runtime_api::runtime_decl_for_parachain_host::ParachainHostV4; + use $crate::polkadot_primitives::runtime_api::runtime_decl_for_parachain_host::$api_version; //TODO: mark sent count & filter out sent msg for para_id in <$name>::para_ids() { @@ -388,7 +389,7 @@ macro_rules! __impl_relay { } pub fn sovereign_account_id_of(location: $crate::MultiLocation) -> $crate::AccountId { - ::SovereignAccountOf::convert(location.into()).unwrap() + ::SovereignAccountOf::convert_location(&location).unwrap() } pub fn fund_accounts(accounts: Vec<(AccountId, Balance)>) { @@ -653,7 +654,7 @@ macro_rules! __impl_parachain { } pub fn sovereign_account_id_of(location: $crate::MultiLocation) -> $crate::AccountId { - ::LocationToAccountId::convert(location.into()).unwrap() + ::LocationToAccountId::convert_location(&location).unwrap() } pub fn fund_accounts(accounts: Vec<(AccountId, Balance)>) { @@ -739,6 +740,8 @@ macro_rules! decl_test_networks { $crate::HORIZONTAL_MESSAGES.with(|b| b.borrow_mut().insert(stringify!($name).to_string(), $crate::VecDeque::new())); $crate::RELAY_BLOCK_NUMBER.with(|b| b.borrow_mut().insert(stringify!($name).to_string(), 1)); $crate::PARA_IDS.with(|b| b.borrow_mut().insert(stringify!($name).to_string(), Self::_para_ids())); + + $( <$parachain>::prepare_for_xcmp(); )* } } diff --git a/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml b/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml index 7badbe51d63..4e1260f9e41 100644 --- a/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml +++ b/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml @@ -64,7 +64,7 @@ cumulus_based = true [[parachains]] id = 1000 -chain = "statemine-local" +chain = "asset-hub-kusama-local" cumulus_based = true [[parachains.collators]] diff --git a/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml b/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml index 53247b6fdc8..7dcc8dd7232 100644 --- a/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml +++ b/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml @@ -64,7 +64,7 @@ cumulus_based = true [[parachains]] id = 1000 -chain = "westmint-local" +chain = "asset-hub-westend-local" cumulus_based = true [[parachains.collators]] diff --git a/zombienet/examples/small_network.toml b/zombienet/examples/small_network.toml index ac5ee11e5bb..06ac0d0e5e7 100644 --- a/zombienet/examples/small_network.toml +++ b/zombienet/examples/small_network.toml @@ -14,7 +14,7 @@ chain = "rococo-local" [[parachains]] id = 2000 cumulus_based = true -chain = "statemine-local" +chain = "asset-hub-kusama-local" # run charlie as parachain collator [[parachains.collators]] diff --git a/zombienet/examples/statemine_kusama_local_network.toml b/zombienet/examples/statemine_kusama_local_network.toml index 01d1b0b2d21..1f3debfb9d2 100644 --- a/zombienet/examples/statemine_kusama_local_network.toml +++ b/zombienet/examples/statemine_kusama_local_network.toml @@ -21,7 +21,7 @@ chain = "kusama-local" [[parachains]] id = 1000 -chain = "statemine-local" +chain = "asset-hub-kusama-local" cumulus_based = true # run alice as parachain collator