diff --git a/.config/zepter.yaml b/.config/zepter.yaml index 8bd03268e9f9f..a36cac2a80235 100644 --- a/.config/zepter.yaml +++ b/.config/zepter.yaml @@ -2,7 +2,7 @@ version: format: 1 # Minimum version of the binary that is expected to work. This is just for printing a nice error # message when someone tries to use an older version. - binary: 0.13.2 + binary: 1.78.0 # The examples in this file assume crate `A` to have a dependency on crate `B`. workflows: @@ -19,6 +19,8 @@ workflows: '--left-side-outside-workspace=ignore', # Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used. '--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking', + # Do not propagate std feature from sp-wasm-interface down to wasmtime dependency. + '--ignore-missing-propagate=sp-wasm-interface/std:wasmtime/std', # Auxillary flags: '--offline', '--locked', diff --git a/.github/scripts/release/release_lib.sh b/.github/scripts/release/release_lib.sh index c0dfd306c84ce..f4ac971824c48 100644 --- a/.github/scripts/release/release_lib.sh +++ b/.github/scripts/release/release_lib.sh @@ -189,6 +189,12 @@ function get_s3_url_base() { frame-omni-bencher) printf "releases.parity.io/frame-omni-bencher" ;; + substrate-node) + printf "releases.parity.io/substrate-node" + ;; + eth-rpc) + printf "releases.parity.io/eth-rpc" + ;; *) printf "UNSUPPORTED BINARY $name" exit 1 diff --git a/.github/workflows/checks-quick.yml b/.github/workflows/checks-quick.yml index 9cc15096f30b5..0bcdded9609b5 100644 --- a/.github/workflows/checks-quick.yml +++ b/.github/workflows/checks-quick.yml @@ -60,6 +60,9 @@ jobs: run: | # Pull all dependencies eagerly: time cargo metadata --format-version=1 --locked > /dev/null + - name: Install newer Zepter + run: | + cargo install zepter@1.78.2 --locked -q - name: run zepter run: | zepter --version @@ -138,6 +141,9 @@ jobs: - uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.0 (22. Sep 2023) - name: install python deps run: pip3 install "cargo-workspace>=1.2.4" toml + - name: Install newer Zepter + run: | + cargo install zepter@1.78.2 --locked -q && zepter --version - name: check umbrella correctness run: | # Fixes "detected dubious ownership" error in the ci diff --git a/.github/workflows/release-20_build-rc.yml b/.github/workflows/release-20_build-rc.yml index 6b4c67b832685..77e55a44070d2 100644 --- a/.github/workflows/release-20_build-rc.yml +++ b/.github/workflows/release-20_build-rc.yml @@ -13,6 +13,8 @@ on: - polkadot-omni-node - frame-omni-bencher - chain-spec-builder + - substrate-node + - eth-rpc - all release_tag: @@ -155,6 +157,50 @@ jobs: attestations: write contents: read + build-substrate-node-binary: + needs: [validate-inputs] + if: ${{ inputs.binary == 'substrate-node' || inputs.binary == 'all' }} + uses: "./.github/workflows/release-reusable-rc-build.yml" + with: + binary: '["substrate-node"]' + package: staging-node-cli + release_tag: ${{ needs.validate-inputs.outputs.release_tag }} + target: x86_64-unknown-linux-gnu + secrets: + PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} + PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + permissions: + id-token: write + attestations: write + contents: read + + build-eth-rpc-binary: + needs: [validate-inputs] + if: ${{ inputs.binary == 'eth-rpc' || inputs.binary == 'all' }} + uses: "./.github/workflows/release-reusable-rc-build.yml" + with: + binary: '["eth-rpc"]' + package: pallet-revive-eth-rpc + release_tag: ${{ needs.validate-inputs.outputs.release_tag }} + target: x86_64-unknown-linux-gnu + secrets: + PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} + PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + permissions: + id-token: write + attestations: write + contents: read + build-polkadot-macos-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }} @@ -265,3 +311,47 @@ jobs: id-token: write attestations: write contents: read + + build-substrate-node-macos-binary: + needs: [validate-inputs] + if: ${{ inputs.binary == 'substrate-node' || inputs.binary == 'all' }} + uses: "./.github/workflows/release-reusable-rc-build.yml" + with: + binary: '["substrate-node"]' + package: staging-node-cli + release_tag: ${{ needs.validate-inputs.outputs.release_tag }} + target: aarch64-apple-darwin + secrets: + PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} + PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + permissions: + id-token: write + attestations: write + contents: read + + build-eth-rpc-macos-binary: + needs: [validate-inputs] + if: ${{ inputs.binary == 'eth-rpc' || inputs.binary == 'all' }} + uses: "./.github/workflows/release-reusable-rc-build.yml" + with: + binary: '["eth-rpc"]' + package: pallet-revive-eth-rpc + release_tag: ${{ needs.validate-inputs.outputs.release_tag }} + target: aarch64-apple-darwin + secrets: + PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} + PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + permissions: + id-token: write + attestations: write + contents: read diff --git a/.github/workflows/release-99_notif-published.yml b/.github/workflows/release-99_notif-published.yml index b5b2ed38e845e..f609c30a4e0d8 100644 --- a/.github/workflows/release-99_notif-published.yml +++ b/.github/workflows/release-99_notif-published.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: channel: - # Internal + # Internal - name: "RelEng: Polkadot Release Coordination" room: '!cqAmzdIcbOFwrdrubV:parity.io' pre-release: true @@ -22,7 +22,7 @@ jobs: room: '!EoIhaKfGPmFOBrNSHT:web3.foundation' pre-release: true - # Public + # Public - name: '#polkadotvalidatorlounge:web3.foundation' room: '!NZrbtteFeqYKCUGQtr:matrix.parity.io' pre-releases: false @@ -34,6 +34,20 @@ jobs: pre-releases: false steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Extract node version + id: extract_version + run: | + . ./.github/scripts/common/lib.sh + + version=v$(get_polkadot_node_version_from_code) + echo "Extracted node version: $version" + echo "node_version=$version" >> $GITHUB_OUTPUT + - name: Matrix notification to ${{ matrix.channel.name }} if: github.event.release.prerelease == false || matrix.channel.pre-release uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 @@ -45,6 +59,7 @@ jobs: @room A new node release has been ${{github.event.action}} in **${{github.event.repository.full_name}}:**
- Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}}) + Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}})
+ Node version: ${{ steps.extract_version.outputs.node_version }} ----- diff --git a/.github/workflows/release-reusable-rc-build.yml b/.github/workflows/release-reusable-rc-build.yml index 15b37f36a0829..edd32920361dc 100644 --- a/.github/workflows/release-reusable-rc-build.yml +++ b/.github/workflows/release-reusable-rc-build.yml @@ -373,6 +373,32 @@ jobs: AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + upload-substrate-node-artifacts-to-s3: + if: ${{ inputs.package == 'staging-node-cli' && inputs.target == 'x86_64-unknown-linux-gnu' }} + needs: [build-rc] + uses: ./.github/workflows/release-reusable-s3-upload.yml + with: + package: substrate-node + release_tag: ${{ inputs.release_tag }} + target: ${{ inputs.target }} + secrets: + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + + upload-eth-rpc-artifacts-to-s3: + if: ${{ inputs.package == 'pallet-revive-eth-rpc' && inputs.target == 'x86_64-unknown-linux-gnu' }} + needs: [build-rc] + uses: ./.github/workflows/release-reusable-s3-upload.yml + with: + package: eth-rpc + release_tag: ${{ inputs.release_tag }} + target: ${{ inputs.target }} + secrets: + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + upload-polkadot-macos-artifacts-to-s3: if: ${{ inputs.package == 'polkadot' && inputs.target == 'aarch64-apple-darwin' }} # TODO: add and use a `build-polkadot-homebrew-package` which packs all `polkadot` binaries: @@ -465,3 +491,29 @@ jobs: AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + + upload-substrate-node-macos-artifacts-to-s3: + if: ${{ inputs.package == 'staging-node-cli' && inputs.target == 'aarch64-apple-darwin' }} + needs: [build-macos-rc] + uses: ./.github/workflows/release-reusable-s3-upload.yml + with: + package: substrate-node + release_tag: ${{ inputs.release_tag }} + target: ${{ inputs.target }} + secrets: + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + + upload-eth-rpc-macos-artifacts-to-s3: + if: ${{ inputs.package == 'pallet-revive-eth-rpc' && inputs.target == 'aarch64-apple-darwin' }} + needs: [build-macos-rc] + uses: ./.github/workflows/release-reusable-s3-upload.yml + with: + package: eth-rpc + release_tag: ${{ inputs.release_tag }} + target: ${{ inputs.target }} + secrets: + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} diff --git a/.gitignore b/.gitignore index 4fe0701fde684..b59ece2791d17 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .local .lycheecache .vscode +.zed .wasm-binaries *.adoc *.bin @@ -40,5 +41,4 @@ runtime/wasm/target/ substrate.code-workspace target/ *.scale -justfile rustc-ice-* diff --git a/Cargo.lock b/Cargo.lock index 07a7625d41c22..79a9ab4a54943 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,20 +14,20 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.0", ] [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.28.0", + "gimli 0.31.1", ] [[package]] @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy-core" @@ -159,7 +159,7 @@ dependencies = [ "derive_more 2.0.1", "foldhash", "hashbrown 0.15.3", - "indexmap 2.9.0", + "indexmap", "itoa", "k256", "keccak-asm", @@ -207,7 +207,7 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.9.0", + "indexmap", "proc-macro-error2", "proc-macro2 1.0.95", "quote 1.0.40", @@ -331,9 +331,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "approx" @@ -360,9 +360,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -2309,7 +2309,6 @@ dependencies = [ "hash-db", "hex-literal", "impl-trait-for-tuples", - "log", "num-traits", "parity-scale-codec", "scale-info", @@ -2320,6 +2319,7 @@ dependencies = [ "sp-state-machine", "sp-std 14.0.0", "sp-trie", + "tracing", "trie-db", ] @@ -2770,7 +2770,6 @@ dependencies = [ "bp-test-utils", "frame-support", "frame-system", - "log", "pallet-balances", "pallet-bridge-grandpa", "pallet-bridge-messages", @@ -2788,6 +2787,7 @@ dependencies = [ "sp-weights", "staging-xcm", "static_assertions", + "tracing", "tuplex", ] @@ -2823,9 +2823,12 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +dependencies = [ + "allocator-api2", +] [[package]] name = "byte-slice-cast" @@ -3219,6 +3222,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.12", +] + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -3246,6 +3258,7 @@ dependencies = [ name = "collectives-westend-integration-tests" version = "1.0.0" dependencies = [ + "collectives-westend-runtime", "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", "emulated-integration-tests-common", @@ -3753,15 +3766,6 @@ dependencies = [ "xcm-runtime-apis", ] -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpp_demangle" version = "0.4.3" @@ -3790,64 +3794,113 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-assembler-x64" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae7b60ec3fd7162427d3b3801520a1908bef7c035b52983cd3ca11b8e7deb51" +dependencies = [ + "cranelift-assembler-x64-meta", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6511c200fed36452697b4b6b161eae57d917a2044e6333b1c1389ed63ccadeee" +dependencies = [ + "cranelift-srcgen", +] + [[package]] name = "cranelift-bforest" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" +checksum = "5f7086a645aa58bae979312f64e3029ac760ac1b577f5cd2417844842a2ca07f" dependencies = [ "cranelift-entity", ] +[[package]] +name = "cranelift-bitset" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5225b4dec45f3f3dbf383f12560fac5ce8d780f399893607e21406e12e77f491" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "cranelift-codegen" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" +checksum = "858fb3331e53492a95979378d6df5208dd1d0d315f19c052be8115f4efc888e0" dependencies = [ "bumpalo", + "cranelift-assembler-x64", "cranelift-bforest", + "cranelift-bitset", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.27.3", - "hashbrown 0.13.2", + "gimli 0.31.1", + "hashbrown 0.15.3", "log", - "regalloc2 0.6.1", + "pulley-interpreter", + "regalloc2 0.12.2", + "rustc-hash 2.1.1", + "serde", "smallvec", "target-lexicon", + "wasmtime-internal-math", ] [[package]] name = "cranelift-codegen-meta" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" +checksum = "456715b9d5f12398f156d5081096e7b5d039f01b9ecc49790a011c8e43e65b5f" dependencies = [ + "cranelift-assembler-x64-meta", "cranelift-codegen-shared", + "cranelift-srcgen", + "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" +checksum = "0306041099499833f167a0ddb707e1e54100f1a84eab5631bc3dad249708f482" + +[[package]] +name = "cranelift-control" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1672945e1f9afc2297f49c92623f5eabc64398e2cb0d824f8f72a2db2df5af23" +dependencies = [ + "arbitrary", +] [[package]] name = "cranelift-entity" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" +checksum = "aa3cd55eb5f3825b9ae5de1530887907360a6334caccdc124c52f6d75246c98a" dependencies = [ + "cranelift-bitset", "serde", + "serde_derive", ] [[package]] name = "cranelift-frontend" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" +checksum = "781f9905f8139b8de22987b66b522b416fe63eb76d823f0b3a8c02c8fd9500c7" dependencies = [ "cranelift-codegen", "log", @@ -3857,15 +3910,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" +checksum = "a05337a2b02c3df00b4dd9a263a027a07b3dff49f61f7da3b5d195c21eaa633d" [[package]] name = "cranelift-native" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" +checksum = "2eee7a496dd66380082c9c5b6f2d5fa149cec0ec383feec5caf079ca2b3671c2" dependencies = [ "cranelift-codegen", "libc", @@ -3873,20 +3926,10 @@ dependencies = [ ] [[package]] -name = "cranelift-wasm" -version = "0.95.1" +name = "cranelift-srcgen" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.10.5", - "log", - "smallvec", - "wasmparser", - "wasmtime-types", -] +checksum = "b530783809a55cb68d070e0de60cfbb3db0dc94c8850dd5725411422bedcf6bb" [[package]] name = "crc" @@ -3985,7 +4028,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", + "memoffset", "scopeguard", ] @@ -4251,6 +4294,11 @@ dependencies = [ "anyhow", "async-trait", "cumulus-primitives-parachain-inherent", + "sc-basic-authorship", + "sc-block-builder", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", "sp-consensus", "sp-inherents", "sp-runtime", @@ -4474,7 +4522,9 @@ dependencies = [ "polkadot-runtime-parachains", "rand 0.8.5", "rstest", + "sc-consensus", "scale-info", + "sp-api", "sp-consensus-babe", "sp-consensus-slots", "sp-core 28.0.0", @@ -5337,9 +5387,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2 1.0.95", "quote 1.0.40", @@ -5549,7 +5599,7 @@ dependencies = [ "regex", "syn 2.0.98", "termcolor", - "toml 0.8.19", + "toml", "walkdir", ] @@ -5725,6 +5775,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "emulated-integration-tests-common" version = "3.0.0" @@ -5847,9 +5909,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -6077,12 +6139,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -6154,7 +6210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb42427514b063d97ce21d5199f36c0c307d981434a6be32582bc79fe5bd2303" dependencies = [ "expander", - "indexmap 2.9.0", + "indexmap", "proc-macro-crate 3.1.0", "proc-macro2 1.0.95", "quote 1.0.40", @@ -6213,16 +6269,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "file-per-thread-logger" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" -dependencies = [ - "env_logger 0.10.1", - "log", -] - [[package]] name = "filetime" version = "0.2.22" @@ -6444,6 +6490,7 @@ dependencies = [ "cumulus-client-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "cumulus-test-runtime", + "env_filter", "frame-benchmarking", "frame-storage-access-test-runtime", "frame-support", @@ -6482,6 +6529,7 @@ dependencies = [ "sp-io", "sp-keystore", "sp-runtime", + "sp-runtime-interface 24.0.0", "sp-state-machine", "sp-storage 19.0.0", "sp-timestamp", @@ -7128,15 +7176,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generate-bags" version = "28.0.0" @@ -7236,17 +7275,6 @@ dependencies = [ "polyval", ] -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -dependencies = [ - "fallible-iterator 0.2.0", - "indexmap 1.9.3", - "stable_deref_trait", -] - [[package]] name = "gimli" version = "0.28.0" @@ -7259,7 +7287,8 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ - "fallible-iterator 0.3.0", + "fallible-iterator", + "indexmap", "stable_deref_trait", ] @@ -7441,7 +7470,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.9", - "indexmap 2.9.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -7460,7 +7489,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.9.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -7502,12 +7531,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.13.2" @@ -8296,17 +8319,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.9.0" @@ -8482,6 +8494,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -9029,6 +9050,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" version = "0.2.172" @@ -9647,12 +9674,6 @@ dependencies = [ "nalgebra", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -9665,6 +9686,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "lioness" version = "0.1.2" @@ -9715,7 +9742,7 @@ dependencies = [ "futures", "futures-timer", "hickory-resolver 0.25.2", - "indexmap 2.9.0", + "indexmap", "libc", "mockall", "multiaddr 0.17.1", @@ -9825,15 +9852,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "mach2" version = "0.4.2" @@ -9976,15 +9994,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -10848,18 +10857,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" -[[package]] -name = "object" -version = "0.30.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.32.2" @@ -10871,10 +10868,13 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ + "crc32fast", + "hashbrown 0.15.3", + "indexmap", "memchr", ] @@ -10998,7 +10998,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43dfaf083aef571385fccfdc3a2f8ede8d0a1863160455d4f2b014d8f7d04a3f" dependencies = [ "expander", - "indexmap 2.9.0", + "indexmap", "itertools 0.11.0", "petgraph", "proc-macro-crate 3.1.0", @@ -11491,7 +11491,6 @@ dependencies = [ "bp-test-utils", "frame-support", "frame-system", - "log", "pallet-beefy-mmr", "pallet-mmr", "parity-scale-codec", @@ -11504,6 +11503,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std 14.0.0", + "tracing", ] [[package]] @@ -11537,7 +11537,6 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "pallet-balances", "pallet-bridge-grandpa", "parity-scale-codec", @@ -11547,6 +11546,7 @@ dependencies = [ "sp-runtime", "sp-std 14.0.0", "sp-trie", + "tracing", ] [[package]] @@ -11561,7 +11561,6 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "pallet-bridge-grandpa", "parity-scale-codec", "scale-info", @@ -11569,6 +11568,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std 14.0.0", + "tracing", ] [[package]] @@ -11642,7 +11642,6 @@ dependencies = [ name = "pallet-collator-selection" version = "9.0.0" dependencies = [ - "cumulus-pallet-session-benchmarking", "frame-benchmarking", "frame-support", "frame-system", @@ -11743,7 +11742,7 @@ dependencies = [ "parity-wasm", "sp-runtime", "tempfile", - "toml 0.8.19", + "toml", "twox-hash", ] @@ -12941,7 +12940,7 @@ dependencies = [ "polkavm-linker", "sp-core 28.0.0", "sp-io", - "toml 0.8.19", + "toml", ] [[package]] @@ -13176,6 +13175,8 @@ dependencies = [ name = "pallet-staking-async" version = "0.1.0" dependencies = [ + "anyhow", + "env_logger 0.11.3", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -13223,6 +13224,7 @@ dependencies = [ name = "pallet-staking-async-parachain-runtime" version = "0.15.0" dependencies = [ + "asset-test-utils", "assets-common", "bp-asset-hub-rococo", "bp-bridge-hub-rococo", @@ -13240,6 +13242,7 @@ dependencies = [ "frame-election-provider-support", "frame-executive", "frame-metadata-hash-extension", + "frame-remote-externalities", "frame-support", "frame-system", "frame-system-benchmarking", @@ -13257,6 +13260,7 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-bags-list", + "pallet-bags-list-remote-tests", "pallet-balances", "pallet-collator-selection", "pallet-conviction-voting", @@ -13277,6 +13281,7 @@ dependencies = [ "pallet-scheduler", "pallet-session", "pallet-staking-async", + "pallet-staking-async-preset-store", "pallet-staking-async-rc-client", "pallet-staking-async-runtime-api", "pallet-state-trie-migration", @@ -13293,6 +13298,7 @@ dependencies = [ "pallet-xcm-benchmarks", "pallet-xcm-bridge-hub-router", "parachains-common", + "parachains-runtimes-test-utils", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-runtime-common", @@ -13306,6 +13312,7 @@ dependencies = [ "sp-core 28.0.0", "sp-genesis-builder", "sp-inherents", + "sp-io", "sp-keyring", "sp-npos-elections", "sp-offchain", @@ -13323,10 +13330,20 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "testnet-parachains-constants", + "tokio", "westend-runtime-constants", "xcm-runtime-apis", ] +[[package]] +name = "pallet-staking-async-preset-store" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + [[package]] name = "pallet-staking-async-rc-client" version = "0.1.0" @@ -13388,12 +13405,14 @@ dependencies = [ "pallet-proxy", "pallet-recovery", "pallet-referenda", + "pallet-root-offences", "pallet-root-testing", "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", "pallet-staking", "pallet-staking-async-ah-client", + "pallet-staking-async-preset-store", "pallet-staking-async-rc-client", "pallet-staking-async-rc-runtime-constants", "pallet-sudo", @@ -14515,7 +14534,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.9.0", + "indexmap", ] [[package]] @@ -14573,9 +14592,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plotters" @@ -14828,7 +14847,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "indexmap 2.9.0", + "indexmap", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -16982,7 +17001,7 @@ dependencies = [ "gimli 0.31.1", "hashbrown 0.14.5", "log", - "object 0.36.1", + "object 0.36.7", "polkavm-common 0.26.0", "regalloc2 0.9.3", "rustc-demangle", @@ -17062,6 +17081,18 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -17463,7 +17494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.14.0", "proc-macro2 1.0.95", "quote 1.0.40", "syn 2.0.98", @@ -17479,12 +17510,26 @@ dependencies = [ ] [[package]] -name = "psm" -version = "0.1.21" +name = "pulley-interpreter" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "b89c4319786b16c1a6a38ee04788d32c669b61ba4b69da2162c868c18be99c1b" dependencies = [ - "cc", + "cranelift-bitset", + "log", + "pulley-macros", + "wasmtime-internal-math", +] + +[[package]] +name = "pulley-macros" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938543690519c20c3a480d20a8efcc8e69abeb44093ab1df4e7c1f81f26c677a" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.98", ] [[package]] @@ -17886,26 +17931,28 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.6.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" dependencies = [ - "fxhash", + "hashbrown 0.13.2", "log", + "rustc-hash 1.1.0", "slice-group-by", "smallvec", ] [[package]] name = "regalloc2" -version = "0.9.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" dependencies = [ - "hashbrown 0.13.2", + "allocator-api2", + "bumpalo", + "hashbrown 0.15.3", "log", - "rustc-hash 1.1.0", - "slice-group-by", + "rustc-hash 2.1.1", "smallvec", ] @@ -18610,42 +18657,41 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.15" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", ] [[package]] name = "rustix" -version = "0.37.23" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "errno", - "io-lifetimes", "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.14", + "windows-sys 0.59.0", ] [[package]] name = "rustix" -version = "0.38.42" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] @@ -18945,6 +18991,7 @@ dependencies = [ "sp-core 28.0.0", "sp-inherents", "sp-runtime", + "sp-trie", "substrate-prometheus-endpoint", "substrate-test-runtime-client", ] @@ -19540,7 +19587,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "paste", - "rustix 0.36.15", + "rustix 1.0.8", "sc-allocator", "sc-executor-common", "sc-runtime-test", @@ -20304,7 +20351,7 @@ dependencies = [ "env_logger 0.11.3", "futures", "futures-timer", - "indexmap 2.9.0", + "indexmap", "itertools 0.11.0", "linked-hash-map", "parity-scale-codec", @@ -20344,7 +20391,7 @@ version = "28.0.0" dependencies = [ "async-trait", "futures", - "indexmap 2.9.0", + "indexmap", "log", "parity-scale-codec", "serde", @@ -20960,7 +21007,7 @@ version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "indexmap 2.9.0", + "indexmap", "itoa", "memchr", "ryu", @@ -21022,7 +21069,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.9.0", + "indexmap", "itoa", "ryu", "serde", @@ -23289,7 +23336,7 @@ dependencies = [ "hashbrown 0.14.5", "hashlink 0.9.1", "hex", - "indexmap 2.9.0", + "indexmap", "log", "memchr", "once_cell", @@ -24127,7 +24174,7 @@ dependencies = [ "sp-version", "strum 0.26.3", "tempfile", - "toml 0.8.19", + "toml", "walkdir", "wasm-opt", ] @@ -24603,7 +24650,7 @@ version = "12.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42bcacd080282a72e795864660b148392af7babd75691d5ae9a3b77e29c98c77" dependencies = [ - "cpp_demangle 0.4.3", + "cpp_demangle", "rustc-demangle", "symbolic-common", ] @@ -24767,9 +24814,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "target-triple" @@ -24836,9 +24883,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-log" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dffced63c2b5c7be278154d76b479f9f9920ed34e7574201407f0b14e2bbb93" +checksum = "1e33b98a582ea0be1168eba097538ee8dd4bbe0f2b01b22ac92ea30054e5be7b" dependencies = [ "env_logger 0.11.3", "test-log-macros", @@ -24847,9 +24894,9 @@ dependencies = [ [[package]] name = "test-log-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" +checksum = "451b374529930d7601b1eef8d32bc79ae870b6079b069401709c2a8bf9e75f36" dependencies = [ "proc-macro2 1.0.95", "quote 1.0.40", @@ -25320,15 +25367,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.8.19" @@ -25356,7 +25394,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.9.0", + "indexmap", "toml_datetime", "winnow 0.5.15", ] @@ -25367,7 +25405,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.9.0", + "indexmap", "toml_datetime", "winnow 0.5.15", ] @@ -25378,7 +25416,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.9.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -25614,7 +25652,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 0.8.19", + "toml", ] [[package]] @@ -26178,6 +26216,16 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" +dependencies = [ + "leb128fmt", + "wasmparser", +] + [[package]] name = "wasm-instrument" version = "0.4.0" @@ -26315,12 +26363,15 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.102.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ - "indexmap 1.9.3", - "url", + "bitflags 2.6.0", + "hashbrown 0.15.3", + "indexmap", + "semver 1.0.18", + "serde", ] [[package]] @@ -26332,199 +26383,224 @@ dependencies = [ "indexmap-nostd", ] +[[package]] +name = "wasmprinter" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aa8e9076de6b9544e6dab4badada518cca0bf4966d35b131bbd057aed8fa0a" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser", +] + [[package]] name = "wasmtime" -version = "8.0.1" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" +checksum = "b6fe976922a16af3b0d67172c473d1fd4f1aa5d0af9c8ba6538c741f3af686f4" dependencies = [ + "addr2line 0.24.2", "anyhow", - "bincode", + "bitflags 2.6.0", + "bumpalo", + "cc", "cfg-if", - "indexmap 1.9.3", + "gimli 0.31.1", + "hashbrown 0.15.3", + "indexmap", "libc", "log", - "object 0.30.4", + "mach2", + "memfd", + "object 0.36.7", "once_cell", - "paste", - "psm", + "postcard", + "pulley-interpreter", "rayon", + "rustix 1.0.8", "serde", + "serde_derive", + "smallvec", "target-lexicon", "wasmparser", - "wasmtime-cache", - "wasmtime-cranelift", "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", + "wasmtime-internal-asm-macros", + "wasmtime-internal-cache", + "wasmtime-internal-cranelift", + "wasmtime-internal-fiber", + "wasmtime-internal-jit-icache-coherence", + "wasmtime-internal-math", + "wasmtime-internal-slab", + "wasmtime-internal-unwinder", + "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-winch", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-environ" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44b6264a78d806924abbc76bbc75eac24976bc83bdfb938e5074ae551242436f" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-bitset", + "cranelift-entity", + "gimli 0.31.1", + "indexmap", + "log", + "object 0.36.7", + "postcard", + "rustc-demangle", + "serde", + "serde_derive", + "smallvec", + "target-lexicon", + "wasm-encoder 0.235.0", + "wasmparser", + "wasmprinter", ] [[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" +name = "wasmtime-internal-asm-macros" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" +checksum = "6775a9b516559716e5710e95a8014ca0adcc81e5bf4d3ad7899d89ae40094d1a" dependencies = [ "cfg-if", ] [[package]] -name = "wasmtime-cache" -version = "8.0.1" +name = "wasmtime-internal-cache" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" +checksum = "138e33ad4bd120f3b1c77d6d0dcdce0de8239555495befcda89393a40ba5e324" dependencies = [ "anyhow", - "base64 0.21.7", - "bincode", + "base64 0.22.1", "directories-next", - "file-per-thread-logger", "log", - "rustix 0.36.15", + "postcard", + "rustix 1.0.8", "serde", + "serde_derive", "sha2 0.10.8", - "toml 0.5.11", - "windows-sys 0.45.0", - "zstd 0.11.2+zstd.1.5.2", + "toml", + "windows-sys 0.59.0", + "zstd 0.13.3", ] [[package]] -name = "wasmtime-cranelift" -version = "8.0.1" +name = "wasmtime-internal-cranelift" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" +checksum = "7ec9ad7565e6a8de7cb95484e230ff689db74a4a085219e0da0cbd637a29c01c" dependencies = [ "anyhow", + "cfg-if", "cranelift-codegen", + "cranelift-control", "cranelift-entity", "cranelift-frontend", "cranelift-native", - "cranelift-wasm", - "gimli 0.27.3", + "gimli 0.31.1", + "itertools 0.14.0", "log", - "object 0.30.4", + "object 0.36.7", + "pulley-interpreter", + "smallvec", "target-lexicon", - "thiserror 1.0.65", + "thiserror 2.0.12", "wasmparser", - "wasmtime-cranelift-shared", "wasmtime-environ", + "wasmtime-internal-math", + "wasmtime-internal-versioned-export-macros", ] [[package]] -name = "wasmtime-cranelift-shared" -version = "8.0.1" +name = "wasmtime-internal-fiber" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +checksum = "8b636ff8b220ebaf29dfe3b23770e4b2bad317b9683e3bf7345e162387385b39" dependencies = [ "anyhow", - "cranelift-codegen", - "cranelift-native", - "gimli 0.27.3", - "object 0.30.4", - "target-lexicon", - "wasmtime-environ", + "cc", + "cfg-if", + "libc", + "rustix 1.0.8", + "wasmtime-internal-asm-macros", + "wasmtime-internal-versioned-export-macros", + "windows-sys 0.59.0", ] [[package]] -name = "wasmtime-environ" -version = "8.0.1" +name = "wasmtime-internal-jit-icache-coherence" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" +checksum = "4417e06b7f80baff87d9770852c757a39b8d7f11d78b2620ca992b8725f16f50" dependencies = [ "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror 1.0.65", - "wasmparser", - "wasmtime-types", + "cfg-if", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "wasmtime-jit" -version = "8.0.1" +name = "wasmtime-internal-math" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" +checksum = "7710d5c4ecdaa772927fd11e5dc30a9a62d1fc8fe933e11ad5576ad596ab6612" dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle 0.3.5", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-debug", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", + "libm", ] [[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" +name = "wasmtime-internal-slab" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "object 0.30.4", - "once_cell", - "rustix 0.36.15", -] +checksum = "e6ab22fabe1eed27ab01fd47cd89deacf43ad222ed7fd169ba6f4dd1fbddc53b" [[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" +name = "wasmtime-internal-unwinder" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" +checksum = "307708f302f5dcf19c1bbbfb3d9f2cbc837dd18088a7988747b043a46ba38ecc" dependencies = [ + "anyhow", "cfg-if", - "libc", - "windows-sys 0.45.0", + "cranelift-codegen", + "log", + "object 0.36.7", ] [[package]] -name = "wasmtime-runtime" -version = "8.0.1" +name = "wasmtime-internal-versioned-export-macros" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" +checksum = "342b0466f92b7217a4de9e114175fedee1907028567d2548bcd42f71a8b5b016" dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset 0.8.0", - "paste", - "rand 0.8.5", - "rustix 0.36.15", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.98", ] [[package]] -name = "wasmtime-types" -version = "8.0.1" +name = "wasmtime-internal-winch" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +checksum = "2012e7384c25b91aab2f1b6a1e1cbab9d0f199bbea06cc873597a3f047f05730" dependencies = [ - "cranelift-entity", - "serde", - "thiserror 1.0.65", + "anyhow", + "cranelift-codegen", + "gimli 0.31.1", + "object 0.36.7", + "target-lexicon", "wasmparser", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "winch-codegen", ] [[package]] @@ -26536,7 +26612,7 @@ dependencies = [ "leb128", "memchr", "unicode-width 0.1.10", - "wasm-encoder", + "wasm-encoder 0.31.1", ] [[package]] @@ -26797,6 +26873,26 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winch-codegen" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "839a334ef7c62d8368dbd427e767a6fbb1ba08cc12ecce19cbb666c10613b585" +dependencies = [ + "anyhow", + "cranelift-assembler-x64", + "cranelift-codegen", + "gimli 0.31.1", + "regalloc2 0.12.2", + "smallvec", + "target-lexicon", + "thiserror 2.0.12", + "wasmparser", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "wasmtime-internal-math", +] + [[package]] name = "windows" version = "0.48.0" @@ -26925,15 +27021,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -26961,21 +27048,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -27007,12 +27079,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -27025,12 +27091,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -27043,12 +27103,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -27067,12 +27121,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -27085,12 +27133,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -27103,12 +27145,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -27121,12 +27157,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -27295,7 +27325,6 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "log", "pallet-balances", "pallet-message-queue", "pallet-timestamp", @@ -27313,6 +27342,7 @@ dependencies = [ "sp-tracing 16.0.0", "staging-xcm", "staging-xcm-executor", + "tracing", "xcm-simulator", ] @@ -27732,7 +27762,7 @@ dependencies = [ "serde_json", "thiserror 1.0.65", "tokio", - "toml 0.8.19", + "toml", "tracing", "url", "zombienet-support", @@ -27855,27 +27885,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.11.2+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", + "zstd-safe 6.0.6", ] [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe 6.0.6", + "zstd-safe 7.2.4", ] [[package]] name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", @@ -27883,21 +27913,19 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ - "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index c943368b47893..0894625d9452c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -443,6 +443,7 @@ members = [ "substrate/frame/staking-async/reward-fn", "substrate/frame/staking-async/runtime-api", "substrate/frame/staking-async/runtimes/parachain", + "substrate/frame/staking-async/runtimes/preset-store", "substrate/frame/staking-async/runtimes/rc", "substrate/frame/staking-async/runtimes/rc/constants", "substrate/frame/staking/reward-curve", @@ -787,6 +788,7 @@ either = { version = "1.8.1", default-features = false } emulated-integration-tests-common = { path = "cumulus/parachains/integration-tests/emulated/common", default-features = false } enumflags2 = { version = "0.7.11" } enumn = { version = "0.1.13" } +env_filter = { version = "0.1.3" } env_logger = { version = "0.11.2" } environmental = { version = "1.1.4", default-features = false } equivocation-detector = { path = "bridges/relays/equivocation" } @@ -1052,6 +1054,7 @@ revive-dev-runtime = { path = "substrate/frame/revive/dev-node/runtime" } pallet-staking-async = { path = "substrate/frame/staking-async", default-features = false } pallet-staking-async-ah-client = { path = "substrate/frame/staking-async/ah-client", default-features = false } pallet-staking-async-parachain-runtime = { path = "substrate/frame/staking-async/runtimes/parachain" } +pallet-staking-async-preset-store = { path = "substrate/frame/staking-async/runtimes/preset-store", default-features = false } pallet-staking-async-rc-client = { path = "substrate/frame/staking-async/rc-client", default-features = false } pallet-staking-async-rc-runtime = { path = "substrate/frame/staking-async/runtimes/rc" } pallet-staking-async-rc-runtime-constants = { path = "substrate/frame/staking-async/runtimes/rc/constants", default-features = false } @@ -1197,7 +1200,7 @@ rpassword = { version = "7.0.0" } rstest = { version = "0.18.2" } rustc-hash = { version = "1.1.0" } rustc-hex = { version = "2.1.0", default-features = false } -rustix = { version = "0.36.7", default-features = false } +rustix = { version = "1.0.3", default-features = false } rustls = { version = "0.23.18", default-features = false, features = [ "logging", "ring", @@ -1452,7 +1455,7 @@ wasm-instrument = { version = "0.4", default-features = false } wasm-opt = { version = "0.116" } wasm-timer = { version = "0.2.5" } wasmi = { version = "0.32.3", default-features = false } -wasmtime = { version = "8.0.1", default-features = false } +wasmtime = { version = "35.0.0", default-features = false } wat = { version = "1.0.0" } westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/relays/westend", default-features = false } westend-runtime = { path = "polkadot/runtime/westend", default-features = false } @@ -1515,7 +1518,6 @@ blake2 = { opt-level = 3 } blake2b_simd = { opt-level = 3 } chacha20poly1305 = { opt-level = 3 } cranelift-codegen = { opt-level = 3 } -cranelift-wasm = { opt-level = 3 } crc32fast = { opt-level = 3 } crossbeam-deque = { opt-level = 3 } crypto-mac = { opt-level = 3 } diff --git a/bridges/bin/runtime-common/Cargo.toml b/bridges/bin/runtime-common/Cargo.toml index d59be4f6dda86..abd5c33cb4259 100644 --- a/bridges/bin/runtime-common/Cargo.toml +++ b/bridges/bin/runtime-common/Cargo.toml @@ -12,9 +12,9 @@ workspace = true [dependencies] codec = { features = ["derive"], workspace = true } -log = { workspace = true } scale-info = { features = ["derive"], workspace = true } static_assertions = { optional = true, workspace = true, default-features = true } +tracing = { workspace = true } tuplex = { workspace = true } # Bridge dependencies @@ -62,7 +62,6 @@ std = [ "codec/std", "frame-support/std", "frame-system/std", - "log/std", "pallet-bridge-grandpa/std", "pallet-bridge-messages/std", "pallet-bridge-parachains/std", @@ -75,6 +74,7 @@ std = [ "sp-std/std", "sp-trie/std", "sp-weights/std", + "tracing/std", "tuplex/std", "xcm/std", ] diff --git a/bridges/bin/runtime-common/src/messages_benchmarking.rs b/bridges/bin/runtime-common/src/messages_benchmarking.rs index acbdbcda8deaf..4486f6819e51a 100644 --- a/bridges/bin/runtime-common/src/messages_benchmarking.rs +++ b/bridges/bin/runtime-common/src/messages_benchmarking.rs @@ -303,10 +303,10 @@ pub fn generate_xcm_builder_bridge_message_sample( .encoded_size(), ); - log::trace!( + tracing::trace!( target: "runtime::bridge-benchmarks", - "generate_xcm_builder_bridge_message_sample with expected_message_size: {}, location_encoded_size: {}, xcm_size: {}, xcm_data_size: {}", - expected_message_size, location_encoded_size, xcm_size, xcm_data_size, + %expected_message_size, %location_encoded_size, %xcm_size, %xcm_data_size, + "generate_xcm_builder_bridge_message_sample" ); let xcm = xcm::VersionedXcm::<()>::from(Xcm(vec![Instruction::<()>::ExpectPallet { diff --git a/bridges/modules/beefy/Cargo.toml b/bridges/modules/beefy/Cargo.toml index 76a723b5a7be8..d62ae730e3c87 100644 --- a/bridges/modules/beefy/Cargo.toml +++ b/bridges/modules/beefy/Cargo.toml @@ -13,9 +13,9 @@ workspace = true [dependencies] codec = { workspace = true } -log = { workspace = true } scale-info = { features = ["derive"], workspace = true } serde = { optional = true, workspace = true } +tracing = { workspace = true } # Bridge Dependencies bp-beefy = { workspace = true } @@ -45,12 +45,12 @@ std = [ "codec/std", "frame-support/std", "frame-system/std", - "log/std", "scale-info/std", "serde/std", "sp-core/std", "sp-runtime/std", "sp-std/std", + "tracing/std", ] try-runtime = [ "frame-support/try-runtime", diff --git a/bridges/modules/beefy/src/lib.rs b/bridges/modules/beefy/src/lib.rs index cc34dbfd20ced..02ecc9e03eddc 100644 --- a/bridges/modules/beefy/src/lib.rs +++ b/bridges/modules/beefy/src/lib.rs @@ -164,7 +164,7 @@ pub mod pallet { let is_initialized = >::exists(); ensure!(!is_initialized, >::AlreadyInitialized); - log::info!(target: LOG_TARGET, "Initializing bridge BEEFY pallet: {:?}", init_data); + tracing::info!(target: LOG_TARGET, ?init_data, "Initializing bridge BEEFY pallet"); Ok(initialize::(init_data)?) } @@ -257,18 +257,18 @@ pub mod pallet { next_block_number_index: (block_number_index + 1) % T::CommitmentsToKeep::get(), }); if let Ok(old_block_number) = to_prune { - log::debug!( + tracing::debug!( target: LOG_TARGET, - "Pruning commitment for old block: {:?}.", - old_block_number + ?old_block_number, + "Pruning commitment for old block." ); ImportedCommitments::::remove(old_block_number); } - log::info!( + tracing::info!( target: LOG_TARGET, - "Successfully imported commitment for block {:?}", - commitment.commitment.block_number, + block=?commitment.commitment.block_number, + "Successfully imported commitment for block", ); Ok(()) diff --git a/bridges/modules/beefy/src/utils.rs b/bridges/modules/beefy/src/utils.rs index ce7a116308d16..e7071403c95fd 100644 --- a/bridges/modules/beefy/src/utils.rs +++ b/bridges/modules/beefy/src/utils.rs @@ -78,12 +78,12 @@ fn verify_signatures, I: 'static>( break } } else { - log::debug!( + tracing::debug!( target: LOG_TARGET, - "Signed commitment contains incorrect signature of validator {} ({:?}): {:?}", - idx, - authority, - sig, + %idx, + ?authority, + ?sig, + "Signed commitment contains incorrect signature of validator" ); } } @@ -142,15 +142,14 @@ pub(crate) fn verify_beefy_mmr_leaf, I: 'static>( mmr_proof, ) .map_err(|e| { - log::error!( + tracing::error!( target: LOG_TARGET, - "MMR proof of leaf {:?} (root: {:?}, leaf count: {}, len: {}) \ - verification has failed with error: {:?}", - mmr_leaf_hash, - mmr_root, - mmr_proof_leaf_count, - mmr_proof_length, - e, + error=?e, + ?mmr_leaf_hash, + root=?mmr_root, + leaf_count=%mmr_proof_leaf_count, + len=%mmr_proof_length, + "MMR proof of leaf verification has failed" ); Error::::MmrProofVerificationFailed diff --git a/bridges/modules/messages/Cargo.toml b/bridges/modules/messages/Cargo.toml index 6248c9e65e167..6f6c6815a4f5a 100644 --- a/bridges/modules/messages/Cargo.toml +++ b/bridges/modules/messages/Cargo.toml @@ -12,8 +12,8 @@ workspace = true [dependencies] codec = { workspace = true } -log = { workspace = true } scale-info = { features = ["derive"], workspace = true } +tracing = { workspace = true } # Bridge dependencies bp-header-chain = { workspace = true } @@ -47,7 +47,6 @@ std = [ "frame-benchmarking/std", "frame-support/std", "frame-system/std", - "log/std", "pallet-balances/std", "pallet-bridge-grandpa/std", "scale-info/std", @@ -56,6 +55,7 @@ std = [ "sp-runtime/std", "sp-std/std", "sp-trie/std", + "tracing/std", ] runtime-benchmarks = [ "bp-runtime/test-helpers", diff --git a/bridges/modules/messages/src/call_ext.rs b/bridges/modules/messages/src/call_ext.rs index 9e5f5f8d1129e..aa88fd6a219c2 100644 --- a/bridges/modules/messages/src/call_ext.rs +++ b/bridges/modules/messages/src/call_ext.rs @@ -189,10 +189,10 @@ impl< let is_pallet_halted = Pallet::::ensure_not_halted().is_err(); match self.call_info() { Some(proof_info) if is_pallet_halted => { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Rejecting messages transaction on halted pallet: {:?}", - proof_info + ?proof_info, + "Rejecting messages transaction on halted pallet" ); return sp_runtime::transaction_validity::InvalidTransaction::Call.into() @@ -201,10 +201,10 @@ impl< if proof_info .is_obsolete(T::MessageDispatch::is_active(proof_info.base.lane_id)) => { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Rejecting obsolete messages delivery transaction: {:?}", - proof_info + ?proof_info, + "Rejecting obsolete messages delivery transaction" ); return sp_runtime::transaction_validity::InvalidTransaction::Stale.into() @@ -212,10 +212,10 @@ impl< Some(MessagesCallInfo::ReceiveMessagesDeliveryProof(proof_info)) if proof_info.is_obsolete() => { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Rejecting obsolete messages confirmation transaction: {:?}", - proof_info, + ?proof_info, + "Rejecting obsolete messages confirmation transaction" ); return sp_runtime::transaction_validity::InvalidTransaction::Stale.into() diff --git a/bridges/modules/messages/src/lib.rs b/bridges/modules/messages/src/lib.rs index 10cbfcb336564..243b3d22c0b98 100644 --- a/bridges/modules/messages/src/lib.rs +++ b/bridges/modules/messages/src/lib.rs @@ -249,7 +249,7 @@ pub mod pallet { let (lane_id, lane_data) = verify_and_decode_messages_proof::(*proof, messages_count).map_err( |err| { - log::trace!(target: LOG_TARGET, "Rejecting invalid messages proof: {:?}", err,); + tracing::trace!(target: LOG_TARGET, error=?err, "Rejecting invalid messages proof"); Error::::InvalidMessagesProof }, @@ -271,12 +271,12 @@ pub mod pallet { if let Some(lane_state) = lane_data.lane_state { let updated_latest_confirmed_nonce = lane.receive_state_update(lane_state); if let Some(updated_latest_confirmed_nonce) = updated_latest_confirmed_nonce { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Received lane {:?} state update: latest_confirmed_nonce={}. Unrewarded relayers: {:?}", - lane_id, - updated_latest_confirmed_nonce, - UnrewardedRelayersState::from(&lane.storage().data()), + ?lane_id, + latest_confirmed_nonce=%updated_latest_confirmed_nonce, + unrewarded_relayers=?UnrewardedRelayersState::from(&lane.storage().data()), + "Received state update" ); } } @@ -292,12 +292,12 @@ pub mod pallet { // weight is not enough, let's move to next lane let message_dispatch_weight = T::MessageDispatch::dispatch_weight(&mut message); if message_dispatch_weight.any_gt(dispatch_weight_left) { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Cannot dispatch any more messages on lane {:?}. Weight: declared={}, left={}", - lane_id, - message_dispatch_weight, - dispatch_weight_left, + ?lane_id, + declared=%message_dispatch_weight, + left=%dispatch_weight_left, + "Cannot dispatch any more messages" ); fail!(Error::::InsufficientDispatchWeight); @@ -339,13 +339,13 @@ pub mod pallet { actual_weight, ); - log::debug!( + tracing::debug!( target: LOG_TARGET, - "Received messages: total={}, valid={}. Weight used: {}/{}.", - total_messages, - valid_messages, - actual_weight, - declared_weight, + total=%total_messages, + valid=%valid_messages, + %actual_weight, + %declared_weight, + "Received messages." ); Self::deposit_event(Event::MessagesReceived(messages_received_status)); @@ -370,10 +370,10 @@ pub mod pallet { let confirmation_relayer = ensure_signed(origin)?; let (lane_id, lane_data) = proofs::verify_messages_delivery_proof::(proof) .map_err(|err| { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Rejecting invalid messages delivery proof: {:?}", - err, + error=?err, + "Rejecting invalid messages delivery proof" ); Error::::InvalidMessagesDeliveryProof @@ -421,11 +421,11 @@ pub mod pallet { ); }; - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Received messages delivery proof up to (and including) {} at lane {:?}", - last_delivered_nonce, - lane_id, + ?lane_id, + %last_delivered_nonce, + "Received messages delivery proof up to (and including)" ); // notify others about messages delivery @@ -649,9 +649,12 @@ pub mod pallet { } if !unpruned_message_nonces.is_empty() { - log::warn!( + tracing::warn!( target: LOG_TARGET, - "do_try_state_for_outbound_lanes for lane_id: {lane_id:?} with lane_data: {lane_data:?} found unpruned_message_nonces: {unpruned_message_nonces:?}", + ?lane_id, + ?lane_data, + ?unpruned_message_nonces, + "do_try_state_for_outbound_lanes found", ); unpruned_lanes.push((lane_id, lane_data, unpruned_message_nonces)); } @@ -710,12 +713,12 @@ where // return number of messages in the queue to let sender know about its state let enqueued_messages = lane.data().queued_messages().saturating_len(); - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Accepted message {} to lane {:?}. Message size: {:?}", - nonce, - args.lane_id, - message_len, + lane_id=?args.lane_id, + %nonce, + message_size=?message_len, + "Accepted message" ); Pallet::::deposit_event(Event::MessageAccepted { diff --git a/bridges/modules/messages/src/migration.rs b/bridges/modules/messages/src/migration.rs index dc9a8119079ef..24c7f13f11985 100644 --- a/bridges/modules/messages/src/migration.rs +++ b/bridges/modules/messages/src/migration.rs @@ -116,8 +116,8 @@ pub mod v1 { let number_of_inbound = InboundLanes::::iter_keys().count(); let number_of_outbound = OutboundLanes::::iter_keys().count(); - log::info!(target: LOG_TARGET, "post-upgrade expects '{number_of_inbound_to_migrate}' inbound lanes to have been migrated."); - log::info!(target: LOG_TARGET, "post-upgrade expects '{number_of_outbound_to_migrate}' outbound lanes to have been migrated."); + tracing::info!(target: LOG_TARGET, %number_of_inbound_to_migrate, "post-upgrade expects inbound lanes to have been migrated."); + tracing::info!(target: LOG_TARGET, %number_of_outbound_to_migrate, "post-upgrade expects outbound lanes to have been migrated."); frame_support::ensure!( number_of_inbound_to_migrate as usize == number_of_inbound, @@ -128,7 +128,7 @@ pub mod v1 { "must migrate all `OutboundLanes`." ); - log::info!(target: LOG_TARGET, "migrated all."); + tracing::info!(target: LOG_TARGET, "migrated all."); Ok(()) } } diff --git a/bridges/modules/messages/src/outbound_lane.rs b/bridges/modules/messages/src/outbound_lane.rs index 1e4411f7b4e29..5f718109e329d 100644 --- a/bridges/modules/messages/src/outbound_lane.rs +++ b/bridges/modules/messages/src/outbound_lane.rs @@ -155,11 +155,11 @@ impl OutboundLane { // chain storage is corrupted, though) that the actual number of confirmed messages if // larger than declared. This would mean that 'reward loop' will take more time than the // weight formula accounts, so we can't allow that. - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Messages delivery proof contains too many messages to confirm: {} vs declared {}", - confirmed_messages.total_messages(), - max_allowed_messages, + confirmed=%confirmed_messages.total_messages(), + max_allowed=%max_allowed_messages, + "Messages delivery proof contains too many messages to confirm" ); return Err(ReceptionConfirmationError::TryingToConfirmMoreMessagesThanExpected) } diff --git a/bridges/modules/parachains/Cargo.toml b/bridges/modules/parachains/Cargo.toml index a187cd3d2ed3e..699b39298cd25 100644 --- a/bridges/modules/parachains/Cargo.toml +++ b/bridges/modules/parachains/Cargo.toml @@ -12,8 +12,8 @@ workspace = true [dependencies] codec = { workspace = true } -log = { workspace = true } scale-info = { features = ["derive"], workspace = true } +tracing = { workspace = true } # Bridge Dependencies bp-header-chain = { workspace = true } @@ -46,11 +46,11 @@ std = [ "frame-benchmarking/std", "frame-support/std", "frame-system/std", - "log/std", "pallet-bridge-grandpa/std", "scale-info/std", "sp-runtime/std", "sp-std/std", + "tracing/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/bridges/modules/parachains/src/benchmarking.rs b/bridges/modules/parachains/src/benchmarking.rs index 92ece6d688cbe..a2be02b7bd67b 100644 --- a/bridges/modules/parachains/src/benchmarking.rs +++ b/bridges/modules/parachains/src/benchmarking.rs @@ -64,7 +64,7 @@ benchmarks_instance_pallet! { } else { Default::default() }; - log::trace!(target: crate::LOG_TARGET, "=== {:?}", parachains.len()); + tracing::trace!(target: crate::LOG_TARGET, "=== {:?}", parachains.len()); let (relay_block_number, relay_block_hash, parachain_heads_proof, parachains_heads) = T::prepare_parachain_heads_proof( ¶chains, DEFAULT_PARACHAIN_HEAD_SIZE, diff --git a/bridges/modules/parachains/src/call_ext.rs b/bridges/modules/parachains/src/call_ext.rs index b67da03a6315c..f6871ecdb0443 100644 --- a/bridges/modules/parachains/src/call_ext.rs +++ b/bridges/modules/parachains/src/call_ext.rs @@ -61,11 +61,10 @@ impl, I: 'static> SubmitParachainHeadsHelper { // reject if no more free slots remaining in the block if !SubmitFinalityProofHelper::::has_free_header_slots() { - log::trace!( + tracing::trace!( target: crate::LOG_TARGET, - "The free parachain {:?} head can't be updated: no more free slots \ - left in the block.", - update.para_id, + para_id=?update.para_id, + "The free parachain head can't be updated: no more free slots left in the block." ); return Err(InvalidTransaction::Call.into()); @@ -80,13 +79,12 @@ impl, I: 'static> SubmitParachainHeadsHelper { // reject if we are importing parachain headers too often if improved_by < free_headers_interval { - log::trace!( + tracing::trace!( target: crate::LOG_TARGET, - "The free parachain {:?} head can't be updated: it improves previous - best head by {} while at least {} is expected.", - update.para_id, - improved_by, - free_headers_interval, + para_id=?update.para_id, + %improved_by, + "The free parachain head can't be updated: it improves previous + best head while at least {free_headers_interval} is expected." ); return Err(InvalidTransaction::Stale.into()); @@ -110,11 +108,11 @@ impl, I: 'static> SubmitParachainHeadsHelper { { Some(improved_by) if improved_by > Zero::zero() => improved_by, _ => { - log::trace!( + tracing::trace!( target: crate::LOG_TARGET, - "The parachain head can't be updated. The parachain head for {:?} \ + para_id=?update.para_id, + "The parachain head can't be updated. The parachain head \ was already updated at better relay chain block {} >= {}.", - update.para_id, stored_best_head.best_head_hash.at_relay_block_number, update.at_relay_block.0 ); @@ -123,12 +121,12 @@ impl, I: 'static> SubmitParachainHeadsHelper { }; if stored_best_head.best_head_hash.head_hash == update.para_head_hash { - log::trace!( + tracing::trace!( target: crate::LOG_TARGET, - "The parachain head can't be updated. The parachain head hash for {:?} \ - was already updated to {} at block {} < {}.", - update.para_id, - update.para_head_hash, + para_id=?update.para_id, + para_head_hash=%update.para_head_hash, + "The parachain head can't be updated. The parachain head hash \ + was already updated at block {} < {}.", stored_best_head.best_head_hash.at_relay_block_number, update.at_relay_block.0 ); @@ -143,13 +141,12 @@ impl, I: 'static> SubmitParachainHeadsHelper { // let's check if our chain had no reorgs and we still know the relay chain header // used to craft the proof if GrandpaPalletOf::::finalized_header_state_root(update.at_relay_block.1).is_none() { - log::trace!( + tracing::trace!( target: crate::LOG_TARGET, - "The parachain {:?} head can't be updated. Relay chain header {}/{} used to create \ - parachain proof is missing from the storage.", - update.para_id, - update.at_relay_block.0, - update.at_relay_block.1, + para_id=?update.para_id, + at_relay_block=?update.at_relay_block, + "The parachain head can't be updated. Relay chain header used to create \ + parachain proof is missing from the storage." ); return Err(InvalidTransaction::Call.into()) diff --git a/bridges/modules/parachains/src/lib.rs b/bridges/modules/parachains/src/lib.rs index 81f73f4b5f359..f93ee5eda7f5c 100644 --- a/bridges/modules/parachains/src/lib.rs +++ b/bridges/modules/parachains/src/lib.rs @@ -461,10 +461,10 @@ pub mod pallet { let parachain_head = match storage.read_parachain_head(parachain) { Ok(Some(parachain_head)) => parachain_head, Ok(None) => { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "The head of parachain {:?} is None. {}", - parachain, + ?parachain, + "The head of parachain is None. {}", if ParasInfo::::contains_key(parachain) { "Looks like it is not yet registered at the source relay chain" } else { @@ -475,11 +475,11 @@ pub mod pallet { continue }, Err(e) => { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "The read of head of parachain {:?} has failed: {:?}", - parachain, - e, + error=?e, + ?parachain, + "The read of head of parachain has failed" ); Self::deposit_event(Event::MissingParachainHead { parachain }); continue @@ -490,13 +490,12 @@ pub mod pallet { // (this isn't strictly necessary, but better safe than sorry) let actual_parachain_head_hash = parachain_head.hash(); if parachain_head_hash != actual_parachain_head_hash { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "The submitter has specified invalid parachain {:?} head hash: \ - {:?} vs {:?}", - parachain, - parachain_head_hash, - actual_parachain_head_hash, + ?parachain, + ?parachain_head_hash, + ?actual_parachain_head_hash, + "The submitter has specified invalid parachain head hash" ); Self::deposit_event(Event::IncorrectParachainHeadHash { parachain, @@ -512,10 +511,10 @@ pub mod pallet { match T::ParaStoredHeaderDataBuilder::try_build(parachain, ¶chain_head) { Some(parachain_head_data) => parachain_head_data, None => { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "The head of parachain {:?} has been provided, but it is not tracked by the pallet", - parachain, + ?parachain, + "The head of parachain has been provided, but it is not tracked by the pallet" ); Self::deposit_event(Event::UntrackedParachainRejected { parachain }); continue @@ -583,12 +582,12 @@ pub mod pallet { && free_parachain_heads == total_parachains && SubmitFinalityProofHelper::::has_free_header_slots(); let pays_fee = if is_free { - log::trace!(target: LOG_TARGET, "Parachain heads update transaction is free"); + tracing::trace!(target: LOG_TARGET, "Parachain heads update transaction is free"); pallet_bridge_grandpa::on_free_header_imported::( ); Pays::No } else { - log::trace!(target: LOG_TARGET, "Parachain heads update transaction is paid"); + tracing::trace!(target: LOG_TARGET, "Parachain heads update transaction is paid"); Pays::Yes }; @@ -662,28 +661,27 @@ pub mod pallet { } // verify that the parachain head data size is <= `MaxParaHeadDataSize` - let updated_head_data = - match StoredParaHeadDataOf::::try_from_inner(new_head_data) { - Ok(updated_head_data) => updated_head_data, - Err(e) => { - log::trace!( - target: LOG_TARGET, - "The parachain head can't be updated. The parachain head data size \ - for {:?} is {}. It exceeds maximal configured size {}.", - parachain, - e.value_size, - e.maximal_size, - ); + let updated_head_data = match StoredParaHeadDataOf::::try_from_inner( + new_head_data, + ) { + Ok(updated_head_data) => updated_head_data, + Err(e) => { + tracing::trace!( + target: LOG_TARGET, + error=?e, + ?parachain, + "The parachain head can't be updated. The parachain head data size exceeds maximal configured size." + ); - Self::deposit_event(Event::RejectedLargeParachainHead { - parachain, - parachain_head_hash: new_head_hash, - parachain_head_size: e.value_size as _, - }); + Self::deposit_event(Event::RejectedLargeParachainHead { + parachain, + parachain_head_hash: new_head_hash, + parachain_head_size: e.value_size as _, + }); - return Err(()) - }, - }; + return Err(()) + }, + }; let next_imported_hash_position = stored_best_head .map_or(0, |stored_best_head| stored_best_head.next_imported_hash_position); @@ -705,12 +703,12 @@ pub mod pallet { new_head_hash, ); ImportedParaHeads::::insert(parachain, new_head_hash, &updated_head_data); - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Updated head of parachain {:?} to {} at relay block {}", - parachain, - new_head_hash, - new_at_relay_block.0, + ?parachain, + %new_head_hash, + at_relay_block=%new_at_relay_block.0, + "Updated head of parachain" ); // trigger callback @@ -719,11 +717,11 @@ pub mod pallet { // remove old head let prune_happened = head_hash_to_prune.is_ok(); if let Ok(head_hash_to_prune) = head_hash_to_prune { - log::trace!( + tracing::trace!( target: LOG_TARGET, - "Pruning old head of parachain {:?}: {}", - parachain, - head_hash_to_prune, + ?parachain, + %head_hash_to_prune, + "Pruning old head of parachain" ); ImportedParaHeads::::remove(parachain, head_hash_to_prune); } diff --git a/bridges/primitives/runtime/Cargo.toml b/bridges/primitives/runtime/Cargo.toml index 7528f2e5d6caa..1311587b997cc 100644 --- a/bridges/primitives/runtime/Cargo.toml +++ b/bridges/primitives/runtime/Cargo.toml @@ -14,10 +14,10 @@ workspace = true codec = { workspace = true } hash-db = { workspace = true } impl-trait-for-tuples = { workspace = true } -log = { workspace = true } num-traits = { workspace = true } scale-info = { features = ["derive"], workspace = true } serde = { features = ["alloc", "derive"], workspace = true } +tracing = { workspace = true } # Substrate Dependencies frame-support = { workspace = true } @@ -40,7 +40,6 @@ std = [ "frame-support/std", "frame-system/std", "hash-db/std", - "log/std", "num-traits/std", "scale-info/std", "serde/std", @@ -50,6 +49,7 @@ std = [ "sp-state-machine/std", "sp-std/std", "sp-trie/std", + "tracing/std", "trie-db/std", ] test-helpers = [] diff --git a/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs index fc13870904de4..4b15ce2d2c9b0 100644 --- a/bridges/primitives/runtime/src/lib.rs +++ b/bridges/primitives/runtime/src/lib.rs @@ -371,6 +371,8 @@ impl OperatingMode for BasicOperatingMode { } } +const COMMON_LOG_TARGET: &'static str = "runtime::bridge-module"; + /// Bridge module that has owner and operating mode pub trait OwnedBridgeModule { /// The target that will be used when publishing logs related to this module. @@ -413,11 +415,11 @@ pub trait OwnedBridgeModule { match maybe_owner { Some(owner) => { Self::OwnerStorage::put(&owner); - log::info!(target: Self::LOG_TARGET, "Setting pallet Owner to: {:?}", owner); + tracing::info!(target: COMMON_LOG_TARGET, module=%Self::LOG_TARGET, ?owner, "Setting pallet."); }, None => { Self::OwnerStorage::kill(); - log::info!(target: Self::LOG_TARGET, "Removed Owner of pallet."); + tracing::info!(target: COMMON_LOG_TARGET, module=%Self::LOG_TARGET, "Removed Owner of pallet."); }, } @@ -431,7 +433,7 @@ pub trait OwnedBridgeModule { ) -> DispatchResult { Self::ensure_owner_or_root(origin)?; Self::OperatingModeStorage::put(operating_mode); - log::info!(target: Self::LOG_TARGET, "Setting operating mode to {:?}.", operating_mode); + tracing::info!(target: COMMON_LOG_TARGET, module=%Self::LOG_TARGET, ?operating_mode, "Setting operating mode."); Ok(()) } diff --git a/bridges/primitives/runtime/src/storage_proof.rs b/bridges/primitives/runtime/src/storage_proof.rs index 113e101e3703a..19355358e2e33 100644 --- a/bridges/primitives/runtime/src/storage_proof.rs +++ b/bridges/primitives/runtime/src/storage_proof.rs @@ -166,7 +166,7 @@ where self.read_value(key).and_then(|v| { v.map(|v| { T::decode(&mut &v[..]).map_err(|e| { - log::warn!(target: "bridge-storage-proofs", "read_and_decode_value error: {e:?}"); + tracing::warn!(target: "bridge-storage-proofs", error=?e, "read_and_decode_value"); StorageProofError::DecodeError }) }) diff --git a/cumulus/client/consensus/proposer/Cargo.toml b/cumulus/client/consensus/proposer/Cargo.toml index e391481bc4452..b98c77b3f891b 100644 --- a/cumulus/client/consensus/proposer/Cargo.toml +++ b/cumulus/client/consensus/proposer/Cargo.toml @@ -17,6 +17,11 @@ async-trait = { workspace = true } thiserror = { workspace = true } # Substrate +sc-basic-authorship = { workspace = true } +sc-block-builder = { workspace = true } +sc-transaction-pool-api = { workspace = true } +sp-api = { workspace = true, default-features = true } +sp-blockchain = { workspace = true, default-features = true } sp-consensus = { workspace = true, default-features = true } sp-inherents = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } diff --git a/cumulus/client/consensus/proposer/src/lib.rs b/cumulus/client/consensus/proposer/src/lib.rs index 47ef05839d70a..af6894fd5da72 100644 --- a/cumulus/client/consensus/proposer/src/lib.rs +++ b/cumulus/client/consensus/proposer/src/lib.rs @@ -15,19 +15,22 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -//! The Cumulus [`Proposer`] is a wrapper around a Substrate [`sp_consensus::Environment`] +//! The Cumulus [`ProposerInterface`] is an extension of the Substrate [`ProposerFactory`] //! for creating new parachain blocks. //! //! This utility is designed to be composed within any collator consensus algorithm. use async_trait::async_trait; - -use sp_consensus::{EnableProofRecording, Environment, Proposal, Proposer as SubstrateProposer}; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use sc_basic_authorship::{ProposeArgs, ProposerFactory}; +use sc_block_builder::BlockBuilderApi; +use sc_transaction_pool_api::TransactionPool; +use sp_api::{ApiExt, CallApiAt, ProvideRuntimeApi}; +use sp_blockchain::HeaderBackend; +use sp_consensus::{EnableProofRecording, Environment, Proposal}; use sp_inherents::{InherentData, InherentDataProvider}; use sp_runtime::{traits::Block as BlockT, Digest}; use sp_state_machine::StorageProof; - -use cumulus_primitives_parachain_inherent::ParachainInherentData; use std::{fmt::Debug, time::Duration}; /// Errors that can occur when proposing a parachain block. @@ -50,7 +53,7 @@ impl Error { } /// A type alias for easily referring to the type of a proposal produced by a specific -/// [`Proposer`]. +/// [`ProposerInterface`]. pub type ProposalOf = Proposal; /// An interface for proposers. @@ -80,39 +83,24 @@ pub trait ProposerInterface { ) -> Result>, Error>; } -/// A simple wrapper around a Substrate proposer for creating collations. -pub struct Proposer { - inner: T, - _marker: std::marker::PhantomData, -} - -impl Proposer { - /// Create a new Cumulus [`Proposer`]. - pub fn new(inner: T) -> Self { - Proposer { inner, _marker: std::marker::PhantomData } - } -} - #[async_trait] -impl ProposerInterface for Proposer +impl ProposerInterface for ProposerFactory where - B: sp_runtime::traits::Block, - T: Environment + Send, - T::Error: Send + Sync + 'static, - T::Proposer: SubstrateProposer, - >::Error: Send + Sync + 'static, + A: TransactionPool + 'static, + C: HeaderBackend + ProvideRuntimeApi + CallApiAt + Send + Sync + 'static, + C::Api: ApiExt + BlockBuilderApi, + Block: sp_runtime::traits::Block, { async fn propose( &mut self, - parent_header: &B::Header, + parent_header: &Block::Header, paras_inherent_data: &ParachainInherentData, other_inherent_data: InherentData, inherent_digests: Digest, max_duration: Duration, block_size_limit: Option, - ) -> Result>, Error> { + ) -> Result>, Error> { let proposer = self - .inner .init(parent_header) .await .map_err(|e| Error::proposer_creation(anyhow::Error::new(e)))?; @@ -124,7 +112,13 @@ where .map_err(|e| Error::proposing(anyhow::Error::new(e)))?; proposer - .propose(inherent_data, inherent_digests, max_duration, block_size_limit) + .propose_block(ProposeArgs { + inherent_data, + inherent_digests, + max_duration, + block_size_limit, + ignored_nodes_by_proof_recording: None, + }) .await .map(Some) .map_err(|e| Error::proposing(anyhow::Error::new(e)).into()) diff --git a/cumulus/pallets/parachain-system/Cargo.toml b/cumulus/pallets/parachain-system/Cargo.toml index 28776b2dae581..6f84162dcb010 100644 --- a/cumulus/pallets/parachain-system/Cargo.toml +++ b/cumulus/pallets/parachain-system/Cargo.toml @@ -59,12 +59,13 @@ trie-standardmap = { workspace = true } # Substrate +sc-consensus = { workspace = true } +sp-api = { workspace = true, default-features = true } sp-consensus-slots = { workspace = true, default-features = true } sp-crypto-hashing = { workspace = true, default-features = true } sp-keyring = { workspace = true, default-features = true } sp-tracing = { workspace = true, default-features = true } sp-version = { workspace = true, default-features = true } - # Cumulus cumulus-test-client = { workspace = true } cumulus-test-relay-sproof-builder = { workspace = true, default-features = true } diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index f56fc1327aa50..4e8789c9bcb10 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -1241,6 +1241,33 @@ impl Pallet { } } + /// Performs some checks related to the sender and the `sent_at` field of an HRMP message. + /// + /// **Panics** if the message submitted by the collator doesn't respect the expected order or if + /// it was sent from a para which has no open channel to this parachain. + fn check_hrmp_message_metadata( + ingress_channels: &[(ParaId, cumulus_primitives_core::AbridgedHrmpChannel)], + maybe_prev_msg_metadata: &mut Option<(u32, ParaId)>, + msg_metadata: (u32, ParaId), + ) { + // Check that the message is properly ordered. + if let Some(prev_msg) = maybe_prev_msg_metadata { + assert!(&msg_metadata >= prev_msg, "[HRMP] Messages order violation"); + } + + // Check that the message is sent from an existing channel. The channel exists + // if its MQC head is present in `vfp.hrmp_mqc_heads`. + let sender = msg_metadata.1; + let maybe_channel_idx = + ingress_channels.binary_search_by_key(&sender, |&(channel_sender, _)| channel_sender); + assert!( + maybe_channel_idx.is_ok(), + "One of the messages submitted by the collator was sent from a sender ({}) \ + that doesn't have a channel opened to this parachain", + >::into(sender) + ); + } + /// Process all inbound horizontal messages relayed by the collator. /// /// This is similar to [`enqueue_inbound_downward_messages`], but works with multiple inbound @@ -1258,14 +1285,6 @@ impl Pallet { ) -> Weight { // First, check the HRMP advancement rule. horizontal_messages.check_enough_messages_included("HRMP"); - // Then, check that all submitted messages are sent from channels that exist. The - // channel exists if its MQC head is present in `vfp.hrmp_mqc_heads`. - for sender in horizontal_messages.get_senders() { - // A violation of the assertion below indicates that one of the messages submitted - // by the collator was sent from a sender that doesn't have a channel opened to - // this parachain, according to the relay-parent state. - assert!(ingress_channels.binary_search_by_key(&sender, |&(s, _)| s).is_ok(),); - } let (messages, hashed_messages) = horizontal_messages.messages(); let mut mqc_heads = >::get(); @@ -1279,18 +1298,29 @@ impl Pallet { return T::DbWeight::get().reads_writes(1, 2); } + let mut prev_msg_metadata = None; let mut last_processed_block = HrmpWatermark::::get(); let mut last_processed_msg = InboundMessageId { sent_at: 0, reverse_idx: 0 }; for (sender, msg) in messages { + Self::check_hrmp_message_metadata( + ingress_channels, + &mut prev_msg_metadata, + (msg.sent_at, *sender), + ); + mqc_heads.entry(*sender).or_default().extend_hrmp(msg); + if msg.sent_at > last_processed_msg.sent_at && last_processed_msg.sent_at > 0 { last_processed_block = last_processed_msg.sent_at; } last_processed_msg.sent_at = msg.sent_at; - - mqc_heads.entry(*sender).or_default().extend_hrmp(msg); } >::put(&mqc_heads); for (sender, msg) in hashed_messages { + Self::check_hrmp_message_metadata( + ingress_channels, + &mut prev_msg_metadata, + (msg.sent_at, *sender), + ); mqc_heads.entry(*sender).or_default().extend_with_hashed_msg(msg); if msg.sent_at == last_processed_msg.sent_at { diff --git a/cumulus/pallets/parachain-system/src/parachain_inherent.rs b/cumulus/pallets/parachain-system/src/parachain_inherent.rs index 0d1012b171232..59c9faaeda6de 100644 --- a/cumulus/pallets/parachain-system/src/parachain_inherent.rs +++ b/cumulus/pallets/parachain-system/src/parachain_inherent.rs @@ -16,11 +16,7 @@ //! Cumulus parachain inherent related structures. -use alloc::{ - collections::{btree_map::BTreeMap, btree_set::BTreeSet}, - vec, - vec::Vec, -}; +use alloc::{collections::btree_map::BTreeMap, vec, vec::Vec}; use core::fmt::Debug; use cumulus_primitives_core::{ relay_chain::{ @@ -307,15 +303,6 @@ pub type AbridgedInboundHrmpMessages = AbridgedInboundMessagesCollection<(ParaId, InboundHrmpMessage)>; impl AbridgedInboundHrmpMessages { - /// Returns a list of all the unique senders. - pub fn get_senders(&self) -> BTreeSet { - self.full_messages - .iter() - .map(|(sender, _msg)| *sender) - .chain(self.hashed_messages.iter().map(|(sender, _msg)| *sender)) - .collect() - } - /// Returns an iterator over the deconstructed messages. pub fn flat_msgs_iter(&self) -> impl Iterator { self.full_messages diff --git a/cumulus/pallets/parachain-system/src/tests.rs b/cumulus/pallets/parachain-system/src/tests.rs index 6c72ca8d292f8..e846bc8013804 100755 --- a/cumulus/pallets/parachain-system/src/tests.rs +++ b/cumulus/pallets/parachain-system/src/tests.rs @@ -560,6 +560,117 @@ fn inherent_messages_are_compressed() { }); } +#[test] +fn check_hrmp_message_metadata_works_with_known_channel() { + Pallet::::check_hrmp_message_metadata( + &[(1000.into(), Default::default())], + &mut None, + (1, 1000.into()), + ); +} + +#[test] +#[should_panic( + expected = "One of the messages submitted by the collator was sent from a sender (2000) that \ + doesn't have a channel opened to this parachain" +)] +fn check_hrmp_message_metadata_panics_on_unknown_channel() { + Pallet::::check_hrmp_message_metadata( + &[(1000.into(), Default::default())], + &mut None, + (1, 2000.into()), + ); +} + +#[test] +fn check_hrmp_message_metadata_works_when_correctly_ordered() { + Pallet::::check_hrmp_message_metadata( + &[(1000.into(), Default::default())], + &mut None, + (1, 1000.into()), + ); + + Pallet::::check_hrmp_message_metadata( + &[(1000.into(), Default::default())], + &mut Some((0, 1000.into())), + (1, 1000.into()), + ); +} + +#[test] +#[should_panic(expected = "[HRMP] Messages order violation")] +fn check_hrmp_message_metadata_panics_on_unordered_sent_at() { + Pallet::::check_hrmp_message_metadata( + &[(1000.into(), Default::default())], + &mut Some((1, 1000.into())), + (0, 1000.into()), + ); +} + +#[test] +#[should_panic(expected = "[HRMP] Messages order violation")] +fn check_hrmp_message_metadata_panics_on_unordered_para_id() { + Pallet::::check_hrmp_message_metadata( + &[(1000.into(), Default::default())], + &mut Some((1, 2000.into())), + (1, 1000.into()), + ); +} + +#[test] +#[should_panic( + expected = "One of the messages submitted by the collator was sent from a sender (2000) that \ + doesn't have a channel opened to this parachain" +)] +fn hrmp_ingress_channels_are_checked() { + CONSENSUS_HOOK.with(|c| { + *c.borrow_mut() = Box::new(|_| (Weight::zero(), NonZeroU32::new(2).unwrap().into())) + }); + + let mut test = BlockTests::new() + .with_inclusion_delay(1) + .with_relay_block_number(|block_number| 2.max(*block_number as RelayChainBlockNumber)) + .with_relay_sproof_builder(move |_, relay_block_num, sproof| match relay_block_num { + // Let's open a channel only with parachain 1000. + 2 => { + let mqc_head = + sproof.upsert_inbound_channel(1000.into()).mqc_head.get_or_insert_default(); + let mut mqc = MessageQueueChain::new(*mqc_head); + mqc.extend_hrmp(&mk_hrmp(1, 100)); + *mqc_head = mqc.head(); + }, + _ => {}, + }) + .with_inherent_data(move |_, relay_block_num, data| match relay_block_num { + // Simulate receiving a message from parachain 1000 at block 2. This should work. + 2 => { + let entry = data.horizontal_messages.entry(1000.into()).or_default(); + entry.push(mk_hrmp(1, 100)) + }, + _ => {}, + }) + .add(2, move || { + HANDLED_XCMP_MESSAGES.with(|m| { + let m = m.borrow_mut(); + assert_eq!(&*m, &vec![(1000.into(), 1, vec![1; 100])]); + }); + }); + test.run(); + + let mut test = test + .with_relay_block_number(|block_number| 3.max(*block_number as RelayChainBlockNumber)) + .with_inherent_data(move |_, relay_block_num, data| match relay_block_num { + // Simulate receiving a message from parachain 2000 at block 3. This should lead to a + // panic. + 3 => { + let entry = data.horizontal_messages.entry(2000.into()).or_default(); + entry.push(mk_hrmp(1, 100)) + }, + _ => {}, + }); + test.run(); +} + #[test] fn hrmp_outbound_respects_used_bandwidth() { let recipient = ParaId::from(400); diff --git a/cumulus/pallets/parachain-system/src/validate_block/implementation.rs b/cumulus/pallets/parachain-system/src/validate_block/implementation.rs index 1fe0bc45f8d57..7546d3f38c8df 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/implementation.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/implementation.rs @@ -17,33 +17,32 @@ //! The actual implementation of the validate block functionality. use super::{trie_cache, trie_recorder, MemoryOptimizedValidationParams}; -use crate::parachain_inherent::BasicParachainInherentData; -use cumulus_primitives_core::{ - relay_chain::Hash as RHash, ParachainBlockData, PersistedValidationData, -}; - -use polkadot_parachain_primitives::primitives::{ - HeadData, RelayChainBlockNumber, ValidationResult, -}; - +use crate::{parachain_inherent::BasicParachainInherentData, ClaimQueueOffset, CoreSelector}; use alloc::vec::Vec; use codec::{Decode, Encode}; - -use cumulus_primitives_core::relay_chain::vstaging::{UMPSignal, UMP_SEPARATOR}; +use cumulus_primitives_core::{ + relay_chain::{ + vstaging::{UMPSignal, UMP_SEPARATOR}, + Hash as RHash, + }, + ParachainBlockData, PersistedValidationData, +}; use frame_support::{ traits::{ExecuteBlock, Get, IsSubType}, BoundedVec, }; +use polkadot_parachain_primitives::primitives::{ + HeadData, RelayChainBlockNumber, ValidationResult, +}; use sp_core::storage::{ChildInfo, StateVersion}; use sp_externalities::{set_and_run_with_externalities, Externalities}; use sp_io::{hashing::blake2_128, KillStorageResult}; use sp_runtime::traits::{ - Block as BlockT, ExtrinsicCall, ExtrinsicLike, HashingFor, Header as HeaderT, + Block as BlockT, ExtrinsicCall, ExtrinsicLike, Hash as HashT, HashingFor, Header as HeaderT, }; - use sp_state_machine::OverlayedChanges; -use sp_trie::ProofSizeProvider; -use trie_recorder::SizeOnlyRecorderProvider; +use sp_trie::{HashDBT, ProofSizeProvider, EMPTY_PREFIX}; +use trie_recorder::{SeenNodes, SizeOnlyRecorderProvider}; type Ext<'a, Block, Backend> = sp_state_machine::Ext<'a, HashingFor, Backend>; @@ -174,7 +173,7 @@ where let num_blocks = blocks.len(); // Create the db - let db = match proof.to_memory_db(Some(parent_header.state_root())) { + let mut db = match proof.to_memory_db(Some(parent_header.state_root())) { Ok((db, _)) => db, Err(_) => panic!("Compact proof decoding failure."), }; @@ -182,29 +181,32 @@ where core::mem::drop(proof); let cache_provider = trie_cache::CacheProvider::new(); - // We use the storage root of the `parent_head` to ensure that it is the correct root. - // This is already being done above while creating the in-memory db, but let's be paranoid!! - let backend = sp_state_machine::TrieBackendBuilder::new_with_cache( - db, - *parent_header.state_root(), - cache_provider, - ) - .build(); - - // We use the same recorder when executing all blocks. So, each node only contributes once to - // the total size of the storage proof. This recorder should only be used for `execute_block`. - let mut execute_recorder = SizeOnlyRecorderProvider::default(); - // `backend` with the `execute_recorder`. As the `execute_recorder`, this should only be used - // for `execute_block`. - let execute_backend = sp_state_machine::TrieBackendBuilder::wrap(&backend) - .with_recorder(execute_recorder.clone()) + let seen_nodes = SeenNodes::>::default(); + + for (block_index, block) in blocks.into_iter().enumerate() { + // We use the storage root of the `parent_head` to ensure that it is the correct root. + // This is already being done above while creating the in-memory db, but let's be paranoid!! + let backend = sp_state_machine::TrieBackendBuilder::new_with_cache( + &db, + *parent_header.state_root(), + &cache_provider, + ) .build(); - // We let all blocks contribute to the same overlay. Data written by a previous block will be - // directly accessible without going to the db. - let mut overlay = OverlayedChanges::default(); + // We use the same recorder when executing all blocks. So, each node only contributes once + // to the total size of the storage proof. This recorder should only be used for + // `execute_block`. + let mut execute_recorder = SizeOnlyRecorderProvider::with_seen_nodes(seen_nodes.clone()); + // `backend` with the `execute_recorder`. As the `execute_recorder`, this should only be + // used for `execute_block`. + let execute_backend = sp_state_machine::TrieBackendBuilder::wrap(&backend) + .with_recorder(execute_recorder.clone()) + .build(); + + // We let all blocks contribute to the same overlay. Data written by a previous block will + // be directly accessible without going to the db. + let mut overlay = OverlayedChanges::default(); - for (block_index, block) in blocks.into_iter().enumerate() { parent_header = block.header().clone(); let inherent_data = extract_parachain_inherent_data(&block); @@ -308,11 +310,33 @@ where ); } }, - ) + ); + + if block_index + 1 != num_blocks { + let mut changes = overlay + .drain_storage_changes( + &backend, + ::Version::get().state_version(), + ) + .expect("Failed to get drain storage changes from the overlay."); + + drop(backend); + + // We just forward the changes directly to our db. + changes.transaction.drain().into_iter().for_each(|(_, (value, count))| { + // We only care about inserts and not deletes. + if count > 0 { + db.insert(EMPTY_PREFIX, &value); + + let hash = HashingFor::::hash(&value); + seen_nodes.borrow_mut().insert(hash); + } + }); + } } if !upward_message_signals.is_empty() { - let mut selected_core = None; + let mut selected_core: Option<(CoreSelector, ClaimQueueOffset)> = None; let mut approved_peer = None; upward_message_signals.iter().for_each(|s| { diff --git a/cumulus/pallets/parachain-system/src/validate_block/tests.rs b/cumulus/pallets/parachain-system/src/validate_block/tests.rs index 028bd64566d25..77bea27e182d3 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/tests.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/tests.rs @@ -14,11 +14,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::*; +use crate::{validate_block::MemoryOptimizedValidationParams, *}; use codec::{Decode, DecodeAll, Encode}; use cumulus_primitives_core::{ParachainBlockData, PersistedValidationData}; use cumulus_test_client::{ - generate_extrinsic, + generate_extrinsic, generate_extrinsic_with_pair, runtime::{ self as test_runtime, Block, Hash, Header, TestPalletCall, UncheckedExtrinsic, WASM_BINARY, }, @@ -31,12 +31,14 @@ use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use polkadot_parachain_primitives::primitives::ValidationResult; #[cfg(feature = "experimental-ump-signals")] use relay_chain::vstaging::{UMPSignal, UMP_SEPARATOR}; -use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; - +use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; +use sp_api::{ApiExt, Core, ProofRecorder, ProvideRuntimeApi}; +use sp_consensus_slots::SlotDuration; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT}; +use sp_trie::{proof_size_extension::ProofSizeExt, recorder::IgnoredNodes, StorageProof}; use std::{env, process::Command}; -use crate::validate_block::MemoryOptimizedValidationParams; - fn call_validate_block_validation_result( validation_code: &[u8], parent_head: Header, @@ -75,7 +77,7 @@ fn call_validate_block_elastic_scaling( relay_parent_storage_root: Hash, ) -> cumulus_test_client::ExecutorResult
{ call_validate_block_validation_result( - test_runtime::elastic_scaling::WASM_BINARY + test_runtime::elastic_scaling_500ms::WASM_BINARY .expect("You need to build the WASM binaries to run the tests!"), parent_head, block_data, @@ -97,13 +99,14 @@ fn create_test_client() -> (Client, Header) { } /// Create test client using the runtime with `elastic-scaling` feature enabled. -fn create_elastic_scaling_test_client() -> (Client, Header) { +fn create_elastic_scaling_test_client(blocks_per_pov: u32) -> (Client, Header) { let mut builder = TestClientBuilder::new(); builder.genesis_init_mut().wasm = Some( - test_runtime::elastic_scaling::WASM_BINARY + test_runtime::elastic_scaling_500ms::WASM_BINARY .expect("You need to build the WASM binaries to run the tests!") .to_vec(), ); + builder.genesis_init_mut().blocks_per_pov = Some(blocks_per_pov); let client = builder.enable_import_proof_recording().build(); let genesis_header = client @@ -151,16 +154,28 @@ fn build_multiple_blocks_with_witness( client: &Client, mut parent_head: Header, mut sproof_builder: RelayStateSproofBuilder, - num_blocks: usize, + num_blocks: u32, + extra_extrinsics: impl Fn(u32) -> Vec, ) -> TestBlockData { + let parent_head_root = *parent_head.state_root(); sproof_builder.para_id = test_runtime::PARACHAIN_ID.into(); sproof_builder.included_para_head = Some(HeadData(parent_head.encode())); - sproof_builder.current_slot = (std::time::SystemTime::now() - .duration_since(std::time::SystemTime::UNIX_EPOCH) - .expect("Time is always after UNIX_EPOCH; qed") - .as_millis() as u64 / - 6000) - .into(); + + let timestamp = if sproof_builder.current_slot == 0u64 { + let timestamp = std::time::SystemTime::now() + .duration_since(std::time::SystemTime::UNIX_EPOCH) + .expect("Time is always after UNIX_EPOCH; qed") + .as_millis() as u64; + sproof_builder.current_slot = (timestamp / 6000).into(); + + timestamp + } else { + sproof_builder + .current_slot + .timestamp(SlotDuration::from_millis(6000)) + .unwrap() + .as_millis() + }; let validation_data = PersistedValidationData { relay_parent_number: 1, @@ -170,32 +185,65 @@ fn build_multiple_blocks_with_witness( let mut persisted_validation_data = None; let mut blocks = Vec::new(); - //TODO: Fix this, not correct. - let mut proof = None; + let mut proof = StorageProof::empty(); + let mut ignored_nodes = IgnoredNodes::::default(); - for _ in 0..num_blocks { + for i in 0..num_blocks { let cumulus_test_client::BlockBuilderAndSupportData { - block_builder, + mut block_builder, persisted_validation_data: p_v_data, - } = client.init_block_builder(Some(validation_data.clone()), sproof_builder.clone()); + } = client.init_block_builder_with_ignored_nodes( + parent_head.hash(), + Some(validation_data.clone()), + sproof_builder.clone(), + timestamp, + ignored_nodes.clone(), + ); persisted_validation_data = Some(p_v_data); - let (build_blocks, build_proof) = - block_builder.build_parachain_block(*parent_head.state_root()).into_inner(); + for ext in (extra_extrinsics)(i) { + block_builder.push(ext).unwrap(); + } + + let built_block = block_builder.build().unwrap(); - proof.get_or_insert_with(|| build_proof); + futures::executor::block_on({ + let parent_hash = *built_block.block.header.parent_hash(); + let state = client.state_at(parent_hash).unwrap(); - blocks.extend(build_blocks.into_iter().inspect(|b| { - futures::executor::block_on(client.import_as_best(BlockOrigin::Own, b.clone())) - .unwrap(); + let mut api = client.runtime_api(); + let proof_recorder = ProofRecorder::::with_ignored_nodes(ignored_nodes.clone()); + api.record_proof_with_recorder(proof_recorder.clone()); + api.register_extension(ProofSizeExt::new(proof_recorder)); + api.execute_block(parent_hash, built_block.block.clone()).unwrap(); - parent_head = b.header.clone(); - })); + let (header, extrinsics) = built_block.block.clone().deconstruct(); + + let mut import = BlockImportParams::new(BlockOrigin::Own, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + import.state_action = api.into_storage_changes(&state, parent_hash).unwrap().into(); + + BlockImport::import_block(&client, import) + }) + .unwrap(); + + ignored_nodes.extend(IgnoredNodes::from_storage_proof::( + &built_block.proof.clone().unwrap(), + )); + ignored_nodes.extend(IgnoredNodes::from_memory_db(built_block.storage_changes.transaction)); + proof = StorageProof::merge([proof, built_block.proof.unwrap()]); + + parent_head = built_block.block.header.clone(); + + blocks.push(built_block.block); } + let proof = proof.into_compact_proof::(parent_head_root).unwrap(); + TestBlockData { - block: ParachainBlockData::new(blocks, proof.unwrap()), + block: ParachainBlockData::new(blocks, proof), validation_data: persisted_validation_data.unwrap(), } } @@ -217,13 +265,27 @@ fn validate_block_works() { } #[test] -#[ignore = "Needs another pr to work"] fn validate_multiple_blocks_work() { sp_tracing::try_init_simple(); - let (client, parent_head) = create_elastic_scaling_test_client(); - let TestBlockData { block, validation_data } = - build_multiple_blocks_with_witness(&client, parent_head.clone(), Default::default(), 4); + let blocks_per_pov = 4; + let (client, parent_head) = create_elastic_scaling_test_client(blocks_per_pov); + let TestBlockData { block, validation_data } = build_multiple_blocks_with_witness( + &client, + parent_head.clone(), + Default::default(), + blocks_per_pov, + |i| { + vec![generate_extrinsic_with_pair( + &client, + Charlie.into(), + TestPalletCall::read_and_write_big_value {}, + Some(i), + )] + }, + ); + + assert!(block.proof().encoded_size() < 3 * 1024 * 1024); let block = seal_parachain_block_data(block, &client); let header = block.blocks().last().unwrap().header().clone(); @@ -451,12 +513,68 @@ fn validate_block_works_with_child_tries() { assert_eq!(header, res_header); } +#[test] +fn state_changes_in_multiple_blocks_are_applied_in_exact_order() { + sp_tracing::try_init_simple(); + + let blocks_per_pov = 12; + // disable the core selection logic + let (client, genesis_head) = create_elastic_scaling_test_client(0); + + // 1. Build the initial block that stores values in the map. + let TestBlockData { block: initial_block_data, .. } = build_block_with_witness( + &client, + vec![generate_extrinsic_with_pair( + &client, + Alice.into(), + TestPalletCall::store_values_in_map { max_key: 4095 }, + Some(0), + )], + genesis_head.clone(), + RelayStateSproofBuilder { current_slot: 1.into(), ..Default::default() }, + ); + + let initial_block = initial_block_data.blocks()[0].clone(); + futures::executor::block_on(client.import(BlockOrigin::Own, initial_block.clone())).unwrap(); + let initial_block_header = initial_block.header().clone(); + + // 2. Build the PoV block that removes values from the map. + let TestBlockData { block: pov_block_data, validation_data: pov_validation_data } = + build_multiple_blocks_with_witness( + &client, + initial_block_header.clone(), // Start building PoV from the initial block's header + RelayStateSproofBuilder { current_slot: 2.into(), ..Default::default() }, + blocks_per_pov, + |i| { + // Each block `i` (0-11) removes key `116 + i`. + let key_to_remove = 116 + i; + vec![generate_extrinsic_with_pair( + &client, + Bob.into(), // Use Bob to avoid nonce conflicts with Alice + TestPalletCall::remove_value_from_map { key: key_to_remove }, + Some(i), + )] + }, + ); + + // 3. Validate the PoV. + let sealed_pov_block = seal_parachain_block_data(pov_block_data, &client); + let final_pov_header = sealed_pov_block.blocks().last().unwrap().header().clone(); + let res_header = call_validate_block_elastic_scaling( + initial_block_header, // The parent is the head of the initial block before the PoV + sealed_pov_block, + pov_validation_data.relay_parent_storage_root, + ) + .expect("Calls `validate_block` after building the PoV"); + assert_eq!(final_pov_header, res_header); +} + #[test] #[cfg(feature = "experimental-ump-signals")] fn validate_block_handles_ump_signal() { sp_tracing::try_init_simple(); - let (client, parent_head) = create_elastic_scaling_test_client(); + let (client, parent_head) = create_elastic_scaling_test_client(1); let extra_extrinsics = vec![transfer(&client, Alice, Bob, 69), transfer(&client, Bob, Charlie, 100)]; diff --git a/cumulus/pallets/parachain-system/src/validate_block/trie_cache.rs b/cumulus/pallets/parachain-system/src/validate_block/trie_cache.rs index f92bd399bf84d..cf6eb6fb94f33 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/trie_cache.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/trie_cache.rs @@ -85,6 +85,26 @@ impl CacheProvider { } } +impl TrieCacheProvider for &&CacheProvider { + type Cache<'a> + = TrieCache<'a, H> + where + Self: 'a, + H: 'a; + + fn as_trie_db_cache(&self, storage_root: ::Out) -> Self::Cache<'_> { + TrieCacheProvider::::as_trie_db_cache(**self, storage_root) + } + + fn as_trie_db_mut_cache(&self) -> Self::Cache<'_> { + TrieCacheProvider::::as_trie_db_mut_cache(**self) + } + + fn merge<'a>(&'a self, other: Self::Cache<'a>, new_root: ::Out) { + TrieCacheProvider::merge(**self, other, new_root) + } +} + impl TrieCacheProvider for &CacheProvider { type Cache<'a> = TrieCache<'a, H> diff --git a/cumulus/pallets/parachain-system/src/validate_block/trie_recorder.rs b/cumulus/pallets/parachain-system/src/validate_block/trie_recorder.rs index 4aad9e3dd6577..c7ed8a6a9323d 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/trie_recorder.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/trie_recorder.rs @@ -20,15 +20,15 @@ //! [`SizeOnlyRecorderProvider`]. They are used to track the current //! proof-size without actually recording the accessed nodes themselves. -use codec::Encode; - use alloc::rc::Rc; - +use codec::Encode; use core::cell::{RefCell, RefMut}; use hashbrown::{HashMap, HashSet}; use sp_trie::{NodeCodec, ProofSizeProvider, RandomState, StorageProof}; use trie_db::{Hasher, RecordedForKey, TrieAccess}; +pub(crate) type SeenNodes = Rc::Out, RandomState>>>; + /// A trie recorder that only keeps track of the proof size. /// /// The internal size counting logic should align @@ -90,7 +90,7 @@ impl<'a, H: trie_db::Hasher> trie_db::TrieRecorder for SizeOnlyRecorder< #[derive(Clone)] pub struct SizeOnlyRecorderProvider { - seen_nodes: Rc>>, + seen_nodes: SeenNodes, encoded_size: Rc>, recorded_keys: Rc, RecordedForKey, RandomState>>>, } @@ -105,6 +105,14 @@ impl Default for SizeOnlyRecorderProvider { } } +impl SizeOnlyRecorderProvider { + /// Use the given `seen_nodes` to populate the internal state. + #[cfg(not(feature = "std"))] + pub(crate) fn with_seen_nodes(seen_nodes: SeenNodes) -> Self { + Self { seen_nodes, ..Default::default() } + } +} + impl sp_trie::TrieRecorderProvider for SizeOnlyRecorderProvider { type Recorder<'a> = SizeOnlyRecorder<'a, H> diff --git a/cumulus/parachains/chain-specs/asset-hub-westend.json b/cumulus/parachains/chain-specs/asset-hub-westend.json index 79567c24666dd..7720be583cb31 100644 --- a/cumulus/parachains/chain-specs/asset-hub-westend.json +++ b/cumulus/parachains/chain-specs/asset-hub-westend.json @@ -13,8 +13,6 @@ "/dns/asset-hub-westend.boot.stake.plus/tcp/31332/wss/p2p/12D3KooWFLR2UN6PMAUwNAjiWBAiEDoYcWRrtjDrUfRkdUssge4v", "/dns/boot.metaspan.io/tcp/36052/p2p/12D3KooWBCqfNb6Y39DXTr4UBWXyjuS3hcZM1qTbHhDXxF6HkAJJ", "/dns/boot.metaspan.io/tcp/36056/wss/p2p/12D3KooWBCqfNb6Y39DXTr4UBWXyjuS3hcZM1qTbHhDXxF6HkAJJ", - "/dns/boot.gatotech.network/tcp/33310/p2p/12D3KooWMSW6hr8KcNBhGFN1bg8kYC76o67PnuDEbxRhxacW6dui", - "/dns/boot.gatotech.network/tcp/35310/wss/p2p/12D3KooWMSW6hr8KcNBhGFN1bg8kYC76o67PnuDEbxRhxacW6dui", "/dns/westmint-bootnode.turboflakes.io/tcp/30325/p2p/12D3KooWHU4qqSyqKdbXdrCTMXUJxxueaZjqpqSaQqYiFPw6XqEx", "/dns/westmint-bootnode.turboflakes.io/tcp/30425/wss/p2p/12D3KooWHU4qqSyqKdbXdrCTMXUJxxueaZjqpqSaQqYiFPw6XqEx", "/dns/boot-node.helikon.io/tcp/10200/p2p/12D3KooWMRY8wb7rMT81LLuivvsy6ahUxKHQgYJw4zm1hC1uYLxb", diff --git a/cumulus/parachains/chain-specs/bridge-hub-westend.json b/cumulus/parachains/chain-specs/bridge-hub-westend.json index ef91b6811b5d2..bb02c1d04cc14 100644 --- a/cumulus/parachains/chain-specs/bridge-hub-westend.json +++ b/cumulus/parachains/chain-specs/bridge-hub-westend.json @@ -13,8 +13,6 @@ "/dns/westend-bridge-hub-boot-ng.dwellir.com/tcp/443/wss/p2p/12D3KooWJWWRYTAwBLqYkh7iMBGDr5ouJ3MHj7M3fZ7zWS4zEk6F", "/dns/bridge-hub-westend.boot.stake.plus/tcp/30332/wss/p2p/12D3KooW9rqdajWEpC3i65zaTVR1ER2RmY6e26vndPsKhBB6WJ1k", "/dns/bridge-hub-westend.boot.stake.plus/tcp/31332/wss/p2p/12D3KooWN55mz6EQb5nrCgTiNL6nroVrRXygCiFDvHpeKk97Jqqc", - "/dns/boot.gatotech.network/tcp/33330/p2p/12D3KooWJHG6qznPzTSEbuujHNcvyzBZcR9zNRPFcXWUaoVWZBEw", - "/dns/boot.gatotech.network/tcp/35330/wss/p2p/12D3KooWJHG6qznPzTSEbuujHNcvyzBZcR9zNRPFcXWUaoVWZBEw", "/dns/bridge-hub-westend-bootnode.turboflakes.io/tcp/30620/p2p/12D3KooWLeExhPWCDUjcxCdzxTP5TpPbNBVG5t9MPvk1dZUM5naU", "/dns/bridge-hub-westend-bootnode.turboflakes.io/tcp/30720/wss/p2p/12D3KooWLeExhPWCDUjcxCdzxTP5TpPbNBVG5t9MPvk1dZUM5naU", "/dns/boot.metaspan.io/tcp/36032/p2p/12D3KooWPaLsu3buByBnGFQnp5UP4q1S652dGVft92TFeChizFir", diff --git a/cumulus/parachains/chain-specs/collectives-westend.json b/cumulus/parachains/chain-specs/collectives-westend.json index 7371e05b8b491..ce4a29dda6caf 100644 --- a/cumulus/parachains/chain-specs/collectives-westend.json +++ b/cumulus/parachains/chain-specs/collectives-westend.json @@ -13,8 +13,6 @@ "/dns/collectives-westend.boot.stake.plus/tcp/31332/wss/p2p/12D3KooWBMRn31J3wJh3eu96XFUiAmgP3eKUxyNCv7249NXrAarZ", "/dns/boot.metaspan.io/tcp/36072/p2p/12D3KooWEf2QXWq5pAbFJLfbnexA7KYtRRDSPkqTP64n1KtdsdV2", "/dns/boot.metaspan.io/tcp/36076/wss/p2p/12D3KooWEf2QXWq5pAbFJLfbnexA7KYtRRDSPkqTP64n1KtdsdV2", - "/dns/boot.gatotech.network/tcp/33320/p2p/12D3KooWMedtdBGiSn7HLZusHwafXkZAdmWD18ciGQBfS4X1fv9K", - "/dns/boot.gatotech.network/tcp/35320/wss/p2p/12D3KooWMedtdBGiSn7HLZusHwafXkZAdmWD18ciGQBfS4X1fv9K", "/dns/collectives-westend-bootnode.turboflakes.io/tcp/30600/p2p/12D3KooWAe9CFXp6je3TAPQJE135KRemTLSqEqQBZMFwJontrThZ", "/dns/collectives-westend-bootnode.turboflakes.io/tcp/30700/wss/p2p/12D3KooWAe9CFXp6je3TAPQJE135KRemTLSqEqQBZMFwJontrThZ", "/dns/boot-node.helikon.io/tcp/10260/p2p/12D3KooWMzfnt29VAmrJHQcJU6Vfn4RsMbqPqgyWHqt9VTTAbSrL", diff --git a/cumulus/parachains/chain-specs/coretime-westend.json b/cumulus/parachains/chain-specs/coretime-westend.json index 467e7dedbaa13..6143c1b576ba8 100644 --- a/cumulus/parachains/chain-specs/coretime-westend.json +++ b/cumulus/parachains/chain-specs/coretime-westend.json @@ -25,8 +25,6 @@ "/dns/ibp-boot-westend-coretime.luckyfriday.io/tcp/30340/p2p/12D3KooWBzfzNhvyRVTb9KtNYpkRf26yTRHorBZR2LmYhH5ArCey", "/dns/coretime-westend.boot.rotko.net/tcp/33051/p2p/12D3KooWFmGg7EGzxGDawuJ9EfyEznCrZfMJgGa4eHpMWjcJmg85", "/dns/coretime-westend.boot.rotko.net/tcp/30435/wss/p2p/12D3KooWFmGg7EGzxGDawuJ9EfyEznCrZfMJgGa4eHpMWjcJmg85", - "/dns/boot.gatotech.network/tcp/33350/p2p/12D3KooWN6FJDaZvWbtX1pSc6UdHgyF2UZtYxPp3UkXQZa8ko7uS", - "/dns/boot.gatotech.network/tcp/35350/wss/p2p/12D3KooWN6FJDaZvWbtX1pSc6UdHgyF2UZtYxPp3UkXQZa8ko7uS", "/dns/coretime-westend.bootnodes.polkadotters.com/tcp/30358/wss/p2p/12D3KooWDc9T2vQ8rHvX7hAt9eLWktD9Q89NDTcLm5STkuNbzUGf", "/dns/coretime-westend.bootnodes.polkadotters.com/tcp/30356/p2p/12D3KooWDc9T2vQ8rHvX7hAt9eLWktD9Q89NDTcLm5STkuNbzUGf", "/dns/coretime-westend.bootnode.amforc.com/tcp/29999/wss/p2p/12D3KooWG9a9H9An96E3kgXL1sirHta117iuacJXnJRaUywkMiSd", diff --git a/cumulus/parachains/chain-specs/people-westend.json b/cumulus/parachains/chain-specs/people-westend.json index ea714bdc6467f..7c7d9c753394d 100644 --- a/cumulus/parachains/chain-specs/people-westend.json +++ b/cumulus/parachains/chain-specs/people-westend.json @@ -19,8 +19,6 @@ "/dns/boot.metaspan.io/tcp/35069/wss/p2p/12D3KooWAtw8ybFXNmNdTUsvt2gfKwtuea9wDQT2b8FpbVNKYGwc", "/dns/people-westend.boot.stake.plus/tcp/30332/wss/p2p/12D3KooWD5T1YN8oZUEsRXWod69kYH67jrSXHm6tSvs7RvH4Cb3p", "/dns/people-westend.boot.stake.plus/tcp/31332/wss/p2p/12D3KooWSByQrekhxx7pyDMTZcnnWBBFdj2LtqN9QtTCBDckc2zi", - "/dns/boot.gatotech.network/tcp/33340/p2p/12D3KooWHwURYtEHpexfrZa8k8hVgVi5FTFr4N8HBnn9kPDsWfgA", - "/dns/boot.gatotech.network/tcp/35340/wss/p2p/12D3KooWHwURYtEHpexfrZa8k8hVgVi5FTFr4N8HBnn9kPDsWfgA", "/dns/people-westend.bootnode.amforc.com/tcp/29999/wss/p2p/12D3KooWE1btdwDhNpApg8BEe2QwJxdVDtz6a6BRhgTeUh9HMhWs", "/dns/people-westend.bootnode.amforc.com/tcp/30016/p2p/12D3KooWE1btdwDhNpApg8BEe2QwJxdVDtz6a6BRhgTeUh9HMhWs", "/dns/people-westend-bootnode.turboflakes.io/tcp/30650/p2p/12D3KooWQEhmZg3uMkuxVUx3jbsD84zEX4dUKtvHfmCoBWMhybKW", diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs index 4f41680838483..64245240cb899 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs @@ -44,8 +44,10 @@ mod imports { TestArgs, TestContext, TestExt, }, xcm_helpers::{ - fee_asset, get_amount_from_versioned_assets, non_fee_asset, xcm_transact_paid_execution, + fee_asset, find_mq_processed_id, find_xcm_sent_message_id, + get_amount_from_versioned_assets, non_fee_asset, xcm_transact_paid_execution, }, + xcm_simulator::helpers::TopicIdTracker, PenpalATeleportableAssetLocation, ASSETS_PALLET_ID, RESERVABLE_ASSET_ID, USDT_ID, XCM_V3, }; pub(crate) use parachains_common::{AccountId, Balance}; diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/exchange_asset.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/exchange_asset.rs index 695ecff9f63a3..800fa967aa475 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/exchange_asset.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/exchange_asset.rs @@ -14,7 +14,7 @@ // limitations under the License. use crate::{ - create_pool_with_wnd_on, + assets_balance_on, create_pool_with_wnd_on, foreign_balance_on, imports::{ asset_hub_westend_runtime::{ExistentialDeposit, Runtime}, *, @@ -156,3 +156,173 @@ fn test_exchange_asset( } }); } + +#[test] +fn exchange_asset_from_penpal_via_asset_hub_back_to_penpal() { + let sender = PenpalASender::get(); + let sov_of_penpal_on_asset_hub = AssetHubWestend::sovereign_account_id_of( + AssetHubWestend::sibling_location_of(PenpalA::para_id()), + ); + let wnd_from_parachain_pov: Location = RelayLocation::get(); + let usdt_asset_hub_pov = + Location::new(0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(USDT_ID.into())]); + let usdt_penpal_pov = PenpalUsdtFromAssetHub::get(); + let amount_of_wnd_to_transfer_to_ah = WESTEND_ED * 1_000_000_000; + let amount_of_usdt_we_want_from_exchange = 1_000_000_000; + + let mut topic_id_tracker = TopicIdTracker::new(); + + // SA-of-Penpal-on-AHW should contain WND amount equal at least the amount that will be + // transferred-in to AH Since AH is the reserve for WND + AssetHubWestend::fund_accounts(vec![( + sov_of_penpal_on_asset_hub.clone().into(), + ASSET_HUB_WESTEND_ED + amount_of_wnd_to_transfer_to_ah, + )]); + // Give the sender enough WND + PenpalA::mint_foreign_asset( + ::RuntimeOrigin::signed(PenpalAssetOwner::get()), + wnd_from_parachain_pov.clone(), + sender.clone(), + amount_of_wnd_to_transfer_to_ah, + ); + + // We create a pool between WND and USDT in AssetHub so we can do the exchange + create_pool_with_wnd_on!( + AssetHubWestend, + usdt_asset_hub_pov.clone(), + false, + AssetHubWestendSender::get(), + 1_000_000_000_000, + 20_000_000_000 + ); + + // Query initial balances + let sender_usdt_on_penpal_before = + foreign_balance_on!(PenpalA, usdt_penpal_pov.clone(), &sender); + let sender_usdt_on_ah_before = assets_balance_on!(AssetHubWestend, USDT_ID, &sender); + + let asset_hub_location_penpal_pov = PenpalA::sibling_location_of(AssetHubWestend::para_id()); + let penpal_location_ah_pov = AssetHubWestend::sibling_location_of(PenpalA::para_id()); + + PenpalA::execute_with(|| { + let sender_signed_origin = ::RuntimeOrigin::signed(sender.clone()); + + let local_fees_amount = 80_000_000_000_000u128; + let remote_fees_amount = 200_000_000_000_000u128; + + let penpal_local_fees: Asset = (wnd_from_parachain_pov.clone(), local_fees_amount).into(); + let ah_remote_fees: Asset = (wnd_from_parachain_pov.clone(), remote_fees_amount).into(); + let penpal_remote_fees: Asset = (wnd_from_parachain_pov.clone(), remote_fees_amount).into(); + let wnd_to_withdraw: Asset = + (wnd_from_parachain_pov.clone(), amount_of_wnd_to_transfer_to_ah).into(); + + // xcm to be executed by penpal, sent by ah + let xcm_back_on_penpal = Xcm(vec![ + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // xcm to be executed by ah, sent by penpal + let xcm_on_ah = Xcm(vec![ + ExchangeAsset { + give: Definite((wnd_from_parachain_pov.clone(), 100_000_000_000u128).into()), + want: (usdt_asset_hub_pov.clone(), amount_of_usdt_we_want_from_exchange).into(), + maximal: false, + }, + InitiateTransfer { + destination: penpal_location_ah_pov, + remote_fees: Some(AssetTransferFilter::ReserveDeposit( + penpal_remote_fees.clone().into(), + )), + preserve_origin: false, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::ReserveDeposit(Wild( + All, + ))]), + remote_xcm: xcm_back_on_penpal, + }, + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // xcm to be executed locally on penpal as starting point + let xcm = Xcm::<()>(vec![ + WithdrawAsset(wnd_to_withdraw.into()), + PayFees { asset: penpal_local_fees }, + InitiateTransfer { + destination: asset_hub_location_penpal_pov, + remote_fees: Some(AssetTransferFilter::ReserveWithdraw( + ah_remote_fees.clone().into(), + )), + preserve_origin: false, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::ReserveWithdraw( + Wild(All), + )]), + remote_xcm: xcm_on_ah, + }, + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // initiate transaction + ::PolkadotXcm::execute( + sender_signed_origin, + bx!(xcm::VersionedXcm::from(xcm.into())), + Weight::MAX, + ) + .unwrap(); + + // verify expected events; + PenpalA::assert_xcm_pallet_attempted_complete(None); + + let msg_sent_id = find_xcm_sent_message_id::().expect("Missing Sent Event"); + topic_id_tracker.insert("PenpalA_sent", msg_sent_id.into()); + }); + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + RuntimeEvent::AssetConversion( + pallet_asset_conversion::Event::SwapCreditExecuted { amount_out, ..} + ) => { amount_out: *amount_out == amount_of_usdt_we_want_from_exchange, }, + ] + ); + + let mq_prc_id = find_mq_processed_id::().expect("Missing Processed Event"); + topic_id_tracker.insert("AssetHubWestend_received", mq_prc_id); + let msg_sent_id = + find_xcm_sent_message_id::().expect("Missing Sent Event"); + topic_id_tracker.insert("AssetHubWestend_sent", msg_sent_id.into()); + }); + + PenpalA::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + PenpalA, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + + let mq_prc_id = find_mq_processed_id::().expect("Missing Processed Event"); + topic_id_tracker.insert("PenpalA_received", mq_prc_id); + }); + + topic_id_tracker.assert_unique(); + + // Query final balances + let sender_usdt_on_ah_after = assets_balance_on!(AssetHubWestend, USDT_ID, &sender); + let sender_usdt_on_penpal_after = + foreign_balance_on!(PenpalA, usdt_penpal_pov.clone(), &sender); + + // Receiver's balance is increased by usdt amount we got from exchange + assert_eq!( + sender_usdt_on_penpal_after, + sender_usdt_on_penpal_before + amount_of_usdt_we_want_from_exchange + ); + // Usdt amount on senders account AH side should stay the same i.e. all usdt came from exchange + // not free balance + assert_eq!(sender_usdt_on_ah_before, sender_usdt_on_ah_after); +} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/mod.rs index 22bfebddefee2..111c3ddf4b0cd 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/mod.rs @@ -36,7 +36,19 @@ macro_rules! foreign_balance_on { emulated_integration_tests_common::impls::paste::paste! { <$chain>::execute_with(|| { type ForeignAssets = <$chain as [<$chain Pallet>]>::ForeignAssets; - >::balance($id, $who) + >::balance($id, $who) + }) + } + }; +} + +#[macro_export] +macro_rules! assets_balance_on { + ( $chain:ident, $id:expr, $who:expr ) => { + emulated_integration_tests_common::impls::paste::paste! { + <$chain>::execute_with(|| { + type Assets = <$chain as [<$chain Pallet>]>::Assets; + >::balance($id, $who) }) } }; diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/transact.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/transact.rs index ad886dbe5e24d..6ebcb621f0687 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/transact.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/transact.rs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{create_pool_with_wnd_on, foreign_balance_on, imports::*}; +use crate::{assets_balance_on, create_pool_with_wnd_on, foreign_balance_on, imports::*}; use frame_support::traits::tokens::fungibles::Mutate; use xcm_builder::{DescribeAllTerminal, DescribeFamily, HashedDescription}; use xcm_executor::traits::ConvertLocation; @@ -201,6 +201,437 @@ fn transact_from_para_to_para_through_asset_hub() { assert!(receiver_assets_after > receiver_assets_before); } +#[test] +fn transact_using_authorized_alias_from_para_to_asset_hub_and_back_to_para() { + let sender = PenpalASender::get(); + let sov_of_penpal_on_asset_hub = AssetHubWestend::sovereign_account_id_of( + AssetHubWestend::sibling_location_of(PenpalA::para_id()), + ); + let wnd_from_parachain_pov: Location = RelayLocation::get(); + let usdt_asset_hub_pov = + Location::new(0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(USDT_ID.into())]); + let usdt_penpal_pov = PenpalUsdtFromAssetHub::get(); + let amount_of_wnd_to_transfer_to_ah = WESTEND_ED * 1_000_000_000u128; + let amount_of_usdt_we_want_from_exchange = 1_000_000_000u128; + let max_amount_of_wnd_we_allow_for_exchange = 1_000_000_000_000u128; + let sender_as_seen_from_ah = Location::new( + 1, + [ + Parachain(2000), + AccountId32 { + network: Some(NetworkId::ByGenesis(ROCOCO_GENESIS_HASH)), + id: sender.clone().into(), + }, + ], + ); + + let mut topic_id_tracker = TopicIdTracker::new(); + + // SA-of-Penpal-on-AHW should contain WND amount equal at least the amount that will be + // transferred-in to AH Since AH is the reserve for WND + AssetHubWestend::fund_accounts(vec![( + sov_of_penpal_on_asset_hub.clone().into(), + ASSET_HUB_WESTEND_ED + amount_of_wnd_to_transfer_to_ah, + )]); + // Give the sender enough WND + PenpalA::mint_foreign_asset( + ::RuntimeOrigin::signed(PenpalAssetOwner::get()), + wnd_from_parachain_pov.clone(), + sender.clone(), + amount_of_wnd_to_transfer_to_ah, + ); + + // We create a pool between WND and USDT in AssetHub so we can do the exchange + create_pool_with_wnd_on!( + AssetHubWestend, + usdt_asset_hub_pov.clone(), + false, + AssetHubWestendSender::get(), + 1_000_000_000_000, + 20_000_000_000 + ); + + // We add auhtorized alias on AH so sender from Penpal can AliasOrigin into itself on AH + // (instead of aliasing into Sovereign Account of sender) + AssetHubWestend::execute_with(|| { + assert_ok!(::PolkadotXcm::add_authorized_alias( + ::RuntimeOrigin::signed(sender.clone()), + Box::new(sender_as_seen_from_ah.into()), + None + )); + }); + + // Query initial balances + let sender_usdt_on_penpal_before = + foreign_balance_on!(PenpalA, usdt_penpal_pov.clone(), &sender); + let sender_usdt_on_ah_before = assets_balance_on!(AssetHubWestend, USDT_ID, &sender); + + // Encoded `swap_tokens_for_exact_tokens` call to be executed in AH + let call = ::RuntimeCall::AssetConversion( + pallet_asset_conversion::Call::swap_tokens_for_exact_tokens { + path: vec![ + Box::new(wnd_from_parachain_pov.clone()), + Box::new(usdt_asset_hub_pov.clone()), + ], + amount_out: amount_of_usdt_we_want_from_exchange, + amount_in_max: max_amount_of_wnd_we_allow_for_exchange, + send_to: sender.clone(), + keep_alive: true, + }, + ) + .encode() + .into(); + + let asset_hub_location_penpal_pov = PenpalA::sibling_location_of(AssetHubWestend::para_id()); + let penpal_location_ah_pov = AssetHubWestend::sibling_location_of(PenpalA::para_id()); + + PenpalA::execute_with(|| { + let sender_signed_origin = ::RuntimeOrigin::signed(sender.clone()); + + let local_fees_amount = 80_000_000_000_000u128; + let remote_fees_amount = 90_000_000_000_000u128; + + let penpal_local_fees: Asset = (wnd_from_parachain_pov.clone(), local_fees_amount).into(); + let ah_remote_fees: Asset = (wnd_from_parachain_pov.clone(), remote_fees_amount).into(); + let penpal_remote_fees: Asset = (wnd_from_parachain_pov.clone(), remote_fees_amount).into(); + let wnd_to_withdraw: Asset = + (wnd_from_parachain_pov.clone(), amount_of_wnd_to_transfer_to_ah).into(); + + // xcm to be executed by penpal, sent by ah + let xcm_back_on_penpal = Xcm(vec![ + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // xcm to be executed by ah, sent by penpal + let xcm_on_ah = Xcm(vec![ + // aliasing into sender itself, as opposed to sender's sovereign account + // its possible due to add_authorized_alias above + AliasOrigin(Location::new( + 0, + [AccountId32 { network: None, id: sender.clone().into() }], + )), + DepositAsset { + assets: Definite( + (wnd_from_parachain_pov.clone(), max_amount_of_wnd_we_allow_for_exchange) + .into(), + ), + beneficiary: sender.clone().into(), + }, + Transact { origin_kind: OriginKind::SovereignAccount, call, fallback_max_weight: None }, + ExpectTransactStatus(MaybeErrorCode::Success), + WithdrawAsset( + (usdt_asset_hub_pov.clone(), amount_of_usdt_we_want_from_exchange).into(), + ), + InitiateTransfer { + destination: penpal_location_ah_pov, + remote_fees: Some(AssetTransferFilter::ReserveDeposit( + penpal_remote_fees.clone().into(), + )), + preserve_origin: false, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::ReserveDeposit(Wild( + All, + ))]), + remote_xcm: xcm_back_on_penpal, + }, + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // xcm to be executed locally on penpal as starting point + let xcm = Xcm::<()>(vec![ + WithdrawAsset(wnd_to_withdraw.into()), + PayFees { asset: penpal_local_fees }, + InitiateTransfer { + destination: asset_hub_location_penpal_pov, + remote_fees: Some(AssetTransferFilter::ReserveWithdraw( + ah_remote_fees.clone().into(), + )), + preserve_origin: true, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::ReserveWithdraw( + Wild(All), + )]), + remote_xcm: xcm_on_ah, + }, + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // initiate transaction + ::PolkadotXcm::execute( + sender_signed_origin, + bx!(xcm::VersionedXcm::from(xcm.into())), + Weight::MAX, + ) + .unwrap(); + + // verify expected events; + PenpalA::assert_xcm_pallet_attempted_complete(None); + + let msg_sent_id = find_xcm_sent_message_id::().expect("Missing Sent Event"); + topic_id_tracker.insert("PenpalA_sent", msg_sent_id.into()); + }); + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + RuntimeEvent::AssetConversion( + pallet_asset_conversion::Event::SwapExecuted { amount_out, ..} + ) => { amount_out: *amount_out == amount_of_usdt_we_want_from_exchange, }, + ] + ); + + let mq_prc_id = find_mq_processed_id::().expect("Missing Processed Event"); + topic_id_tracker.insert("AssetHubWestend_received", mq_prc_id); + let msg_sent_id = + find_xcm_sent_message_id::().expect("Missing Sent Event"); + topic_id_tracker.insert("AssetHubWestend_sent", msg_sent_id.into()); + }); + + PenpalA::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + PenpalA, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + + let mq_prc_id = find_mq_processed_id::().expect("Missing Processed Event"); + topic_id_tracker.insert("PenpalA_received", mq_prc_id); + }); + + topic_id_tracker.assert_unique(); + + // Query final balances + let sender_usdt_on_ah_after = assets_balance_on!(AssetHubWestend, USDT_ID, &sender); + let sender_usdt_on_penpal_after = + foreign_balance_on!(PenpalA, usdt_penpal_pov.clone(), &sender); + + // Receiver's balance is increased by usdt amount we got from exchange + assert_eq!( + sender_usdt_on_penpal_after, + sender_usdt_on_penpal_before + amount_of_usdt_we_want_from_exchange + ); + // Usdt amount on senders account AH side should stay the same i.e. all usdt came from exchange + // not free balance + assert_eq!(sender_usdt_on_ah_before, sender_usdt_on_ah_after); +} + +#[test] +fn transact_using_sov_account_from_para_to_asset_hub_and_back_to_para() { + let sender = PenpalASender::get(); + let sov_of_penpal_on_asset_hub = AssetHubWestend::sovereign_account_id_of( + AssetHubWestend::sibling_location_of(PenpalA::para_id()), + ); + let wnd_from_parachain_pov: Location = RelayLocation::get(); + let usdt_asset_hub_pov = + Location::new(0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(USDT_ID.into())]); + let usdt_penpal_pov = PenpalUsdtFromAssetHub::get(); + let amount_of_wnd_to_transfer_to_ah = WESTEND_ED * 1_000_000_000u128; + let amount_of_usdt_we_want_from_exchange = 1_000_000_000u128; + let max_amount_of_wnd_we_allow_for_exchange = 1_000_000_000_000u128; + let sender_as_seen_from_ah = Location::new( + 1, + [ + Parachain(2000), + AccountId32 { + network: Some(NetworkId::ByGenesis(ROCOCO_GENESIS_HASH)), + id: sender.clone().into(), + }, + ], + ); + let sov_of_sender_on_asset_hub = + AssetHubWestend::sovereign_account_id_of(sender_as_seen_from_ah.clone()); + + let mut topic_id_tracker = TopicIdTracker::new(); + + // SA-of-Penpal-on-AHW should contain WND amount equal at least the amount that will be + // transferred-in to AH Since AH is the reserve for WND + AssetHubWestend::fund_accounts(vec![( + sov_of_penpal_on_asset_hub.clone().into(), + ASSET_HUB_WESTEND_ED + amount_of_wnd_to_transfer_to_ah, + )]); + // Give the sender enough WND + PenpalA::mint_foreign_asset( + ::RuntimeOrigin::signed(PenpalAssetOwner::get()), + wnd_from_parachain_pov.clone(), + sender.clone(), + amount_of_wnd_to_transfer_to_ah, + ); + + // We create a pool between WND and USDT in AssetHub so we can do the exchange + create_pool_with_wnd_on!( + AssetHubWestend, + usdt_asset_hub_pov.clone(), + false, + AssetHubWestendSender::get(), + 1_000_000_000_000, + 20_000_000_000 + ); + + // Query initial balances + let sender_usdt_on_penpal_before = + foreign_balance_on!(PenpalA, usdt_penpal_pov.clone(), &sender); + let sender_usdt_on_ah_before = + assets_balance_on!(AssetHubWestend, USDT_ID, &sov_of_sender_on_asset_hub); + + // Encoded `swap_tokens_for_exact_tokens` call to be executed in AH + let call = ::RuntimeCall::AssetConversion( + pallet_asset_conversion::Call::swap_tokens_for_exact_tokens { + path: vec![ + Box::new(wnd_from_parachain_pov.clone()), + Box::new(usdt_asset_hub_pov.clone()), + ], + amount_out: amount_of_usdt_we_want_from_exchange, + amount_in_max: max_amount_of_wnd_we_allow_for_exchange, + send_to: sov_of_sender_on_asset_hub.clone(), + keep_alive: false, + }, + ) + .encode() + .into(); + + let asset_hub_location_penpal_pov = PenpalA::sibling_location_of(AssetHubWestend::para_id()); + let penpal_location_ah_pov = AssetHubWestend::sibling_location_of(PenpalA::para_id()); + + PenpalA::execute_with(|| { + let sender_signed_origin = ::RuntimeOrigin::signed(sender.clone()); + + let local_fees_amount = 80_000_000_000_000u128; + let remote_fees_amount = 90_000_000_000_000u128; + + let penpal_local_fees: Asset = (wnd_from_parachain_pov.clone(), local_fees_amount).into(); + let ah_remote_fees: Asset = (wnd_from_parachain_pov.clone(), remote_fees_amount).into(); + let penpal_remote_fees: Asset = (wnd_from_parachain_pov.clone(), remote_fees_amount).into(); + let wnd_to_withdraw: Asset = + (wnd_from_parachain_pov.clone(), amount_of_wnd_to_transfer_to_ah).into(); + + // xcm to be executed by penpal, sent by ah + let xcm_back_on_penpal = Xcm(vec![ + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // xcm to be executed by ah, sent by penpal + let xcm_on_ah = Xcm(vec![ + DepositAsset { + assets: Definite( + (wnd_from_parachain_pov.clone(), max_amount_of_wnd_we_allow_for_exchange) + .into(), + ), + beneficiary: sov_of_sender_on_asset_hub.clone().into(), + }, + Transact { origin_kind: OriginKind::SovereignAccount, call, fallback_max_weight: None }, + ExpectTransactStatus(MaybeErrorCode::Success), + WithdrawAsset( + (usdt_asset_hub_pov.clone(), amount_of_usdt_we_want_from_exchange).into(), + ), + InitiateTransfer { + destination: penpal_location_ah_pov, + remote_fees: Some(AssetTransferFilter::ReserveDeposit( + penpal_remote_fees.clone().into(), + )), + preserve_origin: false, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::ReserveDeposit(Wild( + All, + ))]), + remote_xcm: xcm_back_on_penpal, + }, + RefundSurplus, + DepositAsset { + assets: Wild(All), + beneficiary: sov_of_sender_on_asset_hub.clone().into(), + }, + ]); + // xcm to be executed locally on penpal as starting point + let xcm = Xcm::<()>(vec![ + WithdrawAsset(wnd_to_withdraw.into()), + PayFees { asset: penpal_local_fees }, + InitiateTransfer { + destination: asset_hub_location_penpal_pov, + remote_fees: Some(AssetTransferFilter::ReserveWithdraw( + ah_remote_fees.clone().into(), + )), + preserve_origin: true, + assets: BoundedVec::truncate_from(vec![AssetTransferFilter::ReserveWithdraw( + Wild(All), + )]), + remote_xcm: xcm_on_ah, + }, + RefundSurplus, + DepositAsset { assets: Wild(All), beneficiary: sender.clone().into() }, + ]); + // initiate transaction + ::PolkadotXcm::execute( + sender_signed_origin, + bx!(xcm::VersionedXcm::from(xcm.into())), + Weight::MAX, + ) + .unwrap(); + + // verify expected events; + PenpalA::assert_xcm_pallet_attempted_complete(None); + + let msg_sent_id = find_xcm_sent_message_id::().expect("Missing Sent Event"); + topic_id_tracker.insert("PenpalA_sent", msg_sent_id.into()); + }); + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + RuntimeEvent::AssetConversion( + pallet_asset_conversion::Event::SwapExecuted { amount_out, ..} + ) => { amount_out: *amount_out == amount_of_usdt_we_want_from_exchange, }, + ] + ); + + let mq_prc_id = find_mq_processed_id::().expect("Missing Processed Event"); + topic_id_tracker.insert("AssetHubWestend_received", mq_prc_id); + let msg_sent_id = + find_xcm_sent_message_id::().expect("Missing Sent Event"); + topic_id_tracker.insert("AssetHubWestend_sent", msg_sent_id.into()); + }); + + PenpalA::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + PenpalA, + vec![ + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + + let mq_prc_id = find_mq_processed_id::().expect("Missing Processed Event"); + topic_id_tracker.insert("PenpalA_received", mq_prc_id); + }); + + topic_id_tracker.assert_unique(); + + // Query final balances + let sender_usdt_on_ah_after = + assets_balance_on!(AssetHubWestend, USDT_ID, &sov_of_sender_on_asset_hub); + let sender_usdt_on_penpal_after = + foreign_balance_on!(PenpalA, usdt_penpal_pov.clone(), &sender); + + // Receiver's balance is increased by usdt amount we got from exchange + assert_eq!( + sender_usdt_on_penpal_after, + sender_usdt_on_penpal_before + amount_of_usdt_we_want_from_exchange + ); + // Usdt amount on senders account AH side should stay the same i.e. all usdt came from exchange + // not free balance + assert_eq!(sender_usdt_on_ah_before, sender_usdt_on_ah_after); +} + fn asset_hub_hop_assertions(sender_sa: AccountId) { type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs index 27bab30a0cb9f..6bd130110eb7d 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs @@ -1243,7 +1243,7 @@ fn do_send_pens_and_wnds_from_penpal_westend_via_ahw_to_asset_hub_rococo( ByGenesis(ROCOCO_GENESIS_HASH), AssetHubRococo::para_id(), ); - let ahw_fee_amount = 100_000_000_000; + let ahw_fee_amount = 120_000_000_000; // send message over bridge assert_ok!(PenpalB::execute_with(|| { let destination = asset_hub_rococo_location(); diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml index 5d2288282ab66..86f906784b63d 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml @@ -24,6 +24,7 @@ pallet-whitelist = { workspace = true } sp-runtime = { workspace = true } # Polkadot +collectives-westend-runtime = { workspace = true } pallet-xcm = { workspace = true } polkadot-runtime-common = { workspace = true, default-features = true } westend-runtime-constants = { workspace = true, default-features = true } diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship_salary.rs b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/collectives_salary.rs similarity index 57% rename from cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship_salary.rs rename to cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/collectives_salary.rs index fe6eedb085749..3e404b0657666 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship_salary.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/collectives_salary.rs @@ -14,7 +14,9 @@ // limitations under the License. use crate::imports::*; -use collectives_fellowship::FellowshipSalaryPaymaster; +use collectives_westend_runtime::{ + fellowship::FellowshipSalaryPaymaster, secretary::SecretarySalaryPaymaster, +}; use frame_support::{ assert_ok, traits::{fungibles::Mutate, tokens::Pay}, @@ -22,9 +24,10 @@ use frame_support::{ use xcm_executor::traits::ConvertLocation; const FELLOWSHIP_SALARY_PALLET_ID: u8 = 64; +const SECRETARY_SALARY_PALLET_ID: u8 = 91; #[test] -fn pay_salary() { +fn pay_salary_technical_fellowship() { let asset_id: u32 = 1984; let fellowship_salary = ( Parent, @@ -64,3 +67,45 @@ fn pay_salary() { ); }); } + +#[test] +fn pay_salary_secretary() { + const USDT_ID: u32 = 1984; + let secretary_salary = ( + Parent, + Parachain(CollectivesWestend::para_id().into()), + PalletInstance(SECRETARY_SALARY_PALLET_ID), + ); + let pay_from = AssetHubLocationToAccountId::convert_location(&secretary_salary.into()).unwrap(); + let pay_to = Westend::account_id_of(ALICE); + let pay_amount = 9_000_000_000; + + AssetHubWestend::execute_with(|| { + type AssetHubAssets = ::Assets; + // USDT registered in genesis, now mint some into the payer's account + assert_ok!(>::mint_into(USDT_ID, &pay_from, pay_amount * 2)); + }); + + CollectivesWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + assert_ok!(SecretarySalaryPaymaster::pay(&pay_to, (), pay_amount)); + assert_expected_events!( + CollectivesWestend, + vec![ + RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {}, + ] + ); + }); + + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Transferred { .. }) => {}, + RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true ,.. }) => {}, + ] + ); + }); +} diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs index a3fa1ce3e2f37..3e8b470d6c284 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs @@ -14,7 +14,7 @@ // limitations under the License. mod aliases; +mod collectives_salary; mod fellowship; -mod fellowship_salary; mod fellowship_treasury; mod teleport; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 8ec34bdfd0561..a169a54a153af 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -130,7 +130,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("statemine"), impl_name: alloc::borrow::Cow::Borrowed("statemine"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 16, @@ -1712,33 +1712,36 @@ impl_runtime_apis! { Config as XcmBridgeHubRouterConfig, }; + use testnet_parachains_constants::rococo::locations::{PeopleParaId, PeopleLocation}; parameter_types! { pub ExistentialDepositAsset: Option = Some(( TokenLocation::get(), ExistentialDeposit::get() ).into()); + pub const RandomParaId: ParaId = ParaId::new(43211234); } use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { type DeliveryHelper = ( - cumulus_primitives_utility::ToParentDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, + PriceForSiblingParachainDelivery, + RandomParaId, + ParachainSystem >, - polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, PriceForSiblingParachainDelivery, - RandomParaId, - ParachainSystem, - > - ); + PeopleParaId, + ParachainSystem + >); fn reachable_dest() -> Option { - Some(Parent.into()) + Some(PeopleLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -1746,9 +1749,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(TokenLocation::get()) }, - Parent.into(), + PeopleLocation::get(), )) } @@ -1765,13 +1768,10 @@ impl_runtime_apis! { fn set_up_complex_asset_transfer( ) -> Option<(XcmAssets, u32, Location, alloc::boxed::Box)> { - // Transfer to Relay some local AH asset (local-reserve-transfer) while paying - // fees using teleported native token. - // (We don't care that Relay doesn't accept incoming unknown AH local asset) - let dest = Parent.into(); + let dest = PeopleLocation::get(); let fee_amount = EXISTENTIAL_DEPOSIT; - let fee_asset: Asset = (Location::parent(), fee_amount).into(); + let fee_asset: Asset = (TokenLocation::get(), fee_amount).into(); let who = frame_benchmarking::whitelisted_caller(); // Give some multiple of the existential deposit @@ -1874,13 +1874,15 @@ impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + PeopleParaId, + ParachainSystem + >; fn valid_destination() -> Result { - Ok(TokenLocation::get()) + Ok(PeopleLocation::get()) } fn worst_case_holding(depositable_count: u32) -> XcmAssets { // A mix of fungible, non-fungible, and concrete assets. @@ -1906,8 +1908,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - TokenLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + PeopleLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(TokenLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1970,15 +1972,18 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((TokenLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok(( + PeopleLocation::get(), + frame_system::Call::remark_with_event {remark: vec![]}.into() + )) } fn subscribe_origin() -> Result { - Ok(TokenLocation::get()) + Ok(PeopleLocation::get()) } fn claimable_asset() -> Result<(Location, Location, XcmAssets), BenchmarkError> { - let origin = TokenLocation::get(); + let origin = PeopleLocation::get(); let assets: XcmAssets = (TokenLocation::get(), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs index 9300c8b72ad2a..0d4f3bc4be597 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-03-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `f69416f67ec1`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,69 +50,51 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `498` - // Estimated: `3963` - // Minimum execution time: 19_789_000 picoseconds. - Weight::from_parts(20_317_000, 3963) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `537` - // Estimated: `4002` - // Minimum execution time: 20_805_000 picoseconds. - Weight::from_parts(21_481_000, 4002) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 21_641_000 picoseconds. - Weight::from_parts(22_643_000, 0) - .saturating_add(Weight::from_parts(0, 3507)) + // Measured: `245` + // Estimated: `3710` + // Minimum execution time: 31_621_000 picoseconds. + Weight::from_parts(33_059_000, 0) + .saturating_add(Weight::from_parts(0, 3710)) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3593` - // Minimum execution time: 104_695_000 picoseconds. - Weight::from_parts(108_272_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `277` + // Estimated: `3742` + // Minimum execution time: 120_046_000 picoseconds. + Weight::from_parts(123_674_000, 0) + .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -134,8 +116,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `329` // Estimated: `6196` - // Minimum execution time: 134_968_000 picoseconds. - Weight::from_parts(139_074_000, 0) + // Minimum execution time: 136_136_000 picoseconds. + Weight::from_parts(140_390_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) @@ -152,23 +134,25 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(84), added: 2559, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `466` + // Measured: `669` // Estimated: `6208` - // Minimum execution time: 171_734_000 picoseconds. - Weight::from_parts(178_520_000, 0) + // Minimum execution time: 187_283_000 picoseconds. + Weight::from_parts(195_176_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -176,8 +160,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_417_000 picoseconds. - Weight::from_parts(9_919_000, 0) + // Minimum execution time: 10_096_000 picoseconds. + Weight::from_parts(10_505_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -187,8 +171,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_400_000 picoseconds. - Weight::from_parts(7_689_000, 0) + // Minimum execution time: 8_024_000 picoseconds. + Weight::from_parts(8_375_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -196,54 +180,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_627_000 picoseconds. - Weight::from_parts(2_694_000, 0) + // Minimum execution time: 2_480_000 picoseconds. + Weight::from_parts(2_590_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 28_334_000 picoseconds. - Weight::from_parts(28_827_000, 0) - .saturating_add(Weight::from_parts(0, 3507)) + // Measured: `245` + // Estimated: `3710` + // Minimum execution time: 38_995_000 picoseconds. + Weight::from_parts(40_184_000, 0) + .saturating_add(Weight::from_parts(0, 3710)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `136` - // Estimated: `3601` - // Minimum execution time: 29_803_000 picoseconds. - Weight::from_parts(30_535_000, 0) - .saturating_add(Weight::from_parts(0, 3601)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `404` + // Estimated: `108971` + // Minimum execution time: 43_832_000 picoseconds. + Weight::from_parts(45_241_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -252,8 +240,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_508_000 picoseconds. - Weight::from_parts(2_678_000, 0) + // Minimum execution time: 2_395_000 picoseconds. + Weight::from_parts(2_546_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -263,8 +251,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `22` // Estimated: `15862` - // Minimum execution time: 21_973_000 picoseconds. - Weight::from_parts(22_169_000, 0) + // Minimum execution time: 22_061_000 picoseconds. + Weight::from_parts(22_555_000, 0) .saturating_add(Weight::from_parts(0, 15862)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -275,8 +263,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26` // Estimated: `15866` - // Minimum execution time: 22_064_000 picoseconds. - Weight::from_parts(22_446_000, 0) + // Minimum execution time: 21_646_000 picoseconds. + Weight::from_parts(22_119_000, 0) .saturating_add(Weight::from_parts(0, 15866)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -285,32 +273,30 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `36` - // Estimated: `18351` - // Minimum execution time: 25_450_000 picoseconds. - Weight::from_parts(25_918_000, 0) - .saturating_add(Weight::from_parts(0, 18351)) + // Measured: `39` + // Estimated: `18354` + // Minimum execution time: 25_937_000 picoseconds. + Weight::from_parts(26_388_000, 0) + .saturating_add(Weight::from_parts(0, 18354)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `6015` - // Minimum execution time: 26_915_000 picoseconds. - Weight::from_parts(28_156_000, 0) - .saturating_add(Weight::from_parts(0, 6015)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `187` + // Estimated: `6127` + // Minimum execution time: 36_716_000 picoseconds. + Weight::from_parts(38_269_000, 0) + .saturating_add(Weight::from_parts(0, 6127)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -318,8 +304,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `13404` - // Minimum execution time: 18_127_000 picoseconds. - Weight::from_parts(18_559_000, 0) + // Minimum execution time: 17_974_000 picoseconds. + Weight::from_parts(18_407_000, 0) .saturating_add(Weight::from_parts(0, 13404)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -329,31 +315,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `33` // Estimated: `15873` - // Minimum execution time: 22_240_000 picoseconds. - Weight::from_parts(22_779_000, 0) + // Minimum execution time: 21_964_000 picoseconds. + Weight::from_parts(22_610_000, 0) .saturating_add(Weight::from_parts(0, 15873)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `15915` - // Minimum execution time: 40_206_000 picoseconds. - Weight::from_parts(41_244_000, 0) - .saturating_add(Weight::from_parts(0, 15915)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `187` + // Estimated: `16027` + // Minimum execution time: 46_704_000 picoseconds. + Weight::from_parts(49_027_000, 0) + .saturating_add(Weight::from_parts(0, 16027)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -363,8 +347,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_683_000 picoseconds. - Weight::from_parts(2_848_000, 0) + // Minimum execution time: 2_694_000 picoseconds. + Weight::from_parts(2_829_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -375,8 +359,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 25_440_000 picoseconds. - Weight::from_parts(26_113_000, 0) + // Minimum execution time: 27_767_000 picoseconds. + Weight::from_parts(28_348_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -393,19 +377,46 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `303` // Estimated: `3768` - // Minimum execution time: 45_551_000 picoseconds. - Weight::from_parts(47_389_000, 0) + // Minimum execution time: 45_836_000 picoseconds. + Weight::from_parts(47_883_000, 0) .saturating_add(Weight::from_parts(0, 3768)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `160` + // Estimated: `3625` + // Minimum execution time: 50_608_000 picoseconds. + Weight::from_parts(51_989_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `516` + // Estimated: `3981` + // Minimum execution time: 52_003_000 picoseconds. + Weight::from_parts(52_989_000, 0) + .saturating_add(Weight::from_parts(0, 3981)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } fn weigh_message() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_416_000 picoseconds. + Weight::from_parts(8_668_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 067a15a77375f..a29c0d8e3f636 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-03-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dd489642b81c`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -64,8 +64,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `493` // Estimated: `3675` - // Minimum execution time: 56_861_000 picoseconds. - Weight::from_parts(58_296_000, 3675) + // Minimum execution time: 54_678_000 picoseconds. + Weight::from_parts(56_251_000, 3675) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -81,8 +81,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `392` // Estimated: `6208` - // Minimum execution time: 51_788_000 picoseconds. - Weight::from_parts(53_051_000, 6208) + // Minimum execution time: 51_938_000 picoseconds. + Weight::from_parts(52_634_000, 6208) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -96,57 +96,61 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `567` + // Measured: `770` // Estimated: `8799` - // Minimum execution time: 127_591_000 picoseconds. - Weight::from_parts(131_326_000, 8799) + // Minimum execution time: 137_278_000 picoseconds. + Weight::from_parts(142_344_000, 8799) .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(T::DbWeight::get().writes(8)) } pub fn reserve_asset_deposited() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_310_000 picoseconds. - Weight::from_parts(1_454_000, 0) + // Minimum execution time: 1_491_000 picoseconds. + Weight::from_parts(1_611_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `378` // Estimated: `6196` - // Minimum execution time: 108_706_000 picoseconds. - Weight::from_parts(111_596_000, 6196) + // Minimum execution time: 121_122_000 picoseconds. + Weight::from_parts(123_821_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_985_000 picoseconds. - Weight::from_parts(3_195_000, 0) + // Minimum execution time: 2_843_000 picoseconds. + Weight::from_parts(3_108_000, 0) } // Storage: `Assets::Asset` (r:1 w:1) // Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -158,15 +162,15 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3675` - // Minimum execution time: 32_454_000 picoseconds. - Weight::from_parts(33_452_000, 3675) + // Minimum execution time: 33_119_000 picoseconds. + Weight::from_parts(34_511_000, 3675) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Assets::Asset` (r:1 w:1) @@ -175,39 +179,43 @@ impl WeightInfo { // 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: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `354` - // Estimated: `3819` - // Minimum execution time: 70_617_000 picoseconds. - Weight::from_parts(72_500_000, 3819) + // Measured: `557` + // Estimated: `4022` + // Minimum execution time: 84_913_000 picoseconds. + Weight::from_parts(87_883_000, 4022) .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Assets::Asset` (r:1 w:0) // Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `354` - // Estimated: `3819` - // Minimum execution time: 52_909_000 picoseconds. - Weight::from_parts(54_376_000, 3819) + // Measured: `557` + // Estimated: `4022` + // Minimum execution time: 65_709_000 picoseconds. + Weight::from_parts(67_783_000, 4022) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: `Assets::Asset` (r:1 w:1) // Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -217,21 +225,23 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `354` + // Measured: `557` // Estimated: `6196` - // Minimum execution time: 87_524_000 picoseconds. - Weight::from_parts(91_889_000, 6196) + // Minimum execution time: 103_077_000 picoseconds. + Weight::from_parts(105_234_000, 6196) .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes(6)) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 2b881606fe306..b6c6f645742c7 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ef4134d66388`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,31 +52,37 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `378` // Estimated: `6196` - // Minimum execution time: 101_141_000 picoseconds. - Weight::from_parts(104_064_000, 6196) + // Minimum execution time: 113_423_000 picoseconds. + Weight::from_parts(118_011_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `0` - // Minimum execution time: 708_000 picoseconds. - Weight::from_parts(756_000, 0) + // Estimated: `3593` + // Minimum execution time: 6_436_000 picoseconds. + Weight::from_parts(6_716_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -84,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 6_738_000 picoseconds. - Weight::from_parts(7_319_000, 3593) + // Minimum execution time: 6_397_000 picoseconds. + Weight::from_parts(6_862_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -93,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 716_000 picoseconds. - Weight::from_parts(776_000, 0) + // Minimum execution time: 793_000 picoseconds. + Weight::from_parts(874_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,7 +108,7 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_868_000 picoseconds. + // Minimum execution time: 5_817_000 picoseconds. Weight::from_parts(6_093_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } @@ -110,78 +116,82 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_600_000 picoseconds. - Weight::from_parts(7_890_000, 0) + // Minimum execution time: 7_553_000 picoseconds. + Weight::from_parts(7_755_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_850_000 picoseconds. - Weight::from_parts(2_955_000, 0) + // Minimum execution time: 1_359_000 picoseconds. + Weight::from_parts(1_453_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 706_000 picoseconds. - Weight::from_parts(756_000, 0) + // Minimum execution time: 786_000 picoseconds. + Weight::from_parts(850_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 694_000 picoseconds. - Weight::from_parts(740_000, 0) + // Minimum execution time: 794_000 picoseconds. + Weight::from_parts(850_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 659_000 picoseconds. - Weight::from_parts(707_000, 0) + // Minimum execution time: 787_000 picoseconds. + Weight::from_parts(870_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 724_000 picoseconds. - Weight::from_parts(780_000, 0) + // Minimum execution time: 802_000 picoseconds. + Weight::from_parts(856_000, 0) } + // Storage: `Benchmark::Override` (r:0 w:0) + // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 786_000 picoseconds. - Weight::from_parts(820_000, 0) + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 683_000 picoseconds. - Weight::from_parts(727_000, 0) + // Minimum execution time: 788_000 picoseconds. + Weight::from_parts(864_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `378` // Estimated: `6196` - // Minimum execution time: 66_182_000 picoseconds. - Weight::from_parts(69_754_000, 6196) + // Minimum execution time: 77_436_000 picoseconds. + Weight::from_parts(80_386_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -189,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 9_126_000 picoseconds. - Weight::from_parts(9_940_000, 3488) + // Minimum execution time: 9_386_000 picoseconds. + Weight::from_parts(9_645_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -198,27 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 673_000 picoseconds. - Weight::from_parts(723_000, 0) + // Minimum execution time: 3_433_000 picoseconds. + Weight::from_parts(3_661_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 23_218_000 picoseconds. - Weight::from_parts(23_828_000, 3507) + // Measured: `245` + // Estimated: `3710` + // Minimum execution time: 32_643_000 picoseconds. + Weight::from_parts(33_979_000, 3710) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -226,114 +238,118 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_725_000 picoseconds. - Weight::from_parts(2_925_000, 0) + // Minimum execution time: 3_453_000 picoseconds. + Weight::from_parts(3_585_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_445_000 picoseconds. - Weight::from_parts(23_907_000, 0) + // Minimum execution time: 22_253_000 picoseconds. + Weight::from_parts(22_627_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_642_000 picoseconds. - Weight::from_parts(6_826_000, 0) + // Minimum execution time: 5_892_000 picoseconds. + Weight::from_parts(6_118_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 673_000 picoseconds. - Weight::from_parts(723_000, 0) + // Minimum execution time: 3_423_000 picoseconds. + Weight::from_parts(3_650_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(722_000, 0) + // Minimum execution time: 3_552_000 picoseconds. + Weight::from_parts(3_715_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 789_000 picoseconds. - Weight::from_parts(875_000, 0) + // Minimum execution time: 905_000 picoseconds. + Weight::from_parts(957_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `378` // Estimated: `6196` - // Minimum execution time: 73_117_000 picoseconds. - Weight::from_parts(75_425_000, 6196) + // Minimum execution time: 84_232_000 picoseconds. + Weight::from_parts(86_965_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_008_000 picoseconds. - Weight::from_parts(5_204_000, 0) + // Minimum execution time: 5_116_000 picoseconds. + Weight::from_parts(5_309_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `378` // Estimated: `6196` - // Minimum execution time: 66_658_000 picoseconds. - Weight::from_parts(69_044_000, 6196) + // Minimum execution time: 79_148_000 picoseconds. + Weight::from_parts(81_056_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 710_000 picoseconds. - Weight::from_parts(761_000, 0) + // Minimum execution time: 812_000 picoseconds. + Weight::from_parts(883_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 662_000 picoseconds. - Weight::from_parts(709_000, 0) + // Minimum execution time: 783_000 picoseconds. + Weight::from_parts(823_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 654_000 picoseconds. - Weight::from_parts(697_000, 0) + // Minimum execution time: 785_000 picoseconds. + Weight::from_parts(844_000, 0) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -341,29 +357,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1489` - // Minimum execution time: 4_788_000 picoseconds. - Weight::from_parts(4_981_000, 1489) + // Minimum execution time: 4_812_000 picoseconds. + Weight::from_parts(4_956_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: 645_000 picoseconds. - Weight::from_parts(727_000, 0) + // Minimum execution time: 748_000 picoseconds. + Weight::from_parts(813_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 710_000 picoseconds. - Weight::from_parts(758_000, 0) + // Minimum execution time: 779_000 picoseconds. + Weight::from_parts(817_000, 0) } pub fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 682_000 picoseconds. - Weight::from_parts(737_000, 0) + // Minimum execution time: 796_000 picoseconds. + Weight::from_parts(855_000, 0) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 5da305fba00a0..d8a299b35bd24 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -145,7 +145,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("westmint"), impl_name: alloc::borrow::Cow::Borrowed("westmint"), authoring_version: 1, - spec_version: 1_018_012, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 16, @@ -1584,7 +1584,7 @@ impl fn create_asset_id_parameter( seed: u32, ) -> (cumulus_primitives_core::Location, cumulus_primitives_core::Location) { - // Use a different parachain' foreign assets pallet so that the asset is indeed foreign. + // Use a different parachain foreign assets pallet so that the asset is indeed foreign. let asset_id = cumulus_primitives_core::Location::new( 1, [ @@ -2177,7 +2177,6 @@ pallet_revive::impl_runtime_apis_plus_revive!( use frame_benchmarking::{BenchmarkBatch, BenchmarkError}; use frame_support::assert_ok; use sp_storage::TrackedStorageKey; - use frame_system_benchmarking::Pallet as SystemBench; use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench; impl frame_system_benchmarking::Config for Runtime { @@ -2192,6 +2191,7 @@ pallet_revive::impl_runtime_apis_plus_revive!( } use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + use xcm_config::{MaxAssetsIntoHolding, WestendLocation}; impl cumulus_pallet_session_benchmarking::Config for Runtime { fn generate_session_keys_and_proof(owner: Self::AccountId) -> (Self::Keys, Vec) { let keys = SessionKeys::generate(&owner.encode(), None); @@ -2199,33 +2199,37 @@ pallet_revive::impl_runtime_apis_plus_revive!( } } + impl cumulus_pallet_session_benchmarking::Config for Runtime {} + use testnet_parachains_constants::westend::locations::{PeopleParaId, PeopleLocation}; parameter_types! { pub ExistentialDepositAsset: Option = Some(( WestendLocation::get(), ExistentialDeposit::get() ).into()); - pub const RandomParaId: ParaId = ParaId::new(43211234); + + pub RandomParaId: ParaId = ParaId::new(43211234); } use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { type DeliveryHelper = ( - cumulus_primitives_utility::ToParentDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, + PriceForSiblingParachainDelivery, + RandomParaId, + ParachainSystem >, - polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, PriceForSiblingParachainDelivery, - RandomParaId, - ParachainSystem, - > - ); + PeopleParaId, + ParachainSystem + >); fn reachable_dest() -> Option { - Some(Parent.into()) + Some(PeopleLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -2233,19 +2237,15 @@ pallet_revive::impl_runtime_apis_plus_revive!( Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(WestendLocation::get()) }, - Parent.into(), + PeopleLocation::get(), )) } fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> { Some(( - Asset { - fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) - }, - // AH can reserve transfer native token to some random parachain. + Asset { fun: Fungible(ExistentialDeposit::get()), id: AssetId(Parent.into()) }, ParentThen(Parachain(RandomParaId::get().into()).into()).into(), )) } @@ -2255,10 +2255,10 @@ pallet_revive::impl_runtime_apis_plus_revive!( // Transfer to Relay some local AH asset (local-reserve-transfer) while paying // fees using teleported native token. // (We don't care that Relay doesn't accept incoming unknown AH local asset) - let dest = Parent.into(); + let dest: Location = PeopleLocation::get(); let fee_amount = EXISTENTIAL_DEPOSIT; - let fee_asset: Asset = (Location::parent(), fee_amount).into(); + let fee_asset: Asset = (WestendLocation::get(), fee_amount).into(); let who = frame_benchmarking::whitelisted_caller(); // Give some multiple of the existential deposit @@ -2360,19 +2360,20 @@ pallet_revive::impl_runtime_apis_plus_revive!( } } - use xcm_config::{MaxAssetsIntoHolding, WestendLocation}; use pallet_xcm_benchmarks::asset_instance_from; impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + PeopleParaId, + ParachainSystem >; fn valid_destination() -> Result { - Ok(WestendLocation::get()) + Ok(PeopleLocation::get()) } fn worst_case_holding(depositable_count: u32) -> XcmAssets { // A mix of fungible, non-fungible, and concrete assets. @@ -2398,11 +2399,10 @@ pallet_revive::impl_runtime_apis_plus_revive!( } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - WestendLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + PeopleLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(WestendLocation::get()) }, )); - pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; // AssetHubWestend trusts AssetHubRococo as reserve for ROCs pub TrustedReserve: Option<(Location, Asset)> = Some( ( @@ -2415,7 +2415,7 @@ pallet_revive::impl_runtime_apis_plus_revive!( impl pallet_xcm_benchmarks::fungible::Config for Runtime { type TransactAsset = Balances; - type CheckedAccount = CheckedAccount; + type CheckedAccount = xcm_config::TeleportTracking; type TrustedTeleporter = TrustedTeleporter; type TrustedReserve = TrustedReserve; @@ -2509,15 +2509,18 @@ pallet_revive::impl_runtime_apis_plus_revive!( } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((WestendLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok(( + PeopleLocation::get(), + frame_system::Call::remark_with_event { remark: vec![] }.into() + )) } fn subscribe_origin() -> Result { - Ok(WestendLocation::get()) + Ok(PeopleLocation::get()) } fn claimable_asset() -> Result<(Location, Location, XcmAssets), BenchmarkError> { - let origin = WestendLocation::get(); + let origin = PeopleLocation::get(); let assets: XcmAssets = (AssetId(WestendLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs index d0803d75d7de8..e1ac4f8e096ef 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_staking_async` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `2144d2c1c0c2`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `00ad0745bb4b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -68,8 +68,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `6813` // Estimated: `4218` - // Minimum execution time: 107_759_000 picoseconds. - Weight::from_parts(112_057_000, 0) + // Minimum execution time: 107_432_000 picoseconds. + Weight::from_parts(111_160_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -96,8 +96,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `8274` // Estimated: `8877` - // Minimum execution time: 284_822_000 picoseconds. - Weight::from_parts(295_779_000, 0) + // Minimum execution time: 283_604_000 picoseconds. + Weight::from_parts(293_630_000, 0) .saturating_add(Weight::from_parts(0, 8877)) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(7)) @@ -110,8 +110,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `MaxEncodedLen`) /// Storage: `Staking::MinNominatorBond` (r:1 w:0) /// Proof: `Staking::MinNominatorBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `Staking::CurrentEra` (r:1 w:0) - /// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Staking::ActiveEra` (r:1 w:0) + /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::VirtualStakers` (r:1 w:0) /// Proof: `Staking::VirtualStakers` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:0) @@ -126,8 +126,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `8422` // Estimated: `8877` - // Minimum execution time: 248_826_000 picoseconds. - Weight::from_parts(263_736_000, 0) + // Minimum execution time: 249_063_000 picoseconds. + Weight::from_parts(258_863_000, 0) .saturating_add(Weight::from_parts(0, 8877)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(6)) @@ -136,8 +136,12 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:1 w:0) /// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) - /// Storage: `Staking::CurrentEra` (r:1 w:0) - /// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Staking::ActiveEra` (r:1 w:0) + /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) + /// Storage: `Staking::UnappliedSlashes` (r:1 w:0) + /// Proof: `Staking::UnappliedSlashes` (`max_values`: None, `max_size`: Some(3231), added: 5706, mode: `MaxEncodedLen`) + /// Storage: `Staking::OffenceQueueEras` (r:1 w:0) + /// Proof: `Staking::OffenceQueueEras` (`max_values`: Some(1), `max_size`: Some(9), added: 504, mode: `MaxEncodedLen`) /// Storage: `Staking::MinValidatorBond` (r:1 w:0) /// Proof: `Staking::MinValidatorBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) /// Storage: `Staking::MinNominatorBond` (r:1 w:0) @@ -152,20 +156,24 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `DelegatedStaking::Agents` (`max_values`: None, `max_size`: Some(120), added: 2595, mode: `MaxEncodedLen`) fn withdraw_unbonded_update() -> Weight { // Proof Size summary in bytes: - // Measured: `7421` - // Estimated: `4218` - // Minimum execution time: 115_338_000 picoseconds. - Weight::from_parts(118_300_000, 0) - .saturating_add(Weight::from_parts(0, 4218)) - .saturating_add(T::DbWeight::get().reads(9)) + // Measured: `7413` + // Estimated: `6696` + // Minimum execution time: 120_968_000 picoseconds. + Weight::from_parts(125_564_000, 0) + .saturating_add(Weight::from_parts(0, 6696)) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Staking::Ledger` (r:1 w:1) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:1 w:1) /// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) - /// Storage: `Staking::CurrentEra` (r:1 w:0) - /// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Staking::ActiveEra` (r:1 w:0) + /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) + /// Storage: `Staking::UnappliedSlashes` (r:1 w:0) + /// Proof: `Staking::UnappliedSlashes` (`max_values`: None, `max_size`: Some(3231), added: 5706, mode: `MaxEncodedLen`) + /// Storage: `Staking::OffenceQueueEras` (r:1 w:0) + /// Proof: `Staking::OffenceQueueEras` (`max_values`: Some(1), `max_size`: Some(9), added: 504, mode: `MaxEncodedLen`) /// Storage: `Staking::MinValidatorBond` (r:1 w:0) /// Proof: `Staking::MinValidatorBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) /// Storage: `Staking::MinNominatorBond` (r:1 w:0) @@ -192,12 +200,12 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn withdraw_unbonded_kill() -> Weight { // Proof Size summary in bytes: - // Measured: `8368` - // Estimated: `6248` - // Minimum execution time: 276_546_000 picoseconds. - Weight::from_parts(290_575_000, 0) - .saturating_add(Weight::from_parts(0, 6248)) - .saturating_add(T::DbWeight::get().reads(15)) + // Measured: `8360` + // Estimated: `6696` + // Minimum execution time: 291_826_000 picoseconds. + Weight::from_parts(303_497_000, 0) + .saturating_add(Weight::from_parts(0, 6696)) + .saturating_add(T::DbWeight::get().reads(17)) .saturating_add(T::DbWeight::get().writes(11)) } /// Storage: `Staking::Ledger` (r:1 w:0) @@ -230,8 +238,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `8805` // Estimated: `4218` - // Minimum execution time: 109_094_000 picoseconds. - Weight::from_parts(114_256_000, 0) + // Minimum execution time: 108_937_000 picoseconds. + Weight::from_parts(112_665_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(5)) @@ -247,11 +255,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `12207 + k * (1121 ±0)` // Estimated: `4218 + k * (3033 ±0)` - // Minimum execution time: 76_067_000 picoseconds. - Weight::from_parts(72_930_170, 0) + // Minimum execution time: 74_688_000 picoseconds. + Weight::from_parts(61_475_056, 0) .saturating_add(Weight::from_parts(0, 4218)) - // Standard Error: 22_719 - .saturating_add(Weight::from_parts(14_110_106, 0).saturating_mul(k.into())) + // Standard Error: 26_215 + .saturating_add(Weight::from_parts(14_123_790, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) @@ -286,11 +294,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `4995 + n * (68 ±0)` // Estimated: `6248 + n * (2520 ±0)` - // Minimum execution time: 175_538_000 picoseconds. - Weight::from_parts(193_929_980, 0) + // Minimum execution time: 173_664_000 picoseconds. + Weight::from_parts(191_925_653, 0) .saturating_add(Weight::from_parts(0, 6248)) - // Standard Error: 49_121 - .saturating_add(Weight::from_parts(5_847_379, 0).saturating_mul(n.into())) + // Standard Error: 44_857 + .saturating_add(Weight::from_parts(5_974_175, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -318,8 +326,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `5237` // Estimated: `6248` - // Minimum execution time: 160_395_000 picoseconds. - Weight::from_parts(168_805_000, 0) + // Minimum execution time: 169_879_000 picoseconds. + Weight::from_parts(177_094_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(6)) @@ -334,8 +342,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `4060` // Estimated: `4218` - // Minimum execution time: 38_594_000 picoseconds. - Weight::from_parts(40_798_000, 0) + // Minimum execution time: 38_313_000 picoseconds. + Weight::from_parts(39_502_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -350,8 +358,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `5732` // Estimated: `4218` - // Minimum execution time: 48_340_000 picoseconds. - Weight::from_parts(50_335_000, 0) + // Minimum execution time: 48_735_000 picoseconds. + Weight::from_parts(50_256_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -364,8 +372,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `5370` // Estimated: `7446` - // Minimum execution time: 49_183_000 picoseconds. - Weight::from_parts(51_793_000, 0) + // Minimum execution time: 48_618_000 picoseconds. + Weight::from_parts(49_956_000, 0) .saturating_add(Weight::from_parts(0, 7446)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -376,8 +384,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_712_000 picoseconds. - Weight::from_parts(2_854_000, 0) + // Minimum execution time: 2_633_000 picoseconds. + Weight::from_parts(2_835_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -387,8 +395,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_468_000 picoseconds. - Weight::from_parts(15_223_000, 0) + // Minimum execution time: 14_085_000 picoseconds. + Weight::from_parts(15_022_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -398,8 +406,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_444_000 picoseconds. - Weight::from_parts(14_990_000, 0) + // Minimum execution time: 12_634_000 picoseconds. + Weight::from_parts(14_866_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -409,8 +417,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_472_000 picoseconds. - Weight::from_parts(15_274_000, 0) + // Minimum execution time: 12_912_000 picoseconds. + Weight::from_parts(14_826_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -421,11 +429,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_849_000 picoseconds. - Weight::from_parts(3_361_903, 0) + // Minimum execution time: 2_803_000 picoseconds. + Weight::from_parts(3_215_980, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 976 - .saturating_add(Weight::from_parts(21_939, 0).saturating_mul(v.into())) + // Standard Error: 697 + .saturating_add(Weight::from_parts(18_238, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Staking::Ledger` (r:1502 w:1502) @@ -439,11 +447,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `194937 + u * (1086 ±0)` // Estimated: `990 + u * (6456 ±0)` - // Minimum execution time: 5_688_000 picoseconds. - Weight::from_parts(5_761_000, 0) + // Minimum execution time: 5_407_000 picoseconds. + Weight::from_parts(5_490_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 58_001 - .saturating_add(Weight::from_parts(45_672_901, 0).saturating_mul(u.into())) + // Standard Error: 24_405 + .saturating_add(Weight::from_parts(45_143_275, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 6456).saturating_mul(u.into())) @@ -478,27 +486,26 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `8305` // Estimated: `6248` - // Minimum execution time: 262_502_000 picoseconds. - Weight::from_parts(272_555_000, 0) + // Minimum execution time: 261_353_000 picoseconds. + Weight::from_parts(279_295_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) } - /// Storage: `Staking::UnappliedSlashes` (r:999 w:999) - /// Proof: `Staking::UnappliedSlashes` (`max_values`: None, `max_size`: Some(3231), added: 5706, mode: `MaxEncodedLen`) + /// Storage: `Staking::CancelledSlashes` (r:1 w:1) + /// Proof: `Staking::CancelledSlashes` (`max_values`: None, `max_size`: Some(36014), added: 38489, mode: `MaxEncodedLen`) /// The range of component `s` is `[1, 1000]`. fn cancel_deferred_slash(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `693 + s * (122 ±0)` - // Estimated: `990 + s * (5706 ±0)` - // Minimum execution time: 19_435_000 picoseconds. - Weight::from_parts(20_076_000, 0) - .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 5_792 - .saturating_add(Weight::from_parts(7_752_125, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) - .saturating_add(Weight::from_parts(0, 5706).saturating_mul(s.into())) + // Measured: `653` + // Estimated: `39479` + // Minimum execution time: 15_566_000 picoseconds. + Weight::from_parts(15_953_000, 0) + .saturating_add(Weight::from_parts(0, 39479)) + // Standard Error: 9_932 + .saturating_add(Weight::from_parts(2_874_760, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Staking::ErasStakersOverview` (r:1 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) @@ -531,11 +538,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `32761 + n * (3627 ±0)` // Estimated: `39483 + n * (3228 ±0)` - // Minimum execution time: 313_275_000 picoseconds. - Weight::from_parts(452_843_120, 0) + // Minimum execution time: 315_476_000 picoseconds. + Weight::from_parts(470_344_887, 0) .saturating_add(Weight::from_parts(0, 39483)) - // Standard Error: 150_208 - .saturating_add(Weight::from_parts(124_254_939, 0).saturating_mul(n.into())) + // Standard Error: 163_579 + .saturating_add(Weight::from_parts(125_046_004, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -561,15 +568,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Storage: `VoterList::ListBags` (r:2 w:2) /// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) /// The range of component `l` is `[1, 32]`. - fn rebond(l: u32, ) -> Weight { + fn rebond(_l: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `8275 + l * (5 ±0)` // Estimated: `8877` - // Minimum execution time: 232_316_000 picoseconds. - Weight::from_parts(250_863_688, 0) + // Minimum execution time: 234_345_000 picoseconds. + Weight::from_parts(254_379_995, 0) .saturating_add(Weight::from_parts(0, 8877)) - // Standard Error: 18_397 - .saturating_add(Weight::from_parts(85_198, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -605,8 +610,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `8368` // Estimated: `6248` - // Minimum execution time: 282_188_000 picoseconds. - Weight::from_parts(293_330_000, 0) + // Minimum execution time: 283_180_000 picoseconds. + Weight::from_parts(299_374_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(14)) .saturating_add(T::DbWeight::get().writes(11)) @@ -629,8 +634,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_743_000 picoseconds. - Weight::from_parts(5_028_000, 0) + // Minimum execution time: 4_657_000 picoseconds. + Weight::from_parts(5_103_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -652,8 +657,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_373_000 picoseconds. - Weight::from_parts(4_577_000, 0) + // Minimum execution time: 4_283_000 picoseconds. + Weight::from_parts(4_483_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -685,8 +690,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `5360` // Estimated: `6248` - // Minimum execution time: 199_601_000 picoseconds. - Weight::from_parts(207_015_000, 0) + // Minimum execution time: 194_071_000 picoseconds. + Weight::from_parts(211_491_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(6)) @@ -699,8 +704,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `663` // Estimated: `3510` - // Minimum execution time: 37_972_000 picoseconds. - Weight::from_parts(39_502_000, 0) + // Minimum execution time: 37_156_000 picoseconds. + Weight::from_parts(38_620_000, 0) .saturating_add(Weight::from_parts(0, 3510)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -711,8 +716,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_777_000 picoseconds. - Weight::from_parts(2_943_000, 0) + // Minimum execution time: 2_640_000 picoseconds. + Weight::from_parts(2_816_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -732,8 +737,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `6968` // Estimated: `4764` - // Minimum execution time: 75_083_000 picoseconds. - Weight::from_parts(77_036_000, 0) + // Minimum execution time: 74_018_000 picoseconds. + Weight::from_parts(75_714_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -754,8 +759,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `7039` // Estimated: `4764` - // Minimum execution time: 115_430_000 picoseconds. - Weight::from_parts(120_211_000, 0) + // Minimum execution time: 114_405_000 picoseconds. + Weight::from_parts(119_159_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -782,8 +787,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `212846` // Estimated: `210810` - // Minimum execution time: 5_784_969_000 picoseconds. - Weight::from_parts(5_855_975_000, 0) + // Minimum execution time: 5_719_919_000 picoseconds. + Weight::from_parts(5_833_376_000, 0) .saturating_add(Weight::from_parts(0, 210810)) .saturating_add(T::DbWeight::get().reads(457)) .saturating_add(T::DbWeight::get().writes(261)) @@ -806,8 +811,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `3622` // Estimated: `6617` - // Minimum execution time: 149_203_000 picoseconds. - Weight::from_parts(159_626_000, 0) + // Minimum execution time: 148_872_000 picoseconds. + Weight::from_parts(153_994_000, 0) .saturating_add(Weight::from_parts(0, 6617)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) @@ -831,11 +836,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `687 + v * (96 ±0)` // Estimated: `2126 + v * (2576 ±0)` - // Minimum execution time: 91_086_000 picoseconds. - Weight::from_parts(54_502_332, 0) + // Minimum execution time: 97_284_000 picoseconds. + Weight::from_parts(38_368_587, 0) .saturating_add(Weight::from_parts(0, 2126)) - // Standard Error: 16_860 - .saturating_add(Weight::from_parts(18_091_039, 0).saturating_mul(v.into())) + // Standard Error: 14_583 + .saturating_add(Weight::from_parts(17_935_502, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(v.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -856,8 +861,12 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::BondedEras` (`max_values`: Some(1), `max_size`: Some(25), added: 520, mode: `MaxEncodedLen`) /// Storage: `Staking::ForceEra` (r:1 w:0) /// Proof: `Staking::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0x876b5159e787527164dca1c92959a6f1` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x876b5159e787527164dca1c92959a6f1` (r:1 w:0) + /// Storage: UNKNOWN KEY `0x6358acd2035ec4bb863fa981e0c177b9` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x6358acd2035ec4bb863fa981e0c177b9` (r:1 w:0) + /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) + /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: `Staking::VoterSnapshotStatus` (r:0 w:1) /// Proof: `Staking::VoterSnapshotStatus` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasValidatorReward` (r:0 w:1) @@ -868,21 +877,21 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::ElectableStashes` (`max_values`: Some(1), `max_size`: Some(32002), added: 32497, mode: `MaxEncodedLen`) fn rc_on_session_report() -> Weight { // Proof Size summary in bytes: - // Measured: `1092` + // Measured: `1230` // Estimated: `39483` - // Minimum execution time: 442_273_000 picoseconds. - Weight::from_parts(463_488_000, 0) + // Minimum execution time: 465_155_000 picoseconds. + Weight::from_parts(480_074_000, 0) .saturating_add(Weight::from_parts(0, 39483)) - .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(7)) } - /// Storage: `Staking::ErasValidatorPrefs` (r:1000 w:1000) + /// Storage: `Staking::ErasValidatorPrefs` (r:999 w:999) /// Proof: `Staking::ErasValidatorPrefs` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `Measured`) - /// Storage: `Staking::ClaimedRewards` (r:1000 w:1000) + /// Storage: `Staking::ClaimedRewards` (r:999 w:999) /// Proof: `Staking::ClaimedRewards` (`max_values`: None, `max_size`: Some(1462), added: 3937, mode: `Measured`) - /// Storage: `Staking::ErasStakersPaged` (r:1000 w:1000) + /// Storage: `Staking::ErasStakersPaged` (r:999 w:999) /// Proof: `Staking::ErasStakersPaged` (`max_values`: None, `max_size`: Some(3152), added: 5627, mode: `Measured`) - /// Storage: `Staking::ErasStakersOverview` (r:1000 w:1000) + /// Storage: `Staking::ErasStakersOverview` (r:999 w:999) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `Measured`) /// Storage: `Staking::ValidatorCount` (r:1 w:0) /// Proof: `Staking::ValidatorCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) @@ -895,16 +904,17 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `v` is `[1, 1000]`. fn prune_era(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `17590 + v * (273 ±0)` - // Estimated: `842072 + v * (2747 ±1)` - // Minimum execution time: 1_139_207_000 picoseconds. - Weight::from_parts(1_095_249_876, 842072) - // Standard Error: 80_293 - .saturating_add(Weight::from_parts(9_694_271, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().reads(334_u64)) + // Measured: `11838 + v * (279 ±0)` + // Estimated: `734012 + v * (2749 ±0)` + // Minimum execution time: 517_577_000 picoseconds. + Weight::from_parts(258_763_550, 0) + .saturating_add(Weight::from_parts(0, 734012)) + // Standard Error: 29_499 + .saturating_add(Weight::from_parts(5_622_698, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(291)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(v.into()))) - .saturating_add(T::DbWeight::get().writes(336_u64)) + .saturating_add(T::DbWeight::get().writes(293)) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(v.into()))) - .saturating_add(Weight::from_parts(0, 2747).saturating_mul(v.into())) + .saturating_add(Weight::from_parts(0, 2749).saturating_mul(v.into())) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs index 33ae9dd76f9b6..1ddc3d01ec4d7 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-06-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `c534dd18938a`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `601cc0634d73`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,47 +50,51 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `3577` - // Minimum execution time: 25_999_000 picoseconds. - Weight::from_parts(26_719_000, 0) - .saturating_add(Weight::from_parts(0, 3577)) + // Measured: `378` + // Estimated: `3843` + // Minimum execution time: 38_049_000 picoseconds. + Weight::from_parts(43_000_000, 0) + .saturating_add(Weight::from_parts(0, 3843)) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `181` - // Estimated: `3646` - // Minimum execution time: 113_047_000 picoseconds. - Weight::from_parts(121_624_000, 0) - .saturating_add(Weight::from_parts(0, 3646)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `2928` + // Estimated: `6393` + // Minimum execution time: 162_919_000 picoseconds. + Weight::from_parts(171_214_000, 0) + .saturating_add(Weight::from_parts(0, 6393)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -110,16 +114,18 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn reserve_transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `366` - // Estimated: `6196` - // Minimum execution time: 141_129_000 picoseconds. - Weight::from_parts(147_335_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) + // Measured: `2829` + // Estimated: `6294` + // Minimum execution time: 157_079_000 picoseconds. + Weight::from_parts(163_944_000, 0) + .saturating_add(Weight::from_parts(0, 6294)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Assets::Asset` (r:1 w:1) @@ -128,25 +134,25 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(84), added: 2559, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `607` - // Estimated: `6208` - // Minimum execution time: 181_802_000 picoseconds. - Weight::from_parts(188_363_000, 0) - .saturating_add(Weight::from_parts(0, 6208)) - .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(6)) + // Measured: `4461` + // Estimated: `8799` + // Minimum execution time: 243_058_000 picoseconds. + Weight::from_parts(253_065_000, 0) + .saturating_add(Weight::from_parts(0, 8799)) + .saturating_add(T::DbWeight::get().reads(13)) + .saturating_add(T::DbWeight::get().writes(8)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -154,8 +160,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_788_000 picoseconds. - Weight::from_parts(10_113_000, 0) + // Minimum execution time: 10_467_000 picoseconds. + Weight::from_parts(11_021_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -165,8 +171,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_589_000 picoseconds. - Weight::from_parts(7_947_000, 0) + // Minimum execution time: 8_401_000 picoseconds. + Weight::from_parts(9_107_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -174,54 +180,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_623_000 picoseconds. - Weight::from_parts(2_794_000, 0) + // Minimum execution time: 2_570_000 picoseconds. + Weight::from_parts(2_800_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `3577` - // Minimum execution time: 32_613_000 picoseconds. - Weight::from_parts(34_199_000, 0) - .saturating_add(Weight::from_parts(0, 3577)) + // Measured: `378` + // Estimated: `3843` + // Minimum execution time: 44_107_000 picoseconds. + Weight::from_parts(45_808_000, 0) + .saturating_add(Weight::from_parts(0, 3843)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `202` - // Estimated: `3667` - // Minimum execution time: 33_335_000 picoseconds. - Weight::from_parts(34_426_000, 0) - .saturating_add(Weight::from_parts(0, 3667)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `537` + // Estimated: `108971` + // Minimum execution time: 47_432_000 picoseconds. + Weight::from_parts(49_109_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -230,8 +240,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_690_000 picoseconds. - Weight::from_parts(2_840_000, 0) + // Minimum execution time: 2_663_000 picoseconds. + Weight::from_parts(2_834_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -241,8 +251,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `22` // Estimated: `15862` - // Minimum execution time: 22_280_000 picoseconds. - Weight::from_parts(22_728_000, 0) + // Minimum execution time: 24_527_000 picoseconds. + Weight::from_parts(25_001_000, 0) .saturating_add(Weight::from_parts(0, 15862)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -253,8 +263,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26` // Estimated: `15866` - // Minimum execution time: 21_688_000 picoseconds. - Weight::from_parts(22_205_000, 0) + // Minimum execution time: 23_654_000 picoseconds. + Weight::from_parts(24_456_000, 0) .saturating_add(Weight::from_parts(0, 15866)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -263,28 +273,28 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `36` - // Estimated: `18351` - // Minimum execution time: 25_326_000 picoseconds. - Weight::from_parts(25_776_000, 0) - .saturating_add(Weight::from_parts(0, 18351)) + // Measured: `39` + // Estimated: `18354` + // Minimum execution time: 29_102_000 picoseconds. + Weight::from_parts(29_697_000, 0) + .saturating_add(Weight::from_parts(0, 18354)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `6015` - // Minimum execution time: 23_473_000 picoseconds. - Weight::from_parts(24_334_000, 0) - .saturating_add(Weight::from_parts(0, 6015)) + // Measured: `320` + // Estimated: `6260` + // Minimum execution time: 40_295_000 picoseconds. + Weight::from_parts(42_747_000, 0) + .saturating_add(Weight::from_parts(0, 6260)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -294,8 +304,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `13404` - // Minimum execution time: 18_006_000 picoseconds. - Weight::from_parts(18_360_000, 0) + // Minimum execution time: 20_848_000 picoseconds. + Weight::from_parts(21_325_000, 0) .saturating_add(Weight::from_parts(0, 13404)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -305,27 +315,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `33` // Estimated: `15873` - // Minimum execution time: 22_627_000 picoseconds. - Weight::from_parts(23_215_000, 0) + // Minimum execution time: 25_329_000 picoseconds. + Weight::from_parts(25_654_000, 0) .saturating_add(Weight::from_parts(0, 15873)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `15915` - // Minimum execution time: 35_005_000 picoseconds. - Weight::from_parts(35_598_000, 0) - .saturating_add(Weight::from_parts(0, 15915)) + // Measured: `320` + // Estimated: `16160` + // Minimum execution time: 53_724_000 picoseconds. + Weight::from_parts(55_468_000, 0) + .saturating_add(Weight::from_parts(0, 16160)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -337,8 +347,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_703_000 picoseconds. - Weight::from_parts(2_951_000, 0) + // Minimum execution time: 2_700_000 picoseconds. + Weight::from_parts(2_906_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -349,8 +359,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 26_584_000 picoseconds. - Weight::from_parts(27_096_000, 0) + // Minimum execution time: 29_164_000 picoseconds. + Weight::from_parts(29_794_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -367,8 +377,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3802` - // Minimum execution time: 47_406_000 picoseconds. - Weight::from_parts(49_633_000, 0) + // Minimum execution time: 50_961_000 picoseconds. + Weight::from_parts(53_730_000, 0) .saturating_add(Weight::from_parts(0, 3802)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -376,28 +386,28 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(265), added: 2740, mode: `MaxEncodedLen`) fn add_authorized_alias() -> Weight { // Proof Size summary in bytes: - // Measured: `160` - // Estimated: `3640` - // Minimum execution time: 48_861_000 picoseconds. - Weight::from_parts(50_079_000, 0) - .saturating_add(Weight::from_parts(0, 3640)) + // Measured: `1936` + // Estimated: `5401` + // Minimum execution time: 62_955_000 picoseconds. + Weight::from_parts(64_184_000, 0) + .saturating_add(Weight::from_parts(0, 5401)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(265), added: 2740, mode: `MaxEncodedLen`) fn remove_authorized_alias() -> Weight { // Proof Size summary in bytes: - // Measured: `516` - // Estimated: `3981` - // Minimum execution time: 50_978_000 picoseconds. - Weight::from_parts(51_996_000, 0) - .saturating_add(Weight::from_parts(0, 3981)) + // Measured: `2292` + // Estimated: `5757` + // Minimum execution time: 64_429_000 picoseconds. + Weight::from_parts(65_916_000, 0) + .saturating_add(Weight::from_parts(0, 5757)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -405,8 +415,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_604_000 picoseconds. + Weight::from_parts(8_790_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index b3f1b009b8a0c..12e6bf3fe97ef 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-03-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `c2cc39483446`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `601cc0634d73`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -59,13 +59,13 @@ impl WeightInfo { // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) // Storage: `AssetsFreezer::Freezes` (r:1 w:1) - // Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) + // Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(105), added: 2580, mode: `MaxEncodedLen`) pub fn withdraw_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `527` + // Measured: `1270` // Estimated: `3675` - // Minimum execution time: 55_738_000 picoseconds. - Weight::from_parts(57_700_000, 3675) + // Minimum execution time: 63_006_000 picoseconds. + Weight::from_parts(64_684_000, 3675) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -79,10 +79,10 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn transfer_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `426` + // Measured: `1533` // Estimated: `6208` - // Minimum execution time: 52_416_000 picoseconds. - Weight::from_parts(53_673_000, 6208) + // Minimum execution time: 61_134_000 picoseconds. + Weight::from_parts(62_630_000, 6208) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -96,57 +96,65 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `638` + // Measured: `4165` // Estimated: `8799` - // Minimum execution time: 130_383_000 picoseconds. - Weight::from_parts(134_409_000, 8799) + // Minimum execution time: 160_634_000 picoseconds. + Weight::from_parts(164_735_000, 8799) .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(T::DbWeight::get().writes(8)) } pub fn reserve_asset_deposited() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_397_000 picoseconds. - Weight::from_parts(1_511_000, 0) + // Minimum execution time: 1_550_000 picoseconds. + Weight::from_parts(1_655_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `2632` // Estimated: `6196` - // Minimum execution time: 109_295_000 picoseconds. - Weight::from_parts(120_413_000, 6196) + // Minimum execution time: 137_823_000 picoseconds. + Weight::from_parts(141_470_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_910_000 picoseconds. - Weight::from_parts(3_056_000, 0) + // Measured: `1274` + // Estimated: `3593` + // Minimum execution time: 36_159_000 picoseconds. + Weight::from_parts(37_617_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: `Assets::Asset` (r:1 w:1) // Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -156,17 +164,17 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn deposit_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `314` + // Measured: `1421` // Estimated: `3675` - // Minimum execution time: 32_342_000 picoseconds. - Weight::from_parts(34_037_000, 3675) + // Minimum execution time: 44_280_000 picoseconds. + Weight::from_parts(46_439_000, 3675) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Assets::Asset` (r:1 w:1) @@ -175,39 +183,43 @@ impl WeightInfo { // 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: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `425` - // Estimated: `3890` - // Minimum execution time: 72_043_000 picoseconds. - Weight::from_parts(74_586_000, 3890) + // Measured: `1935` + // Estimated: `5400` + // Minimum execution time: 100_045_000 picoseconds. + Weight::from_parts(104_239_000, 5400) .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Assets::Asset` (r:1 w:0) // Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `425` - // Estimated: `3890` - // Minimum execution time: 53_342_000 picoseconds. - Weight::from_parts(56_209_000, 3890) + // Measured: `828` + // Estimated: `4293` + // Minimum execution time: 74_309_000 picoseconds. + Weight::from_parts(77_487_000, 4293) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: `Assets::Asset` (r:1 w:1) // Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -217,21 +229,23 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `425` - // Estimated: `6196` - // Minimum execution time: 89_970_000 picoseconds. - Weight::from_parts(92_829_000, 6196) + // Measured: `3209` + // Estimated: `6674` + // Minimum execution time: 121_698_000 picoseconds. + Weight::from_parts(125_795_000, 6674) .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes(6)) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 16ad43529bf89..04ed54ad8f48b 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `0af6a34749d7`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `601cc0634d73`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,24 +52,26 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `2632` // Estimated: `6196` - // Minimum execution time: 103_614_000 picoseconds. - Weight::from_parts(107_306_000, 6196) + // Minimum execution time: 128_179_000 picoseconds. + Weight::from_parts(132_827_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -77,8 +79,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 7_998_000 picoseconds. - Weight::from_parts(8_489_000, 3593) + // Minimum execution time: 6_735_000 picoseconds. + Weight::from_parts(7_064_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -88,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 6_293_000 picoseconds. - Weight::from_parts(6_672_000, 3593) + // Minimum execution time: 6_580_000 picoseconds. + Weight::from_parts(7_050_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -97,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 782_000 picoseconds. - Weight::from_parts(839_000, 0) + // Minimum execution time: 773_000 picoseconds. + Weight::from_parts(829_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -106,51 +108,51 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_635_000 picoseconds. - Weight::from_parts(5_973_000, 3465) + // Minimum execution time: 6_112_000 picoseconds. + Weight::from_parts(6_358_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_331_000 picoseconds. - Weight::from_parts(7_532_000, 0) + // Minimum execution time: 8_002_000 picoseconds. + Weight::from_parts(8_377_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_839_000 picoseconds. - Weight::from_parts(3_034_000, 0) + // Minimum execution time: 1_344_000 picoseconds. + Weight::from_parts(1_497_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 747_000 picoseconds. - Weight::from_parts(802_000, 0) + // Minimum execution time: 786_000 picoseconds. + Weight::from_parts(840_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 727_000 picoseconds. - Weight::from_parts(787_000, 0) + // Minimum execution time: 737_000 picoseconds. + Weight::from_parts(805_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 717_000 picoseconds. - Weight::from_parts(771_000, 0) + // Minimum execution time: 745_000 picoseconds. + Weight::from_parts(810_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 757_000 picoseconds. - Weight::from_parts(822_000, 0) + // Minimum execution time: 774_000 picoseconds. + Weight::from_parts(828_000, 0) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -165,29 +167,31 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 735_000 picoseconds. - Weight::from_parts(788_000, 0) + // Minimum execution time: 739_000 picoseconds. + Weight::from_parts(822_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `2632` // Estimated: `6196` - // Minimum execution time: 68_640_000 picoseconds. - Weight::from_parts(70_050_000, 6196) + // Minimum execution time: 91_221_000 picoseconds. + Weight::from_parts(93_944_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -195,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 8_891_000 picoseconds. - Weight::from_parts(9_210_000, 3488) + // Minimum execution time: 9_795_000 picoseconds. + Weight::from_parts(10_091_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -204,27 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_247_000 picoseconds. - Weight::from_parts(3_479_000, 0) + // Minimum execution time: 3_599_000 picoseconds. + Weight::from_parts(3_920_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 22_866_000 picoseconds. - Weight::from_parts(23_629_000, 3507) + // Measured: `378` + // Estimated: `3843` + // Minimum execution time: 36_969_000 picoseconds. + Weight::from_parts(37_920_000, 3843) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -232,114 +238,118 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_928_000 picoseconds. - Weight::from_parts(3_033_000, 0) + // Minimum execution time: 3_401_000 picoseconds. + Weight::from_parts(3_642_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_095_000 picoseconds. - Weight::from_parts(23_613_000, 0) + // Minimum execution time: 23_275_000 picoseconds. + Weight::from_parts(23_612_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_766_000 picoseconds. - Weight::from_parts(6_918_000, 0) + // Minimum execution time: 5_950_000 picoseconds. + Weight::from_parts(6_129_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_339_000 picoseconds. - Weight::from_parts(3_560_000, 0) + // Minimum execution time: 3_589_000 picoseconds. + Weight::from_parts(3_806_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_337_000 picoseconds. - Weight::from_parts(3_543_000, 0) + // Minimum execution time: 3_648_000 picoseconds. + Weight::from_parts(3_844_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 875_000 picoseconds. - Weight::from_parts(944_000, 0) + // Minimum execution time: 917_000 picoseconds. + Weight::from_parts(975_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `2632` // Estimated: `6196` - // Minimum execution time: 74_710_000 picoseconds. - Weight::from_parts(77_414_000, 6196) + // Minimum execution time: 100_417_000 picoseconds. + Weight::from_parts(102_884_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_491_000 picoseconds. - Weight::from_parts(5_699_000, 0) + // Minimum execution time: 8_030_000 picoseconds. + Weight::from_parts(8_265_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `2632` // Estimated: `6196` - // Minimum execution time: 68_452_000 picoseconds. - Weight::from_parts(70_643_000, 6196) + // Minimum execution time: 91_164_000 picoseconds. + Weight::from_parts(93_992_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 760_000 picoseconds. - Weight::from_parts(832_000, 0) + // Minimum execution time: 780_000 picoseconds. + Weight::from_parts(842_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 727_000 picoseconds. - Weight::from_parts(778_000, 0) + // Minimum execution time: 707_000 picoseconds. + Weight::from_parts(768_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 729_000 picoseconds. - Weight::from_parts(776_000, 0) + // Minimum execution time: 711_000 picoseconds. + Weight::from_parts(775_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -351,10 +361,10 @@ impl WeightInfo { // Proof: `ForeignAssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(682), added: 3157, mode: `MaxEncodedLen`) pub fn exchange_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `498` + // Measured: `1244` // Estimated: `4273` - // Minimum execution time: 83_321_000 picoseconds. - Weight::from_parts(86_103_000, 4273) + // Minimum execution time: 93_724_000 picoseconds. + Weight::from_parts(96_332_000, 4273) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -362,31 +372,31 @@ impl WeightInfo { // 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: `69` + // Measured: `136` // Estimated: `1489` - // Minimum execution time: 5_230_000 picoseconds. - Weight::from_parts(5_429_000, 1489) + // Minimum execution time: 5_567_000 picoseconds. + Weight::from_parts(5_841_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: 737_000 picoseconds. - Weight::from_parts(780_000, 0) + // Minimum execution time: 713_000 picoseconds. + Weight::from_parts(779_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 759_000 picoseconds. - Weight::from_parts(825_000, 0) + // Minimum execution time: 728_000 picoseconds. + Weight::from_parts(783_000, 0) } pub fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 780_000 picoseconds. - Weight::from_parts(854_000, 0) + // Minimum execution time: 777_000 picoseconds. + Weight::from_parts(859_000, 0) } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs index 9e6ab673b2993..0bae9b30e3ac1 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs @@ -42,9 +42,9 @@ use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::xcm_sender::ExponentialPrice; use snowbridge_outbound_queue_primitives::v2::exporter::PausableExporter; use sp_runtime::traits::{AccountIdConversion, TryConvertInto}; +use testnet_parachains_constants::westend::locations::AssetHubParaId; use westend_runtime_constants::{ - system_parachain::{ASSET_HUB_ID, COLLECTIVES_ID}, - xcm::body::FELLOWSHIP_ADMIN_INDEX, + system_parachain::COLLECTIVES_ID, xcm::body::FELLOWSHIP_ADMIN_INDEX, }; use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH}; use xcm_builder::{ @@ -67,7 +67,6 @@ parameter_types! { pub const RootLocation: Location = Location::here(); pub const WestendLocation: Location = Location::parent(); pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(WESTEND_GENESIS_HASH)); - pub const AssetHubParaId: crate::ParaId = crate::ParaId::new(ASSET_HUB_ID); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())].into(); @@ -309,6 +308,13 @@ impl Contains for AmbassadorEntities { } } +pub struct SecretaryEntities; +impl Contains for SecretaryEntities { + fn contains(location: &Location) -> bool { + matches!(location.unpack(), (1, [Parachain(COLLECTIVES_ID), PalletInstance(91)])) + } +} + pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyRecursively, @@ -330,6 +336,7 @@ pub type Barrier = TrailingSetTopicAsId< RelayOrOtherSystemParachains, FellowshipEntities, AmbassadorEntities, + SecretaryEntities, )>, // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, @@ -353,6 +360,7 @@ pub type WaivedLocations = ( FellowshipEntities, AmbassadorEntities, LocalPlurality, + SecretaryEntities, ); /// Cases where a remote origin is accepted as trusted Teleporter for a given asset: diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs index cf69163101bd9..529982749b313 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs @@ -104,7 +104,7 @@ frame_support::parameter_types! { /// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Rococo /// BridgeHub. /// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`) - pub const BridgeHubRococoBaseXcmFeeInRocs: u128 = 57_145_832; + pub const BridgeHubRococoBaseXcmFeeInRocs: u128 = 72_091_666; /// Transaction fee that is paid at the Rococo BridgeHub for delivering single inbound message. /// (initially was calculated by test `BridgeHubRococo::can_calculate_fee_for_standalone_message_delivery_transaction` + `33%`) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index ecf43f78c9e27..285d988de41aa 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -253,7 +253,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("bridge-hub-rococo"), impl_name: alloc::borrow::Cow::Borrowed("bridge-hub-rococo"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 6, @@ -1120,16 +1120,28 @@ impl_runtime_apis! { } } + use xcm::latest::prelude::*; + use xcm_config::TokenLocation; + use testnet_parachains_constants::rococo::locations::{AssetHubParaId, AssetHubLocation}; + parameter_types! { + pub ExistentialDepositAsset: Option = Some(( + TokenLocation::get(), + ExistentialDeposit::get() + ).into()); + } + use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -1137,9 +1149,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(TokenLocation::get()) }, - Parent.into(), + AssetHubLocation::get(), )) } @@ -1152,8 +1164,8 @@ impl_runtime_apis! { ) -> Option<(Assets, u32, Location, Box)> { // BH only supports teleports to system parachain. // Relay/native token can be teleported between BH and Relay. - let native_location = Parent.into(); - let dest = Parent.into(); + let native_location = TokenLocation::get(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, dest @@ -1168,26 +1180,18 @@ impl_runtime_apis! { } } - use xcm::latest::prelude::*; - use xcm_config::TokenLocation; - - parameter_types! { - pub ExistentialDepositAsset: Option = Some(( - TokenLocation::get(), - ExistentialDeposit::get() - ).into()); - } - impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn valid_destination() -> Result { - Ok(TokenLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just concrete assets according to relay chain. @@ -1202,8 +1206,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - TokenLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(TokenLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1242,15 +1246,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((TokenLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(TokenLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = TokenLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(TokenLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs index dfd2fc67bb8e9..61dd97465090d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `814af52b0d43`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,69 +50,51 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `498` - // Estimated: `3963` - // Minimum execution time: 19_789_000 picoseconds. - Weight::from_parts(20_317_000, 3963) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `537` - // Estimated: `4002` - // Minimum execution time: 20_805_000 picoseconds. - Weight::from_parts(21_481_000, 4002) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 21_253_000 picoseconds. - Weight::from_parts(22_237_000, 0) - .saturating_add(Weight::from_parts(0, 3471)) + // Measured: `103` + // Estimated: `3568` + // Minimum execution time: 29_956_000 picoseconds. + Weight::from_parts(31_455_000, 0) + .saturating_add(Weight::from_parts(0, 3568)) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3593` - // Minimum execution time: 106_391_000 picoseconds. - Weight::from_parts(108_786_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `135` + // Estimated: `3600` + // Minimum execution time: 120_900_000 picoseconds. + Weight::from_parts(124_848_000, 0) + .saturating_add(Weight::from_parts(0, 3600)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -128,25 +110,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3593` - // Minimum execution time: 107_330_000 picoseconds. - Weight::from_parts(111_355_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `135` + // Estimated: `3600` + // Minimum execution time: 120_896_000 picoseconds. + Weight::from_parts(125_530_000, 0) + .saturating_add(Weight::from_parts(0, 3600)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -154,8 +138,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 10_241_000 picoseconds. - Weight::from_parts(10_860_000, 0) + // Minimum execution time: 10_196_000 picoseconds. + Weight::from_parts(10_787_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -165,8 +149,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_599_000 picoseconds. - Weight::from_parts(8_176_000, 0) + // Minimum execution time: 8_246_000 picoseconds. + Weight::from_parts(8_554_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -174,54 +158,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_504_000 picoseconds. - Weight::from_parts(2_733_000, 0) + // Minimum execution time: 2_463_000 picoseconds. + Weight::from_parts(2_631_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 27_996_000 picoseconds. - Weight::from_parts(28_873_000, 0) - .saturating_add(Weight::from_parts(0, 3471)) + // Measured: `103` + // Estimated: `3568` + // Minimum execution time: 36_799_000 picoseconds. + Weight::from_parts(38_247_000, 0) + .saturating_add(Weight::from_parts(0, 3568)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `99` - // Estimated: `3564` - // Minimum execution time: 33_575_000 picoseconds. - Weight::from_parts(34_770_000, 0) - .saturating_add(Weight::from_parts(0, 3564)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `262` + // Estimated: `108971` + // Minimum execution time: 42_329_000 picoseconds. + Weight::from_parts(43_649_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -230,8 +218,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_532_000 picoseconds. - Weight::from_parts(2_673_000, 0) + // Minimum execution time: 2_412_000 picoseconds. + Weight::from_parts(2_511_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -241,8 +229,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `15863` - // Minimum execution time: 20_457_000 picoseconds. - Weight::from_parts(21_110_000, 0) + // Minimum execution time: 21_165_000 picoseconds. + Weight::from_parts(21_522_000, 0) .saturating_add(Weight::from_parts(0, 15863)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -253,8 +241,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `27` // Estimated: `15867` - // Minimum execution time: 20_587_000 picoseconds. - Weight::from_parts(21_325_000, 0) + // Minimum execution time: 20_591_000 picoseconds. + Weight::from_parts(21_078_000, 0) .saturating_add(Weight::from_parts(0, 15867)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -263,32 +251,30 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `18391` - // Minimum execution time: 25_398_000 picoseconds. - Weight::from_parts(26_047_000, 0) - .saturating_add(Weight::from_parts(0, 18391)) + // Measured: `79` + // Estimated: `18394` + // Minimum execution time: 26_283_000 picoseconds. + Weight::from_parts(26_707_000, 0) + .saturating_add(Weight::from_parts(0, 18394)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `5980` - // Minimum execution time: 26_286_000 picoseconds. - Weight::from_parts(27_235_000, 0) - .saturating_add(Weight::from_parts(0, 5980)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `47` + // Estimated: `5987` + // Minimum execution time: 34_495_000 picoseconds. + Weight::from_parts(36_648_000, 0) + .saturating_add(Weight::from_parts(0, 5987)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -296,8 +282,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `79` // Estimated: `13444` - // Minimum execution time: 18_160_000 picoseconds. - Weight::from_parts(18_577_000, 0) + // Minimum execution time: 18_378_000 picoseconds. + Weight::from_parts(18_889_000, 0) .saturating_add(Weight::from_parts(0, 13444)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -307,31 +293,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `34` // Estimated: `15874` - // Minimum execution time: 20_642_000 picoseconds. - Weight::from_parts(21_004_000, 0) + // Minimum execution time: 20_656_000 picoseconds. + Weight::from_parts(21_321_000, 0) .saturating_add(Weight::from_parts(0, 15874)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `15880` - // Minimum execution time: 38_604_000 picoseconds. - Weight::from_parts(39_550_000, 0) - .saturating_add(Weight::from_parts(0, 15880)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `47` + // Estimated: `15887` + // Minimum execution time: 45_214_000 picoseconds. + Weight::from_parts(46_367_000, 0) + .saturating_add(Weight::from_parts(0, 15887)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -341,8 +325,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_820_000 picoseconds. - Weight::from_parts(2_942_000, 0) + // Minimum execution time: 2_648_000 picoseconds. + Weight::from_parts(2_865_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -353,8 +337,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 26_892_000 picoseconds. - Weight::from_parts(27_221_000, 0) + // Minimum execution time: 27_980_000 picoseconds. + Weight::from_parts(28_563_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -367,19 +351,46 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 40_005_000 picoseconds. - Weight::from_parts(41_438_000, 0) + // Minimum execution time: 40_317_000 picoseconds. + Weight::from_parts(41_335_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `161` + // Estimated: `3626` + // Minimum execution time: 52_518_000 picoseconds. + Weight::from_parts(53_441_000, 0) + .saturating_add(Weight::from_parts(0, 3626)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `517` + // Estimated: `3982` + // Minimum execution time: 53_492_000 picoseconds. + Weight::from_parts(54_536_000, 0) + .saturating_add(Weight::from_parts(0, 3982)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } fn weigh_message() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_493_000 picoseconds. + Weight::from_parts(8_693_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index f9bbcff27370b..b80030333846a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `814af52b0d43`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_087_000 picoseconds. - Weight::from_parts(33_091_000, 3593) + // Minimum execution time: 31_195_000 picoseconds. + Weight::from_parts(31_942_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,10 +65,10 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn transfer_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `153` + // Measured: `101` // Estimated: `6196` - // Minimum execution time: 45_599_000 picoseconds. - Weight::from_parts(46_591_000, 6196) + // Minimum execution time: 42_862_000 picoseconds. + Weight::from_parts(43_901_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -76,22 +76,24 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `191` + // Measured: `236` // Estimated: `8799` - // Minimum execution time: 105_329_000 picoseconds. - Weight::from_parts(109_209_000, 8799) + // Minimum execution time: 116_922_000 picoseconds. + Weight::from_parts(120_287_000, 8799) .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -104,102 +106,110 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `236` // Estimated: `6196` - // Minimum execution time: 70_718_000 picoseconds. - Weight::from_parts(73_796_000, 6196) + // Minimum execution time: 84_299_000 picoseconds. + Weight::from_parts(87_257_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_692_000 picoseconds. - Weight::from_parts(2_949_000, 0) + // Minimum execution time: 3_187_000 picoseconds. + Weight::from_parts(3_391_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn deposit_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `52` + // Measured: `0` // Estimated: `3593` - // Minimum execution time: 25_537_000 picoseconds. - Weight::from_parts(26_209_000, 3593) + // Minimum execution time: 24_827_000 picoseconds. + Weight::from_parts(25_400_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `90` - // Estimated: `3593` - // Minimum execution time: 57_090_000 picoseconds. - Weight::from_parts(58_826_000, 3593) + // Measured: `135` + // Estimated: `3600` + // Minimum execution time: 68_295_000 picoseconds. + Weight::from_parts(71_778_000, 3600) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 34_980_000 picoseconds. - Weight::from_parts(36_217_000, 3503) + // Measured: `135` + // Estimated: `3600` + // Minimum execution time: 46_618_000 picoseconds. + Weight::from_parts(48_602_000, 3600) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `90` + // Measured: `135` // Estimated: `6196` - // Minimum execution time: 86_804_000 picoseconds. - Weight::from_parts(90_062_000, 6196) + // Minimum execution time: 96_639_000 picoseconds. + Weight::from_parts(99_446_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index dc6c2f1160e44..f8b74c4172e6e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `814af52b0d43`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,31 +52,37 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `236` // Estimated: `6196` - // Minimum execution time: 68_899_000 picoseconds. - Weight::from_parts(71_498_000, 6196) + // Minimum execution time: 82_427_000 picoseconds. + Weight::from_parts(84_639_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `0` - // Minimum execution time: 894_000 picoseconds. - Weight::from_parts(986_000, 0) + // Estimated: `3593` + // Minimum execution time: 4_303_000 picoseconds. + Weight::from_parts(4_578_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -84,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_915_000 picoseconds. - Weight::from_parts(4_132_000, 3593) + // Minimum execution time: 4_246_000 picoseconds. + Weight::from_parts(4_542_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -93,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 948_000 picoseconds. - Weight::from_parts(1_025_000, 0) + // Minimum execution time: 1_164_000 picoseconds. + Weight::from_parts(1_228_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,86 +108,90 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_974_000 picoseconds. - Weight::from_parts(6_250_000, 3465) + // Minimum execution time: 6_126_000 picoseconds. + Weight::from_parts(6_517_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_971_000 picoseconds. - Weight::from_parts(8_413_000, 0) + // Minimum execution time: 8_277_000 picoseconds. + Weight::from_parts(8_732_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_599_000 picoseconds. - Weight::from_parts(1_719_000, 0) + // Minimum execution time: 1_597_000 picoseconds. + Weight::from_parts(1_711_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 926_000 picoseconds. - Weight::from_parts(1_002_000, 0) + // Minimum execution time: 1_176_000 picoseconds. + Weight::from_parts(1_214_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 963_000 picoseconds. - Weight::from_parts(1_012_000, 0) + // Minimum execution time: 1_116_000 picoseconds. + Weight::from_parts(1_223_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 911_000 picoseconds. - Weight::from_parts(979_000, 0) + // Minimum execution time: 1_086_000 picoseconds. + Weight::from_parts(1_165_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 960_000 picoseconds. - Weight::from_parts(1_014_000, 0) + // Minimum execution time: 1_173_000 picoseconds. + Weight::from_parts(1_194_000, 0) } + // Storage: `Benchmark::Override` (r:0 w:0) + // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_071_000, 0) + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 899_000 picoseconds. - Weight::from_parts(966_000, 0) + // Minimum execution time: 1_113_000 picoseconds. + Weight::from_parts(1_163_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `236` // Estimated: `6196` - // Minimum execution time: 66_321_000 picoseconds. - Weight::from_parts(67_682_000, 6196) + // Minimum execution time: 78_312_000 picoseconds. + Weight::from_parts(80_573_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -189,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 9_487_000 picoseconds. - Weight::from_parts(9_854_000, 3489) + // Minimum execution time: 9_836_000 picoseconds. + Weight::from_parts(10_243_000, 3489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -198,27 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 925_000 picoseconds. - Weight::from_parts(973_000, 0) + // Minimum execution time: 3_944_000 picoseconds. + Weight::from_parts(4_138_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 22_376_000 picoseconds. - Weight::from_parts(23_161_000, 3471) + // Measured: `103` + // Estimated: `3568` + // Minimum execution time: 31_602_000 picoseconds. + Weight::from_parts(32_924_000, 3568) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -226,114 +238,118 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_970_000 picoseconds. - Weight::from_parts(3_145_000, 0) + // Minimum execution time: 3_631_000 picoseconds. + Weight::from_parts(3_856_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_286_000 picoseconds. - Weight::from_parts(1_413_000, 0) + // Minimum execution time: 1_572_000 picoseconds. + Weight::from_parts(1_670_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_010_000 picoseconds. - Weight::from_parts(1_100_000, 0) + // Minimum execution time: 1_245_000 picoseconds. + Weight::from_parts(1_312_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 895_000 picoseconds. - Weight::from_parts(1_011_000, 0) + // Minimum execution time: 3_995_000 picoseconds. + Weight::from_parts(4_092_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 905_000 picoseconds. - Weight::from_parts(994_000, 0) + // Minimum execution time: 3_774_000 picoseconds. + Weight::from_parts(4_149_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_026_000 picoseconds. - Weight::from_parts(1_144_000, 0) + // Minimum execution time: 1_283_000 picoseconds. + Weight::from_parts(1_344_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `236` // Estimated: `6196` - // Minimum execution time: 71_051_000 picoseconds. - Weight::from_parts(73_917_000, 6196) + // Minimum execution time: 83_156_000 picoseconds. + Weight::from_parts(85_475_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_835_000 picoseconds. - Weight::from_parts(5_048_000, 0) + // Minimum execution time: 5_215_000 picoseconds. + Weight::from_parts(5_435_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `236` // Estimated: `6196` - // Minimum execution time: 66_511_000 picoseconds. - Weight::from_parts(69_101_000, 6196) + // Minimum execution time: 79_039_000 picoseconds. + Weight::from_parts(82_087_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 978_000 picoseconds. - Weight::from_parts(1_012_000, 0) + // Minimum execution time: 1_164_000 picoseconds. + Weight::from_parts(1_207_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 895_000 picoseconds. - Weight::from_parts(954_000, 0) + // Minimum execution time: 1_112_000 picoseconds. + Weight::from_parts(1_185_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 914_000 picoseconds. - Weight::from_parts(995_000, 0) + // Minimum execution time: 1_133_000 picoseconds. + Weight::from_parts(1_181_000, 0) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -352,10 +368,10 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `583` // Estimated: `6523` - // Minimum execution time: 54_537_000 picoseconds. - Weight::from_parts(56_626_935, 6523) - // Standard Error: 172 - .saturating_add(Weight::from_parts(54_409, 0).saturating_mul(x.into())) + // Minimum execution time: 64_105_000 picoseconds. + Weight::from_parts(66_162_307, 6523) + // Standard Error: 344 + .saturating_add(Weight::from_parts(76_211, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -363,14 +379,14 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 914_000 picoseconds. - Weight::from_parts(965_000, 0) + // Minimum execution time: 1_118_000 picoseconds. + Weight::from_parts(1_181_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 954_000 picoseconds. - Weight::from_parts(1_027_000, 0) + // Minimum execution time: 1_134_000 picoseconds. + Weight::from_parts(1_205_000, 0) } } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs index 8fffbd8130e71..c359f396fea7a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs @@ -245,7 +245,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("bridge-hub-westend"), impl_name: alloc::borrow::Cow::Borrowed("bridge-hub-westend"), authoring_version: 1, - spec_version: 1_018_002, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 6, @@ -1062,16 +1062,28 @@ impl_runtime_apis! { } } + use xcm::latest::prelude::*; + use xcm_config::WestendLocation; + use testnet_parachains_constants::westend::locations::{AssetHubParaId, AssetHubLocation}; + parameter_types! { + pub ExistentialDepositAsset: Option = Some(( + WestendLocation::get(), + ExistentialDeposit::get() + ).into()); + } + use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -1079,9 +1091,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(WestendLocation::get()) }, - Parent.into(), + AssetHubLocation::get(), )) } @@ -1094,8 +1106,8 @@ impl_runtime_apis! { ) -> Option<(Assets, u32, Location, alloc::boxed::Box)> { // BH only supports teleports to system parachain. // Relay/native token can be teleported between BH and Relay. - let native_location = Parent.into(); - let dest = Parent.into(); + let native_location = WestendLocation::get(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, dest @@ -1110,26 +1122,18 @@ impl_runtime_apis! { } } - use xcm::latest::prelude::*; - use xcm_config::WestendLocation; - - parameter_types! { - pub ExistentialDepositAsset: Option = Some(( - WestendLocation::get(), - ExistentialDeposit::get() - ).into()); - } - impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn valid_destination() -> Result { - Ok(WestendLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just assets according to relay chain. @@ -1144,8 +1148,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - WestendLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(WestendLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1184,15 +1188,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((WestendLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(WestendLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = WestendLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(WestendLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_xcm.rs index b3e8228e1617c..7921b6b3b990e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `d3b41be4aae8`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,69 +50,51 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `498` - // Estimated: `3963` - // Minimum execution time: 19_789_000 picoseconds. - Weight::from_parts(20_317_000, 3963) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `537` - // Estimated: `4002` - // Minimum execution time: 20_805_000 picoseconds. - Weight::from_parts(21_481_000, 4002) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 21_514_000 picoseconds. - Weight::from_parts(22_069_000, 0) - .saturating_add(Weight::from_parts(0, 3471)) + // Measured: `278` + // Estimated: `3743` + // Minimum execution time: 30_703_000 picoseconds. + Weight::from_parts(32_412_000, 0) + .saturating_add(Weight::from_parts(0, 3743)) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3593` - // Minimum execution time: 108_292_000 picoseconds. - Weight::from_parts(117_670_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 122_307_000 picoseconds. + Weight::from_parts(127_200_000, 0) + .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -128,25 +110,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3593` - // Minimum execution time: 108_967_000 picoseconds. - Weight::from_parts(113_506_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 124_672_000 picoseconds. + Weight::from_parts(128_089_000, 0) + .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -154,8 +138,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 10_141_000 picoseconds. - Weight::from_parts(10_504_000, 0) + // Minimum execution time: 10_262_000 picoseconds. + Weight::from_parts(10_680_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -165,8 +149,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_615_000 picoseconds. - Weight::from_parts(8_033_000, 0) + // Minimum execution time: 8_220_000 picoseconds. + Weight::from_parts(8_488_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -174,54 +158,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_515_000 picoseconds. - Weight::from_parts(2_572_000, 0) + // Minimum execution time: 2_362_000 picoseconds. + Weight::from_parts(2_581_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 28_009_000 picoseconds. - Weight::from_parts(28_523_000, 0) - .saturating_add(Weight::from_parts(0, 3471)) + // Measured: `278` + // Estimated: `3743` + // Minimum execution time: 38_605_000 picoseconds. + Weight::from_parts(39_672_000, 0) + .saturating_add(Weight::from_parts(0, 3743)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `99` - // Estimated: `3564` - // Minimum execution time: 29_474_000 picoseconds. - Weight::from_parts(30_517_000, 0) - .saturating_add(Weight::from_parts(0, 3564)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `437` + // Estimated: `108971` + // Minimum execution time: 42_845_000 picoseconds. + Weight::from_parts(44_557_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -230,8 +218,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_325_000 picoseconds. - Weight::from_parts(2_523_000, 0) + // Minimum execution time: 2_291_000 picoseconds. + Weight::from_parts(2_502_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -241,8 +229,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `15863` - // Minimum execution time: 20_609_000 picoseconds. - Weight::from_parts(21_003_000, 0) + // Minimum execution time: 20_737_000 picoseconds. + Weight::from_parts(21_126_000, 0) .saturating_add(Weight::from_parts(0, 15863)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -253,8 +241,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `27` // Estimated: `15867` - // Minimum execution time: 20_637_000 picoseconds. - Weight::from_parts(21_032_000, 0) + // Minimum execution time: 20_628_000 picoseconds. + Weight::from_parts(21_031_000, 0) .saturating_add(Weight::from_parts(0, 15867)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -263,32 +251,30 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `18391` - // Minimum execution time: 25_487_000 picoseconds. - Weight::from_parts(25_954_000, 0) - .saturating_add(Weight::from_parts(0, 18391)) + // Measured: `79` + // Estimated: `18394` + // Minimum execution time: 25_598_000 picoseconds. + Weight::from_parts(26_332_000, 0) + .saturating_add(Weight::from_parts(0, 18394)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `5980` - // Minimum execution time: 26_382_000 picoseconds. - Weight::from_parts(27_406_000, 0) - .saturating_add(Weight::from_parts(0, 5980)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `221` + // Estimated: `6161` + // Minimum execution time: 35_870_000 picoseconds. + Weight::from_parts(37_326_000, 0) + .saturating_add(Weight::from_parts(0, 6161)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -296,8 +282,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `79` // Estimated: `13444` - // Minimum execution time: 18_038_000 picoseconds. - Weight::from_parts(18_355_000, 0) + // Minimum execution time: 18_228_000 picoseconds. + Weight::from_parts(18_620_000, 0) .saturating_add(Weight::from_parts(0, 13444)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -307,31 +293,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `34` // Estimated: `15874` - // Minimum execution time: 20_438_000 picoseconds. - Weight::from_parts(21_024_000, 0) + // Minimum execution time: 20_177_000 picoseconds. + Weight::from_parts(20_853_000, 0) .saturating_add(Weight::from_parts(0, 15874)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `15880` - // Minimum execution time: 38_882_000 picoseconds. - Weight::from_parts(39_942_000, 0) - .saturating_add(Weight::from_parts(0, 15880)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `221` + // Estimated: `16061` + // Minimum execution time: 45_807_000 picoseconds. + Weight::from_parts(47_096_000, 0) + .saturating_add(Weight::from_parts(0, 16061)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -341,8 +325,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_720_000 picoseconds. - Weight::from_parts(2_868_000, 0) + // Minimum execution time: 2_652_000 picoseconds. + Weight::from_parts(2_840_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -353,8 +337,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 26_326_000 picoseconds. - Weight::from_parts(26_885_000, 0) + // Minimum execution time: 27_403_000 picoseconds. + Weight::from_parts(27_979_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -367,19 +351,46 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 40_983_000 picoseconds. - Weight::from_parts(41_911_000, 0) + // Minimum execution time: 41_150_000 picoseconds. + Weight::from_parts(41_900_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `161` + // Estimated: `3626` + // Minimum execution time: 51_582_000 picoseconds. + Weight::from_parts(52_732_000, 0) + .saturating_add(Weight::from_parts(0, 3626)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `517` + // Estimated: `3982` + // Minimum execution time: 51_921_000 picoseconds. + Weight::from_parts(53_310_000, 0) + .saturating_add(Weight::from_parts(0, 3982)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } fn weigh_message() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_173_000 picoseconds. + Weight::from_parts(8_364_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 65488da52ac4e..8fc0a7c16743b 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `d3b41be4aae8`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_949_000 picoseconds. - Weight::from_parts(33_732_000, 3593) + // Minimum execution time: 31_500_000 picoseconds. + Weight::from_parts(32_397_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,10 +65,10 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn transfer_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `153` + // Measured: `101` // Estimated: `6196` - // Minimum execution time: 47_016_000 picoseconds. - Weight::from_parts(47_928_000, 6196) + // Minimum execution time: 43_635_000 picoseconds. + Weight::from_parts(44_379_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -76,22 +76,24 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `228` + // Measured: `448` // Estimated: `8799` - // Minimum execution time: 107_932_000 picoseconds. - Weight::from_parts(111_763_000, 8799) + // Minimum execution time: 120_562_000 picoseconds. + Weight::from_parts(122_997_000, 8799) .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -104,102 +106,110 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `176` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 72_678_000 picoseconds. - Weight::from_parts(75_669_000, 6196) + // Minimum execution time: 84_735_000 picoseconds. + Weight::from_parts(87_652_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_782_000 picoseconds. - Weight::from_parts(3_085_000, 0) + // Minimum execution time: 3_070_000 picoseconds. + Weight::from_parts(3_223_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn deposit_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `52` + // Measured: `0` // Estimated: `3593` - // Minimum execution time: 25_748_000 picoseconds. - Weight::from_parts(26_502_000, 3593) + // Minimum execution time: 25_024_000 picoseconds. + Weight::from_parts(25_685_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `127` - // Estimated: `3593` - // Minimum execution time: 59_661_000 picoseconds. - Weight::from_parts(62_363_000, 3593) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 73_267_000 picoseconds. + Weight::from_parts(75_053_000, 3812) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 36_673_000 picoseconds. - Weight::from_parts(37_896_000, 3540) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 51_130_000 picoseconds. + Weight::from_parts(53_304_000, 3812) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `127` + // Measured: `347` // Estimated: `6196` - // Minimum execution time: 88_296_000 picoseconds. - Weight::from_parts(90_428_000, 6196) + // Minimum execution time: 100_166_000 picoseconds. + Weight::from_parts(103_298_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 7004d985ed8f5..71b3ae6af6b2b 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `0af6a34749d7`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,24 +52,26 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 71_915_000 picoseconds. - Weight::from_parts(74_472_000, 6196) + // Minimum execution time: 84_814_000 picoseconds. + Weight::from_parts(87_025_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -77,8 +79,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 4_181_000 picoseconds. - Weight::from_parts(4_432_000, 3593) + // Minimum execution time: 4_202_000 picoseconds. + Weight::from_parts(4_408_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -88,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 4_176_000 picoseconds. - Weight::from_parts(4_299_000, 3593) + // Minimum execution time: 4_150_000 picoseconds. + Weight::from_parts(4_423_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -97,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_215_000 picoseconds. - Weight::from_parts(1_295_000, 0) + // Minimum execution time: 1_105_000 picoseconds. + Weight::from_parts(1_152_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -106,51 +108,51 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_138_000 picoseconds. - Weight::from_parts(6_316_000, 3465) + // Minimum execution time: 6_078_000 picoseconds. + Weight::from_parts(6_297_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_645_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 8_586_000 picoseconds. + Weight::from_parts(8_908_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_928_000 picoseconds. - Weight::from_parts(2_022_000, 0) + // Minimum execution time: 1_581_000 picoseconds. + Weight::from_parts(1_705_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_150_000 picoseconds. - Weight::from_parts(1_213_000, 0) + // Minimum execution time: 1_118_000 picoseconds. + Weight::from_parts(1_166_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_173_000 picoseconds. - Weight::from_parts(1_215_000, 0) + // Minimum execution time: 1_096_000 picoseconds. + Weight::from_parts(1_142_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_181_000 picoseconds. - Weight::from_parts(1_220_000, 0) + // Minimum execution time: 1_049_000 picoseconds. + Weight::from_parts(1_130_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_212_000 picoseconds. - Weight::from_parts(1_288_000, 0) + // Minimum execution time: 1_077_000 picoseconds. + Weight::from_parts(1_140_000, 0) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -165,29 +167,31 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_207_000 picoseconds. - Weight::from_parts(1_241_000, 0) + // Minimum execution time: 1_097_000 picoseconds. + Weight::from_parts(1_147_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 67_573_000 picoseconds. - Weight::from_parts(70_052_000, 6196) + // Minimum execution time: 79_156_000 picoseconds. + Weight::from_parts(82_289_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -195,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 9_485_000 picoseconds. - Weight::from_parts(9_788_000, 3489) + // Minimum execution time: 9_923_000 picoseconds. + Weight::from_parts(10_220_000, 3489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -204,27 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_887_000 picoseconds. - Weight::from_parts(4_032_000, 0) + // Minimum execution time: 3_814_000 picoseconds. + Weight::from_parts(4_024_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 23_434_000 picoseconds. - Weight::from_parts(24_003_000, 3507) + // Measured: `278` + // Estimated: `3743` + // Minimum execution time: 33_105_000 picoseconds. + Weight::from_parts(34_887_000, 3743) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -232,114 +238,118 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_365_000 picoseconds. - Weight::from_parts(3_514_000, 0) + // Minimum execution time: 3_587_000 picoseconds. + Weight::from_parts(3_898_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_552_000 picoseconds. - Weight::from_parts(1_639_000, 0) + // Minimum execution time: 1_515_000 picoseconds. + Weight::from_parts(1_600_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_249_000 picoseconds. - Weight::from_parts(1_298_000, 0) + // Minimum execution time: 1_156_000 picoseconds. + Weight::from_parts(1_234_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_847_000 picoseconds. - Weight::from_parts(3_996_000, 0) + // Minimum execution time: 3_753_000 picoseconds. + Weight::from_parts(3_974_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_879_000 picoseconds. - Weight::from_parts(3_995_000, 0) + // Minimum execution time: 3_737_000 picoseconds. + Weight::from_parts(3_893_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_310_000 picoseconds. - Weight::from_parts(1_390_000, 0) + // Minimum execution time: 1_178_000 picoseconds. + Weight::from_parts(1_272_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 73_840_000 picoseconds. - Weight::from_parts(75_771_000, 6196) + // Minimum execution time: 86_480_000 picoseconds. + Weight::from_parts(88_562_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_945_000 picoseconds. - Weight::from_parts(5_099_000, 0) + // Minimum execution time: 5_175_000 picoseconds. + Weight::from_parts(5_346_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 68_779_000 picoseconds. - Weight::from_parts(70_590_000, 6196) + // Minimum execution time: 79_699_000 picoseconds. + Weight::from_parts(82_168_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_226_000 picoseconds. - Weight::from_parts(1_281_000, 0) + // Minimum execution time: 1_119_000 picoseconds. + Weight::from_parts(1_177_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_157_000 picoseconds. - Weight::from_parts(1_237_000, 0) + // Minimum execution time: 1_104_000 picoseconds. + Weight::from_parts(1_154_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_160_000 picoseconds. - Weight::from_parts(1_218_000, 0) + // Minimum execution time: 1_032_000 picoseconds. + Weight::from_parts(1_105_000, 0) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -358,10 +368,10 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `546` // Estimated: `6486` - // Minimum execution time: 59_944_000 picoseconds. - Weight::from_parts(63_325_816, 6486) - // Standard Error: 326 - .saturating_add(Weight::from_parts(58_420, 0).saturating_mul(x.into())) + // Minimum execution time: 64_386_000 picoseconds. + Weight::from_parts(66_478_537, 6486) + // Standard Error: 399 + .saturating_add(Weight::from_parts(74_645, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -369,21 +379,21 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_122_000 picoseconds. - Weight::from_parts(1_201_000, 0) + // Minimum execution time: 1_044_000 picoseconds. + Weight::from_parts(1_120_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_187_000 picoseconds. - Weight::from_parts(1_237_000, 0) + // Minimum execution time: 1_062_000 picoseconds. + Weight::from_parts(1_106_000, 0) } pub fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_050_000 picoseconds. - Weight::from_parts(1_135_000, 0) + // Minimum execution time: 1_078_000 picoseconds. + Weight::from_parts(1_152_000, 0) } } diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index 6a1ad307323ac..1b2e857f4946a 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -44,6 +44,9 @@ pub mod xcm_config; // Fellowship configurations. pub mod fellowship; +// Secretary Configuration +pub mod secretary; + extern crate alloc; pub use ambassador::pallet_ambassador_origins; @@ -126,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("collectives-westend"), impl_name: alloc::borrow::Cow::Borrowed("collectives-westend"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 6, @@ -312,6 +315,8 @@ pub enum ProxyType { Fellowship, /// Ambassador proxy. Allows calls related to the Ambassador Program. Ambassador, + /// Secretary proxy. Allows calls related to the Secretary collective + Secretary, } impl Default for ProxyType { fn default() -> Self { @@ -362,6 +367,13 @@ impl InstanceFilter for ProxyType { RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), + ProxyType::Secretary => matches!( + c, + RuntimeCall::SecretaryCollective { .. } | + RuntimeCall::SecretarySalary { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } + ), } } fn is_superset(&self, o: &Self) -> bool { @@ -734,6 +746,12 @@ construct_runtime!( AmbassadorContent: pallet_collective_content:: = 75, StateTrieMigration: pallet_state_trie_migration = 80, + + // The Secretary Collective + // pub type SecretaryCollectiveInstance = pallet_ranked_collective::instance3; + SecretaryCollective: pallet_ranked_collective:: = 90, + // pub type SecretarySalaryInstance = pallet_salary::Instance3; + SecretarySalary: pallet_salary:: = 91, } ); @@ -818,12 +836,14 @@ mod benches { [pallet_ranked_collective, FellowshipCollective] [pallet_core_fellowship, FellowshipCore] [pallet_salary, FellowshipSalary] + [pallet_treasury, FellowshipTreasury] [pallet_referenda, AmbassadorReferenda] [pallet_ranked_collective, AmbassadorCollective] [pallet_collective_content, AmbassadorContent] [pallet_core_fellowship, AmbassadorCore] [pallet_salary, AmbassadorSalary] - [pallet_treasury, FellowshipTreasury] + [pallet_ranked_collective, SecretaryCollective] + [pallet_salary, SecretarySalary] [pallet_asset_rate, AssetRate] [cumulus_pallet_weight_reclaim, WeightReclaim] // XCM @@ -1141,6 +1161,7 @@ impl_runtime_apis! { } } use xcm_config::WndLocation; + use testnet_parachains_constants::westend::locations::{AssetHubParaId, AssetHubLocation}; parameter_types! { pub ExistentialDepositAsset: Option = Some(( @@ -1151,14 +1172,16 @@ impl_runtime_apis! { use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -1166,9 +1189,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(WndLocation::get()) }.into(), - Parent.into(), + AssetHubLocation::get(), )) } @@ -1181,8 +1204,8 @@ impl_runtime_apis! { ) -> Option<(Assets, u32, Location, alloc::boxed::Box)> { // Collectives only supports teleports to system parachain. // Relay/native token can be teleported between Collectives and Relay. - let native_location = Parent.into(); - let dest = Parent.into(); + let native_location = WndLocation::get(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, dest @@ -1191,7 +1214,7 @@ impl_runtime_apis! { fn get_asset() -> Asset { Asset { - id: AssetId(Location::parent()), + id: AssetId(WndLocation::get()), fun: Fungible(ExistentialDeposit::get()), } } @@ -1200,13 +1223,15 @@ impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem + >; fn valid_destination() -> Result { - Ok(WndLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just concrete assets according to relay chain. @@ -1221,8 +1246,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - WndLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(WndLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1261,15 +1286,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((WndLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(WndLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = WndLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(WndLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/secretary/mod.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/secretary/mod.rs new file mode 100644 index 0000000000000..3ff98ee9c53cb --- /dev/null +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/secretary/mod.rs @@ -0,0 +1,141 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. +// 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. + +//! The Westend Technical Fellowship. + +//! The Polkadot Secretary Collective. + +use crate::{xcm_config::FellowshipAdminBodyId, *}; +use frame_support::{ + parameter_types, + traits::{tokens::GetSalary, EitherOf, MapSuccess, NoOpPoll, PalletInfoAccess}, +}; +use frame_system::{pallet_prelude::BlockNumberFor, EnsureRootWithSuccess}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; +use sp_core::{ConstU128, ConstU32}; +use sp_runtime::traits::{ConstU16, ConvertToValue, Identity, Replace}; +use westend_runtime_constants::time::HOURS; + +#[cfg(feature = "runtime-benchmarks")] +use crate::impls::benchmarks::OpenHrmpChannel; + +use xcm::prelude::*; +use xcm_builder::{AliasesIntoAccountId32, PayOverXcm}; + +use self::xcm_config::UsdtAssetHub; + +/// The Secretary members' ranks. +pub mod ranks { + use pallet_ranked_collective::Rank; + + pub const SECRETARY_CANDIDATE: Rank = 0; + pub const SECRETARY: Rank = 1; +} + +/// Origins of: +/// - Root; +/// - FellowshipAdmin (i.e. token holder referendum); +/// - Plurality vote from Fellows can promote, demote, remove and approve rank retention of members +/// of the Secretary Collective (rank `2`). +type ApproveOrigin = EitherOf< + EnsureRootWithSuccess>, + EitherOf< + MapSuccess< + EnsureXcm>, + Replace>, + >, + MapSuccess>>, + >, +>; + +pub type SecretaryCollectiveInstance = pallet_ranked_collective::Instance3; + +impl pallet_ranked_collective::Config for Runtime { + type WeightInfo = (); + type RuntimeEvent = RuntimeEvent; + type AddOrigin = ApproveOrigin; + type RemoveOrigin = ApproveOrigin; + type PromoteOrigin = ApproveOrigin; + type DemoteOrigin = ApproveOrigin; + type ExchangeOrigin = ApproveOrigin; + type Polls = NoOpPoll>; + type MinRankOfClass = Identity; + type MemberSwappedHandler = crate::SecretarySalary; + type VoteWeight = pallet_ranked_collective::Geometric; + type MaxMemberCount = (); + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = crate::SecretarySalary; +} + +pub type SecretarySalaryInstance = pallet_salary::Instance3; + +parameter_types! { + // The interior location on AssetHub for the paying account. This is the Secretary Salary + // pallet instance. This sovereign account will need funding. + pub SecretarySalaryInteriorLocation: InteriorLocation = PalletInstance(::index() as u8).into(); +} + +const USDT_UNITS: u128 = 1_000_000; + +/// [`PayOverXcm`] setup to pay the Secretary salary on the AssetHub in USDT. +pub type SecretarySalaryPaymaster = PayOverXcm< + SecretarySalaryInteriorLocation, + crate::xcm_config::XcmRouter, + crate::PolkadotXcm, + ConstU32<{ 6 * HOURS }>, + AccountId, + (), + ConvertToValue, + AliasesIntoAccountId32<(), AccountId>, +>; + +pub struct SalaryForRank; +impl GetSalary for SalaryForRank { + fn get_salary(rank: u16, _who: &AccountId) -> Balance { + if rank == 1 { + 6666 * USDT_UNITS + } else { + 0 + } + } +} + +impl pallet_salary::Config for Runtime { + type WeightInfo = (); + type RuntimeEvent = RuntimeEvent; + + #[cfg(not(feature = "runtime-benchmarks"))] + type Paymaster = SecretarySalaryPaymaster; + #[cfg(feature = "runtime-benchmarks")] + type Paymaster = crate::impls::benchmarks::PayWithEnsure< + SecretarySalaryPaymaster, + OpenHrmpChannel>, + >; + type Members = pallet_ranked_collective::Pallet; + + #[cfg(not(feature = "runtime-benchmarks"))] + type Salary = SalaryForRank; + #[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<{ 6666 * USDT_UNITS }>; +} diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_xcm.rs index 152112e9ceccd..d058864e05aec 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `e0f303704c84`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,71 +50,53 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `498` - // Estimated: `3963` - // Minimum execution time: 19_789_000 picoseconds. - Weight::from_parts(20_317_000, 3963) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) - /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `537` - // Estimated: `4002` - // Minimum execution time: 20_805_000 picoseconds. - Weight::from_parts(21_481_000, 4002) - .saturating_add(T::DbWeight::get().reads(1)) - .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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `3576` - // Minimum execution time: 26_857_000 picoseconds. - Weight::from_parts(27_479_000, 0) - .saturating_add(Weight::from_parts(0, 3576)) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 36_462_000 picoseconds. + Weight::from_parts(37_913_000, 0) + .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `3593` - // Minimum execution time: 112_500_000 picoseconds. - Weight::from_parts(115_990_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 124_821_000 picoseconds. + Weight::from_parts(129_294_000, 0) + .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -130,25 +112,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `3593` - // Minimum execution time: 111_126_000 picoseconds. - Weight::from_parts(113_618_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 125_175_000 picoseconds. + Weight::from_parts(129_316_000, 0) + .saturating_add(Weight::from_parts(0, 3812)) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -156,8 +140,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_687_000 picoseconds. - Weight::from_parts(10_029_000, 0) + // Minimum execution time: 9_788_000 picoseconds. + Weight::from_parts(10_155_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -167,8 +151,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_729_000 picoseconds. - Weight::from_parts(8_047_000, 0) + // Minimum execution time: 8_371_000 picoseconds. + Weight::from_parts(8_737_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,54 +160,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_334_000 picoseconds. - Weight::from_parts(2_564_000, 0) + // Minimum execution time: 2_326_000 picoseconds. + Weight::from_parts(2_620_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 29_566_000 picoseconds. - Weight::from_parts(30_743_000, 0) - .saturating_add(Weight::from_parts(0, 3507)) + // Measured: `278` + // Estimated: `3743` + // Minimum execution time: 40_534_000 picoseconds. + Weight::from_parts(43_788_000, 0) + .saturating_add(Weight::from_parts(0, 3743)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `136` - // Estimated: `3601` - // Minimum execution time: 31_297_000 picoseconds. - Weight::from_parts(32_217_000, 0) - .saturating_add(Weight::from_parts(0, 3601)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `437` + // Estimated: `108971` + // Minimum execution time: 45_700_000 picoseconds. + Weight::from_parts(46_886_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -232,8 +220,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_523_000 picoseconds. - Weight::from_parts(2_613_000, 0) + // Minimum execution time: 2_405_000 picoseconds. + Weight::from_parts(2_537_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -243,8 +231,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `22` // Estimated: `15862` - // Minimum execution time: 22_011_000 picoseconds. - Weight::from_parts(22_630_000, 0) + // Minimum execution time: 22_934_000 picoseconds. + Weight::from_parts(23_538_000, 0) .saturating_add(Weight::from_parts(0, 15862)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -255,8 +243,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26` // Estimated: `15866` - // Minimum execution time: 21_787_000 picoseconds. - Weight::from_parts(22_177_000, 0) + // Minimum execution time: 22_627_000 picoseconds. + Weight::from_parts(23_273_000, 0) .saturating_add(Weight::from_parts(0, 15866)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -265,32 +253,30 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `36` - // Estimated: `18351` - // Minimum execution time: 25_206_000 picoseconds. - Weight::from_parts(25_805_000, 0) - .saturating_add(Weight::from_parts(0, 18351)) + // Measured: `39` + // Estimated: `18354` + // Minimum execution time: 25_357_000 picoseconds. + Weight::from_parts(25_887_000, 0) + .saturating_add(Weight::from_parts(0, 18354)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `6015` - // Minimum execution time: 28_653_000 picoseconds. - Weight::from_parts(29_290_000, 0) - .saturating_add(Weight::from_parts(0, 6015)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `220` + // Estimated: `6160` + // Minimum execution time: 37_185_000 picoseconds. + Weight::from_parts(38_533_000, 0) + .saturating_add(Weight::from_parts(0, 6160)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -298,8 +284,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `13404` - // Minimum execution time: 17_820_000 picoseconds. - Weight::from_parts(18_017_000, 0) + // Minimum execution time: 17_694_000 picoseconds. + Weight::from_parts(18_163_000, 0) .saturating_add(Weight::from_parts(0, 13404)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -309,31 +295,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `33` // Estimated: `15873` - // Minimum execution time: 22_475_000 picoseconds. - Weight::from_parts(22_907_000, 0) + // Minimum execution time: 22_115_000 picoseconds. + Weight::from_parts(23_026_000, 0) .saturating_add(Weight::from_parts(0, 15873)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `15915` - // Minimum execution time: 41_551_000 picoseconds. - Weight::from_parts(42_740_000, 0) - .saturating_add(Weight::from_parts(0, 15915)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `220` + // Estimated: `16060` + // Minimum execution time: 48_193_000 picoseconds. + Weight::from_parts(49_682_000, 0) + .saturating_add(Weight::from_parts(0, 16060)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -343,8 +327,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_871_000 picoseconds. - Weight::from_parts(2_974_000, 0) + // Minimum execution time: 2_749_000 picoseconds. + Weight::from_parts(2_872_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -355,8 +339,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 27_172_000 picoseconds. - Weight::from_parts(27_636_000, 0) + // Minimum execution time: 30_864_000 picoseconds. + Weight::from_parts(31_461_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -369,19 +353,46 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 41_197_000 picoseconds. - Weight::from_parts(41_868_000, 0) + // Minimum execution time: 40_991_000 picoseconds. + Weight::from_parts(42_264_000, 0) .saturating_add(Weight::from_parts(0, 3488)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `160` + // Estimated: `3625` + // Minimum execution time: 52_085_000 picoseconds. + Weight::from_parts(53_710_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) + /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `516` + // Estimated: `3981` + // Minimum execution time: 53_918_000 picoseconds. + Weight::from_parts(54_668_000, 0) + .saturating_add(Weight::from_parts(0, 3981)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } fn weigh_message() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_201_000 picoseconds. + Weight::from_parts(8_365_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index c35b9ff0edf02..3427f99dcc1a7 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `e0f303704c84`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 33_268_000 picoseconds. - Weight::from_parts(33_765_000, 3593) + // Minimum execution time: 32_178_000 picoseconds. + Weight::from_parts(33_259_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -67,8 +67,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 45_975_000 picoseconds. - Weight::from_parts(46_558_000, 6196) + // Minimum execution time: 44_300_000 picoseconds. + Weight::from_parts(45_380_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -76,22 +76,24 @@ impl WeightInfo { // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `8799` - // Minimum execution time: 107_492_000 picoseconds. - Weight::from_parts(110_697_000, 8799) + // Minimum execution time: 119_384_000 picoseconds. + Weight::from_parts(124_635_000, 8799) .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -104,31 +106,33 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 74_030_000 picoseconds. - Weight::from_parts(77_113_000, 6196) + // Minimum execution time: 87_192_000 picoseconds. + Weight::from_parts(89_659_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_442_000 picoseconds. - Weight::from_parts(2_530_000, 0) + // Minimum execution time: 2_551_000 picoseconds. + Weight::from_parts(2_775_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -136,70 +140,76 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 25_052_000 picoseconds. - Weight::from_parts(25_607_000, 3593) + // Minimum execution time: 25_223_000 picoseconds. + Weight::from_parts(25_656_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `3593` - // Minimum execution time: 59_720_000 picoseconds. - Weight::from_parts(61_217_000, 3593) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 71_055_000 picoseconds. + Weight::from_parts(74_130_000, 3812) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `3576` - // Minimum execution time: 37_442_000 picoseconds. - Weight::from_parts(38_269_000, 3576) + // Measured: `347` + // Estimated: `3812` + // Minimum execution time: 49_498_000 picoseconds. + Weight::from_parts(51_347_000, 3812) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `111` + // Measured: `347` // Estimated: `6196` - // Minimum execution time: 89_232_000 picoseconds. - Weight::from_parts(92_095_000, 6196) + // Minimum execution time: 99_704_000 picoseconds. + Weight::from_parts(103_937_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 3b1bee00033ae..e398549257656 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `0af6a34749d7`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,24 +52,26 @@ 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 73_783_000 picoseconds. - Weight::from_parts(75_788_000, 6196) + // Minimum execution time: 83_204_000 picoseconds. + Weight::from_parts(85_444_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -77,8 +79,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_801_000 picoseconds. - Weight::from_parts(4_034_000, 3593) + // Minimum execution time: 3_812_000 picoseconds. + Weight::from_parts(4_044_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -88,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_592_000 picoseconds. - Weight::from_parts(3_830_000, 3593) + // Minimum execution time: 3_805_000 picoseconds. + Weight::from_parts(3_986_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -97,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 665_000 picoseconds. - Weight::from_parts(730_000, 0) + // Minimum execution time: 722_000 picoseconds. + Weight::from_parts(782_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -106,51 +108,51 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_922_000 picoseconds. - Weight::from_parts(6_123_000, 3465) + // Minimum execution time: 6_110_000 picoseconds. + Weight::from_parts(6_319_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_420_000 picoseconds. - Weight::from_parts(7_787_000, 0) + // Minimum execution time: 7_483_000 picoseconds. + Weight::from_parts(7_709_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_346_000 picoseconds. - Weight::from_parts(1_443_000, 0) + // Minimum execution time: 1_210_000 picoseconds. + Weight::from_parts(1_300_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 636_000 picoseconds. - Weight::from_parts(686_000, 0) + // Minimum execution time: 707_000 picoseconds. + Weight::from_parts(801_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 620_000 picoseconds. - Weight::from_parts(696_000, 0) + // Minimum execution time: 724_000 picoseconds. + Weight::from_parts(780_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 618_000 picoseconds. - Weight::from_parts(669_000, 0) + // Minimum execution time: 702_000 picoseconds. + Weight::from_parts(786_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 635_000 picoseconds. - Weight::from_parts(715_000, 0) + // Minimum execution time: 722_000 picoseconds. + Weight::from_parts(773_000, 0) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -165,29 +167,31 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 643_000 picoseconds. - Weight::from_parts(691_000, 0) + // Minimum execution time: 680_000 picoseconds. + Weight::from_parts(758_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 68_952_000 picoseconds. - Weight::from_parts(71_917_000, 6196) + // Minimum execution time: 79_918_000 picoseconds. + Weight::from_parts(81_914_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -195,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 9_130_000 picoseconds. - Weight::from_parts(9_449_000, 3488) + // Minimum execution time: 9_800_000 picoseconds. + Weight::from_parts(10_101_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -204,27 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_571_000 picoseconds. - Weight::from_parts(3_670_000, 0) + // Minimum execution time: 3_689_000 picoseconds. + Weight::from_parts(3_865_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 23_180_000 picoseconds. - Weight::from_parts(23_872_000, 3507) + // Measured: `278` + // Estimated: `3743` + // Minimum execution time: 33_263_000 picoseconds. + Weight::from_parts(34_232_000, 3743) .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -232,134 +238,138 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_747_000 picoseconds. - Weight::from_parts(2_902_000, 0) + // Minimum execution time: 3_416_000 picoseconds. + Weight::from_parts(3_603_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_020_000 picoseconds. - Weight::from_parts(1_112_000, 0) + // Minimum execution time: 1_104_000 picoseconds. + Weight::from_parts(1_189_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 711_000 picoseconds. - Weight::from_parts(799_000, 0) + // Minimum execution time: 766_000 picoseconds. + Weight::from_parts(817_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_579_000 picoseconds. - Weight::from_parts(3_689_000, 0) + // Minimum execution time: 3_668_000 picoseconds. + Weight::from_parts(3_796_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_571_000 picoseconds. - Weight::from_parts(3_754_000, 0) + // Minimum execution time: 3_634_000 picoseconds. + Weight::from_parts(3_824_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 752_000 picoseconds. - Weight::from_parts(827_000, 0) + // Minimum execution time: 850_000 picoseconds. + Weight::from_parts(934_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 76_043_000 picoseconds. - Weight::from_parts(78_165_000, 6196) + // Minimum execution time: 86_934_000 picoseconds. + Weight::from_parts(88_810_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_431_000 picoseconds. - Weight::from_parts(5_633_000, 0) + // Minimum execution time: 5_523_000 picoseconds. + Weight::from_parts(5_685_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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) - // Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:2 w:2) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `212` + // Measured: `448` // Estimated: `6196` - // Minimum execution time: 70_282_000 picoseconds. - Weight::from_parts(71_620_000, 6196) + // Minimum execution time: 80_346_000 picoseconds. + Weight::from_parts(82_126_000, 6196) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 664_000 picoseconds. - Weight::from_parts(738_000, 0) + // Minimum execution time: 751_000 picoseconds. + Weight::from_parts(821_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 639_000 picoseconds. - Weight::from_parts(694_000, 0) + // Minimum execution time: 679_000 picoseconds. + Weight::from_parts(747_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 631_000 picoseconds. - Weight::from_parts(675_000, 0) + // Minimum execution time: 657_000 picoseconds. + Weight::from_parts(761_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 631_000 picoseconds. - Weight::from_parts(665_000, 0) + // Minimum execution time: 732_000 picoseconds. + Weight::from_parts(766_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 655_000 picoseconds. - Weight::from_parts(701_000, 0) + // Minimum execution time: 729_000 picoseconds. + Weight::from_parts(779_000, 0) } pub fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 743_000 picoseconds. - Weight::from_parts(768_000, 0) + // Minimum execution time: 730_000 picoseconds. + Weight::from_parts(784_000, 0) } } diff --git a/cumulus/parachains/runtimes/constants/src/rococo.rs b/cumulus/parachains/runtimes/constants/src/rococo.rs index be4b5c9711ccb..1538b49b064f2 100644 --- a/cumulus/parachains/runtimes/constants/src/rococo.rs +++ b/cumulus/parachains/runtimes/constants/src/rococo.rs @@ -167,3 +167,14 @@ pub mod xcm_version { /// The default XCM version to set in genesis config. pub const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; } + +pub mod locations { + use frame_support::parameter_types; + pub use rococo_runtime_constants::system_parachain::{AssetHubParaId, PeopleParaId}; + use xcm::latest::prelude::{Location, Parachain}; + + parameter_types! { + pub AssetHubLocation: Location = Location::new(1, Parachain(rococo_runtime_constants::system_parachain::ASSET_HUB_ID)); + pub PeopleLocation: Location = Location::new(1, Parachain(rococo_runtime_constants::system_parachain::PEOPLE_ID)); + } +} diff --git a/cumulus/parachains/runtimes/constants/src/westend.rs b/cumulus/parachains/runtimes/constants/src/westend.rs index 0978462b2c1e0..16eb5533011b6 100644 --- a/cumulus/parachains/runtimes/constants/src/westend.rs +++ b/cumulus/parachains/runtimes/constants/src/westend.rs @@ -198,10 +198,12 @@ pub mod xcm_version { pub mod locations { use frame_support::parameter_types; + pub use westend_runtime_constants::system_parachain::{AssetHubParaId, PeopleParaId}; use xcm::latest::prelude::{Location, Parachain}; parameter_types! { pub AssetHubLocation: Location = Location::new(1, Parachain(westend_runtime_constants::system_parachain::ASSET_HUB_ID)); + pub PeopleLocation: Location = Location::new(1, Parachain(westend_runtime_constants::system_parachain::PEOPLE_ID)); } /// The governance on the AssetHub. diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs index 9995614f1e1b3..3bfa1940f5126 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("coretime-rococo"), impl_name: alloc::borrow::Cow::Borrowed("coretime-rococo"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -988,24 +988,27 @@ impl_runtime_apis! { use xcm_config::RocRelayLocation; use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; + use testnet_parachains_constants::rococo::locations::{AssetHubParaId, AssetHubLocation}; + + parameter_types! { + pub ExistentialDepositAsset: Option = Some(( + RocRelayLocation::get(), + ExistentialDeposit::get() + ).into()); + } + impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = ( - cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >, + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, PriceForSiblingParachainDelivery, - RandomParaId, + AssetHubParaId, ParachainSystem, - > - ); + >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -1013,9 +1016,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(RocRelayLocation::get()) }, - Parent.into(), + AssetHubLocation::get(), )) } @@ -1033,13 +1036,13 @@ impl_runtime_apis! { fun: NonFungible(Index(region_id.into())), id: AssetId(xcm_config::BrokerPalletLocation::get()) }, - ParentThen(Parachain(RandomParaId::get().into()).into()).into(), + AssetHubLocation::get(), )) } fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box)> { let native_location = Parent.into(); - let dest = Parent.into(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, @@ -1049,39 +1052,24 @@ impl_runtime_apis! { fn get_asset() -> Asset { Asset { - id: AssetId(Location::parent()), + id: AssetId(RocRelayLocation::get()), fun: Fungible(ExistentialDeposit::get()), } } } - parameter_types! { - pub ExistentialDepositAsset: Option = Some(( - RocRelayLocation::get(), - ExistentialDeposit::get() - ).into()); - pub const RandomParaId: ParaId = ParaId::new(43211234); - } - impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; - type DeliveryHelper = ( - cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >, - polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, PriceForSiblingParachainDelivery, - RandomParaId, + AssetHubParaId, ParachainSystem, - > - ); + >; type AccountIdConverter = xcm_config::LocationToAccountId; fn valid_destination() -> Result { - Ok(RocRelayLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just concrete assets according to relay chain. @@ -1096,8 +1084,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - RocRelayLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(RocRelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1136,15 +1124,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((RocRelayLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(RocRelayLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = RocRelayLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(RocRelayLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs index 4266f2bfec792..a8fc53528ceb0 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-06-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `455f6642ce6b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,41 +50,51 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `3577` - // Minimum execution time: 23_817_000 picoseconds. - Weight::from_parts(24_512_000, 0) - .saturating_add(Weight::from_parts(0, 3577)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 31_555_000 picoseconds. + Weight::from_parts(32_773_000, 0) + .saturating_add(Weight::from_parts(0, 3677)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 71_741_000 picoseconds. - Weight::from_parts(73_469_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 116_744_000 picoseconds. + Weight::from_parts(120_244_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -108,8 +118,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `345` // Estimated: `3810` - // Minimum execution time: 116_480_000 picoseconds. - Weight::from_parts(119_179_000, 0) + // Minimum execution time: 116_448_000 picoseconds. + Weight::from_parts(118_864_000, 0) .saturating_add(Weight::from_parts(0, 3810)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) @@ -118,21 +128,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 71_460_000 picoseconds. - Weight::from_parts(74_429_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 117_177_000 picoseconds. + Weight::from_parts(120_737_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -140,8 +156,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_455_000 picoseconds. - Weight::from_parts(9_816_000, 0) + // Minimum execution time: 9_083_000 picoseconds. + Weight::from_parts(9_616_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -151,8 +167,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_339_000 picoseconds. - Weight::from_parts(7_582_000, 0) + // Minimum execution time: 7_808_000 picoseconds. + Weight::from_parts(8_180_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -160,50 +176,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_241_000 picoseconds. - Weight::from_parts(2_510_000, 0) + // Minimum execution time: 2_309_000 picoseconds. + Weight::from_parts(2_495_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `3577` - // Minimum execution time: 30_366_000 picoseconds. - Weight::from_parts(31_479_000, 0) - .saturating_add(Weight::from_parts(0, 3577)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 38_166_000 picoseconds. + Weight::from_parts(39_769_000, 0) + .saturating_add(Weight::from_parts(0, 3677)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `202` - // Estimated: `3667` - // Minimum execution time: 30_975_000 picoseconds. - Weight::from_parts(32_043_000, 0) - .saturating_add(Weight::from_parts(0, 3667)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `371` + // Estimated: `108971` + // Minimum execution time: 42_995_000 picoseconds. + Weight::from_parts(44_315_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -212,8 +236,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_318_000 picoseconds. - Weight::from_parts(2_529_000, 0) + // Minimum execution time: 2_409_000 picoseconds. + Weight::from_parts(2_518_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -223,8 +247,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `15863` - // Minimum execution time: 19_923_000 picoseconds. - Weight::from_parts(20_435_000, 0) + // Minimum execution time: 20_235_000 picoseconds. + Weight::from_parts(20_606_000, 0) .saturating_add(Weight::from_parts(0, 15863)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -235,8 +259,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `27` // Estimated: `15867` - // Minimum execution time: 19_705_000 picoseconds. - Weight::from_parts(20_339_000, 0) + // Minimum execution time: 20_259_000 picoseconds. + Weight::from_parts(21_120_000, 0) .saturating_add(Weight::from_parts(0, 15867)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -245,27 +269,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `18391` - // Minimum execution time: 24_955_000 picoseconds. - Weight::from_parts(25_587_000, 0) - .saturating_add(Weight::from_parts(0, 18391)) + // Measured: `79` + // Estimated: `18394` + // Minimum execution time: 25_370_000 picoseconds. + Weight::from_parts(25_734_000, 0) + .saturating_add(Weight::from_parts(0, 18394)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `6016` - // Minimum execution time: 21_333_000 picoseconds. - Weight::from_parts(22_184_000, 0) - .saturating_add(Weight::from_parts(0, 6016)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `155` + // Estimated: `6095` + // Minimum execution time: 35_587_000 picoseconds. + Weight::from_parts(37_045_000, 0) + .saturating_add(Weight::from_parts(0, 6095)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) @@ -274,8 +300,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `79` // Estimated: `13444` - // Minimum execution time: 18_131_000 picoseconds. - Weight::from_parts(18_761_000, 0) + // Minimum execution time: 17_717_000 picoseconds. + Weight::from_parts(18_247_000, 0) .saturating_add(Weight::from_parts(0, 13444)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -285,26 +311,28 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `34` // Estimated: `15874` - // Minimum execution time: 20_411_000 picoseconds. - Weight::from_parts(21_391_000, 0) + // Minimum execution time: 20_002_000 picoseconds. + Weight::from_parts(20_802_000, 0) .saturating_add(Weight::from_parts(0, 15874)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `15916` - // Minimum execution time: 31_249_000 picoseconds. - Weight::from_parts(32_194_000, 0) - .saturating_add(Weight::from_parts(0, 15916)) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `155` + // Estimated: `15995` + // Minimum execution time: 45_805_000 picoseconds. + Weight::from_parts(47_379_000, 0) + .saturating_add(Weight::from_parts(0, 15995)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) @@ -315,8 +343,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_643_000 picoseconds. - Weight::from_parts(2_907_000, 0) + // Minimum execution time: 2_673_000 picoseconds. + Weight::from_parts(2_817_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -327,8 +355,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 26_209_000 picoseconds. - Weight::from_parts(26_727_000, 0) + // Minimum execution time: 27_286_000 picoseconds. + Weight::from_parts(28_304_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -341,8 +369,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 39_861_000 picoseconds. - Weight::from_parts(40_776_000, 0) + // Minimum execution time: 39_233_000 picoseconds. + Weight::from_parts(40_152_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -371,8 +399,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_706_000 picoseconds. - Weight::from_parts(7_834_000, 0) + // Minimum execution time: 8_233_000 picoseconds. + Weight::from_parts(8_339_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index f30b0ed501843..ebaf937171245 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_179_000 picoseconds. - Weight::from_parts(33_078_000, 3593) + // Minimum execution time: 31_106_000 picoseconds. + Weight::from_parts(31_668_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -67,29 +67,33 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 43_627_000 picoseconds. - Weight::from_parts(44_732_000, 6196) + // Minimum execution time: 42_763_000 picoseconds. + Weight::from_parts(43_487_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (r:2 w:2) + // Storage: `System::Account` (r:3 w:3) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `6196` - // Minimum execution time: 66_231_000 picoseconds. - Weight::from_parts(68_129_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `345` + // Estimated: `8799` + // Minimum execution time: 111_295_000 picoseconds. + Weight::from_parts(113_994_000, 8799) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,27 +106,33 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 25_689_000 picoseconds. - Weight::from_parts(26_944_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 80_772_000 picoseconds. + Weight::from_parts(83_123_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_394_000 picoseconds. - Weight::from_parts(2_557_000, 0) + // Minimum execution time: 2_657_000 picoseconds. + Weight::from_parts(2_896_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -130,64 +140,76 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 25_110_000 picoseconds. - Weight::from_parts(27_072_000, 3593) + // Minimum execution time: 23_835_000 picoseconds. + Weight::from_parts(24_763_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3593` - // Minimum execution time: 53_530_000 picoseconds. - Weight::from_parts(54_769_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 69_246_000 picoseconds. + Weight::from_parts(70_977_000, 3709) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 34_868_000 picoseconds. - Weight::from_parts(35_435_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 47_816_000 picoseconds. + Weight::from_parts(49_514_000, 3709) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (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: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3593` - // Minimum execution time: 64_167_000 picoseconds. - Weight::from_parts(68_363_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `6196` + // Minimum execution time: 95_244_000 picoseconds. + Weight::from_parts(97_468_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index de7314a91cce4..2aa90dc75a771 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,27 +52,37 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 25_307_000 picoseconds. - Weight::from_parts(26_337_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 78_005_000 picoseconds. + Weight::from_parts(79_932_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `0` - // Minimum execution time: 671_000 picoseconds. - Weight::from_parts(765_000, 0) + // Estimated: `3593` + // Minimum execution time: 3_719_000 picoseconds. + Weight::from_parts(4_115_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -80,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_534_000 picoseconds. - Weight::from_parts(3_750_000, 3593) + // Minimum execution time: 3_667_000 picoseconds. + Weight::from_parts(3_993_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -89,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 688_000 picoseconds. - Weight::from_parts(757_000, 0) + // Minimum execution time: 682_000 picoseconds. + Weight::from_parts(783_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -98,82 +108,90 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_332_000 picoseconds. - Weight::from_parts(6_744_000, 3465) + // Minimum execution time: 5_687_000 picoseconds. + Weight::from_parts(5_891_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_988_000 picoseconds. - Weight::from_parts(7_423_000, 0) + // Minimum execution time: 7_108_000 picoseconds. + Weight::from_parts(7_371_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_334_000 picoseconds. - Weight::from_parts(1_463_000, 0) + // Minimum execution time: 1_158_000 picoseconds. + Weight::from_parts(1_245_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 667_000 picoseconds. - Weight::from_parts(753_000, 0) + // Minimum execution time: 709_000 picoseconds. + Weight::from_parts(763_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 608_000 picoseconds. - Weight::from_parts(708_000, 0) + // Minimum execution time: 692_000 picoseconds. + Weight::from_parts(756_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 631_000 picoseconds. - Weight::from_parts(697_000, 0) + // Minimum execution time: 662_000 picoseconds. + Weight::from_parts(721_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 680_000 picoseconds. - Weight::from_parts(725_000, 0) + // Minimum execution time: 706_000 picoseconds. + Weight::from_parts(754_000, 0) } + // Storage: `Benchmark::Override` (r:0 w:0) + // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 772_000 picoseconds. - Weight::from_parts(839_000, 0) + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 643_000 picoseconds. - Weight::from_parts(709_000, 0) + // Minimum execution time: 683_000 picoseconds. + Weight::from_parts(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`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 22_052_000 picoseconds. - Weight::from_parts(23_820_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 74_570_000 picoseconds. + Weight::from_parts(77_129_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -181,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 8_871_000 picoseconds. - Weight::from_parts(9_457_000, 3489) + // Minimum execution time: 8_917_000 picoseconds. + Weight::from_parts(9_342_000, 3489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -190,25 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 620_000 picoseconds. - Weight::from_parts(692_000, 0) + // Minimum execution time: 3_270_000 picoseconds. + Weight::from_parts(3_460_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 21_792_000 picoseconds. - Weight::from_parts(22_355_000, 3507) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 31_710_000 picoseconds. + Weight::from_parts(32_692_000, 3677) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -216,119 +238,131 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_727_000 picoseconds. - Weight::from_parts(2_862_000, 0) + // Minimum execution time: 3_065_000 picoseconds. + Weight::from_parts(3_282_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_107_000 picoseconds. - Weight::from_parts(1_160_000, 0) + // Minimum execution time: 1_063_000 picoseconds. + Weight::from_parts(1_134_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 742_000 picoseconds. - Weight::from_parts(797_000, 0) + // Minimum execution time: 773_000 picoseconds. + Weight::from_parts(800_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 637_000 picoseconds. - Weight::from_parts(715_000, 0) + // Minimum execution time: 3_328_000 picoseconds. + Weight::from_parts(3_437_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 616_000 picoseconds. - Weight::from_parts(685_000, 0) + // Minimum execution time: 3_234_000 picoseconds. + Weight::from_parts(3_383_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 841_000 picoseconds. - Weight::from_parts(919_000, 0) + // Minimum execution time: 796_000 picoseconds. + Weight::from_parts(873_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 26_687_000 picoseconds. - Weight::from_parts(28_014_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 79_173_000 picoseconds. + Weight::from_parts(80_575_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_552_000 picoseconds. - Weight::from_parts(3_697_000, 0) + // Minimum execution time: 3_560_000 picoseconds. + Weight::from_parts(3_725_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 21_861_000 picoseconds. - Weight::from_parts(22_777_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 74_574_000 picoseconds. + Weight::from_parts(76_468_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 662_000 picoseconds. - Weight::from_parts(761_000, 0) + // Minimum execution time: 697_000 picoseconds. + Weight::from_parts(777_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 665_000 picoseconds. - Weight::from_parts(735_000, 0) + // Minimum execution time: 642_000 picoseconds. + Weight::from_parts(711_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 592_000 picoseconds. - Weight::from_parts(672_000, 0) + // Minimum execution time: 666_000 picoseconds. + Weight::from_parts(702_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 626_000 picoseconds. - Weight::from_parts(704_000, 0) + // Minimum execution time: 653_000 picoseconds. + Weight::from_parts(718_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 680_000 picoseconds. - Weight::from_parts(745_000, 0) + // Minimum execution time: 657_000 picoseconds. + Weight::from_parts(710_000, 0) } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs index 1bf27f210172a..7597b59936eab 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("coretime-westend"), impl_name: alloc::borrow::Cow::Borrowed("coretime-westend"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -250,7 +250,6 @@ impl pallet_authorship::Config for Runtime { parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const RandomParaId: ParaId = ParaId::new(43211234); } impl pallet_balances::Config for Runtime { @@ -1011,26 +1010,20 @@ impl_runtime_apis! { use xcm::latest::prelude::*; use xcm_config::TokenRelayLocation; + use testnet_parachains_constants::westend::locations::{AssetHubParaId, AssetHubLocation}; use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = ( - cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >, - polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, PriceForSiblingParachainDelivery, - RandomParaId, + AssetHubParaId, ParachainSystem, - > - ); + >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -1038,9 +1031,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(TokenRelayLocation::get()) }, - Parent.into(), + AssetHubLocation::get(), )) } @@ -1058,13 +1051,13 @@ impl_runtime_apis! { fun: NonFungible(Index(region_id.into())), id: AssetId(xcm_config::BrokerPalletLocation::get()) }, - ParentThen(Parachain(RandomParaId::get().into()).into()).into(), + AssetHubLocation::get(), )) } fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box)> { let native_location = Parent.into(); - let dest = Parent.into(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, @@ -1074,7 +1067,7 @@ impl_runtime_apis! { fn get_asset() -> Asset { Asset { - id: AssetId(Location::parent()), + id: AssetId(TokenRelayLocation::get()), fun: Fungible(ExistentialDeposit::get()), } } @@ -1090,24 +1083,17 @@ impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; - type DeliveryHelper = ( - cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >, - polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, PriceForSiblingParachainDelivery, - RandomParaId, + AssetHubParaId, ParachainSystem, - > - ); + >; type AccountIdConverter = xcm_config::LocationToAccountId; fn valid_destination() -> Result { - Ok(TokenRelayLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just concrete assets according to relay chain. @@ -1122,8 +1108,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - TokenRelayLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(TokenRelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1162,15 +1148,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((TokenRelayLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(TokenRelayLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = TokenRelayLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(TokenRelayLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_xcm.rs index 795b0b1f5ee56..a5bd5471cb7ba 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-06-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `455f6642ce6b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -50,41 +50,51 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `3577` - // Minimum execution time: 24_002_000 picoseconds. - Weight::from_parts(24_919_000, 0) - .saturating_add(Weight::from_parts(0, 3577)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 31_322_000 picoseconds. + Weight::from_parts(31_892_000, 0) + .saturating_add(Weight::from_parts(0, 3677)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 70_625_000 picoseconds. - Weight::from_parts(73_167_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 118_351_000 picoseconds. + Weight::from_parts(121_171_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -108,8 +118,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `345` // Estimated: `3810` - // Minimum execution time: 115_391_000 picoseconds. - Weight::from_parts(119_256_000, 0) + // Minimum execution time: 118_440_000 picoseconds. + Weight::from_parts(123_309_000, 0) .saturating_add(Weight::from_parts(0, 3810)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) @@ -118,21 +128,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 71_008_000 picoseconds. - Weight::from_parts(73_368_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 120_170_000 picoseconds. + Weight::from_parts(124_459_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -140,8 +156,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_307_000 picoseconds. - Weight::from_parts(9_566_000, 0) + // Minimum execution time: 9_470_000 picoseconds. + Weight::from_parts(9_899_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -151,8 +167,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_300_000 picoseconds. - Weight::from_parts(7_555_000, 0) + // Minimum execution time: 8_109_000 picoseconds. + Weight::from_parts(8_354_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -160,50 +176,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_453_000 picoseconds. - Weight::from_parts(2_635_000, 0) + // Minimum execution time: 2_281_000 picoseconds. + Weight::from_parts(2_440_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `3577` - // Minimum execution time: 30_261_000 picoseconds. - Weight::from_parts(31_083_000, 0) - .saturating_add(Weight::from_parts(0, 3577)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 38_458_000 picoseconds. + Weight::from_parts(39_299_000, 0) + .saturating_add(Weight::from_parts(0, 3677)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `202` - // Estimated: `3667` - // Minimum execution time: 31_020_000 picoseconds. - Weight::from_parts(32_216_000, 0) - .saturating_add(Weight::from_parts(0, 3667)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `371` + // Estimated: `108971` + // Minimum execution time: 43_181_000 picoseconds. + Weight::from_parts(44_135_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -212,8 +236,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_415_000 picoseconds. - Weight::from_parts(2_619_000, 0) + // Minimum execution time: 2_307_000 picoseconds. + Weight::from_parts(2_530_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -223,8 +247,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `15863` - // Minimum execution time: 20_750_000 picoseconds. - Weight::from_parts(21_045_000, 0) + // Minimum execution time: 20_052_000 picoseconds. + Weight::from_parts(20_473_000, 0) .saturating_add(Weight::from_parts(0, 15863)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -235,8 +259,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `27` // Estimated: `15867` - // Minimum execution time: 20_578_000 picoseconds. - Weight::from_parts(20_930_000, 0) + // Minimum execution time: 20_186_000 picoseconds. + Weight::from_parts(20_486_000, 0) .saturating_add(Weight::from_parts(0, 15867)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -245,27 +269,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `18391` - // Minimum execution time: 26_006_000 picoseconds. - Weight::from_parts(26_776_000, 0) - .saturating_add(Weight::from_parts(0, 18391)) + // Measured: `79` + // Estimated: `18394` + // Minimum execution time: 25_280_000 picoseconds. + Weight::from_parts(26_104_000, 0) + .saturating_add(Weight::from_parts(0, 18394)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `6016` - // Minimum execution time: 21_786_000 picoseconds. - Weight::from_parts(22_388_000, 0) - .saturating_add(Weight::from_parts(0, 6016)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `155` + // Estimated: `6095` + // Minimum execution time: 36_004_000 picoseconds. + Weight::from_parts(37_340_000, 0) + .saturating_add(Weight::from_parts(0, 6095)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) @@ -274,8 +300,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `79` // Estimated: `13444` - // Minimum execution time: 18_563_000 picoseconds. - Weight::from_parts(19_046_000, 0) + // Minimum execution time: 17_676_000 picoseconds. + Weight::from_parts(18_044_000, 0) .saturating_add(Weight::from_parts(0, 13444)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -285,26 +311,28 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `34` // Estimated: `15874` - // Minimum execution time: 20_938_000 picoseconds. - Weight::from_parts(21_474_000, 0) + // Minimum execution time: 20_248_000 picoseconds. + Weight::from_parts(20_655_000, 0) .saturating_add(Weight::from_parts(0, 15874)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `15916` - // Minimum execution time: 32_293_000 picoseconds. - Weight::from_parts(33_289_000, 0) - .saturating_add(Weight::from_parts(0, 15916)) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `155` + // Estimated: `15995` + // Minimum execution time: 45_837_000 picoseconds. + Weight::from_parts(47_123_000, 0) + .saturating_add(Weight::from_parts(0, 15995)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) @@ -315,8 +343,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_549_000 picoseconds. - Weight::from_parts(2_709_000, 0) + // Minimum execution time: 2_691_000 picoseconds. + Weight::from_parts(2_812_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -327,8 +355,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 26_855_000 picoseconds. - Weight::from_parts(27_354_000, 0) + // Minimum execution time: 26_873_000 picoseconds. + Weight::from_parts(27_250_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -341,8 +369,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 38_957_000 picoseconds. - Weight::from_parts(40_018_000, 0) + // Minimum execution time: 39_765_000 picoseconds. + Weight::from_parts(40_715_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -355,8 +383,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `161` // Estimated: `3626` - // Minimum execution time: 48_894_000 picoseconds. - Weight::from_parts(50_841_000, 0) + // Minimum execution time: 50_111_000 picoseconds. + Weight::from_parts(50_871_000, 0) .saturating_add(Weight::from_parts(0, 3626)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -369,8 +397,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `517` // Estimated: `3982` - // Minimum execution time: 51_091_000 picoseconds. - Weight::from_parts(52_178_000, 0) + // Minimum execution time: 51_379_000 picoseconds. + Weight::from_parts(52_632_000, 0) .saturating_add(Weight::from_parts(0, 3982)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -379,8 +407,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_680_000 picoseconds. - Weight::from_parts(7_943_000, 0) + // Minimum execution time: 8_024_000 picoseconds. + Weight::from_parts(8_296_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 9137d3520dd9f..2ab0b1230a01d 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `050e4dc4313a`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_078_000 picoseconds. - Weight::from_parts(33_134_000, 3593) + // Minimum execution time: 31_754_000 picoseconds. + Weight::from_parts(32_780_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -67,29 +67,33 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 43_676_000 picoseconds. - Weight::from_parts(45_177_000, 6196) + // Minimum execution time: 43_509_000 picoseconds. + Weight::from_parts(44_528_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (r:2 w:2) + // Storage: `System::Account` (r:3 w:3) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `6196` - // Minimum execution time: 65_546_000 picoseconds. - Weight::from_parts(66_919_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `345` + // Estimated: `8799` + // Minimum execution time: 114_584_000 picoseconds. + Weight::from_parts(117_342_000, 8799) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,27 +106,33 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 25_739_000 picoseconds. - Weight::from_parts(26_702_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 81_314_000 picoseconds. + Weight::from_parts(83_995_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_449_000 picoseconds. - Weight::from_parts(2_600_000, 0) + // Minimum execution time: 2_637_000 picoseconds. + Weight::from_parts(2_833_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -130,64 +140,76 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 23_697_000 picoseconds. - Weight::from_parts(24_425_000, 3593) + // Minimum execution time: 24_530_000 picoseconds. + Weight::from_parts(25_330_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3593` - // Minimum execution time: 53_409_000 picoseconds. - Weight::from_parts(55_138_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 69_262_000 picoseconds. + Weight::from_parts(72_218_000, 3709) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 33_006_000 picoseconds. - Weight::from_parts(33_996_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 47_461_000 picoseconds. + Weight::from_parts(48_676_000, 3709) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (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: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3593` - // Minimum execution time: 63_809_000 picoseconds. - Weight::from_parts(65_507_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `6196` + // Minimum execution time: 95_992_000 picoseconds. + Weight::from_parts(98_150_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 7e992557aa12e..9ef138209256c 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `0af6a34749d7`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,20 +52,26 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 26_029_000 picoseconds. - Weight::from_parts(27_109_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 76_395_000 picoseconds. + Weight::from_parts(79_372_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -73,8 +79,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_640_000 picoseconds. - Weight::from_parts(3_872_000, 3593) + // Minimum execution time: 3_828_000 picoseconds. + Weight::from_parts(3_960_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -84,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_636_000 picoseconds. - Weight::from_parts(3_814_000, 3593) + // Minimum execution time: 3_746_000 picoseconds. + Weight::from_parts(3_973_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -93,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 646_000 picoseconds. - Weight::from_parts(684_000, 0) + // Minimum execution time: 721_000 picoseconds. + Weight::from_parts(788_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,51 +108,51 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_587_000 picoseconds. - Weight::from_parts(5_812_000, 3465) + // Minimum execution time: 5_637_000 picoseconds. + Weight::from_parts(5_864_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_965_000 picoseconds. - Weight::from_parts(7_196_000, 0) + // Minimum execution time: 7_223_000 picoseconds. + Weight::from_parts(7_685_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_340_000 picoseconds. - Weight::from_parts(1_447_000, 0) + // Minimum execution time: 1_133_000 picoseconds. + Weight::from_parts(1_251_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 588_000 picoseconds. - Weight::from_parts(647_000, 0) + // Minimum execution time: 680_000 picoseconds. + Weight::from_parts(736_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 620_000 picoseconds. - Weight::from_parts(679_000, 0) + // Minimum execution time: 711_000 picoseconds. + Weight::from_parts(762_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 592_000 picoseconds. - Weight::from_parts(640_000, 0) + // Minimum execution time: 663_000 picoseconds. + Weight::from_parts(752_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 616_000 picoseconds. - Weight::from_parts(670_000, 0) + // Minimum execution time: 737_000 picoseconds. + Weight::from_parts(797_000, 0) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -161,25 +167,31 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 609_000 picoseconds. - Weight::from_parts(700_000, 0) + // Minimum execution time: 699_000 picoseconds. + Weight::from_parts(751_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 23_154_000 picoseconds. - Weight::from_parts(23_824_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 74_466_000 picoseconds. + Weight::from_parts(76_100_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -187,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 8_757_000 picoseconds. - Weight::from_parts(9_076_000, 3489) + // Minimum execution time: 9_111_000 picoseconds. + Weight::from_parts(9_470_000, 3489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -196,25 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_185_000 picoseconds. - Weight::from_parts(3_350_000, 0) + // Minimum execution time: 3_258_000 picoseconds. + Weight::from_parts(3_379_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 21_112_000 picoseconds. - Weight::from_parts(21_763_000, 3507) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 32_130_000 picoseconds. + Weight::from_parts(32_799_000, 3677) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -222,126 +238,138 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_667_000 picoseconds. - Weight::from_parts(2_844_000, 0) + // Minimum execution time: 3_140_000 picoseconds. + Weight::from_parts(3_279_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_060_000 picoseconds. - Weight::from_parts(1_129_000, 0) + // Minimum execution time: 1_047_000 picoseconds. + Weight::from_parts(1_153_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 666_000 picoseconds. - Weight::from_parts(764_000, 0) + // Minimum execution time: 763_000 picoseconds. + Weight::from_parts(881_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 3_214_000 picoseconds. - Weight::from_parts(3_380_000, 0) + Weight::from_parts(3_407_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_253_000 picoseconds. - Weight::from_parts(3_355_000, 0) + // Minimum execution time: 3_165_000 picoseconds. + Weight::from_parts(3_414_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 776_000 picoseconds. - Weight::from_parts(856_000, 0) + // Minimum execution time: 832_000 picoseconds. + Weight::from_parts(947_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 26_994_000 picoseconds. - Weight::from_parts(28_092_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 78_896_000 picoseconds. + Weight::from_parts(80_980_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_381_000 picoseconds. - Weight::from_parts(3_566_000, 0) + // Minimum execution time: 3_532_000 picoseconds. + Weight::from_parts(3_722_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 23_632_000 picoseconds. - Weight::from_parts(24_243_000, 3539) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 74_036_000 picoseconds. + Weight::from_parts(75_450_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 651_000 picoseconds. - Weight::from_parts(697_000, 0) + // Minimum execution time: 762_000 picoseconds. + Weight::from_parts(824_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 597_000 picoseconds. - Weight::from_parts(677_000, 0) + // Minimum execution time: 686_000 picoseconds. + Weight::from_parts(748_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 599_000 picoseconds. - Weight::from_parts(651_000, 0) + // Minimum execution time: 676_000 picoseconds. + Weight::from_parts(726_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 605_000 picoseconds. - Weight::from_parts(662_000, 0) + // Minimum execution time: 657_000 picoseconds. + Weight::from_parts(710_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 635_000 picoseconds. - Weight::from_parts(667_000, 0) + // Minimum execution time: 667_000 picoseconds. + Weight::from_parts(732_000, 0) } pub fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 650_000 picoseconds. - Weight::from_parts(695_000, 0) + // Minimum execution time: 724_000 picoseconds. + Weight::from_parts(762_000, 0) } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs index f2034729888a8..7061f9cb1338a 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs @@ -40,7 +40,8 @@ use parachains_common::{ use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::xcm_sender::ExponentialPrice; use sp_runtime::traits::AccountIdConversion; -use westend_runtime_constants::system_parachain::{ASSET_HUB_ID, COLLECTIVES_ID}; +use testnet_parachains_constants::westend::locations::AssetHubLocation; +use westend_runtime_constants::system_parachain::COLLECTIVES_ID; use xcm::latest::{prelude::*, WESTEND_GENESIS_HASH}; use xcm_builder::{ AccountId32Aliases, AliasChildLocation, AliasOriginRootUsingFilter, @@ -62,7 +63,6 @@ pub use testnet_parachains_constants::westend::locations::GovernanceLocation; parameter_types! { pub const RootLocation: Location = Location::here(); pub const TokenRelayLocation: Location = Location::parent(); - pub AssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]); pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(WESTEND_GENESIS_HASH)); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = diff --git a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs index f172334e8d676..f49001bfc1b76 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs @@ -104,7 +104,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("glutton-westend"), impl_name: alloc::borrow::Cow::Borrowed("glutton-westend"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs index ba81ad83d4f19..dad02abfc6ed3 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs @@ -147,7 +147,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("people-rococo"), impl_name: alloc::borrow::Cow::Borrowed("people-rococo"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -931,17 +931,20 @@ impl_runtime_apis! { (keys.keys, keys.proof.encode()) } } + use testnet_parachains_constants::rococo::locations::{AssetHubParaId, AssetHubLocation}; use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< xcm_config::XcmConfig, ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -949,9 +952,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(RelayLocation::get()) }, - Parent.into(), + AssetHubLocation::get(), )) } @@ -961,7 +964,7 @@ impl_runtime_apis! { fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box)> { let native_location = Parent.into(); - let dest = Parent.into(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, @@ -971,14 +974,14 @@ impl_runtime_apis! { fn get_asset() -> Asset { Asset { - id: AssetId(Location::parent()), + id: AssetId(RelayLocation::get()), fun: Fungible(ExistentialDeposit::get()), } } } use xcm::latest::prelude::*; - use xcm_config::{PriceForParentDelivery, RelayLocation}; + use xcm_config::RelayLocation; parameter_types! { pub ExistentialDepositAsset: Option = Some(( @@ -990,13 +993,15 @@ impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - XcmConfig, - ExistentialDepositAsset, - PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn valid_destination() -> Result { - Ok(RelayLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just concrete assets according to relay chain. @@ -1011,8 +1016,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - RelayLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(RelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1051,15 +1056,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((RelayLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(RelayLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = RelayLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(RelayLocation::get()), 1_000 * UNITS).into(); let ticket = Location::new(0, []); Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs index 16b45102a156c..81b759de27100 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `556edb26d47c`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -52,41 +52,51 @@ pub struct WeightInfo(PhantomData); impl pallet_xcm::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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 26_870_000 picoseconds. - Weight::from_parts(27_619_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 34_158_000 picoseconds. + Weight::from_parts(35_174_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 71_943_000 picoseconds. - Weight::from_parts(74_700_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 116_998_000 picoseconds. + Weight::from_parts(120_674_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,21 +112,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 71_353_000 picoseconds. - Weight::from_parts(73_140_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 116_783_000 picoseconds. + Weight::from_parts(121_527_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -124,8 +140,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_499_000 picoseconds. - Weight::from_parts(10_024_000, 0) + // Minimum execution time: 9_424_000 picoseconds. + Weight::from_parts(9_737_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -135,8 +151,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_292_000 picoseconds. - Weight::from_parts(7_679_000, 0) + // Minimum execution time: 7_875_000 picoseconds. + Weight::from_parts(8_130_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -144,50 +160,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_458_000 picoseconds. - Weight::from_parts(2_558_000, 0) + // Minimum execution time: 2_381_000 picoseconds. + Weight::from_parts(2_561_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 29_559_000 picoseconds. - Weight::from_parts(30_460_000, 0) - .saturating_add(Weight::from_parts(0, 3540)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `175` + // Estimated: `3640` + // Minimum execution time: 36_927_000 picoseconds. + Weight::from_parts(38_308_000, 0) + .saturating_add(Weight::from_parts(0, 3640)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `165` - // Estimated: `3630` - // Minimum execution time: 30_582_000 picoseconds. - Weight::from_parts(31_787_000, 0) - .saturating_add(Weight::from_parts(0, 3630)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `334` + // Estimated: `108971` + // Minimum execution time: 42_365_000 picoseconds. + Weight::from_parts(43_757_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -196,8 +220,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_521_000 picoseconds. - Weight::from_parts(2_890_000, 0) + // Minimum execution time: 2_365_000 picoseconds. + Weight::from_parts(2_499_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -207,8 +231,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `15863` - // Minimum execution time: 20_237_000 picoseconds. - Weight::from_parts(21_003_000, 0) + // Minimum execution time: 20_424_000 picoseconds. + Weight::from_parts(21_184_000, 0) .saturating_add(Weight::from_parts(0, 15863)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -219,8 +243,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `27` // Estimated: `15867` - // Minimum execution time: 20_396_000 picoseconds. - Weight::from_parts(21_082_000, 0) + // Minimum execution time: 20_641_000 picoseconds. + Weight::from_parts(21_383_000, 0) .saturating_add(Weight::from_parts(0, 15867)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -229,27 +253,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `18391` - // Minimum execution time: 25_103_000 picoseconds. - Weight::from_parts(25_797_000, 0) - .saturating_add(Weight::from_parts(0, 18391)) + // Measured: `79` + // Estimated: `18394` + // Minimum execution time: 25_931_000 picoseconds. + Weight::from_parts(26_547_000, 0) + .saturating_add(Weight::from_parts(0, 18394)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `5980` - // Minimum execution time: 21_025_000 picoseconds. - Weight::from_parts(21_543_000, 0) - .saturating_add(Weight::from_parts(0, 5980)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `119` + // Estimated: `6059` + // Minimum execution time: 35_296_000 picoseconds. + Weight::from_parts(36_300_000, 0) + .saturating_add(Weight::from_parts(0, 6059)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) @@ -258,8 +284,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `79` // Estimated: `13444` - // Minimum execution time: 18_186_000 picoseconds. - Weight::from_parts(18_514_000, 0) + // Minimum execution time: 18_067_000 picoseconds. + Weight::from_parts(18_628_000, 0) .saturating_add(Weight::from_parts(0, 13444)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -269,26 +295,28 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `34` // Estimated: `15874` - // Minimum execution time: 20_374_000 picoseconds. - Weight::from_parts(20_899_000, 0) + // Minimum execution time: 20_389_000 picoseconds. + Weight::from_parts(21_258_000, 0) .saturating_add(Weight::from_parts(0, 15874)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `15880` - // Minimum execution time: 30_506_000 picoseconds. - Weight::from_parts(31_298_000, 0) - .saturating_add(Weight::from_parts(0, 15880)) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `119` + // Estimated: `15959` + // Minimum execution time: 45_440_000 picoseconds. + Weight::from_parts(47_521_000, 0) + .saturating_add(Weight::from_parts(0, 15959)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) @@ -299,8 +327,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_556_000 picoseconds. - Weight::from_parts(2_759_000, 0) + // Minimum execution time: 2_671_000 picoseconds. + Weight::from_parts(2_797_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -311,8 +339,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 25_919_000 picoseconds. - Weight::from_parts(26_519_000, 0) + // Minimum execution time: 27_233_000 picoseconds. + Weight::from_parts(27_764_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -325,8 +353,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 39_920_000 picoseconds. - Weight::from_parts(43_641_000, 0) + // Minimum execution time: 39_700_000 picoseconds. + Weight::from_parts(40_687_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -351,13 +379,12 @@ impl pallet_xcm::WeightInfo for WeightInfo { Weight::from_parts(18_446_744_073_709_551_000, 0) .saturating_add(Weight::from_parts(0, 0)) } - fn weigh_message() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_080_000 picoseconds. + Weight::from_parts(8_385_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 867ba1f265158..ddeed67df499e 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_542_000 picoseconds. - Weight::from_parts(33_713_000, 3593) + // Minimum execution time: 30_722_000 picoseconds. + Weight::from_parts(31_547_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -67,29 +67,33 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 43_618_000 picoseconds. - Weight::from_parts(44_920_000, 6196) + // Minimum execution time: 41_885_000 picoseconds. + Weight::from_parts(42_845_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (r:2 w:2) + // Storage: `System::Account` (r:3 w:3) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `176` - // Estimated: `6196` - // Minimum execution time: 65_417_000 picoseconds. - Weight::from_parts(67_710_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `345` + // Estimated: `8799` + // Minimum execution time: 110_100_000 picoseconds. + Weight::from_parts(112_319_000, 8799) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,27 +106,33 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 25_816_000 picoseconds. - Weight::from_parts(26_810_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 79_690_000 picoseconds. + Weight::from_parts(82_281_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_544_000 picoseconds. - Weight::from_parts(2_665_000, 0) + // Minimum execution time: 2_748_000 picoseconds. + Weight::from_parts(2_919_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -130,64 +140,76 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 23_754_000 picoseconds. - Weight::from_parts(24_306_000, 3593) + // Minimum execution time: 24_264_000 picoseconds. + Weight::from_parts(24_701_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3593` - // Minimum execution time: 54_727_000 picoseconds. - Weight::from_parts(56_849_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 68_727_000 picoseconds. + Weight::from_parts(70_944_000, 3709) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 33_572_000 picoseconds. - Weight::from_parts(34_598_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 48_495_000 picoseconds. + Weight::from_parts(49_936_000, 3709) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (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: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3593` - // Minimum execution time: 63_786_000 picoseconds. - Weight::from_parts(65_207_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `6196` + // Minimum execution time: 94_270_000 picoseconds. + Weight::from_parts(96_465_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index e21c481f64bcd..37dba06cb564b 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,27 +52,37 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 24_622_000 picoseconds. - Weight::from_parts(25_559_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 76_734_000 picoseconds. + Weight::from_parts(79_192_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `0` - // Minimum execution time: 623_000 picoseconds. - Weight::from_parts(702_000, 0) + // Estimated: `3593` + // Minimum execution time: 3_824_000 picoseconds. + Weight::from_parts(4_021_000, 3593) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -80,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_618_000 picoseconds. - Weight::from_parts(3_876_000, 3593) + // Minimum execution time: 3_653_000 picoseconds. + Weight::from_parts(3_956_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -89,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 644_000 picoseconds. - Weight::from_parts(734_000, 0) + // Minimum execution time: 754_000 picoseconds. + Weight::from_parts(805_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -98,82 +108,90 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_654_000 picoseconds. - Weight::from_parts(5_851_000, 3465) + // Minimum execution time: 5_858_000 picoseconds. + Weight::from_parts(6_017_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_045_000 picoseconds. - Weight::from_parts(7_374_000, 0) + // Minimum execution time: 7_376_000 picoseconds. + Weight::from_parts(7_673_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_313_000 picoseconds. - Weight::from_parts(1_407_000, 0) + // Minimum execution time: 1_183_000 picoseconds. + Weight::from_parts(1_246_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 644_000 picoseconds. - Weight::from_parts(685_000, 0) + // Minimum execution time: 742_000 picoseconds. + Weight::from_parts(801_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 645_000 picoseconds. - Weight::from_parts(705_000, 0) + // Minimum execution time: 727_000 picoseconds. + Weight::from_parts(786_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 610_000 picoseconds. - Weight::from_parts(683_000, 0) + // Minimum execution time: 675_000 picoseconds. + Weight::from_parts(729_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(709_000, 0) + // Minimum execution time: 764_000 picoseconds. + Weight::from_parts(793_000, 0) } + // Storage: `Benchmark::Override` (r:0 w:0) + // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 688_000 picoseconds. - Weight::from_parts(769_000, 0) + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 598_000 picoseconds. - Weight::from_parts(654_000, 0) + // Minimum execution time: 663_000 picoseconds. + Weight::from_parts(752_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 21_765_000 picoseconds. - Weight::from_parts(22_522_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 73_512_000 picoseconds. + Weight::from_parts(75_381_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -181,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 9_084_000 picoseconds. - Weight::from_parts(9_352_000, 3489) + // Minimum execution time: 9_359_000 picoseconds. + Weight::from_parts(9_823_000, 3489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -190,25 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 631_000 picoseconds. - Weight::from_parts(668_000, 0) + // Minimum execution time: 3_402_000 picoseconds. + Weight::from_parts(3_585_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 20_622_000 picoseconds. - Weight::from_parts(21_331_000, 3471) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `175` + // Estimated: `3640` + // Minimum execution time: 31_686_000 picoseconds. + Weight::from_parts(32_742_000, 3640) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -216,119 +238,131 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_634_000 picoseconds. - Weight::from_parts(2_827_000, 0) + // Minimum execution time: 3_091_000 picoseconds. + Weight::from_parts(3_327_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 933_000 picoseconds. - Weight::from_parts(1_103_000, 0) + // Minimum execution time: 1_069_000 picoseconds. + Weight::from_parts(1_126_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 729_000 picoseconds. - Weight::from_parts(779_000, 0) + // Minimum execution time: 769_000 picoseconds. + Weight::from_parts(847_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 625_000 picoseconds. - Weight::from_parts(684_000, 0) + // Minimum execution time: 3_459_000 picoseconds. + Weight::from_parts(3_616_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 596_000 picoseconds. - Weight::from_parts(670_000, 0) + // Minimum execution time: 3_456_000 picoseconds. + Weight::from_parts(3_631_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 801_000 picoseconds. - Weight::from_parts(836_000, 0) + // Minimum execution time: 846_000 picoseconds. + Weight::from_parts(925_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 25_939_000 picoseconds. - Weight::from_parts(26_511_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 77_788_000 picoseconds. + Weight::from_parts(80_423_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_637_000 picoseconds. - Weight::from_parts(3_779_000, 0) + // Minimum execution time: 3_723_000 picoseconds. + Weight::from_parts(3_891_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 21_843_000 picoseconds. - Weight::from_parts(22_575_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 74_903_000 picoseconds. + Weight::from_parts(76_835_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 634_000 picoseconds. - Weight::from_parts(714_000, 0) + // Minimum execution time: 715_000 picoseconds. + Weight::from_parts(786_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 626_000 picoseconds. - Weight::from_parts(675_000, 0) + // Minimum execution time: 686_000 picoseconds. + Weight::from_parts(741_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 570_000 picoseconds. - Weight::from_parts(657_000, 0) + // Minimum execution time: 677_000 picoseconds. + Weight::from_parts(738_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 600_000 picoseconds. - Weight::from_parts(679_000, 0) + // Minimum execution time: 687_000 picoseconds. + Weight::from_parts(745_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 687_000 picoseconds. - Weight::from_parts(717_000, 0) + // Minimum execution time: 704_000 picoseconds. + Weight::from_parts(748_000, 0) } } diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs index 29135e27184bb..f55bce2c09b3a 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs @@ -151,7 +151,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("people-westend"), impl_name: alloc::borrow::Cow::Borrowed("people-westend"), authoring_version: 1, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -958,17 +958,21 @@ impl_runtime_apis! { (keys.keys, keys.proof.encode()) } } + use xcm_config::RelayLocation; + use testnet_parachains_constants::westend::locations::{AssetHubParaId, AssetHubLocation}; use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - xcm_config::PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn reachable_dest() -> Option { - Some(Parent.into()) + Some(AssetHubLocation::get()) } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { @@ -976,9 +980,9 @@ impl_runtime_apis! { Some(( Asset { fun: Fungible(ExistentialDeposit::get()), - id: AssetId(Parent.into()) + id: AssetId(RelayLocation::get()) }, - Parent.into(), + AssetHubLocation::get(), )) } @@ -988,7 +992,7 @@ impl_runtime_apis! { fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box)> { let native_location = Parent.into(); - let dest = Parent.into(); + let dest = AssetHubLocation::get(); pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( native_location, @@ -998,15 +1002,13 @@ impl_runtime_apis! { fn get_asset() -> Asset { Asset { - id: AssetId(Location::parent()), + id: AssetId(RelayLocation::get()), fun: Fungible(ExistentialDeposit::get()), } } } use xcm::latest::prelude::*; - use xcm_config::{PriceForParentDelivery, RelayLocation}; - parameter_types! { pub ExistentialDepositAsset: Option = Some(( RelayLocation::get(), @@ -1017,13 +1019,15 @@ impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - XcmConfig, - ExistentialDepositAsset, - PriceForParentDelivery, - >; + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< + xcm_config::XcmConfig, + ExistentialDepositAsset, + PriceForSiblingParachainDelivery, + AssetHubParaId, + ParachainSystem, + >; fn valid_destination() -> Result { - Ok(RelayLocation::get()) + Ok(AssetHubLocation::get()) } fn worst_case_holding(_depositable_count: u32) -> Assets { // just concrete assets according to relay chain. @@ -1038,8 +1042,8 @@ impl_runtime_apis! { } parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - RelayLocation::get(), + pub TrustedTeleporter: Option<(Location, Asset)> = Some(( + AssetHubLocation::get(), Asset { fun: Fungible(UNITS), id: AssetId(RelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; @@ -1078,15 +1082,15 @@ impl_runtime_apis! { } fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((RelayLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { - Ok(RelayLocation::get()) + Ok(AssetHubLocation::get()) } fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = RelayLocation::get(); + let origin = AssetHubLocation::get(); let assets: Assets = (AssetId(RelayLocation::get()), 1_000 * UNITS).into(); let ticket = Location { parents: 0, interior: Here }; Ok((origin, ticket, assets)) diff --git a/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_xcm.rs index 9f35b1ff817cd..ef351fd3a7c62 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_xcm.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `556edb26d47c`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -52,41 +52,51 @@ pub struct WeightInfo(PhantomData); impl pallet_xcm::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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 26_749_000 picoseconds. - Weight::from_parts(27_800_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 34_201_000 picoseconds. + Weight::from_parts(35_814_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 71_148_000 picoseconds. - Weight::from_parts(73_635_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 117_845_000 picoseconds. + Weight::from_parts(120_752_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,21 +112,27 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `144` - // Estimated: `3609` - // Minimum execution time: 70_969_000 picoseconds. - Weight::from_parts(73_533_000, 0) - .saturating_add(Weight::from_parts(0, 3609)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 117_637_000 picoseconds. + Weight::from_parts(121_390_000, 0) + .saturating_add(Weight::from_parts(0, 3709)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -124,8 +140,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 9_548_000 picoseconds. - Weight::from_parts(9_883_000, 0) + // Minimum execution time: 9_281_000 picoseconds. + Weight::from_parts(9_822_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -135,8 +151,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_364_000 picoseconds. - Weight::from_parts(7_788_000, 0) + // Minimum execution time: 8_014_000 picoseconds. + Weight::from_parts(8_402_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -144,50 +160,58 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_424_000 picoseconds. - Weight::from_parts(2_647_000, 0) + // Minimum execution time: 2_234_000 picoseconds. + Weight::from_parts(2_548_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 29_826_000 picoseconds. - Weight::from_parts(30_896_000, 0) - .saturating_add(Weight::from_parts(0, 3540)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `175` + // Estimated: `3640` + // Minimum execution time: 37_635_000 picoseconds. + Weight::from_parts(38_249_000, 0) + .saturating_add(Weight::from_parts(0, 3640)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::Queries` (r:0 w:1) /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `165` - // Estimated: `3630` - // Minimum execution time: 30_982_000 picoseconds. - Weight::from_parts(32_811_000, 0) - .saturating_add(Weight::from_parts(0, 3630)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `334` + // Estimated: `108971` + // Minimum execution time: 42_794_000 picoseconds. + Weight::from_parts(44_006_000, 0) + .saturating_add(Weight::from_parts(0, 108971)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) @@ -196,8 +220,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_572_000 picoseconds. - Weight::from_parts(2_791_000, 0) + // Minimum execution time: 2_344_000 picoseconds. + Weight::from_parts(2_542_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -207,8 +231,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `15863` - // Minimum execution time: 20_350_000 picoseconds. - Weight::from_parts(20_875_000, 0) + // Minimum execution time: 20_429_000 picoseconds. + Weight::from_parts(21_089_000, 0) .saturating_add(Weight::from_parts(0, 15863)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -219,8 +243,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `27` // Estimated: `15867` - // Minimum execution time: 20_424_000 picoseconds. - Weight::from_parts(20_862_000, 0) + // Minimum execution time: 19_920_000 picoseconds. + Weight::from_parts(20_719_000, 0) .saturating_add(Weight::from_parts(0, 15867)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -229,27 +253,29 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `18391` - // Minimum execution time: 25_639_000 picoseconds. - Weight::from_parts(26_328_000, 0) - .saturating_add(Weight::from_parts(0, 18391)) + // Measured: `79` + // Estimated: `18394` + // Minimum execution time: 25_109_000 picoseconds. + Weight::from_parts(25_911_000, 0) + .saturating_add(Weight::from_parts(0, 18394)) .saturating_add(T::DbWeight::get().reads(7)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `5980` - // Minimum execution time: 21_168_000 picoseconds. - Weight::from_parts(21_795_000, 0) - .saturating_add(Weight::from_parts(0, 5980)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `119` + // Estimated: `6059` + // Minimum execution time: 35_535_000 picoseconds. + Weight::from_parts(36_739_000, 0) + .saturating_add(Weight::from_parts(0, 6059)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) @@ -258,8 +284,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `79` // Estimated: `13444` - // Minimum execution time: 17_944_000 picoseconds. - Weight::from_parts(18_433_000, 0) + // Minimum execution time: 17_689_000 picoseconds. + Weight::from_parts(18_070_000, 0) .saturating_add(Weight::from_parts(0, 13444)) .saturating_add(T::DbWeight::get().reads(5)) } @@ -269,26 +295,28 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `34` // Estimated: `15874` - // Minimum execution time: 20_292_000 picoseconds. - Weight::from_parts(20_813_000, 0) + // Minimum execution time: 20_456_000 picoseconds. + Weight::from_parts(20_845_000, 0) .saturating_add(Weight::from_parts(0, 15874)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `40` - // Estimated: `15880` - // Minimum execution time: 30_867_000 picoseconds. - Weight::from_parts(31_496_000, 0) - .saturating_add(Weight::from_parts(0, 15880)) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `119` + // Estimated: `15959` + // Minimum execution time: 45_046_000 picoseconds. + Weight::from_parts(46_301_000, 0) + .saturating_add(Weight::from_parts(0, 15959)) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) @@ -299,8 +327,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_722_000 picoseconds. - Weight::from_parts(2_814_000, 0) + // Minimum execution time: 2_602_000 picoseconds. + Weight::from_parts(2_817_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -311,8 +339,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7576` // Estimated: `11041` - // Minimum execution time: 26_603_000 picoseconds. - Weight::from_parts(27_050_000, 0) + // Minimum execution time: 28_228_000 picoseconds. + Weight::from_parts(28_864_000, 0) .saturating_add(Weight::from_parts(0, 11041)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -325,8 +353,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 38_523_000 picoseconds. - Weight::from_parts(39_507_000, 0) + // Minimum execution time: 39_589_000 picoseconds. + Weight::from_parts(40_179_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -334,13 +362,13 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) fn add_authorized_alias() -> Weight { // Proof Size summary in bytes: // Measured: `161` // Estimated: `3626` - // Minimum execution time: 48_687_000 picoseconds. - Weight::from_parts(50_682_000, 0) + // Minimum execution time: 51_739_000 picoseconds. + Weight::from_parts(52_716_000, 0) .saturating_add(Weight::from_parts(0, 3626)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -348,24 +376,23 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1) /// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) fn remove_authorized_alias() -> Weight { // Proof Size summary in bytes: // Measured: `517` // Estimated: `3982` - // Minimum execution time: 50_023_000 picoseconds. - Weight::from_parts(51_193_000, 0) + // Minimum execution time: 52_882_000 picoseconds. + Weight::from_parts(54_038_000, 0) .saturating_add(Weight::from_parts(0, 3982)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - fn weigh_message() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_785_000 picoseconds. - Weight::from_parts(8_077_000, 0) + // Minimum execution time: 8_351_000 picoseconds. + Weight::from_parts(8_639_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 1f5b996a6e922..492d5bfde1739 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `b9a9df1fcddf`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,8 +56,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_437_000 picoseconds. - Weight::from_parts(33_200_000, 3593) + // Minimum execution time: 31_297_000 picoseconds. + Weight::from_parts(32_008_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -67,29 +67,33 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `6196` - // Minimum execution time: 44_534_000 picoseconds. - Weight::from_parts(45_437_000, 6196) + // Minimum execution time: 42_973_000 picoseconds. + Weight::from_parts(44_200_000, 6196) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (r:2 w:2) + // Storage: `System::Account` (r:3 w:3) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `176` - // Estimated: `6196` - // Minimum execution time: 65_421_000 picoseconds. - Weight::from_parts(67_076_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `345` + // Estimated: `8799` + // Minimum execution time: 113_095_000 picoseconds. + Weight::from_parts(115_975_000, 8799) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,27 +106,33 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 25_667_000 picoseconds. - Weight::from_parts(26_852_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 81_184_000 picoseconds. + Weight::from_parts(83_289_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_442_000 picoseconds. - Weight::from_parts(2_550_000, 0) + // Minimum execution time: 2_668_000 picoseconds. + Weight::from_parts(2_827_000, 0) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -130,64 +140,76 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 24_036_000 picoseconds. - Weight::from_parts(24_398_000, 3593) + // Minimum execution time: 24_538_000 picoseconds. + Weight::from_parts(25_115_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3593` - // Minimum execution time: 54_307_000 picoseconds. - Weight::from_parts(55_149_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 69_619_000 picoseconds. + Weight::from_parts(71_689_000, 3709) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 33_266_000 picoseconds. - Weight::from_parts(33_936_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `244` + // Estimated: `3709` + // Minimum execution time: 48_416_000 picoseconds. + Weight::from_parts(49_727_000, 3709) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: `System::Account` (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: `ParachainInfo::ParachainId` (r:1 w:0) // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3593` - // Minimum execution time: 63_215_000 picoseconds. - Weight::from_parts(65_123_000, 3593) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `244` + // Estimated: `6196` + // Minimum execution time: 94_130_000 picoseconds. + Weight::from_parts(97_600_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } } diff --git a/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 7ff82ed3da2f5..3c53018d059b6 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `0af6a34749d7`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -52,20 +52,26 @@ 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 25_916_000 picoseconds. - Weight::from_parts(27_426_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 78_180_000 picoseconds. + Weight::from_parts(79_857_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `System::Account` (r:1 w:1) // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -73,8 +79,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_791_000 picoseconds. - Weight::from_parts(3_968_000, 3593) + // Minimum execution time: 3_832_000 picoseconds. + Weight::from_parts(4_027_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -84,8 +90,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 3_527_000 picoseconds. - Weight::from_parts(3_784_000, 3593) + // Minimum execution time: 3_764_000 picoseconds. + Weight::from_parts(4_046_000, 3593) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -93,8 +99,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 658_000 picoseconds. - Weight::from_parts(711_000, 0) + // Minimum execution time: 746_000 picoseconds. + Weight::from_parts(789_000, 0) } // Storage: `PolkadotXcm::Queries` (r:1 w:0) // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -102,51 +108,51 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 5_846_000 picoseconds. - Weight::from_parts(6_441_000, 3465) + // Minimum execution time: 5_595_000 picoseconds. + Weight::from_parts(5_877_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_229_000 picoseconds. - Weight::from_parts(7_593_000, 0) + // Minimum execution time: 7_356_000 picoseconds. + Weight::from_parts(7_701_000, 0) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_418_000 picoseconds. - Weight::from_parts(1_545_000, 0) + // Minimum execution time: 1_172_000 picoseconds. + Weight::from_parts(1_230_000, 0) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 664_000 picoseconds. - Weight::from_parts(730_000, 0) + // Minimum execution time: 680_000 picoseconds. + Weight::from_parts(783_000, 0) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 667_000 picoseconds. - Weight::from_parts(708_000, 0) + // Minimum execution time: 695_000 picoseconds. + Weight::from_parts(762_000, 0) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 627_000 picoseconds. - Weight::from_parts(678_000, 0) + // Minimum execution time: 670_000 picoseconds. + Weight::from_parts(743_000, 0) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 691_000 picoseconds. - Weight::from_parts(734_000, 0) + // Minimum execution time: 692_000 picoseconds. + Weight::from_parts(755_000, 0) } // Storage: `Benchmark::Override` (r:0 w:0) // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -161,25 +167,31 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 674_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 682_000 picoseconds. + Weight::from_parts(723_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 23_383_000 picoseconds. - Weight::from_parts(24_336_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 74_850_000 picoseconds. + Weight::from_parts(76_727_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -187,8 +199,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `24` // Estimated: `3489` - // Minimum execution time: 8_950_000 picoseconds. - Weight::from_parts(9_106_000, 3489) + // Minimum execution time: 9_455_000 picoseconds. + Weight::from_parts(9_762_000, 3489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -196,25 +208,29 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_294_000 picoseconds. - Weight::from_parts(3_447_000, 0) + // Minimum execution time: 3_359_000 picoseconds. + Weight::from_parts(3_640_000, 0) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3471` - // Minimum execution time: 20_463_000 picoseconds. - Weight::from_parts(20_877_000, 3471) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `175` + // Estimated: `3640` + // Minimum execution time: 31_579_000 picoseconds. + Weight::from_parts(32_801_000, 3640) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -222,126 +238,138 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_772_000 picoseconds. - Weight::from_parts(2_979_000, 0) + // Minimum execution time: 3_388_000 picoseconds. + Weight::from_parts(3_518_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_066_000 picoseconds. - Weight::from_parts(1_142_000, 0) + // Minimum execution time: 990_000 picoseconds. + Weight::from_parts(1_117_000, 0) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 762_000 picoseconds. - Weight::from_parts(809_000, 0) + // Minimum execution time: 775_000 picoseconds. + Weight::from_parts(837_000, 0) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_253_000 picoseconds. - Weight::from_parts(3_443_000, 0) + // Minimum execution time: 3_252_000 picoseconds. + Weight::from_parts(3_522_000, 0) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_340_000 picoseconds. - Weight::from_parts(3_520_000, 0) + // Minimum execution time: 3_444_000 picoseconds. + Weight::from_parts(3_569_000, 0) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 786_000 picoseconds. - Weight::from_parts(853_000, 0) + // Minimum execution time: 784_000 picoseconds. + Weight::from_parts(872_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 27_622_000 picoseconds. - Weight::from_parts(28_593_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 80_023_000 picoseconds. + Weight::from_parts(81_985_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_515_000 picoseconds. - Weight::from_parts(3_711_000, 0) + // Minimum execution time: 3_775_000 picoseconds. + Weight::from_parts(3_926_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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - // Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - // Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 23_615_000 picoseconds. - Weight::from_parts(24_619_000, 3540) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `345` + // Estimated: `6196` + // Minimum execution time: 75_698_000 picoseconds. + Weight::from_parts(77_179_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 697_000 picoseconds. - Weight::from_parts(753_000, 0) + // Minimum execution time: 739_000 picoseconds. + Weight::from_parts(791_000, 0) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 654_000 picoseconds. - Weight::from_parts(703_000, 0) + // Minimum execution time: 617_000 picoseconds. + Weight::from_parts(714_000, 0) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 643_000 picoseconds. - Weight::from_parts(688_000, 0) + // Minimum execution time: 629_000 picoseconds. + Weight::from_parts(730_000, 0) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 634_000 picoseconds. - Weight::from_parts(695_000, 0) + // Minimum execution time: 692_000 picoseconds. + Weight::from_parts(737_000, 0) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 668_000 picoseconds. - Weight::from_parts(725_000, 0) + // Minimum execution time: 659_000 picoseconds. + Weight::from_parts(738_000, 0) } pub fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 671_000 picoseconds. - Weight::from_parts(727_000, 0) + // Minimum execution time: 688_000 picoseconds. + Weight::from_parts(776_000, 0) } } diff --git a/cumulus/parachains/runtimes/people/people-westend/src/xcm_config.rs b/cumulus/parachains/runtimes/people/people-westend/src/xcm_config.rs index edab2b23709ac..9cb1a96036b47 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/xcm_config.rs @@ -38,7 +38,8 @@ use parachains_common::{ }; use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::traits::AccountIdConversion; -use westend_runtime_constants::system_parachain::{ASSET_HUB_ID, COLLECTIVES_ID}; +use testnet_parachains_constants::westend::locations::AssetHubLocation; +use westend_runtime_constants::system_parachain::COLLECTIVES_ID; use xcm::latest::{prelude::*, WESTEND_GENESIS_HASH}; use xcm_builder::{ AccountId32Aliases, AliasChildLocation, AliasOriginRootUsingFilter, @@ -60,7 +61,6 @@ pub use testnet_parachains_constants::westend::locations::GovernanceLocation; parameter_types! { pub const RootLocation: Location = Location::here(); pub const RelayLocation: Location = Location::parent(); - pub AssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]); pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(WESTEND_GENESIS_HASH)); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = @@ -240,6 +240,7 @@ impl xcm_executor::Config for XcmConfig { // People does not recognize a reserve location for any asset. Users must teleport WND // where allowed (e.g. with the Relay Chain). type IsReserve = (); + type IsTeleporter = TrustedTeleporters; type UniversalLocation = UniversalLocation; type Barrier = Barrier; diff --git a/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs index 2eace1d860a03..1c23254168bab 100644 --- a/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs @@ -575,8 +575,8 @@ impl_runtime_apis! { SessionKeys::decode_into_raw_public_keys(&encoded) } - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) + fn generate_session_keys(owner: Vec, seed: Option>) -> sp_session::OpaqueGeneratedSessionKeys { + SessionKeys::generate(&owner, seed).into() } } diff --git a/cumulus/polkadot-omni-node/lib/src/fake_runtime_api/utils.rs b/cumulus/polkadot-omni-node/lib/src/fake_runtime_api/utils.rs index 1354dbbfb00a0..29a15b81d9a81 100644 --- a/cumulus/polkadot-omni-node/lib/src/fake_runtime_api/utils.rs +++ b/cumulus/polkadot-omni-node/lib/src/fake_runtime_api/utils.rs @@ -124,7 +124,7 @@ macro_rules! impl_node_runtime_apis { } impl sp_session::SessionKeys<$block> for $runtime { - fn generate_session_keys(_: Option>) -> Vec { + fn generate_session_keys(_: Vec, _: Option>) -> sp_session::OpaqueGeneratedSessionKeys { unimplemented!() } diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index b295ad3865732..39234f5adf6a2 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -45,7 +45,7 @@ use cumulus_client_consensus_aura::{ }, equivocation_import_queue::Verifier as EquivocationVerifier, }; -use cumulus_client_consensus_proposer::{Proposer, ProposerInterface}; +use cumulus_client_consensus_proposer::ProposerInterface; use cumulus_client_consensus_relay_chain::Verifier as RelayChainVerifier; #[allow(deprecated)] use cumulus_client_service::CollatorSybilResistance; @@ -326,7 +326,7 @@ where node_extra_args: NodeExtraArgs, block_import_handle: SlotBasedBlockImportHandle, ) -> Result<(), Error> { - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( + let proposer = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), transaction_pool, @@ -334,7 +334,6 @@ where telemetry.clone(), ); - let proposer = Proposer::new(proposer_factory); let collator_service = CollatorService::new( client.clone(), Arc::new(task_manager.spawn_handle()), @@ -451,7 +450,7 @@ where node_extra_args: NodeExtraArgs, _: (), ) -> Result<(), Error> { - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( + let proposer = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), transaction_pool, @@ -485,7 +484,7 @@ where para_id, overseer_handle, relay_chain_slot_duration, - proposer: Proposer::new(proposer_factory), + proposer, collator_service, authoring_duration: Duration::from_millis(2000), reinitialize: false, diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs b/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs index 269fe0298e16c..b310e30c92c58 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs @@ -24,7 +24,7 @@ use sc_service::{Configuration, TaskManager}; /// The current node version for cumulus official binaries, which takes the basic /// SemVer form `..`. It should correspond to the latest /// `polkadot` version of a stable release. -pub const NODE_VERSION: &'static str = "1.18.5"; +pub const NODE_VERSION: &'static str = "1.19.0"; /// Trait that extends the `DynNodeSpec` trait with manual seal related logic. /// diff --git a/cumulus/test/client/src/block_builder.rs b/cumulus/test/client/src/block_builder.rs index ee400859f75c8..970ae1abf381a 100644 --- a/cumulus/test/client/src/block_builder.rs +++ b/cumulus/test/client/src/block_builder.rs @@ -22,7 +22,7 @@ use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use cumulus_test_runtime::{Block, GetLastTimestamp, Hash, Header}; use polkadot_primitives::{BlockNumber as PBlockNumber, Hash as PHash}; use sc_block_builder::BlockBuilderBuilder; -use sp_api::ProvideRuntimeApi; +use sp_api::{ProofRecorder, ProofRecorderIgnoredNodes, ProvideRuntimeApi}; use sp_consensus_aura::{AuraApi, Slot}; use sp_runtime::{traits::Header as HeaderT, Digest, DigestItem}; @@ -61,6 +61,19 @@ pub trait InitBlockBuilder { relay_sproof_builder: RelayStateSproofBuilder, ) -> BlockBuilderAndSupportData; + /// Init a specific block builder at a specific block that works for the test runtime. + /// + /// Same as [`InitBlockBuilder::init_block_builder_with_timestamp`] besides that it takes + /// `ignored_nodes` that instruct the proof recorder to not record these nodes. + fn init_block_builder_with_ignored_nodes( + &self, + at: Hash, + validation_data: Option>, + relay_sproof_builder: RelayStateSproofBuilder, + timestamp: u64, + ignored_nodes: ProofRecorderIgnoredNodes, + ) -> BlockBuilderAndSupportData; + /// Init a specific block builder that works for the test runtime. /// /// Same as [`InitBlockBuilder::init_block_builder`] besides that it takes a @@ -81,6 +94,7 @@ fn init_block_builder( validation_data: Option>, mut relay_sproof_builder: RelayStateSproofBuilder, timestamp: u64, + ignored_nodes: Option>, ) -> BlockBuilderAndSupportData<'_> { let slot: Slot = (timestamp / client.runtime_api().slot_duration(at).unwrap().as_millis()).into(); @@ -97,7 +111,9 @@ fn init_block_builder( .on_parent_block(at) .fetch_parent_block_number(client) .unwrap() - .enable_proof_recording() + .with_proof_recorder(Some(ProofRecorder::::with_ignored_nodes( + ignored_nodes.unwrap_or_default(), + ))) .with_inherent_digests(aura_pre_digest) .build() .expect("Creates new block builder for test runtime"); @@ -168,7 +184,25 @@ impl InitBlockBuilder for Client { last_timestamp + self.runtime_api().slot_duration(at).unwrap().as_millis() }; - init_block_builder(self, at, validation_data, relay_sproof_builder, timestamp) + init_block_builder(self, at, validation_data, relay_sproof_builder, timestamp, None) + } + + fn init_block_builder_with_ignored_nodes( + &self, + at: Hash, + validation_data: Option>, + relay_sproof_builder: RelayStateSproofBuilder, + timestamp: u64, + ignored_nodes: ProofRecorderIgnoredNodes, + ) -> BlockBuilderAndSupportData { + init_block_builder( + self, + at, + validation_data, + relay_sproof_builder, + timestamp, + Some(ignored_nodes), + ) } fn init_block_builder_with_timestamp( @@ -178,7 +212,7 @@ impl InitBlockBuilder for Client { relay_sproof_builder: RelayStateSproofBuilder, timestamp: u64, ) -> BlockBuilderAndSupportData { - init_block_builder(self, at, validation_data, relay_sproof_builder, timestamp) + init_block_builder(self, at, validation_data, relay_sproof_builder, timestamp, None) } } diff --git a/cumulus/test/client/src/lib.rs b/cumulus/test/client/src/lib.rs index 4579051f77705..b6053c64c0ce8 100644 --- a/cumulus/test/client/src/lib.rs +++ b/cumulus/test/client/src/lib.rs @@ -76,6 +76,7 @@ pub type Client = client::Client; pub struct GenesisParameters { pub endowed_accounts: Vec, pub wasm: Option>, + pub blocks_per_pov: Option, } impl substrate_test_client::GenesisInit for GenesisParameters { @@ -86,6 +87,7 @@ impl substrate_test_client::GenesisInit for GenesisParameters { self.wasm.as_deref().unwrap_or_else(|| { cumulus_test_runtime::WASM_BINARY.expect("WASM binary not compiled!") }), + self.blocks_per_pov, ) .build_storage() .expect("Builds test runtime genesis storage") @@ -202,7 +204,7 @@ pub fn validate_block( let mut ext = TestExternalities::default(); let mut ext_ext = ext.ext(); - let heap_pages = HeapAllocStrategy::Static { extra_pages: 1024 }; + let heap_pages = HeapAllocStrategy::Static { extra_pages: 2048 }; let executor = WasmExecutor::<( sp_io::SubstrateHostFunctions, cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions, diff --git a/cumulus/test/runtime/src/lib.rs b/cumulus/test/runtime/src/lib.rs index 95428d0146dd3..cd4c7a1dbd340 100644 --- a/cumulus/test/runtime/src/lib.rs +++ b/cumulus/test/runtime/src/lib.rs @@ -62,6 +62,8 @@ mod test_pallet; extern crate alloc; use alloc::{vec, vec::Vec}; +use codec::Encode; +use cumulus_pallet_parachain_system::{DefaultCoreSelector, SelectCore}; use frame_support::{derive_impl, traits::OnRuntimeUpgrade, PalletId}; use sp_api::{decl_runtime_apis, impl_runtime_apis}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; @@ -351,6 +353,46 @@ impl pallet_glutton::Config for Runtime { type WeightInfo = pallet_glutton::weights::SubstrateWeight; } +parameter_types! { + pub storage BlocksPerPoV: u32 = 1; +} + +/// Super ultra hacky core selector. +/// +/// TODO: Replace with something useful. +pub struct MultipleBlocksPerPoVCoreSelector; + +impl SelectCore for MultipleBlocksPerPoVCoreSelector { + fn selected_core() -> (CoreSelector, ClaimQueueOffset) { + let blocks_per_pov = BlocksPerPoV::get(); + + if blocks_per_pov == 0 { + return (CoreSelector(0), ClaimQueueOffset(0)) + } else if blocks_per_pov == 1 { + return DefaultCoreSelector::::selected_core() + } + + let core_selector = + (System::block_number().saturating_sub(1) / blocks_per_pov).using_encoded(|b| b[0]); + + (CoreSelector(core_selector), ClaimQueueOffset(0)) + } + + fn select_next_core() -> (CoreSelector, ClaimQueueOffset) { + let blocks_per_pov = BlocksPerPoV::get(); + + if blocks_per_pov == 0 { + return (CoreSelector(0), ClaimQueueOffset(0)) + } else if blocks_per_pov == 1 { + return DefaultCoreSelector::::select_next_core() + } + + let core_selector = (System::block_number() / blocks_per_pov).using_encoded(|b| b[0]); + + (CoreSelector(core_selector), ClaimQueueOffset(0)) + } +} + #[cfg(feature = "relay-parent-offset")] const RELAY_PARENT_OFFSET: u32 = 2; @@ -377,7 +419,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; type ConsensusHook = ConsensusHook; - type SelectCore = cumulus_pallet_parachain_system::DefaultCoreSelector; + type SelectCore = MultipleBlocksPerPoVCoreSelector; type RelayParentOffset = ConstU32; } diff --git a/cumulus/test/runtime/src/test_pallet.rs b/cumulus/test/runtime/src/test_pallet.rs index 61195386ae79d..1d96621655f6c 100644 --- a/cumulus/test/runtime/src/test_pallet.rs +++ b/cumulus/test/runtime/src/test_pallet.rs @@ -24,6 +24,7 @@ pub const TEST_RUNTIME_UPGRADE_KEY: &[u8] = b"+test_runtime_upgrade_key+"; #[frame_support::pallet(dev_mode)] pub mod pallet { use crate::test_pallet::TEST_RUNTIME_UPGRADE_KEY; + use alloc::vec; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; @@ -33,6 +34,10 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + cumulus_pallet_parachain_system::Config {} + /// A simple storage map for testing purposes. + #[pallet::storage] + pub type TestMap = StorageMap<_, Twox64Concat, u32, (), ValueQuery>; + #[pallet::hooks] impl Hooks> for Pallet {} @@ -73,6 +78,33 @@ pub mod pallet { Ok(()) } + + /// Reads a key and writes a big value under this key. + /// + /// At genesis this `key` is empty and thus, will only be set in consequent blocks. + pub fn read_and_write_big_value(_: OriginFor) -> DispatchResult { + let key = &b"really_huge_value"[..]; + sp_io::storage::get(key); + sp_io::storage::set(key, &vec![0u8; 1024 * 1024 * 5]); + + Ok(()) + } + + /// Stores `()` in `TestMap` for keys from 0 up to `max_key`. + #[pallet::weight(0)] + pub fn store_values_in_map(_: OriginFor, max_key: u32) -> DispatchResult { + for i in 0..=max_key { + TestMap::::insert(i, ()); + } + Ok(()) + } + + /// Removes the value associated with `key` from `TestMap`. + #[pallet::weight(0)] + pub fn remove_value_from_map(_: OriginFor, key: u32) -> DispatchResult { + TestMap::::remove(key); + Ok(()) + } } #[derive(frame_support::DefaultNoBound)] @@ -80,12 +112,17 @@ pub mod pallet { pub struct GenesisConfig { #[serde(skip)] pub _config: core::marker::PhantomData, + pub blocks_per_pov: Option, } #[pallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { sp_io::storage::set(TEST_RUNTIME_UPGRADE_KEY, &[1, 2, 3, 4]); + + if let Some(blocks_per_pov) = self.blocks_per_pov { + crate::BlocksPerPoV::set(&blocks_per_pov); + } } } } diff --git a/cumulus/test/service/benches/validate_block.rs b/cumulus/test/service/benches/validate_block.rs index ecfc824b571fa..e2ae6aa9dbc0c 100644 --- a/cumulus/test/service/benches/validate_block.rs +++ b/cumulus/test/service/benches/validate_block.rs @@ -91,8 +91,11 @@ fn benchmark_block_validation(c: &mut Criterion) { let para_id = ParaId::from(cumulus_test_runtime::PARACHAIN_ID); let mut test_client_builder = TestClientBuilder::with_default_backend(); let genesis_init = test_client_builder.genesis_init_mut(); - *genesis_init = - cumulus_test_client::GenesisParameters { endowed_accounts: account_ids, wasm: None }; + *genesis_init = cumulus_test_client::GenesisParameters { + endowed_accounts: account_ids, + wasm: None, + blocks_per_pov: None, + }; let client = test_client_builder.build_with_native_executor(None).0; let (max_transfer_count, extrinsics) = create_extrinsics(&client, &src_accounts, &dst_accounts); diff --git a/cumulus/test/service/benches/validate_block_glutton.rs b/cumulus/test/service/benches/validate_block_glutton.rs index 06ad739965146..36bcea760b84e 100644 --- a/cumulus/test/service/benches/validate_block_glutton.rs +++ b/cumulus/test/service/benches/validate_block_glutton.rs @@ -63,7 +63,11 @@ fn benchmark_block_validation(c: &mut Criterion) { let endowed_accounts = vec![AccountId::from(Alice.public())]; let mut test_client_builder = TestClientBuilder::with_default_backend(); let genesis_init = test_client_builder.genesis_init_mut(); - *genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts, wasm: None }; + *genesis_init = cumulus_test_client::GenesisParameters { + endowed_accounts, + wasm: None, + blocks_per_pov: None, + }; let client = test_client_builder.build_with_native_executor(None).0; diff --git a/cumulus/test/service/src/chain_spec.rs b/cumulus/test/service/src/chain_spec.rs index 1ad21fde663a3..bc30301de5038 100644 --- a/cumulus/test/service/src/chain_spec.rs +++ b/cumulus/test/service/src/chain_spec.rs @@ -30,6 +30,7 @@ pub fn get_chain_spec_with_extra_endowed( id: Option, extra_endowed_accounts: Vec, code: &[u8], + blocks_per_pov: Option, ) -> GenericChainSpec { let runtime_caller = GenesisConfigBuilderRuntimeCaller::::new(code); let mut development_preset = runtime_caller @@ -51,6 +52,9 @@ pub fn get_chain_spec_with_extra_endowed( let mut patch_json = json!({ "balances": { "balances": all_balances, + }, + "testPallet": { + "blocksPerPov": blocks_per_pov, } }); @@ -62,6 +66,7 @@ pub fn get_chain_spec_with_extra_endowed( "parachainInfo": { "parachainId": id, }, + }), ); }; @@ -82,6 +87,7 @@ pub fn get_chain_spec(id: Option) -> GenericChainSpec { id, Default::default(), cumulus_test_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + None, ) } @@ -92,6 +98,7 @@ pub fn get_elastic_scaling_chain_spec(id: Option) -> GenericChainSpec { Default::default(), cumulus_test_runtime::elastic_scaling::WASM_BINARY .expect("WASM binary was not built, please build it!"), + None, ) } @@ -101,6 +108,7 @@ pub fn get_relay_parent_offset_chain_spec(id: Option) -> GenericChainSpe Default::default(), cumulus_test_runtime::relay_parent_offset::WASM_BINARY .expect("WASM binary was not built, please build it!"), + None, ) } @@ -111,6 +119,7 @@ pub fn get_elastic_scaling_500ms_chain_spec(id: Option) -> GenericChainS Default::default(), cumulus_test_runtime::elastic_scaling_500ms::WASM_BINARY .expect("WASM binary was not built, please build it!"), + None, ) } @@ -121,6 +130,7 @@ pub fn get_elastic_scaling_mvp_chain_spec(id: Option) -> GenericChainSpe Default::default(), cumulus_test_runtime::elastic_scaling_mvp::WASM_BINARY .expect("WASM binary was not built, please build it!"), + None, ) } @@ -130,6 +140,7 @@ pub fn get_elastic_scaling_multi_block_slot_chain_spec(id: Option) -> Ge Default::default(), cumulus_test_runtime::elastic_scaling_multi_block_slot::WASM_BINARY .expect("WASM binary was not built, please build it!"), + None, ) } @@ -139,5 +150,6 @@ pub fn get_sync_backing_chain_spec(id: Option) -> GenericChainSpec { Default::default(), cumulus_test_runtime::sync_backing::WASM_BINARY .expect("WASM binary was not built, please build it!"), + None, ) } diff --git a/cumulus/test/service/src/lib.rs b/cumulus/test/service/src/lib.rs index 517c127815f5a..aaa2359e1ebda 100644 --- a/cumulus/test/service/src/lib.rs +++ b/cumulus/test/service/src/lib.rs @@ -34,7 +34,6 @@ use cumulus_client_consensus_aura::{ }, ImportQueueParams, }; -use cumulus_client_consensus_proposer::Proposer; use prometheus::Registry; use runtime::AccountId; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; @@ -289,6 +288,7 @@ async fn build_relay_chain_interface( }, None, polkadot_service::CollatorOverseerGen, + Some("Relaychain"), ) .map_err(|e| RelayChainError::Application(Box::new(e) as Box<_>))?, cumulus_client_cli::RelayChainMode::ExternalRpc(rpc_target_urls) => @@ -474,14 +474,13 @@ where }) .await; } else { - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( + let proposer = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), transaction_pool.clone(), prometheus_registry.as_ref(), None, ); - let proposer = Proposer::new(proposer_factory); let collator_service = CollatorService::new( client.clone(), @@ -842,6 +841,7 @@ pub fn node_config( Some(para_id), endowed_accounts, cumulus_test_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + None, )); let mut storage = spec.as_storage_builder().build_storage().expect("could not build storage"); diff --git a/cumulus/xcm/xcm-emulator/Cargo.toml b/cumulus/xcm/xcm-emulator/Cargo.toml index a57df58b03ec6..94da0f9b4b1e2 100644 --- a/cumulus/xcm/xcm-emulator/Cargo.toml +++ b/cumulus/xcm/xcm-emulator/Cargo.toml @@ -15,8 +15,8 @@ workspace = true array-bytes = { workspace = true } codec = { workspace = true, default-features = true } impl-trait-for-tuples = { workspace = true } -log = { workspace = true } paste = { workspace = true, default-features = true } +tracing = { workspace = true } # Substrate frame-support = { workspace = true, default-features = true } diff --git a/cumulus/xcm/xcm-emulator/src/lib.rs b/cumulus/xcm/xcm-emulator/src/lib.rs index a4d40fa87acee..6ab5366b04035 100644 --- a/cumulus/xcm/xcm-emulator/src/lib.rs +++ b/cumulus/xcm/xcm-emulator/src/lib.rs @@ -18,7 +18,6 @@ extern crate alloc; pub use array_bytes; pub use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; -pub use log; pub use paste; pub use std::{ any::type_name, @@ -29,6 +28,7 @@ pub use std::{ ops::Deref, sync::{Arc, LazyLock, Mutex}, }; +pub use tracing; // Substrate pub use alloc::collections::vec_deque::VecDeque; @@ -552,7 +552,7 @@ macro_rules! __impl_test_ext_for_relay_chain { // Execute let r = $local_ext.with(|v| { - $crate::log::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); + $crate::tracing::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); v.borrow_mut().execute_with(execute) }); @@ -578,7 +578,7 @@ macro_rules! __impl_test_ext_for_relay_chain { // log events Self::events().iter().for_each(|event| { - $crate::log::info!(target: concat!("events::", stringify!($name)), "{:?}", event); + $crate::tracing::info!(target: concat!("events::", stringify!($name)), ?event, "Event emitted"); }); // clean events @@ -904,7 +904,7 @@ macro_rules! __impl_test_ext_for_parachain { // Execute let r = $local_ext.with(|v| { - $crate::log::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); + $crate::tracing::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); v.borrow_mut().execute_with(execute) }); @@ -952,7 +952,7 @@ macro_rules! __impl_test_ext_for_parachain { // log events ::events().iter().for_each(|event| { - $crate::log::info!(target: concat!("events::", stringify!($name)), "{:?}", event); + $crate::tracing::info!(target: concat!("events::", stringify!($name)), ?event, "Event emitted"); }); // clean events @@ -1107,7 +1107,7 @@ macro_rules! decl_test_networks { let messages = msgs.clone().iter().map(|(block, message)| { (*block, $crate::array_bytes::bytes2hex("0x", message)) }).collect::>(); - $crate::log::info!(target: concat!("xcm::dmp::", stringify!($name)) , "Downward messages processed by para_id {:?}: {:?}", &to_para_id, messages); + $crate::tracing::info!(target: concat!("xcm::dmp::", stringify!($name)), ?to_para_id, ?messages, "Downward messages processed"); $crate::DMP_DONE.with(|b| b.borrow_mut().get_mut(Self::name()).unwrap().push_back((to_para_id, block, msg))); } } @@ -1133,7 +1133,7 @@ macro_rules! decl_test_networks { let messages = messages.clone().iter().map(|(para_id, relay_block_number, message)| { (*para_id, *relay_block_number, $crate::array_bytes::bytes2hex("0x", message)) }).collect::>(); - $crate::log::info!(target: concat!("xcm::hrmp::", stringify!($name)), "Horizontal messages processed by para_id {:?}: {:?}", &to_para_id, &messages); + $crate::tracing::info!(target: concat!("xcm::hrmp::", stringify!($name)), ?to_para_id, ?messages, "Horizontal messages processed"); } )* } @@ -1153,7 +1153,7 @@ macro_rules! decl_test_networks { ); }); let message = $crate::array_bytes::bytes2hex("0x", msg.clone()); - $crate::log::info!(target: concat!("xcm::ump::", stringify!($name)) , "Upward message processed from para_id {:?}: {:?}", &from_para_id, &message); + $crate::tracing::info!(target: concat!("xcm::ump::", stringify!($name)), ?from_para_id, ?message, "Upward message processed"); } } @@ -1173,7 +1173,7 @@ macro_rules! decl_test_networks { <::Source as TestExt>::ext_wrapper(|| { <::Handler as BridgeMessageHandler>::notify_source_message_delivery(msg.lane_id.clone()); }); - $crate::log::info!(target: concat!("bridge::", stringify!($name)) , "Bridged message processed {:?}", msg); + $crate::tracing::info!(target: concat!("bridge::", stringify!($name)), ?msg, "Bridged message processed"); } } } @@ -1394,7 +1394,7 @@ macro_rules! assert_expected_events { if !messages.is_empty() { // Log all events (since they won't be logged after the panic). <$chain as $crate::Chain>::events().iter().for_each(|event| { - $crate::log::info!(target: concat!("events::", stringify!($chain)), "{:?}", event); + $crate::tracing::info!(target: concat!("events::", stringify!($chain)), ?event, "Event emitted"); }); panic!("{}", messages.concat()) } diff --git a/cumulus/zombienet/zombienet-sdk-helpers/src/lib.rs b/cumulus/zombienet/zombienet-sdk-helpers/src/lib.rs index 92058c65be1cd..aaf3d70c44264 100644 --- a/cumulus/zombienet/zombienet-sdk-helpers/src/lib.rs +++ b/cumulus/zombienet/zombienet-sdk-helpers/src/lib.rs @@ -14,7 +14,7 @@ use tokio::{ use zombienet_sdk::subxt::{ self, blocks::Block, - config::{substrate::DigestItem, ExtrinsicParams}, + config::{signed_extensions::CheckMortalityParams, substrate::DigestItem, ExtrinsicParams}, dynamic::Value, events::Events, ext::scale_value::value, @@ -295,15 +295,26 @@ fn extract_relay_parent_storage_root( } } -pub async fn submit_extrinsic_and_wait_for_finalization_success>( - client: &OnlineClient, +/// Submits the given `call` as transaction and waits for it successful finalization. +/// +/// The transaction is send as immortal transaction. +pub async fn submit_extrinsic_and_wait_for_finalization_success>( + client: &OnlineClient, call: &DynamicPayload, signer: &S, -) -> Result<(), anyhow::Error> -where - >::Params: Default, -{ - let mut tx = client.tx().sign_and_submit_then_watch_default(call, signer).await?; +) -> Result<(), anyhow::Error> { + let mut extensions: <::ExtrinsicParams as ExtrinsicParams< + PolkadotConfig, + >>::Params = Default::default(); + + extensions.4 = CheckMortalityParams::::immortal(); + + let mut tx = client + .tx() + .create_signed(call, signer, extensions) + .await? + .submit_and_watch() + .await?; // Below we use the low level API to replicate the `wait_for_in_block` behaviour // which was removed in subxt 0.33.0. See https://github.com/paritytech/subxt/pull/1237. @@ -327,18 +338,18 @@ where Ok(()) } +/// Submits the given `call` as transaction and waits `timeout_secs` for it successful finalization. +/// +/// If the transaction does not reach the finalized state in `timeout_secs` an error is returned. +/// The transaction is send as immortal transaction. pub async fn submit_extrinsic_and_wait_for_finalization_success_with_timeout< - C: Config, - S: Signer, + S: Signer, >( - client: &OnlineClient, + client: &OnlineClient, call: &DynamicPayload, signer: &S, timeout_secs: impl Into, -) -> Result<(), anyhow::Error> -where - >::Params: Default, -{ +) -> Result<(), anyhow::Error> { let secs = timeout_secs.into(); let res = tokio::time::timeout( Duration::from_secs(secs), @@ -346,17 +357,15 @@ where ) .await; - if let Ok(inner_res) = res { - match inner_res { - Ok(_) => Ok(()), - Err(e) => Err(anyhow!("Error waiting for metric: {}", e)), - } - } else { + match res { + Ok(Ok(_)) => Ok(()), + Ok(Err(e)) => Err(anyhow!("Error waiting for metric: {}", e)), // timeout - Err(anyhow!("Timeout ({secs}), waiting for extrinsic finalization")) + Err(_) => Err(anyhow!("Timeout ({secs}), waiting for extrinsic finalization")), } } +/// Asserts that the given `para_id` is registered at the relay chain. pub async fn assert_para_is_registered( relay_client: &OnlineClient, para_id: ParaId, @@ -392,5 +401,6 @@ pub async fn assert_para_is_registered( } blocks_cnt += 1; } + Err(anyhow!("No more blocks to check")) } diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs index bf806e9911f84..5d04a3336903a 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs @@ -20,7 +20,6 @@ use zombienet_sdk::{ const PARA_ID_1: u32 = 2100; const PARA_ID_2: u32 = 2000; -// TODO #[tokio::test(flavor = "multi_thread")] async fn elastic_scaling_slot_based_authoring() -> Result<(), anyhow::Error> { let _ = env_logger::try_init_from_env( @@ -60,10 +59,11 @@ async fn elastic_scaling_slot_based_authoring() -> Result<(), anyhow::Error> { for (node, block_cnt) in [(collator_single_core, 20.0), (collator_elastic, 40.0)] { log::info!("Checking block production for {}", node.name()); - assert!(node - .wait_metric_with_timeout(BEST_BLOCK_METRIC, |b| b >= block_cnt, 225u64) + node.wait_metric_with_timeout(BEST_BLOCK_METRIC, |b| b >= block_cnt, 225u64) .await - .is_ok()); + .unwrap_or_else(|e| { + panic!("Failed to reach {block_cnt} blocks with node {}: {e}", node.name()) + }); } // We want to make sure that none of the consensus hook checks fail, even if the chain makes diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_extrinsic_get_finalized.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_extrinsic_get_finalized.rs index e362f25a6c9d9..f3a7a261aead9 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_extrinsic_get_finalized.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_extrinsic_get_finalized.rs @@ -8,7 +8,7 @@ use crate::utils::{initialize_network, BEST_BLOCK_METRIC}; use cumulus_zombienet_sdk_helpers::submit_extrinsic_and_wait_for_finalization_success_with_timeout; use zombienet_orchestrator::network::node::{LogLineCount, LogLineCountOptions}; use zombienet_sdk::{ - subxt::{self, dynamic::Value, OnlineClient, SubstrateConfig}, + subxt::{self, dynamic::Value, OnlineClient, PolkadotConfig}, subxt_signer::sr25519::dev, NetworkConfig, NetworkConfigBuilder, }; @@ -105,7 +105,7 @@ async fn parachain_extrinsic_gets_finalized() -> Result<(), anyhow::Error> { log::info!("Ensuring parachain extrinsic gets finalized"); let call = subxt::dynamic::tx("System", "remark", vec![Value::from_bytes("xxx".as_bytes())]); - let charlie_client: OnlineClient = charlie.wait_client().await?; + let charlie_client: OnlineClient = charlie.wait_client().await?; let res = submit_extrinsic_and_wait_for_finalization_success_with_timeout( &charlie_client, diff --git a/docker/dockerfiles/polkadot/polkadot_builder.Dockerfile b/docker/dockerfiles/polkadot/polkadot_builder.Dockerfile index a5c195931377b..ab0d7c17a0776 100644 --- a/docker/dockerfiles/polkadot/polkadot_builder.Dockerfile +++ b/docker/dockerfiles/polkadot/polkadot_builder.Dockerfile @@ -1,5 +1,5 @@ # This is the build stage for Polkadot. Here we create the binary in a temporary image. -FROM docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408 as builder +FROM docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202507112050 as builder WORKDIR /polkadot COPY . /polkadot diff --git a/polkadot/node/network/collator-protocol/src/collator_side/mod.rs b/polkadot/node/network/collator-protocol/src/collator_side/mod.rs index a9d4116e132ac..1459465bd53c2 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/mod.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/mod.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use std::{ - collections::{HashMap, HashSet}, + collections::{hash_map::Entry, HashMap, HashSet}, time::Duration, }; @@ -207,6 +207,7 @@ struct CollationData { collation: Collation, core_index: CoreIndex, stats: Option, + session_index: SessionIndex, } impl CollationData { @@ -241,6 +242,8 @@ struct PerRelayParent { assignments: HashMap, /// The relay parent block number block_number: Option, + /// The session index of this relay parent. + session_index: SessionIndex, } impl PerRelayParent { @@ -248,6 +251,7 @@ impl PerRelayParent { para_id: ParaId, claim_queue: ClaimQueueSnapshot, block_number: Option, + session_index: SessionIndex, ) -> Self { let assignments = claim_queue.iter_all_claims().fold(HashMap::new(), |mut acc, (core, claims)| { @@ -263,6 +267,7 @@ impl PerRelayParent { collations: HashMap::new(), assignments, block_number, + session_index, } } } @@ -516,6 +521,7 @@ async fn distribute_collation( status: CollationStatus::Created, }, core_index, + session_index, stats: per_relay_parent .block_number .map(|n| CollationStats::new(para_head, n, &state.metrics)), @@ -1242,7 +1248,7 @@ async fn handle_network_msg( }, OurViewChange(view) => { gum::trace!(target: LOG_TARGET, ?view, "Own view change"); - handle_our_view_change(ctx, state, view).await?; + handle_our_view_change(ctx, state, view, runtime).await?; }, PeerMessage(remote, msg) => { handle_incoming_peer_message(ctx, runtime, state, remote, msg).await?; @@ -1323,16 +1329,18 @@ async fn handle_our_view_change( ctx: &mut Context, state: &mut State, view: OurView, + runtime_info: &mut RuntimeInfo, ) -> Result<()> { let Some(implicit_view) = &mut state.implicit_view else { return Ok(()) }; let Some(para_id) = state.collating_on else { return Ok(()) }; - let removed: Vec<_> = - implicit_view.leaves().map(|l| *l).filter(|h| !view.contains(h)).collect(); + let removed: Vec<_> = implicit_view.leaves().filter(|h| !view.contains(h)).copied().collect(); let added: Vec<_> = view.iter().filter(|h| !implicit_view.contains_leaf(h)).collect(); for leaf in added { - let claim_queue: ClaimQueueSnapshot = fetch_claim_queue(ctx.sender(), *leaf).await?; + let session_index = runtime_info.get_session_index_for_child(ctx.sender(), *leaf).await?; + + let claim_queue = fetch_claim_queue(ctx.sender(), *leaf).await?; implicit_view .activate_leaf(ctx.sender(), *leaf) @@ -1342,7 +1350,7 @@ async fn handle_our_view_change( let block_number = implicit_view.block_number(leaf); state .per_relay_parent - .insert(*leaf, PerRelayParent::new(para_id, claim_queue, block_number)); + .insert(*leaf, PerRelayParent::new(para_id, claim_queue, block_number, session_index)); process_block_events( ctx, @@ -1368,15 +1376,43 @@ async fn handle_our_view_change( for block_hash in allowed_ancestry { let block_number = implicit_view.block_number(block_hash); - if state.per_relay_parent.get(block_hash).is_none() { - let claim_queue = fetch_claim_queue(ctx.sender(), *block_hash).await?; - state - .per_relay_parent - .insert(*block_hash, PerRelayParent::new(para_id, claim_queue, block_number)); - } - - let per_relay_parent = - state.per_relay_parent.get_mut(block_hash).expect("Just inserted"); + let per_relay_parent = match state.per_relay_parent.entry(*block_hash) { + Entry::Vacant(entry) => { + let claim_queue = match fetch_claim_queue(ctx.sender(), *block_hash).await { + Ok(cq) => cq, + Err(error) => { + gum::debug!( + target: LOG_TARGET, + ?block_hash, + ?error, + "Failed to fetch claim queue while iterating allowed ancestry", + ); + continue + }, + }; + let session_index = + match runtime_info.get_session_index_for_child(ctx.sender(), *leaf).await { + Ok(si) => si, + Err(error) => { + gum::debug!( + target: LOG_TARGET, + ?block_hash, + ?error, + "Failed to fetch session index while iterating allowed ancestry", + ); + continue + }, + }; + + entry.insert(PerRelayParent::new( + para_id, + claim_queue, + block_number, + session_index, + )) + }, + Entry::Occupied(entry) => entry.into_mut(), + }; // Announce relevant collations to these peers. for peer_id in &peers { @@ -1394,6 +1430,8 @@ async fn handle_our_view_change( } } + let highest_session_index = state.per_relay_parent.values().map(|pr| pr.session_index).max(); + for leaf in removed { // If the leaf is deactivated it still may stay in the view as a part // of implicit ancestry. Only update the state after the hash is actually @@ -1402,14 +1440,18 @@ async fn handle_our_view_change( let pruned = implicit_view.deactivate_leaf(leaf); for removed in &pruned { - gum::debug!(target: LOG_TARGET, relay_parent = ?removed, "Removing relay parent because our view changed."); + gum::debug!( + target: LOG_TARGET, + relay_parent = ?removed, + "Removing relay parent because our view changed.", + ); if let Some(block_number) = maybe_block_number { let expired_collations = state.collation_tracker.drain_expired(block_number); process_expired_collations(expired_collations, *removed, para_id, &state.metrics); } - // Get all the collations built on top of the removed feaf. + // Get all the collations built on top of the removed leaf. let collations = state .per_relay_parent .remove(removed) @@ -1418,12 +1460,16 @@ async fn handle_our_view_change( for collation_with_core in collations.into_values() { let collation = collation_with_core.collation(); - let candidate_hash: CandidateHash = collation.receipt.hash(); + let candidate_hash = collation.receipt.hash(); state.collation_result_senders.remove(&candidate_hash); state.validator_groups_buf.remove_candidate(&candidate_hash); - process_out_of_view_collation(&mut state.collation_tracker, collation_with_core); + process_out_of_view_collation( + &mut state.collation_tracker, + collation_with_core, + highest_session_index, + ); } state.waiting_collation_fetches.remove(removed); @@ -1435,17 +1481,30 @@ async fn handle_our_view_change( fn process_out_of_view_collation( collation_tracker: &mut CollationTracker, mut collation_with_core: CollationData, + highest_session_index: Option, ) { - let collation = collation_with_core.collation(); - let candidate_hash: CandidateHash = collation.receipt.hash(); + let is_same_session = + highest_session_index.map_or(true, |hs| hs == collation_with_core.session_index); + let collation = collation_with_core.collation_mut(); + let candidate_hash = collation.receipt.hash(); match collation.status { - CollationStatus::Created => gum::warn!( - target: LOG_TARGET, - ?candidate_hash, - pov_hash = ?collation.pov.hash(), - "Collation wasn't advertised to any validator.", - ), + CollationStatus::Created => + if is_same_session { + gum::warn!( + target: LOG_TARGET, + ?candidate_hash, + pov_hash = ?collation.pov.hash(), + "Collation wasn't advertised to any validator.", + ) + } else { + gum::debug!( + target: LOG_TARGET, + ?candidate_hash, + pov_hash = ?collation.pov.hash(), + "Collation wasn't advertised because it was built on a relay chain block that is now part of an old session.", + ) + }, CollationStatus::Advertised => gum::debug!( target: LOG_TARGET, ?candidate_hash, diff --git a/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs b/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs index 8be5c4e876b5b..154b5c09f5ea8 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs @@ -44,6 +44,16 @@ pub(super) async fn update_view( .await; for _ in 0..activated { + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + tx.send(Ok(test_state.current_session_index())).unwrap(); + } + ); + // obtain the claim queue schedule. let (leaf_hash, leaf_number) = assert_matches!( overseer_recv(virtual_overseer).await, diff --git a/polkadot/node/network/collator-protocol/src/lib.rs b/polkadot/node/network/collator-protocol/src/lib.rs index b3a508285e1ee..4c366b394936a 100644 --- a/polkadot/node/network/collator-protocol/src/lib.rs +++ b/polkadot/node/network/collator-protocol/src/lib.rs @@ -45,7 +45,7 @@ mod validator_side; mod validator_side_experimental; const LOG_TARGET: &'static str = "parachain::collator-protocol"; -const LOG_TARGET_STATS: &'static str = "parachain::collator-protocol-stats"; +const LOG_TARGET_STATS: &'static str = "parachain::collator-protocol::stats"; /// A collator eviction policy - how fast to evict collators which are inactive. #[derive(Debug, Clone, Copy)] diff --git a/polkadot/node/primitives/src/lib.rs b/polkadot/node/primitives/src/lib.rs index 8c2e88c53fcac..3a187ce5e03b2 100644 --- a/polkadot/node/primitives/src/lib.rs +++ b/polkadot/node/primitives/src/lib.rs @@ -62,7 +62,7 @@ pub use disputes::{ /// relatively rare. /// /// The associated worker binaries should use the same version as the node that spawns them. -pub const NODE_VERSION: &'static str = "1.18.5"; +pub const NODE_VERSION: &'static str = "1.19.0"; // For a 16-ary Merkle Prefix Trie, we can expect at most 16 32-byte hashes per node // plus some overhead: diff --git a/polkadot/node/service/chain-specs/westend.json b/polkadot/node/service/chain-specs/westend.json index f0ac88f292878..f3da752d1ee32 100644 --- a/polkadot/node/service/chain-specs/westend.json +++ b/polkadot/node/service/chain-specs/westend.json @@ -16,8 +16,6 @@ "/dns/westend.bootnode.amforc.com/tcp/29999/wss/p2p/12D3KooWAPmR7rbm2axPjHzF51yvQNDM5GvWfkF5BTV44Y5vJ3ct", "/dns/westend.bootnodes.polkadotters.com/tcp/30308/p2p/12D3KooWHPHb64jXMtSRJDrYFATWeLnvChL8NtWVttY67DCH1eC5", "/dns/westend.bootnodes.polkadotters.com/tcp/30310/wss/p2p/12D3KooWHPHb64jXMtSRJDrYFATWeLnvChL8NtWVttY67DCH1eC5", - "/dns/boot.gatotech.network/tcp/33300/p2p/12D3KooWQGR1vUhoy6mvQorFp3bZFn6NNezhQZ6NWnVV7tpFgoPd", - "/dns/boot.gatotech.network/tcp/35300/wss/p2p/12D3KooWQGR1vUhoy6mvQorFp3bZFn6NNezhQZ6NWnVV7tpFgoPd", "/dns/boot.metaspan.io/tcp/33012/p2p/12D3KooWNTau7iG4G9cUJSwwt2QJP1W88pUf2SgqsHjRU2RL8pfa", "/dns/boot.metaspan.io/tcp/33015/ws/p2p/12D3KooWNTau7iG4G9cUJSwwt2QJP1W88pUf2SgqsHjRU2RL8pfa", "/dns/boot.metaspan.io/tcp/33016/wss/p2p/12D3KooWNTau7iG4G9cUJSwwt2QJP1W88pUf2SgqsHjRU2RL8pfa", diff --git a/polkadot/node/test/service/src/lib.rs b/polkadot/node/test/service/src/lib.rs index 554f167e8ad27..e75aa5948b277 100644 --- a/polkadot/node/test/service/src/lib.rs +++ b/polkadot/node/test/service/src/lib.rs @@ -73,60 +73,40 @@ pub use polkadot_service::{FullBackend, GetLastTimestamp}; use sc_service::config::{ExecutorConfiguration, RpcConfiguration}; /// Create a new full node. -#[sc_tracing::logging::prefix_logs_with(config.network.node_name.as_str())] +#[sc_tracing::logging::prefix_logs_with(custom_log_prefix.unwrap_or(config.network.node_name.as_str()))] pub fn new_full( config: Configuration, is_parachain_node: IsParachainNode, workers_path: Option, overseer_gen: OverseerGenerator, + custom_log_prefix: Option<&'static str>, ) -> Result { let workers_path = Some(workers_path.unwrap_or_else(get_relative_workers_path_for_test)); + let params = polkadot_service::NewFullParams { + is_parachain_node, + enable_beefy: true, + force_authoring_backoff: false, + telemetry_worker_handle: None, + node_version: None, + secure_validator_mode: false, + workers_path, + workers_names: None, + overseer_gen, + overseer_message_channel_capacity_override: None, + malus_finality_delay: None, + hwbench: None, + execute_workers_max_num: None, + prepare_workers_hard_max_num: None, + prepare_workers_soft_max_num: None, + keep_finalized_for: None, + }; + match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => - polkadot_service::new_full::<_, sc_network::NetworkWorker<_, _>>( - config, - polkadot_service::NewFullParams { - is_parachain_node, - enable_beefy: true, - force_authoring_backoff: false, - telemetry_worker_handle: None, - node_version: None, - secure_validator_mode: false, - workers_path, - workers_names: None, - overseer_gen, - overseer_message_channel_capacity_override: None, - malus_finality_delay: None, - hwbench: None, - execute_workers_max_num: None, - prepare_workers_hard_max_num: None, - prepare_workers_soft_max_num: None, - keep_finalized_for: None, - }, - ), + polkadot_service::new_full::<_, sc_network::NetworkWorker<_, _>>(config, params), sc_network::config::NetworkBackendType::Litep2p => - polkadot_service::new_full::<_, sc_network::Litep2pNetworkBackend>( - config, - polkadot_service::NewFullParams { - is_parachain_node, - enable_beefy: true, - force_authoring_backoff: false, - telemetry_worker_handle: None, - node_version: None, - secure_validator_mode: false, - workers_path, - workers_names: None, - overseer_gen, - overseer_message_channel_capacity_override: None, - malus_finality_delay: None, - hwbench: None, - execute_workers_max_num: None, - prepare_workers_hard_max_num: None, - prepare_workers_soft_max_num: None, - keep_finalized_for: None, - }, - ), + polkadot_service::new_full::<_, sc_network::Litep2pNetworkBackend>(config, params), } } @@ -281,6 +261,7 @@ pub async fn run_validator_node( IsParachainNode::No, worker_program_path, polkadot_service::ValidatorOverseerGen, + None, ) .expect("could not create Polkadot test service"); @@ -318,6 +299,7 @@ pub async fn run_collator_node( IsParachainNode::Collator(collator_pair), None, polkadot_service::CollatorOverseerGen, + None, ) .expect("could not create Polkadot test service"); diff --git a/polkadot/parachain/src/primitives.rs b/polkadot/parachain/src/primitives.rs index 73d060c1adaca..e3f2b85d95069 100644 --- a/polkadot/parachain/src/primitives.rs +++ b/polkadot/parachain/src/primitives.rs @@ -190,6 +190,7 @@ impl From for Id { } } +#[cfg(any(feature = "std", feature = "runtime-benchmarks"))] impl From for Id { fn from(x: usize) -> Self { // can't panic, so need to truncate diff --git a/polkadot/primitives/src/v8/mod.rs b/polkadot/primitives/src/v8/mod.rs index 060c6fe97ca99..71cce1ae8e0b0 100644 --- a/polkadot/primitives/src/v8/mod.rs +++ b/polkadot/primitives/src/v8/mod.rs @@ -1351,7 +1351,7 @@ pub struct AbridgedHostConfiguration { /// Abridged version of `HrmpChannel` (from the `Hrmp` parachains host runtime module) meant to be /// used by a parachain or PDK such as cumulus. #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(PartialEq))] +#[cfg_attr(feature = "std", derive(Default, PartialEq))] pub struct AbridgedHrmpChannel { /// The maximum number of messages that can be pending in the channel at once. pub max_capacity: u32, diff --git a/polkadot/primitives/src/vstaging/mod.rs b/polkadot/primitives/src/vstaging/mod.rs index cccd05d2b3ec8..da432fd11ad69 100644 --- a/polkadot/primitives/src/vstaging/mod.rs +++ b/polkadot/primitives/src/vstaging/mod.rs @@ -487,7 +487,7 @@ pub struct ClaimQueueOffset(pub u8); pub type ApprovedPeerId = BoundedVec>; /// Signals that a parachain can send to the relay chain via the UMP queue. -#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, Debug)] pub enum UMPSignal { /// A message sent by a parachain to select the core the candidate is committed to. /// Relay chain validators, in particular backers, use the `CoreSelector` and @@ -594,9 +594,14 @@ pub enum CommittedCandidateReceiptError { /// The core index in commitments doesn't match the one in descriptor #[cfg_attr( feature = "std", - error("The core index in commitments doesn't match the one in descriptor") + error("The core index in commitments ({commitments:?}) doesn't match the one in descriptor ({descriptor:?})") )] - CoreIndexMismatch, + CoreIndexMismatch { + /// The core index as found in the descriptor. + descriptor: CoreIndex, + /// The core index as found in the commitments. + commitments: CoreIndex, + }, /// The core selector or claim queue offset is invalid. #[cfg_attr(feature = "std", error("The core selector or claim queue offset is invalid"))] InvalidSelectedCore, @@ -787,7 +792,10 @@ impl CommittedCandidateReceiptV2 { .copied()?; if core_index != descriptor_core_index { - return Err(CommittedCandidateReceiptError::CoreIndexMismatch) + return Err(CommittedCandidateReceiptError::CoreIndexMismatch { + descriptor: descriptor_core_index, + commitments: core_index, + }) } Ok(()) @@ -1368,7 +1376,10 @@ mod candidate_receipt_tests { new_ccr.descriptor.set_core_index(CoreIndex(1)); assert_eq!( new_ccr.parse_ump_signals(&cq), - Err(CommittedCandidateReceiptError::CoreIndexMismatch) + Err(CommittedCandidateReceiptError::CoreIndexMismatch { + descriptor: CoreIndex(1), + commitments: CoreIndex(0), + }) ); } diff --git a/polkadot/runtime/common/src/claims/mod.rs b/polkadot/runtime/common/src/claims/mod.rs index 1b39845249e69..409391473c70e 100644 --- a/polkadot/runtime/common/src/claims/mod.rs +++ b/polkadot/runtime/common/src/claims/mod.rs @@ -174,6 +174,12 @@ impl<'de> Deserialize<'de> for EthereumAddress { } } +impl AsRef<[u8]> for EthereumAddress { + fn as_ref(&self) -> &[u8] { + &self.0[..] + } +} + #[derive(Encode, Decode, DecodeWithMemTracking, Clone, TypeInfo, MaxEncodedLen)] pub struct EcdsaSignature(pub [u8; 65]); diff --git a/polkadot/runtime/common/src/paras_registrar/mod.rs b/polkadot/runtime/common/src/paras_registrar/mod.rs index 9f4c529e35a27..f889aa8e7bd5c 100644 --- a/polkadot/runtime/common/src/paras_registrar/mod.rs +++ b/polkadot/runtime/common/src/paras_registrar/mod.rs @@ -38,7 +38,7 @@ use polkadot_runtime_parachains::{ }; use crate::traits::{OnSwap, Registrar}; -use codec::{Decode, Encode}; +use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; pub use pallet::*; use polkadot_runtime_parachains::paras::{OnNewHead, ParaKind}; use scale_info::TypeInfo; @@ -47,15 +47,26 @@ use sp_runtime::{ RuntimeDebug, }; -#[derive(Encode, Decode, Clone, PartialEq, Eq, Default, RuntimeDebug, TypeInfo)] +#[derive( + Encode, + Decode, + Clone, + PartialEq, + Eq, + Default, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + DecodeWithMemTracking, +)] pub struct ParaInfo { /// The account that has placed a deposit for registering this para. - pub(crate) manager: Account, + pub manager: Account, /// The amount reserved by the `manager` account for the registration. - deposit: Balance, + pub deposit: Balance, /// Whether the para registration should be locked from being controlled by the manager. /// None means the lock had not been explicitly set, and should be treated as false. - locked: Option, + pub locked: Option, } impl ParaInfo { diff --git a/polkadot/runtime/parachains/src/inclusion/mod.rs b/polkadot/runtime/parachains/src/inclusion/mod.rs index 6bca327984d80..ffc52f7856f58 100644 --- a/polkadot/runtime/parachains/src/inclusion/mod.rs +++ b/polkadot/runtime/parachains/src/inclusion/mod.rs @@ -197,6 +197,11 @@ pub trait RewardValidators { fn reward_bitfields(validators: impl IntoIterator); } +impl RewardValidators for () { + fn reward_backing(_: impl IntoIterator) {} + fn reward_bitfields(_: impl IntoIterator) {} +} + /// Reads the footprint of queues for a specific origin type. pub trait QueueFootprinter { type Origin; diff --git a/polkadot/runtime/rococo/constants/src/lib.rs b/polkadot/runtime/rococo/constants/src/lib.rs index 47b50bf6c1069..2c4fdbb37bad6 100644 --- a/polkadot/runtime/rococo/constants/src/lib.rs +++ b/polkadot/runtime/rococo/constants/src/lib.rs @@ -103,9 +103,15 @@ pub mod fee { /// System Parachains. pub mod system_parachain { - use polkadot_primitives::Id; + use frame_support::parameter_types; + use polkadot_primitives::Id as ParaId; use xcm_builder::IsChildSystemParachain; + parameter_types! { + pub AssetHubParaId: ParaId = ASSET_HUB_ID.into(); + pub PeopleParaId: ParaId = PEOPLE_ID.into(); + } + /// Network's Asset Hub parachain ID. pub const ASSET_HUB_ID: u32 = 1000; /// Contracts parachain ID. @@ -120,7 +126,7 @@ pub mod system_parachain { pub const BROKER_ID: u32 = 1005; /// All system parachains of Rococo. - pub type SystemParachains = IsChildSystemParachain; + pub type SystemParachains = IsChildSystemParachain; /// Coretime constants pub mod coretime { diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 88c7462ebac55..6c9b97f05a967 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -184,7 +184,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("rococo"), impl_name: alloc::borrow::Cow::Borrowed("parity-rococo-v2.0"), authoring_version: 0, - spec_version: 1_018_001, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 26, diff --git a/polkadot/runtime/westend/constants/src/lib.rs b/polkadot/runtime/westend/constants/src/lib.rs index f69c85e699e35..012250700d26f 100644 --- a/polkadot/runtime/westend/constants/src/lib.rs +++ b/polkadot/runtime/westend/constants/src/lib.rs @@ -98,9 +98,15 @@ pub mod fee { /// System Parachains. pub mod system_parachain { - use polkadot_primitives::Id; + use frame_support::parameter_types; + use polkadot_primitives::Id as ParaId; use xcm_builder::IsChildSystemParachain; + parameter_types! { + pub AssetHubParaId: ParaId = ASSET_HUB_ID.into(); + pub PeopleParaId: ParaId = PEOPLE_ID.into(); + } + /// Network's Asset Hub parachain ID. pub const ASSET_HUB_ID: u32 = 1000; /// Collectives parachain ID. @@ -117,7 +123,7 @@ pub mod system_parachain { pub const ASSET_HUB_NEXT_ID: u32 = 1100; /// All system parachains of Westend. - pub type SystemParachains = IsChildSystemParachain; + pub type SystemParachains = IsChildSystemParachain; /// Coretime constants pub mod coretime { diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index d16d582b98920..6bba8e6d17644 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -174,7 +174,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("westend"), impl_name: alloc::borrow::Cow::Borrowed("parity-westend"), authoring_version: 2, - spec_version: 1_018_012, + spec_version: 1_019_002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 27, diff --git a/polkadot/scripts/list-syscalls/execute-worker-syscalls b/polkadot/scripts/list-syscalls/execute-worker-syscalls index 4b22f67878648..4df4d0a998d77 100644 --- a/polkadot/scripts/list-syscalls/execute-worker-syscalls +++ b/polkadot/scripts/list-syscalls/execute-worker-syscalls @@ -13,8 +13,6 @@ 13 (rt_sigaction) 14 (rt_sigprocmask) 15 (rt_sigreturn) -16 (ioctl) -19 (readv) 20 (writev) 22 (pipe) 24 (sched_yield) @@ -25,7 +23,6 @@ 41 (socket) 42 (connect) 45 (recvfrom) -46 (sendmsg) 56 (clone) 57 (fork) 60 (exit) @@ -42,7 +39,6 @@ 97 (getrlimit) 98 (getrusage) 99 (sysinfo) -102 (getuid) 110 (getppid) 131 (sigaltstack) 140 (getpriority) diff --git a/polkadot/scripts/list-syscalls/prepare-worker-syscalls b/polkadot/scripts/list-syscalls/prepare-worker-syscalls index fd46a788537dc..bb4578f6d7623 100644 --- a/polkadot/scripts/list-syscalls/prepare-worker-syscalls +++ b/polkadot/scripts/list-syscalls/prepare-worker-syscalls @@ -71,3 +71,4 @@ 302 (prlimit64) 309 (getcpu) 318 (getrandom) +319 (memfd_create) diff --git a/polkadot/xcm/xcm-builder/src/universal_exports.rs b/polkadot/xcm/xcm-builder/src/universal_exports.rs index abdd7e956bdd3..cb80f52a00410 100644 --- a/polkadot/xcm/xcm-builder/src/universal_exports.rs +++ b/polkadot/xcm/xcm-builder/src/universal_exports.rs @@ -331,6 +331,18 @@ impl InspectMessageQueues + for UnpaidRemoteExporter +{ + fn clear_messages() {} + + /// This router needs to implement `InspectMessageQueues` but doesn't have to + /// return any messages, since it just reuses the `XcmpQueue` router. + fn get_messages() -> Vec<(VersionedLocation, Vec>)> { + Vec::new() + } +} + /// Implementation of `SendXcm` which wraps the message inside an `ExportMessage` instruction /// and sends it to a destination known to be able to handle it. /// diff --git a/polkadot/xcm/xcm-executor/src/lib.rs b/polkadot/xcm/xcm-executor/src/lib.rs index 6b9837d627e0f..b4efab9349a4b 100644 --- a/polkadot/xcm/xcm-executor/src/lib.rs +++ b/polkadot/xcm/xcm-executor/src/lib.rs @@ -562,6 +562,10 @@ impl XcmExecutor { // If there are any leftover `fees`, merge them with `holding`. if !self.fees.is_empty() { let leftover_fees = self.fees.saturating_take(Wild(All)); + tracing::trace!( + target: "xcm::refund_surplus", + ?leftover_fees, + ); self.holding.subsume_assets(leftover_fees); } tracing::trace!( diff --git a/prdoc/pr_7321.prdoc b/prdoc/pr_7321.prdoc new file mode 100644 index 0000000000000..3caf43a3c901c --- /dev/null +++ b/prdoc/pr_7321.prdoc @@ -0,0 +1,39 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Update system parachains XCM benchmarking for sibling parachain delivery +doc: + - audience: Runtime Dev + description: | + Updates cumulus::parachain runtime XCM benchmarking to support asset delivery to system + parachains instead of relay chain. + +crates: + - name: asset-hub-rococo-runtime + bump: patch + - name: asset-hub-westend-runtime + bump: major + - name: bp-bridge-hub-rococo + bump: patch + - name: bridge-hub-rococo-runtime + bump: patch + - name: bridge-hub-westend-integration-tests + bump: patch + - name: bridge-hub-westend-runtime + bump: patch + - name: collectives-westend-runtime + bump: patch + - name: coretime-rococo-runtime + bump: patch + - name: coretime-westend-runtime + bump: major + - name: people-rococo-runtime + bump: patch + - name: people-westend-runtime + bump: major + - name: testnet-parachains-constants + bump: patch + - name: rococo-runtime-constants + bump: minor + - name: westend-runtime-constants + bump: minor diff --git a/prdoc/pr_8172.prdoc b/prdoc/pr_8172.prdoc new file mode 100644 index 0000000000000..19e946e79977c --- /dev/null +++ b/prdoc/pr_8172.prdoc @@ -0,0 +1,40 @@ +title: Ignore trie nodes while recording a proof +doc: +- audience: Node Dev + description: |- + This pull requests implements support for ignoring trie nodes while recording a proof. It directly includes the feature into `basic-authorship` to later make use of it in Cumulus for multi-block PoVs. + + The idea behind this is when you have multiple blocks per PoV that trie nodes accessed or produced by a block before (in the same `PoV`), are not required to be added to the storage proof again. So, all the blocks in one `PoV` basically share the same storage proof. + This also impacts things like storage weight reclaim, because ignored trie node do not contribute a to the storage proof size (similar to when this would happen in the same block). + + In your node you only need to do the following change: + ```diff + -let proposer = Proposer::new(proposer_factory); + + + ``` + + The `cumulus_client_consensus_proposer::Proposer` type was removed. + +crates: +- name: cumulus-pallet-parachain-system + bump: minor + validate: false +- name: polkadot-primitives + bump: patch +- name: cumulus-client-consensus-proposer + bump: major +- name: sc-basic-authorship + bump: major +- name: sc-block-builder + bump: major +- name: sp-api-proc-macro + bump: major +- name: sp-api + bump: major +- name: sp-trie + bump: minor +- name: polkadot-omni-node-lib + bump: patch + validate: false +- name: sc-consensus + bump: minor diff --git a/prdoc/pr_8714.prdoc b/prdoc/pr_8714.prdoc new file mode 100644 index 0000000000000..7e73cbca4a654 --- /dev/null +++ b/prdoc/pr_8714.prdoc @@ -0,0 +1,16 @@ +title: Upgrade wasmtime +doc: +- audience: Node Dev + description: This upgrades wasmtime to the latest version and also fixes backtraces + for `debug` builds. +crates: +- name: sc-executor-wasmtime + bump: major +- name: substrate-wasm-builder + bump: major +- name: sc-mixnet + bump: major +- name: sp-state-machine + bump: major +- name: polkadot-sdk + bump: major diff --git a/prdoc/pr_8802.prdoc b/prdoc/pr_8802.prdoc new file mode 100644 index 0000000000000..008eb5aefc2ff --- /dev/null +++ b/prdoc/pr_8802.prdoc @@ -0,0 +1,19 @@ +title: '[AHM] Staking async e2e zn and papi tests' +doc: +- audience: Runtime Dev + description: Adds end-to-end tests for staking async using zombienet and papi. +crates: +- name: pallet-staking-async + bump: minor +- name: pallet-staking-async-rc-runtime + bump: patch +- name: pallet-election-provider-multi-block + bump: minor +- name: pallet-staking-async-parachain-runtime + bump: patch +- name: sp-staking + bump: patch +- name: frame-election-provider-support + bump: minor +- name: sp-npos-elections + bump: minor diff --git a/prdoc/pr_8839.prdoc b/prdoc/pr_8839.prdoc index 55218f7bce5c3..d28a441907f92 100644 --- a/prdoc/pr_8839.prdoc +++ b/prdoc/pr_8839.prdoc @@ -14,7 +14,7 @@ crates: - name: sc-authority-discovery bump: major - name: sc-network-types - bump: minor + bump: major - name: cumulus-relay-chain-minimal-node bump: patch - name: polkadot-service diff --git a/prdoc/pr_8840.prdoc b/prdoc/pr_8840.prdoc new file mode 100644 index 0000000000000..28d34bf818494 --- /dev/null +++ b/prdoc/pr_8840.prdoc @@ -0,0 +1,8 @@ +title: 'Add `poll_index` to conviction-voting `Voted` and `VoteRemoved` events' +doc: +- audience: Runtime Dev + description: |- + This PR includes `poll_index` field to the `Voted` and `VoteRemoved` events to aid the identification of which referendum a voter voted +crates: +- name: pallet-conviction-voting + bump: major diff --git a/prdoc/pr_8857.prdoc b/prdoc/pr_8857.prdoc new file mode 100644 index 0000000000000..b6f57c1cd2e8d --- /dev/null +++ b/prdoc/pr_8857.prdoc @@ -0,0 +1,12 @@ +title: "[FRAME] Custom log level for the runtime benchmarks" +doc: +- audience: Runtime Dev + description: |- + Changes: + - Add `--runtime-log` option to omni-bencher CLI + - Read env var `RUNTIME_LOG` as fallback to the `--runtime-log` option + - Set custom log level for runtime benchmarks that can be different form CLI level + - Fix issue where old runtimes have a space in the pallet or instance name from breaking change in `quote` macro +crates: +- name: frame-benchmarking-cli + bump: minor diff --git a/prdoc/pr_9024.prdoc b/prdoc/pr_9024.prdoc new file mode 100644 index 0000000000000..0a8ace6ba5026 --- /dev/null +++ b/prdoc/pr_9024.prdoc @@ -0,0 +1,18 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Add Secretary Program to Collectives Westend + +doc: + - audience: Runtime Dev + description: |- + Adds Secretary Program(i.e. pallet-ranked-collective & pallet-salary only). + Salary payments in USDT via Asset Hub and XCM integration for cross-chain payments. + +crates: +- name: collectives-westend-integration-tests + bump: minor +- name: asset-hub-westend-runtime + bump: minor +- name: collectives-westend-runtime + bump: major diff --git a/prdoc/pr_9079.prdoc b/prdoc/pr_9079.prdoc new file mode 100644 index 0000000000000..c303ae09d54d2 --- /dev/null +++ b/prdoc/pr_9079.prdoc @@ -0,0 +1,30 @@ +title: "Prevent withdrawals while processing offences" + +doc: + - audience: Runtime Dev + description: | + Adds withdrawal restrictions to prevent users from withdrawing unbonded funds while + there are unprocessed offences that could result in slashing. This is a defensive + measure that ensures slashing guarantees are maintained even in extreme edge cases. + + Key changes: + - Withdrawals are blocked if there are unapplied slashes from the previous era + (returns `UnappliedSlashesInPreviousEra` error). This occurs when all unapplied + slashes for an era could not be applied within one era worth of blocks. While + one era is reserved for applying slashes page by page, if the era rolls over + before completion, these slashes can only be applied via the permissionless + `apply_slash` call. + - Withdrawals are restricted to the minimum of the active era and the last fully + processed offence era + - Unbonding chunks are now keyed by active era instead of current era + - Offences arriving after their intended application era are rejected and emit + `OffenceTooOld` event + + Both the `UnappliedSlashesInPreviousEra` error and withdrawal restrictions due to + delayed offence processing are extremely rare scenarios that should not occur under + normal operation. These are defensive measures to handle edge cases where slash + processing is delayed beyond expected timelines. + +crates: + - name: pallet-staking-async + bump: major \ No newline at end of file diff --git a/prdoc/pr_9187.prdoc b/prdoc/pr_9187.prdoc new file mode 100644 index 0000000000000..4928256b31837 --- /dev/null +++ b/prdoc/pr_9187.prdoc @@ -0,0 +1,25 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: "Staking Async: Improve slash cancellation to handle multiple slash fractions and pages" + +doc: + - audience: Runtime User + description: | + This PR fixes an issue where governance could not effectively cancel deferred slashes when subsequent offence + reports increased the slash fraction. The solution introduces a new `CancelledSlashes` storage item that tracks + cancelled slashes by era and validator with their maximum slash fractions to cancel. + + Key changes: + - Added `CancelledSlashes` storage map to track cancelled slashes by era + - Updated `cancel_deferred_slash` to accept `Vec<(AccountId, Perbill)>` allowing governance to specify the slash + fraction to cancel for each validator + - Modified slash application logic to check `CancelledSlashes` before applying any slash + - Automatic cleanup of `CancelledSlashes` after all slashes for an era are processed + + This ensures governance can cancel slashes even when the slash fraction changes due to additional offence reports, + addressing a critical limitation in the previous implementation. + +crates: + - name: pallet-staking-async + bump: major \ No newline at end of file diff --git a/prdoc/pr_9189.prdoc b/prdoc/pr_9189.prdoc new file mode 100644 index 0000000000000..79d4e07f838c6 --- /dev/null +++ b/prdoc/pr_9189.prdoc @@ -0,0 +1,8 @@ +title: '`fatxpool`: avoid premature revalidation of transactions' +doc: +- audience: Node Dev + description: |- + After this PR transactions will be revalidated in mempool on finalized blocks only if height of finalized block is greater then the height of the block at which transactions was originally submitted. +crates: +- name: sc-transaction-pool + bump: minor diff --git a/prdoc/pr_9195.prdoc b/prdoc/pr_9195.prdoc new file mode 100644 index 0000000000000..582804c5dd5cf --- /dev/null +++ b/prdoc/pr_9195.prdoc @@ -0,0 +1,9 @@ +title: XCMv5 asset exchange test scenarios +doc: +- audience: Runtime Dev + description: |- + Emulated test scenarios added to cover asset exchanging via Transact or ExchangeAsset instruction using XCMv5 capabilities + +crates: +- name: staging-xcm-executor + bump: patch diff --git a/prdoc/pr_9250.prdoc b/prdoc/pr_9250.prdoc new file mode 100644 index 0000000000000..d5471b49a5865 --- /dev/null +++ b/prdoc/pr_9250.prdoc @@ -0,0 +1,7 @@ +title: implement InspectMessageQueues for UnpaidRemoteExporter +doc: +- audience: Runtime Dev + description: Add missing implementation of `InspectMessageQueues` for `UnpaidRemoteExporter` +crates: +- name: staging-xcm-builder + bump: patch diff --git a/prdoc/pr_9281.prdoc b/prdoc/pr_9281.prdoc new file mode 100644 index 0000000000000..49e997203c915 --- /dev/null +++ b/prdoc/pr_9281.prdoc @@ -0,0 +1,16 @@ +title: 'litep2p/discovery: Ensure non-global addresses are not reported as external' +doc: +- audience: Node Dev + description: "This PR ensures that external addresses discovered by the identify\ + \ protocol are not propagated to the litep2p backend if they are not global. This\ + \ leads to a healthier DHT over time, since nodes will not advertise loopback\ + \ / non-global addresses.\n\nWe have seen various cases were loopback addresses\ + \ were reported as external:\n\n```\n2025-07-16 16:18:39.765 TRACE tokio-runtime-worker\ + \ sub-libp2p::discovery: verify new external address: /ip4/127.0.0.1/tcp/30310/p2p/12D3KooWNw19ScMjzNGLnYYLQxWcM9EK9VYPbCq241araUGgbdLM\n\ + \n2025-07-16 16:18:39.765 INFO tokio-runtime-worker sub-libp2p: \U0001F50D Discovered\ + \ new external address for our node: /ip4/127.0.0.1/tcp/30310/p2p/12D3KooWNw19ScMjzNGLnYYLQxWcM9EK9VYPbCq241araUGgbdLM\n\ + ```\n\nThis PR takes into account the network config for `allow_non_global_addresses`.\n\ + \nCloses: https://github.com/paritytech/polkadot-sdk/issues/9261\n\ncc @paritytech/networking" +crates: +- name: sc-network + bump: patch diff --git a/prdoc/pr_9288.prdoc b/prdoc/pr_9288.prdoc new file mode 100644 index 0000000000000..6ffffc837e73b --- /dev/null +++ b/prdoc/pr_9288.prdoc @@ -0,0 +1,8 @@ +title: Replace `log` with `tracing` on `bridge-runtime-common` +doc: +- audience: Runtime Dev + description: This PR replaces `log` with `tracing` instrumentation on `bridge-runtime-common` + by providing structured logging. +crates: +- name: bridge-runtime-common + bump: minor diff --git a/prdoc/pr_9308.prdoc b/prdoc/pr_9308.prdoc new file mode 100644 index 0000000000000..01b7648da49f2 --- /dev/null +++ b/prdoc/pr_9308.prdoc @@ -0,0 +1,8 @@ +title: Replace `log` with `tracing` on `pallet-bridge-messages` +doc: +- audience: Runtime Dev + description: This PR replaces `log` with `tracing` instrumentation on `pallet-bridge-messages` + by providing structured logging. +crates: +- name: pallet-bridge-messages + bump: minor diff --git a/prdoc/pr_9315.prdoc b/prdoc/pr_9315.prdoc new file mode 100644 index 0000000000000..ac30287b309a3 --- /dev/null +++ b/prdoc/pr_9315.prdoc @@ -0,0 +1,15 @@ +title: 'network/kad: Increase memory store capacity for providers' +doc: +- audience: Node Dev + description: |- + Increase Kademlia memory store capacity for DHT content providers (used by parachain DHT-based bootnodes) and reduce provider republish interval & TTL. This is needed to support testnets with 1-minute fast runtime and up to 13 parachains. + + Parameters set: + - 10000 provider keys per node + - 10h provider record TTL + - 3.5h provider republish interval + + Closes https://github.com/paritytech/litep2p/issues/405. +crates: +- name: sc-network + bump: minor diff --git a/prdoc/pr_9318.prdoc b/prdoc/pr_9318.prdoc new file mode 100644 index 0000000000000..c1ddd3285a5dc --- /dev/null +++ b/prdoc/pr_9318.prdoc @@ -0,0 +1,8 @@ +title: Replace `log` with `tracing` on `pallet-bridge-parachains` +doc: +- audience: Runtime Dev + description: This PR replaces `log` with `tracing` instrumentation on `pallet-bridge-parachains` + by providing structured logging. +crates: +- name: pallet-bridge-parachains + bump: minor diff --git a/prdoc/pr_9321.prdoc b/prdoc/pr_9321.prdoc new file mode 100644 index 0000000000000..18aaec6d7b08c --- /dev/null +++ b/prdoc/pr_9321.prdoc @@ -0,0 +1,10 @@ +title: 'network/litep2p: Switch to system DNS resolver' +doc: +- audience: Node Dev + description: |- + Switch to system DNS resolver instead of 8.8.8.8 that litep2p uses by default. This enables full administrator control of what upstream DNS servers to use, including resolution of local names using custom DNS servers. + + Fixes https://github.com/paritytech/polkadot-sdk/issues/9298. +crates: +- name: sc-network + bump: patch diff --git a/prdoc/pr_9325.prdoc b/prdoc/pr_9325.prdoc new file mode 100644 index 0000000000000..ebdcab0b10767 --- /dev/null +++ b/prdoc/pr_9325.prdoc @@ -0,0 +1,16 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Fix pallet-im-online benchmarking for runtimes with MaxKeys < 1000 + +doc: + - audience: Runtime Dev + description: | + Fixes benchmarking for pallet-im-online when runtime configuration has MaxKeys < 1000. + Previously, the benchmark code used a hardcoded constant MAX_KEYS = 1000 which would + cause benchmark failures for runtimes configured with fewer maximum keys. This change + updates the benchmark to dynamically use the MaxKeys value from the pallet's Config trait. + +crates: +- name: pallet-im-online + bump: patch \ No newline at end of file diff --git a/prdoc/pr_9326.prdoc b/prdoc/pr_9326.prdoc new file mode 100644 index 0000000000000..97bc7358498ff --- /dev/null +++ b/prdoc/pr_9326.prdoc @@ -0,0 +1,12 @@ +title: '[HRMP] Check messages order before enqueing them' +doc: +- audience: Runtime Dev + description: |- + Related to https://github.com/paritytech/polkadot-sdk/pull/8860 + + This PR adds a check in order to ensure that the collator has respected the proper order when sending the HRMP messages to the runtime. +crates: +- name: cumulus-pallet-parachain-system + bump: major +- name: polkadot-primitives + bump: minor diff --git a/prdoc/pr_9335.prdoc b/prdoc/pr_9335.prdoc new file mode 100644 index 0000000000000..ebb91ad33cd9b --- /dev/null +++ b/prdoc/pr_9335.prdoc @@ -0,0 +1,8 @@ +title: 'frame_system: Whitelist storage items and do not double kill!' +doc: +- audience: Runtime Dev + description: |- + This pull requests adds some storage values to the whitelisted storage item list, because they are written in every block. Also it stops double killing `InherentsApplied`. It is killed in `on_finalize`, so there is no need to do it again in `on_initialize`. +crates: +- name: frame-system + bump: patch diff --git a/prdoc/pr_9338.prdoc b/prdoc/pr_9338.prdoc new file mode 100644 index 0000000000000..53ad086b1c944 --- /dev/null +++ b/prdoc/pr_9338.prdoc @@ -0,0 +1,8 @@ +title: 'fatxpool: instant seal support' +doc: +- audience: Node Dev + description: |- + This PR introduces creation of view for known best block during instantiation of `fatxpool`. This is intended to fix an instant-seal nodes, where block building is triggered via transaction import. +crates: +- name: sc-transaction-pool + bump: patch diff --git a/prdoc/pr_9354.prdoc b/prdoc/pr_9354.prdoc new file mode 100644 index 0000000000000..d699bbef14551 --- /dev/null +++ b/prdoc/pr_9354.prdoc @@ -0,0 +1,8 @@ +title: Remove whitespaces added by macros due to token re-parsing +doc: +- audience: Runtime Dev + description: |- + Normalize result of `stringify` in scenarios when used inside nested macros to stringify token streams for benchmarking framework +crates: +- name: frame-benchmarking + bump: patch diff --git a/prdoc/pr_9355.prdoc b/prdoc/pr_9355.prdoc new file mode 100644 index 0000000000000..a529559aaa86a --- /dev/null +++ b/prdoc/pr_9355.prdoc @@ -0,0 +1,11 @@ +title: 'substrate-prometheus-endpoint: directly require the feature "tokio/net"' +doc: +- audience: Node Dev + description: |- + The crate `substrate-prometheus-endpoint` use tokio items given by the feature "net" but it doesn't explictly requires it in the `Cargo.toml`. It compiles on master because `hyper-util` enables the feature "tokio/net". But upgrading `hyper-util` break this indirect enabling. + + This fix the issue by directly setting "net" feature as required, as it is used. + We should also backport this ideally. It is not a breaking change given the code doesn't compile without the feature and only compiles if indirectly enabled by another crate. +crates: +- name: substrate-prometheus-endpoint + bump: patch diff --git a/prdoc/pr_9357.prdoc b/prdoc/pr_9357.prdoc new file mode 100644 index 0000000000000..381e7a19d7e49 --- /dev/null +++ b/prdoc/pr_9357.prdoc @@ -0,0 +1,11 @@ +title: "Fix dust balance handling in ETH transfers" + +doc: + - audience: Runtime Dev + description: |- + Fixed a bug in the eth-decimals implementation where ETH transfers were failing due to incorrect receiver dust balance handling. The condition for minting a new currency unit when transferring dust was checking `to_info.dust.saturating_add(dust) >= plank` which `to_info.dust` has been added twice, could lead to unexpected minting behavior. + This fix ensures that ETH transfers work correctly, enabling proper operation of DeFi protocols like Uniswap on PolkaVM. + +crates: + - name: pallet-revive + bump: patch diff --git a/prdoc/pr_9378.prdoc b/prdoc/pr_9378.prdoc new file mode 100644 index 0000000000000..2f82d447112e6 --- /dev/null +++ b/prdoc/pr_9378.prdoc @@ -0,0 +1,8 @@ +title: Replace `log` with `tracing` on `pallet-bridge-beefy` +doc: +- audience: Runtime Dev + description: This PR replaces `log` with `tracing` instrumentation on `pallet-bridge-beefy` + by providing structured logging. +crates: +- name: pallet-bridge-beefy + bump: minor diff --git a/prdoc/pr_9380.prdoc b/prdoc/pr_9380.prdoc new file mode 100644 index 0000000000000..88a1008ae683c --- /dev/null +++ b/prdoc/pr_9380.prdoc @@ -0,0 +1,13 @@ +title: '[Staking/AHM] Properly report weight of rc -> ah xcm back to the calls' +doc: +- audience: Runtime Dev + description: |- + Properly report weight of rc -> ah xcm back to the calls, which will consequently make the XCM/MQ + code path aware of the weights, which was previously not the case. + + Additionally, adds an event for when an era is pruned. +crates: +- name: pallet-staking-async-rc-client + bump: major +- name: pallet-staking-async + bump: major diff --git a/prdoc/pr_9384.prdoc b/prdoc/pr_9384.prdoc new file mode 100644 index 0000000000000..a9ec6c1de016e --- /dev/null +++ b/prdoc/pr_9384.prdoc @@ -0,0 +1,32 @@ +title: '[AHM] Make stuff public and derive' +doc: +- audience: Runtime Dev + description: | + Preparation for Asset hub migration by making fields public and doing some tweaks. + Also hide one silently truncating constructor from `ParaId``. + +crates: +- name: pallet-delegated-staking + bump: minor +- name: pallet-staking-async + bump: minor +- name: polkadot-runtime-parachains + bump: minor +- name: pallet-referenda + bump: minor +- name: pallet-bounties + bump: major +- name: polkadot-runtime-common + bump: major +- name: polkadot-parachain-primitives + bump: major +- name: pallet-bags-list + bump: minor +- name: pallet-multisig + bump: minor +- name: pallet-nomination-pools + bump: minor +- name: pallet-preimage + bump: minor +- name: pallet-scheduler + bump: major diff --git a/prdoc/pr_9401.prdoc b/prdoc/pr_9401.prdoc new file mode 100644 index 0000000000000..ba5310cae3a92 --- /dev/null +++ b/prdoc/pr_9401.prdoc @@ -0,0 +1,8 @@ +title: Replace `log` with `tracing` on `bp-runtime` +doc: +- audience: Runtime Dev + description: This PR replaces `log` with `tracing` instrumentation on `bp-runtime` + by providing structured logging. +crates: +- name: bp-runtime + bump: minor diff --git a/prdoc/pr_9409.prdoc b/prdoc/pr_9409.prdoc new file mode 100644 index 0000000000000..2b85a5306cb95 --- /dev/null +++ b/prdoc/pr_9409.prdoc @@ -0,0 +1,8 @@ +title: Replace `log` with `tracing` on `xcm-emulator` +doc: +- audience: Runtime Dev + description: This PR replaces `log` with `tracing` instrumentation on `xcm-emulator` + by providing structured logging. +crates: +- name: xcm-emulator + bump: minor diff --git a/prdoc/pr_9411.prdoc b/prdoc/pr_9411.prdoc new file mode 100644 index 0000000000000..97e8c0c365e00 --- /dev/null +++ b/prdoc/pr_9411.prdoc @@ -0,0 +1,7 @@ +title: 'staking-async/papi-tests: fix justfile to run in CI' +doc: +- audience: Runtime Dev + description: "Running the just step within a bash shell, ensures that the error is properly handled and propagated without terminating the just script." +crates: +- name: pallet-staking-async + bump: none diff --git a/prdoc/pr_9416.prdoc b/prdoc/pr_9416.prdoc new file mode 100644 index 0000000000000..ab2315d532583 --- /dev/null +++ b/prdoc/pr_9416.prdoc @@ -0,0 +1,10 @@ +title: 'pallet_revive: Enforce storage deposit limit on plain transfer' +doc: +- audience: Runtime Dev + description: |- + The existential deposit to create a new account is part of the storage deposit. Hence if the storage deposit limit is too low to create a new account we fail the transaction. However, this limit was not enforced for plain transfers. The reason is that we only enforce the limit at the end of each frame. But for plain transfers (transferring to a non contract) there is no frame. + + This PR fixes the situation by enforcing the limit when transferring the existential deposit in order to create a new account. +crates: +- name: pallet-revive + bump: patch diff --git a/prdoc/pr_8461.prdoc b/prdoc/stable2503-6/pr_8461.prdoc similarity index 100% rename from prdoc/pr_8461.prdoc rename to prdoc/stable2503-6/pr_8461.prdoc diff --git a/prdoc/pr_8473.prdoc b/prdoc/stable2503-6/pr_8473.prdoc similarity index 100% rename from prdoc/pr_8473.prdoc rename to prdoc/stable2503-6/pr_8473.prdoc diff --git a/prdoc/pr_8630.prdoc b/prdoc/stable2503-6/pr_8630.prdoc similarity index 100% rename from prdoc/pr_8630.prdoc rename to prdoc/stable2503-6/pr_8630.prdoc diff --git a/prdoc/pr_8650.prdoc b/prdoc/stable2503-6/pr_8650.prdoc similarity index 100% rename from prdoc/pr_8650.prdoc rename to prdoc/stable2503-6/pr_8650.prdoc diff --git a/prdoc/pr_8669.prdoc b/prdoc/stable2503-6/pr_8669.prdoc similarity index 100% rename from prdoc/pr_8669.prdoc rename to prdoc/stable2503-6/pr_8669.prdoc diff --git a/prdoc/pr_6827.prdoc b/prdoc/stable2503-7/pr_6827.prdoc similarity index 100% rename from prdoc/pr_6827.prdoc rename to prdoc/stable2503-7/pr_6827.prdoc diff --git a/prdoc/pr_8345.prdoc b/prdoc/stable2503-7/pr_8345.prdoc similarity index 100% rename from prdoc/pr_8345.prdoc rename to prdoc/stable2503-7/pr_8345.prdoc diff --git a/prdoc/pr_8725.prdoc b/prdoc/stable2503-7/pr_8725.prdoc similarity index 100% rename from prdoc/pr_8725.prdoc rename to prdoc/stable2503-7/pr_8725.prdoc diff --git a/prdoc/stable2503-7/pr_8787.prdoc b/prdoc/stable2503-7/pr_8787.prdoc new file mode 100644 index 0000000000000..e0a30183a0114 --- /dev/null +++ b/prdoc/stable2503-7/pr_8787.prdoc @@ -0,0 +1,13 @@ +title: Westend governance authorize_upgrade integration tests +doc: +- audience: Runtime Dev + description: |- + Integration tests covering `authorize_upgrade` with whitelisting via Collectives for Westend network + +crates: +- name: emulated-integration-tests-common + bump: minor +- name: frame-system + bump: minor +- name: frame-system-benchmarking + bump: patch \ No newline at end of file diff --git a/prdoc/stable2503-7/pr_8831.prdoc b/prdoc/stable2503-7/pr_8831.prdoc new file mode 100644 index 0000000000000..d82ebc1690c28 --- /dev/null +++ b/prdoc/stable2503-7/pr_8831.prdoc @@ -0,0 +1,12 @@ +title: 'dispute-coordinator: increase lru_observed_blocks_capacity' +doc: +- audience: Node Dev + description: |- + Under increase load with finality lagging behind there is a risk for blocks to arrive late or out of sequence in that case we will end up scrapping from the received block un till last finalized block and then process all the dispute in-between. + + This couple with other inefficiencies like https://github.com/paritytech/polkadot-sdk/issues/8823 will increase unnecessarily the load on dispute-coordinator. + + Decided to make this super large to err on the cautious side, the Hash size is only 32 bytes, so this will make the LRU grow up to 65k, which I don't think is a significant increase. +crates: +- name: polkadot-node-core-dispute-coordinator + bump: patch diff --git a/prdoc/stable2503-7/pr_8832.prdoc b/prdoc/stable2503-7/pr_8832.prdoc new file mode 100644 index 0000000000000..7f8d6eb231dd8 --- /dev/null +++ b/prdoc/stable2503-7/pr_8832.prdoc @@ -0,0 +1,10 @@ +title: increase session index cache +doc: +- audience: Node Dev + description: |- + A 10 session index cache is not enough when you run under intense pressure and finality is lagg since you will end requesting the session index for blocks older than that. So let's make this cache larger to achieve its purpose even under intense load when it actually matters more to be faster. + + The session_index_cache keeps a Hash and a u32, so that's about 36 bytes per entry, with this increase it can grow up to 65k which is not that big in my book. +crates: +- name: polkadot-node-subsystem-util + bump: patch diff --git a/prdoc/stable2503-7/pr_8834.prdoc b/prdoc/stable2503-7/pr_8834.prdoc new file mode 100644 index 0000000000000..414d8e89280bb --- /dev/null +++ b/prdoc/stable2503-7/pr_8834.prdoc @@ -0,0 +1,15 @@ +title: extend overseer to send priority messages +doc: +- audience: Node Dev + description: |- + Extend overseer to send priority messages, the new functionality is used for sending messages + on the grandpa call path when we call dispute-coordinator and approval-voting in + finality_target_with_longest_chain to make sure we don't block unnecessarily. + +crates: +- name: polkadot-node-core-approval-voting-parallel + bump: patch +- name: polkadot-overseer + bump: patch +- name: polkadot-service + bump: patch diff --git a/prdoc/stable2503-7/pr_8837.prdoc b/prdoc/stable2503-7/pr_8837.prdoc new file mode 100644 index 0000000000000..9be69f542d4ae --- /dev/null +++ b/prdoc/stable2503-7/pr_8837.prdoc @@ -0,0 +1,14 @@ +title: Cache locally controlled validator indices in dispute-coordinator +doc: + - audience: Node Dev + description: | + `dispute-coordinator` uses `keystore.key_pair()` to obtain the set of locally controlled + validator IDs. This operation happens on each import and is expensive because it involves key + generation from a seed phrase. This patch lazily determines the set of locally controlled + validator IDs and caches the result for each session. + +crates: +- name: polkadot-node-core-dispute-coordinator + bump: minor +- name: polkadot-node-subsystem-util + bump: minor \ No newline at end of file diff --git a/prdoc/stable2503-7/pr_8932.prdoc b/prdoc/stable2503-7/pr_8932.prdoc new file mode 100644 index 0000000000000..771a8d603cef4 --- /dev/null +++ b/prdoc/stable2503-7/pr_8932.prdoc @@ -0,0 +1,11 @@ +title: 'pallet-balances: Do not create account in benchmarking' +doc: +- audience: Runtime Dev + description: |- + This particular benchmark is about benchmarking the account creation, so we should not create it before :) + + + Closes: https://github.com/paritytech/polkadot-sdk/issues/8927 +crates: +- name: pallet-balances + bump: patch diff --git a/prdoc/stable2503-7/pr_8948.prdoc b/prdoc/stable2503-7/pr_8948.prdoc new file mode 100644 index 0000000000000..423167b64a1f3 --- /dev/null +++ b/prdoc/stable2503-7/pr_8948.prdoc @@ -0,0 +1,16 @@ +title: make sure dispute_coordinator/approval-voting parallel can receive priority messages +doc: +- audience: Node Dev + description: |- + https://github.com/paritytech/polkadot-sdk/pull/8834, changed relay_chain_selection to send priority messages, but did not configured + the subsystems to tell they can receive priority messages, with `can_receive_priority_messages` flag. + + If `can_receive_priority_messages` is not specified orchestra falls back when sending a priority message to the normal queue, + so this resulted in the messages not being processed ahead of the others in the queue. + + Fix this configuration mistake and add a test to make sure priority messages are consumed ahead of normal ones by the subsystems. +crates: +- name: polkadot-overseer + bump: patch +- name: polkadot-service + bump: patch diff --git a/prdoc/stable2503-7/pr_8973.prdoc b/prdoc/stable2503-7/pr_8973.prdoc new file mode 100644 index 0000000000000..5e43d3b464e79 --- /dev/null +++ b/prdoc/stable2503-7/pr_8973.prdoc @@ -0,0 +1,9 @@ +title: Add polkadot_parachain_peer_connectivity metric +doc: +- audience: Node Dev + description: |- + Adds `polkadot_parachain_peer_connectivity` histogram metric to better understand connectivity patterns. + +crates: +- name: polkadot-network-bridge + bump: patch diff --git a/prdoc/stable2503-7/pr_8980.prdoc b/prdoc/stable2503-7/pr_8980.prdoc new file mode 100644 index 0000000000000..7e88958b9337e --- /dev/null +++ b/prdoc/stable2503-7/pr_8980.prdoc @@ -0,0 +1,8 @@ +title: Fix revive-fixtures build script +doc: +- audience: Runtime Dev + description: |- + Fix compilation issue with pallet-revive-fixtures build.rs script. +crates: +- name: pallet-revive-fixtures + bump: patch diff --git a/prdoc/stable2503-7/pr_9050.prdoc b/prdoc/stable2503-7/pr_9050.prdoc new file mode 100644 index 0000000000000..be7ad45cdbaba --- /dev/null +++ b/prdoc/stable2503-7/pr_9050.prdoc @@ -0,0 +1,10 @@ +title: "dispute-coordinator: handle race with offchain disabling" + +doc: + - audience: Node Dev + description: | + Fixes a potential race with off-chain disabling when we learned about disablement after importing a dispute from that validator. + +crates: +- name: polkadot-node-core-dispute-coordinator + bump: patch diff --git a/prdoc/pr_9102.prdoc b/prdoc/stable2503-7/pr_9102.prdoc similarity index 100% rename from prdoc/pr_9102.prdoc rename to prdoc/stable2503-7/pr_9102.prdoc diff --git a/prdoc/pr_3811.prdoc b/prdoc/stable2506/pr_3811.prdoc similarity index 100% rename from prdoc/pr_3811.prdoc rename to prdoc/stable2506/pr_3811.prdoc diff --git a/prdoc/pr_5620.prdoc b/prdoc/stable2506/pr_5620.prdoc similarity index 100% rename from prdoc/pr_5620.prdoc rename to prdoc/stable2506/pr_5620.prdoc diff --git a/prdoc/pr_5884.prdoc b/prdoc/stable2506/pr_5884.prdoc similarity index 100% rename from prdoc/pr_5884.prdoc rename to prdoc/stable2506/pr_5884.prdoc diff --git a/prdoc/pr_6010.prdoc b/prdoc/stable2506/pr_6010.prdoc similarity index 100% rename from prdoc/pr_6010.prdoc rename to prdoc/stable2506/pr_6010.prdoc diff --git a/prdoc/pr_6137.prdoc b/prdoc/stable2506/pr_6137.prdoc similarity index 100% rename from prdoc/pr_6137.prdoc rename to prdoc/stable2506/pr_6137.prdoc diff --git a/prdoc/pr_6312.prdoc b/prdoc/stable2506/pr_6312.prdoc similarity index 100% rename from prdoc/pr_6312.prdoc rename to prdoc/stable2506/pr_6312.prdoc diff --git a/prdoc/pr_6324.prdoc b/prdoc/stable2506/pr_6324.prdoc similarity index 100% rename from prdoc/pr_6324.prdoc rename to prdoc/stable2506/pr_6324.prdoc diff --git a/prdoc/stable2506/pr_6827.prdoc b/prdoc/stable2506/pr_6827.prdoc new file mode 100644 index 0000000000000..689ac56aac783 --- /dev/null +++ b/prdoc/stable2506/pr_6827.prdoc @@ -0,0 +1,17 @@ +title: 'Introduction of Approval Slashes' +doc: +- audience: [Node Operator, Runtime Dev] + description: |- + Introduces a more aggressive slashing scheme. + Lazy or spammy validators will from now on be slashable in disputes. + Even if your validator is not a backer but it approves an invalid block + it will be slashed 2%. + If your validator raises or supports fake alarms (disputes against + valid blocks) you will be slashed (0%) and disabled for the remainder + of the era, which will potentially reduce era point gains. + +crates: +- name: polkadot-primitives + bump: minor +- name: polkadot-runtime-parachains + bump: major diff --git a/prdoc/pr_7220.prdoc b/prdoc/stable2506/pr_7220.prdoc similarity index 100% rename from prdoc/pr_7220.prdoc rename to prdoc/stable2506/pr_7220.prdoc diff --git a/prdoc/pr_7229.prdoc b/prdoc/stable2506/pr_7229.prdoc similarity index 100% rename from prdoc/pr_7229.prdoc rename to prdoc/stable2506/pr_7229.prdoc diff --git a/prdoc/pr_7375.prdoc b/prdoc/stable2506/pr_7375.prdoc similarity index 100% rename from prdoc/pr_7375.prdoc rename to prdoc/stable2506/pr_7375.prdoc diff --git a/prdoc/pr_7556.prdoc b/prdoc/stable2506/pr_7556.prdoc similarity index 100% rename from prdoc/pr_7556.prdoc rename to prdoc/stable2506/pr_7556.prdoc diff --git a/prdoc/pr_7592.prdoc b/prdoc/stable2506/pr_7592.prdoc similarity index 100% rename from prdoc/pr_7592.prdoc rename to prdoc/stable2506/pr_7592.prdoc diff --git a/prdoc/pr_7597.prdoc b/prdoc/stable2506/pr_7597.prdoc similarity index 100% rename from prdoc/pr_7597.prdoc rename to prdoc/stable2506/pr_7597.prdoc diff --git a/prdoc/pr_7666.prdoc b/prdoc/stable2506/pr_7666.prdoc similarity index 100% rename from prdoc/pr_7666.prdoc rename to prdoc/stable2506/pr_7666.prdoc diff --git a/prdoc/pr_7682.prdoc b/prdoc/stable2506/pr_7682.prdoc similarity index 100% rename from prdoc/pr_7682.prdoc rename to prdoc/stable2506/pr_7682.prdoc diff --git a/prdoc/pr_7719.prdoc b/prdoc/stable2506/pr_7719.prdoc similarity index 100% rename from prdoc/pr_7719.prdoc rename to prdoc/stable2506/pr_7719.prdoc diff --git a/prdoc/pr_7720.prdoc b/prdoc/stable2506/pr_7720.prdoc similarity index 100% rename from prdoc/pr_7720.prdoc rename to prdoc/stable2506/pr_7720.prdoc diff --git a/prdoc/pr_7730.prdoc b/prdoc/stable2506/pr_7730.prdoc similarity index 100% rename from prdoc/pr_7730.prdoc rename to prdoc/stable2506/pr_7730.prdoc diff --git a/prdoc/pr_7762.prdoc b/prdoc/stable2506/pr_7762.prdoc similarity index 100% rename from prdoc/pr_7762.prdoc rename to prdoc/stable2506/pr_7762.prdoc diff --git a/prdoc/pr_7833.prdoc b/prdoc/stable2506/pr_7833.prdoc similarity index 100% rename from prdoc/pr_7833.prdoc rename to prdoc/stable2506/pr_7833.prdoc diff --git a/prdoc/pr_7857.prdoc b/prdoc/stable2506/pr_7857.prdoc similarity index 100% rename from prdoc/pr_7857.prdoc rename to prdoc/stable2506/pr_7857.prdoc diff --git a/prdoc/pr_7867.prdoc b/prdoc/stable2506/pr_7867.prdoc similarity index 100% rename from prdoc/pr_7867.prdoc rename to prdoc/stable2506/pr_7867.prdoc diff --git a/prdoc/pr_7882.prdoc b/prdoc/stable2506/pr_7882.prdoc similarity index 100% rename from prdoc/pr_7882.prdoc rename to prdoc/stable2506/pr_7882.prdoc diff --git a/prdoc/pr_7936.prdoc b/prdoc/stable2506/pr_7936.prdoc similarity index 100% rename from prdoc/pr_7936.prdoc rename to prdoc/stable2506/pr_7936.prdoc diff --git a/prdoc/pr_7944.prdoc b/prdoc/stable2506/pr_7944.prdoc similarity index 100% rename from prdoc/pr_7944.prdoc rename to prdoc/stable2506/pr_7944.prdoc diff --git a/prdoc/pr_7955.prdoc b/prdoc/stable2506/pr_7955.prdoc similarity index 100% rename from prdoc/pr_7955.prdoc rename to prdoc/stable2506/pr_7955.prdoc diff --git a/prdoc/pr_7960.prdoc b/prdoc/stable2506/pr_7960.prdoc similarity index 100% rename from prdoc/pr_7960.prdoc rename to prdoc/stable2506/pr_7960.prdoc diff --git a/prdoc/pr_7980.prdoc b/prdoc/stable2506/pr_7980.prdoc similarity index 100% rename from prdoc/pr_7980.prdoc rename to prdoc/stable2506/pr_7980.prdoc diff --git a/prdoc/pr_7995.prdoc b/prdoc/stable2506/pr_7995.prdoc similarity index 100% rename from prdoc/pr_7995.prdoc rename to prdoc/stable2506/pr_7995.prdoc diff --git a/prdoc/pr_8001.prdoc b/prdoc/stable2506/pr_8001.prdoc similarity index 100% rename from prdoc/pr_8001.prdoc rename to prdoc/stable2506/pr_8001.prdoc diff --git a/prdoc/pr_8021.prdoc b/prdoc/stable2506/pr_8021.prdoc similarity index 100% rename from prdoc/pr_8021.prdoc rename to prdoc/stable2506/pr_8021.prdoc diff --git a/prdoc/pr_8038.prdoc b/prdoc/stable2506/pr_8038.prdoc similarity index 100% rename from prdoc/pr_8038.prdoc rename to prdoc/stable2506/pr_8038.prdoc diff --git a/prdoc/pr_8069.prdoc b/prdoc/stable2506/pr_8069.prdoc similarity index 100% rename from prdoc/pr_8069.prdoc rename to prdoc/stable2506/pr_8069.prdoc diff --git a/prdoc/pr_8072.prdoc b/prdoc/stable2506/pr_8072.prdoc similarity index 100% rename from prdoc/pr_8072.prdoc rename to prdoc/stable2506/pr_8072.prdoc diff --git a/prdoc/pr_8102.prdoc b/prdoc/stable2506/pr_8102.prdoc similarity index 100% rename from prdoc/pr_8102.prdoc rename to prdoc/stable2506/pr_8102.prdoc diff --git a/prdoc/pr_8103.prdoc b/prdoc/stable2506/pr_8103.prdoc similarity index 100% rename from prdoc/pr_8103.prdoc rename to prdoc/stable2506/pr_8103.prdoc diff --git a/prdoc/pr_8118.prdoc b/prdoc/stable2506/pr_8118.prdoc similarity index 100% rename from prdoc/pr_8118.prdoc rename to prdoc/stable2506/pr_8118.prdoc diff --git a/prdoc/pr_8122.prdoc b/prdoc/stable2506/pr_8122.prdoc similarity index 100% rename from prdoc/pr_8122.prdoc rename to prdoc/stable2506/pr_8122.prdoc diff --git a/prdoc/pr_8127.prdoc b/prdoc/stable2506/pr_8127.prdoc similarity index 100% rename from prdoc/pr_8127.prdoc rename to prdoc/stable2506/pr_8127.prdoc diff --git a/prdoc/pr_8130.prdoc b/prdoc/stable2506/pr_8130.prdoc similarity index 100% rename from prdoc/pr_8130.prdoc rename to prdoc/stable2506/pr_8130.prdoc diff --git a/prdoc/pr_8134.prdoc b/prdoc/stable2506/pr_8134.prdoc similarity index 100% rename from prdoc/pr_8134.prdoc rename to prdoc/stable2506/pr_8134.prdoc diff --git a/prdoc/pr_8148.prdoc b/prdoc/stable2506/pr_8148.prdoc similarity index 100% rename from prdoc/pr_8148.prdoc rename to prdoc/stable2506/pr_8148.prdoc diff --git a/prdoc/pr_8153.prdoc b/prdoc/stable2506/pr_8153.prdoc similarity index 100% rename from prdoc/pr_8153.prdoc rename to prdoc/stable2506/pr_8153.prdoc diff --git a/prdoc/pr_8163.prdoc b/prdoc/stable2506/pr_8163.prdoc similarity index 100% rename from prdoc/pr_8163.prdoc rename to prdoc/stable2506/pr_8163.prdoc diff --git a/prdoc/pr_8164.prdoc b/prdoc/stable2506/pr_8164.prdoc similarity index 100% rename from prdoc/pr_8164.prdoc rename to prdoc/stable2506/pr_8164.prdoc diff --git a/prdoc/pr_8171.prdoc b/prdoc/stable2506/pr_8171.prdoc similarity index 100% rename from prdoc/pr_8171.prdoc rename to prdoc/stable2506/pr_8171.prdoc diff --git a/prdoc/pr_8179.prdoc b/prdoc/stable2506/pr_8179.prdoc similarity index 100% rename from prdoc/pr_8179.prdoc rename to prdoc/stable2506/pr_8179.prdoc diff --git a/prdoc/pr_8197.prdoc b/prdoc/stable2506/pr_8197.prdoc similarity index 100% rename from prdoc/pr_8197.prdoc rename to prdoc/stable2506/pr_8197.prdoc diff --git a/prdoc/pr_8208.prdoc b/prdoc/stable2506/pr_8208.prdoc similarity index 100% rename from prdoc/pr_8208.prdoc rename to prdoc/stable2506/pr_8208.prdoc diff --git a/prdoc/pr_8212.prdoc b/prdoc/stable2506/pr_8212.prdoc similarity index 100% rename from prdoc/pr_8212.prdoc rename to prdoc/stable2506/pr_8212.prdoc diff --git a/prdoc/pr_8230.prdoc b/prdoc/stable2506/pr_8230.prdoc similarity index 100% rename from prdoc/pr_8230.prdoc rename to prdoc/stable2506/pr_8230.prdoc diff --git a/prdoc/pr_8234.prdoc b/prdoc/stable2506/pr_8234.prdoc similarity index 100% rename from prdoc/pr_8234.prdoc rename to prdoc/stable2506/pr_8234.prdoc diff --git a/prdoc/pr_8238.prdoc b/prdoc/stable2506/pr_8238.prdoc similarity index 100% rename from prdoc/pr_8238.prdoc rename to prdoc/stable2506/pr_8238.prdoc diff --git a/prdoc/pr_8248.prdoc b/prdoc/stable2506/pr_8248.prdoc similarity index 100% rename from prdoc/pr_8248.prdoc rename to prdoc/stable2506/pr_8248.prdoc diff --git a/prdoc/pr_8254.prdoc b/prdoc/stable2506/pr_8254.prdoc similarity index 100% rename from prdoc/pr_8254.prdoc rename to prdoc/stable2506/pr_8254.prdoc diff --git a/prdoc/pr_8262.prdoc b/prdoc/stable2506/pr_8262.prdoc similarity index 100% rename from prdoc/pr_8262.prdoc rename to prdoc/stable2506/pr_8262.prdoc diff --git a/prdoc/pr_8271.prdoc b/prdoc/stable2506/pr_8271.prdoc similarity index 100% rename from prdoc/pr_8271.prdoc rename to prdoc/stable2506/pr_8271.prdoc diff --git a/prdoc/pr_8273.prdoc b/prdoc/stable2506/pr_8273.prdoc similarity index 100% rename from prdoc/pr_8273.prdoc rename to prdoc/stable2506/pr_8273.prdoc diff --git a/prdoc/pr_8274.prdoc b/prdoc/stable2506/pr_8274.prdoc similarity index 100% rename from prdoc/pr_8274.prdoc rename to prdoc/stable2506/pr_8274.prdoc diff --git a/prdoc/pr_8281.prdoc b/prdoc/stable2506/pr_8281.prdoc similarity index 100% rename from prdoc/pr_8281.prdoc rename to prdoc/stable2506/pr_8281.prdoc diff --git a/prdoc/pr_8289.prdoc b/prdoc/stable2506/pr_8289.prdoc similarity index 100% rename from prdoc/pr_8289.prdoc rename to prdoc/stable2506/pr_8289.prdoc diff --git a/prdoc/pr_8299.prdoc b/prdoc/stable2506/pr_8299.prdoc similarity index 100% rename from prdoc/pr_8299.prdoc rename to prdoc/stable2506/pr_8299.prdoc diff --git a/prdoc/pr_8310.prdoc b/prdoc/stable2506/pr_8310.prdoc similarity index 100% rename from prdoc/pr_8310.prdoc rename to prdoc/stable2506/pr_8310.prdoc diff --git a/prdoc/pr_8311.prdoc b/prdoc/stable2506/pr_8311.prdoc similarity index 100% rename from prdoc/pr_8311.prdoc rename to prdoc/stable2506/pr_8311.prdoc diff --git a/prdoc/pr_8314.prdoc b/prdoc/stable2506/pr_8314.prdoc similarity index 100% rename from prdoc/pr_8314.prdoc rename to prdoc/stable2506/pr_8314.prdoc diff --git a/prdoc/pr_8316.prdoc b/prdoc/stable2506/pr_8316.prdoc similarity index 100% rename from prdoc/pr_8316.prdoc rename to prdoc/stable2506/pr_8316.prdoc diff --git a/prdoc/pr_8323.prdoc b/prdoc/stable2506/pr_8323.prdoc similarity index 100% rename from prdoc/pr_8323.prdoc rename to prdoc/stable2506/pr_8323.prdoc diff --git a/prdoc/pr_8327.prdoc b/prdoc/stable2506/pr_8327.prdoc similarity index 100% rename from prdoc/pr_8327.prdoc rename to prdoc/stable2506/pr_8327.prdoc diff --git a/prdoc/pr_8332.prdoc b/prdoc/stable2506/pr_8332.prdoc similarity index 100% rename from prdoc/pr_8332.prdoc rename to prdoc/stable2506/pr_8332.prdoc diff --git a/prdoc/pr_8337.prdoc b/prdoc/stable2506/pr_8337.prdoc similarity index 100% rename from prdoc/pr_8337.prdoc rename to prdoc/stable2506/pr_8337.prdoc diff --git a/prdoc/pr_8339.prdoc b/prdoc/stable2506/pr_8339.prdoc similarity index 100% rename from prdoc/pr_8339.prdoc rename to prdoc/stable2506/pr_8339.prdoc diff --git a/prdoc/pr_8344.prdoc b/prdoc/stable2506/pr_8344.prdoc similarity index 100% rename from prdoc/pr_8344.prdoc rename to prdoc/stable2506/pr_8344.prdoc diff --git a/prdoc/stable2506/pr_8345.prdoc b/prdoc/stable2506/pr_8345.prdoc new file mode 100644 index 0000000000000..886e8b17cd123 --- /dev/null +++ b/prdoc/stable2506/pr_8345.prdoc @@ -0,0 +1,26 @@ +title: 'tx/metrics: Add metrics for the RPC v2 `transactionWatch_v1_submitAndWatch`' +doc: +- audience: Node Operator + description: |- + This PR adds metrics for the following RPC subscription: [transactionWatch_v1_submitAndWatch](https://paritytech.github.io/json-rpc-interface-spec/api/transactionWatch_v1_submitAndWatch.html) + + Metrics are exposed in two ways: + - simple counters of how many events we've seen globally + - a histogram vector of execution times, which is labeled by `initial event` -> `final event` + - This helps us identify how long it takes the transaction pool to advance the state of the events, and further debug issues + + Part of: https://github.com/paritytech/polkadot-sdk/issues/8336 + + ### (outdated) PoC Dashboards + + ![Screenshot 2025-04-28 at 17 50 48](https://github.com/user-attachments/assets/9fd0bf30-a321-4362-a10b-dfc3de1eb474) + + + ### Next steps + - [x] initial dashboards with a live node + - [x] adjust testing +crates: +- name: sc-service + bump: major +- name: sc-rpc-spec-v2 + bump: major diff --git a/prdoc/pr_8369.prdoc b/prdoc/stable2506/pr_8369.prdoc similarity index 100% rename from prdoc/pr_8369.prdoc rename to prdoc/stable2506/pr_8369.prdoc diff --git a/prdoc/pr_8370.prdoc b/prdoc/stable2506/pr_8370.prdoc similarity index 100% rename from prdoc/pr_8370.prdoc rename to prdoc/stable2506/pr_8370.prdoc diff --git a/prdoc/pr_8376.prdoc b/prdoc/stable2506/pr_8376.prdoc similarity index 100% rename from prdoc/pr_8376.prdoc rename to prdoc/stable2506/pr_8376.prdoc diff --git a/prdoc/pr_8382.prdoc b/prdoc/stable2506/pr_8382.prdoc similarity index 100% rename from prdoc/pr_8382.prdoc rename to prdoc/stable2506/pr_8382.prdoc diff --git a/prdoc/pr_8387.prdoc b/prdoc/stable2506/pr_8387.prdoc similarity index 100% rename from prdoc/pr_8387.prdoc rename to prdoc/stable2506/pr_8387.prdoc diff --git a/prdoc/pr_8409.prdoc b/prdoc/stable2506/pr_8409.prdoc similarity index 100% rename from prdoc/pr_8409.prdoc rename to prdoc/stable2506/pr_8409.prdoc diff --git a/prdoc/pr_8422.prdoc b/prdoc/stable2506/pr_8422.prdoc similarity index 100% rename from prdoc/pr_8422.prdoc rename to prdoc/stable2506/pr_8422.prdoc diff --git a/prdoc/pr_8441.prdoc b/prdoc/stable2506/pr_8441.prdoc similarity index 100% rename from prdoc/pr_8441.prdoc rename to prdoc/stable2506/pr_8441.prdoc diff --git a/prdoc/pr_8443.prdoc b/prdoc/stable2506/pr_8443.prdoc similarity index 100% rename from prdoc/pr_8443.prdoc rename to prdoc/stable2506/pr_8443.prdoc diff --git a/prdoc/pr_8445.prdoc b/prdoc/stable2506/pr_8445.prdoc similarity index 100% rename from prdoc/pr_8445.prdoc rename to prdoc/stable2506/pr_8445.prdoc diff --git a/prdoc/stable2506/pr_8461.prdoc b/prdoc/stable2506/pr_8461.prdoc new file mode 100644 index 0000000000000..49663422035de --- /dev/null +++ b/prdoc/stable2506/pr_8461.prdoc @@ -0,0 +1,29 @@ +title: Use litep2p as the default network backend + +doc: + - audience: [Node Dev, Node Operator] + description: | + This PR makes the litep2p backend the default backend. + Litep2p is a lightweight alternative to libp2p, that is designed to be more + efficient and easier to use. At the same time, litep2p brings performance + improvements and reduces the CPU usage significantly. + Libp2p is the old network backend, that may still be used for compatibility + reasons until the whole ecosystem is migrated to litep2p. + +crates: + - name: sc-network + bump: minor + - name: sc-cli + bump: patch + - name: sc-network-types + bump: minor + - name: polkadot-service + bump: minor + - name: sc-offchain + bump: patch + - name: cumulus-relay-chain-minimal-node + bump: patch + - name: cumulus-relay-chain-inprocess-interface + bump: patch + - name: polkadot-omni-node-lib + bump: patch diff --git a/prdoc/pr_8470.prdoc b/prdoc/stable2506/pr_8470.prdoc similarity index 100% rename from prdoc/pr_8470.prdoc rename to prdoc/stable2506/pr_8470.prdoc diff --git a/prdoc/stable2506/pr_8473.prdoc b/prdoc/stable2506/pr_8473.prdoc new file mode 100644 index 0000000000000..f4a2294249454 --- /dev/null +++ b/prdoc/stable2506/pr_8473.prdoc @@ -0,0 +1,35 @@ +title: 'Snowbridge: Remove asset location check' +doc: +- audience: Runtime Dev + description: |- + Since the TokenIdOf conversion is XCM version-agnostic and we store the TokenId as the key in storage, + checking whether the key exists is sufficient to verify if the token is registered. + There is no need to verify the asset location. +crates: +- name: snowbridge-outbound-queue-primitives + bump: patch + validate: false +- name: snowbridge-inbound-queue-primitives + bump: patch + validate: false +- name: snowbridge-test-utils + bump: patch + validate: false +- name: snowbridge-pallet-inbound-queue + bump: patch + validate: false +- name: snowbridge-pallet-inbound-queue-v2 + bump: patch + validate: false +- name: snowbridge-pallet-system + bump: patch + validate: false +- name: snowbridge-pallet-system-v2 + bump: patch + validate: false +- name: bridge-hub-westend-runtime + bump: patch + validate: false +- name: bridge-hub-westend-integration-tests + bump: patch + validate: false diff --git a/prdoc/pr_8477.prdoc b/prdoc/stable2506/pr_8477.prdoc similarity index 100% rename from prdoc/pr_8477.prdoc rename to prdoc/stable2506/pr_8477.prdoc diff --git a/prdoc/pr_8500.prdoc b/prdoc/stable2506/pr_8500.prdoc similarity index 100% rename from prdoc/pr_8500.prdoc rename to prdoc/stable2506/pr_8500.prdoc diff --git a/prdoc/pr_8504.prdoc b/prdoc/stable2506/pr_8504.prdoc similarity index 100% rename from prdoc/pr_8504.prdoc rename to prdoc/stable2506/pr_8504.prdoc diff --git a/prdoc/pr_8528.prdoc b/prdoc/stable2506/pr_8528.prdoc similarity index 100% rename from prdoc/pr_8528.prdoc rename to prdoc/stable2506/pr_8528.prdoc diff --git a/prdoc/pr_8531.prdoc b/prdoc/stable2506/pr_8531.prdoc similarity index 100% rename from prdoc/pr_8531.prdoc rename to prdoc/stable2506/pr_8531.prdoc diff --git a/prdoc/pr_8533.prdoc b/prdoc/stable2506/pr_8533.prdoc similarity index 100% rename from prdoc/pr_8533.prdoc rename to prdoc/stable2506/pr_8533.prdoc diff --git a/prdoc/pr_8535.prdoc b/prdoc/stable2506/pr_8535.prdoc similarity index 100% rename from prdoc/pr_8535.prdoc rename to prdoc/stable2506/pr_8535.prdoc diff --git a/prdoc/pr_8545.prdoc b/prdoc/stable2506/pr_8545.prdoc similarity index 100% rename from prdoc/pr_8545.prdoc rename to prdoc/stable2506/pr_8545.prdoc diff --git a/prdoc/pr_8547.prdoc b/prdoc/stable2506/pr_8547.prdoc similarity index 100% rename from prdoc/pr_8547.prdoc rename to prdoc/stable2506/pr_8547.prdoc diff --git a/prdoc/pr_8554.prdoc b/prdoc/stable2506/pr_8554.prdoc similarity index 100% rename from prdoc/pr_8554.prdoc rename to prdoc/stable2506/pr_8554.prdoc diff --git a/prdoc/pr_8559.prdoc b/prdoc/stable2506/pr_8559.prdoc similarity index 100% rename from prdoc/pr_8559.prdoc rename to prdoc/stable2506/pr_8559.prdoc diff --git a/prdoc/pr_8584.prdoc b/prdoc/stable2506/pr_8584.prdoc similarity index 100% rename from prdoc/pr_8584.prdoc rename to prdoc/stable2506/pr_8584.prdoc diff --git a/prdoc/pr_8587.prdoc b/prdoc/stable2506/pr_8587.prdoc similarity index 100% rename from prdoc/pr_8587.prdoc rename to prdoc/stable2506/pr_8587.prdoc diff --git a/prdoc/pr_8594.prdoc b/prdoc/stable2506/pr_8594.prdoc similarity index 100% rename from prdoc/pr_8594.prdoc rename to prdoc/stable2506/pr_8594.prdoc diff --git a/prdoc/pr_8599.prdoc b/prdoc/stable2506/pr_8599.prdoc similarity index 100% rename from prdoc/pr_8599.prdoc rename to prdoc/stable2506/pr_8599.prdoc diff --git a/prdoc/pr_8606.prdoc b/prdoc/stable2506/pr_8606.prdoc similarity index 100% rename from prdoc/pr_8606.prdoc rename to prdoc/stable2506/pr_8606.prdoc diff --git a/prdoc/stable2506/pr_8630.prdoc b/prdoc/stable2506/pr_8630.prdoc new file mode 100644 index 0000000000000..d079ee89c79a5 --- /dev/null +++ b/prdoc/stable2506/pr_8630.prdoc @@ -0,0 +1,24 @@ +title: "Broker: Introduce min price and adjust renewals to lower market" + +doc: +- audience: Runtime Dev + description: |- + pallet-broker now provides an additional `AdaptPrice` implementation: + `MinimumPrice`. This price adapter works exactly the same as the + `CenterTargetPrice` adapter, except that it can be configured with a + minimum price. If set, it will never drop the returned `end_price` (nor the + `target_price`) below that minimum. + + Apart from having an adapter to ensure a minimum price, the behavior of + renewals was also adjusted: Renewals are now either bumped by renewal bump + or set to the `end_price` of the current sale - whatever number is higher. + This ensures some market coupling of renewal prices, while still + maintaining some predictability. + +crates: +- name: pallet-broker + bump: minor +- name: coretime-rococo-runtime + bump: minor +- name: coretime-westend-runtime + bump: minor diff --git a/prdoc/pr_8633.prdoc b/prdoc/stable2506/pr_8633.prdoc similarity index 100% rename from prdoc/pr_8633.prdoc rename to prdoc/stable2506/pr_8633.prdoc diff --git a/prdoc/stable2506/pr_8650.prdoc b/prdoc/stable2506/pr_8650.prdoc new file mode 100644 index 0000000000000..a2a1a8d06f074 --- /dev/null +++ b/prdoc/stable2506/pr_8650.prdoc @@ -0,0 +1,25 @@ +title: 'litep2p/peerset: Reject non-reserved peers in the reserved-only mode' +doc: +- audience: Node Operator + description: |- + This PR rejects non-reserved peers in the reserved-only mode of the litep2p notification peerset. + + Previously, litep2p ignored completely the reserved-only state while accepting inbound connections. However, it handled it properly during the slot allocation phase. + - the main changes are in the `report_inbound_substream` function, which now propagated a `Rejected` response to litep2p on the reserved-only state + - in response, litep2p should never open an inbound substream after receiving the rejected response + - the state of peers is not advanced while in `Disconnected` or `Backoff` states + - the opening state is moved to `Cancelled` + - for consistency purposes (and fuzzing purposes), the `report_substream_opened` is more robustly handling the `Disconnected` state + - while at it have replaced a panic with `debug_assert` and an instant reject + + ## Testing Done + - started 2 nodes in Kusama and Polkadot with litep2p + - added the `reserved_only_rejects_non_reserved_peers` test to ensure litep2p handles peers properly from different states + + + This PR has been extracted from https://github.com/paritytech/polkadot-sdk/pull/8461 to ease the review process + + cc @paritytech/networking +crates: +- name: sc-network + bump: patch diff --git a/prdoc/pr_8652.prdoc b/prdoc/stable2506/pr_8652.prdoc similarity index 100% rename from prdoc/pr_8652.prdoc rename to prdoc/stable2506/pr_8652.prdoc diff --git a/prdoc/pr_8662.prdoc b/prdoc/stable2506/pr_8662.prdoc similarity index 100% rename from prdoc/pr_8662.prdoc rename to prdoc/stable2506/pr_8662.prdoc diff --git a/prdoc/pr_8664.prdoc b/prdoc/stable2506/pr_8664.prdoc similarity index 100% rename from prdoc/pr_8664.prdoc rename to prdoc/stable2506/pr_8664.prdoc diff --git a/prdoc/pr_8667.prdoc b/prdoc/stable2506/pr_8667.prdoc similarity index 100% rename from prdoc/pr_8667.prdoc rename to prdoc/stable2506/pr_8667.prdoc diff --git a/prdoc/stable2506/pr_8669.prdoc b/prdoc/stable2506/pr_8669.prdoc new file mode 100644 index 0000000000000..9ff187e8ff152 --- /dev/null +++ b/prdoc/stable2506/pr_8669.prdoc @@ -0,0 +1,12 @@ +title: 'cumulus-aura: Improve equivocation checks' +doc: +- audience: Node Dev + description: |- + Instead of just checking for the slot, we also take the block number and the relay parent into account (as we actually allow to build multiple blocks per slot). Then this pr also ensures that we are still able to import blocks from availability recovery. This ensures that a network doesn't get stuck on a storm of equivocations. The next step after this pull request would be to implement on chain slashing for equivocations and probably disabling of the offending author. +crates: +- name: cumulus-client-consensus-aura + bump: patch +- name: cumulus-client-pov-recovery + bump: none +- name: cumulus-pallet-parachain-system + bump: none diff --git a/prdoc/pr_8679.prdoc b/prdoc/stable2506/pr_8679.prdoc similarity index 100% rename from prdoc/pr_8679.prdoc rename to prdoc/stable2506/pr_8679.prdoc diff --git a/prdoc/pr_8687.prdoc b/prdoc/stable2506/pr_8687.prdoc similarity index 100% rename from prdoc/pr_8687.prdoc rename to prdoc/stable2506/pr_8687.prdoc diff --git a/prdoc/pr_8688.prdoc b/prdoc/stable2506/pr_8688.prdoc similarity index 100% rename from prdoc/pr_8688.prdoc rename to prdoc/stable2506/pr_8688.prdoc diff --git a/prdoc/pr_8700.prdoc b/prdoc/stable2506/pr_8700.prdoc similarity index 100% rename from prdoc/pr_8700.prdoc rename to prdoc/stable2506/pr_8700.prdoc diff --git a/prdoc/pr_8702.prdoc b/prdoc/stable2506/pr_8702.prdoc similarity index 100% rename from prdoc/pr_8702.prdoc rename to prdoc/stable2506/pr_8702.prdoc diff --git a/prdoc/pr_8704.prdoc b/prdoc/stable2506/pr_8704.prdoc similarity index 100% rename from prdoc/pr_8704.prdoc rename to prdoc/stable2506/pr_8704.prdoc diff --git a/prdoc/pr_8708.prdoc b/prdoc/stable2506/pr_8708.prdoc similarity index 100% rename from prdoc/pr_8708.prdoc rename to prdoc/stable2506/pr_8708.prdoc diff --git a/prdoc/pr_8715.prdoc b/prdoc/stable2506/pr_8715.prdoc similarity index 100% rename from prdoc/pr_8715.prdoc rename to prdoc/stable2506/pr_8715.prdoc diff --git a/prdoc/pr_8718.prdoc b/prdoc/stable2506/pr_8718.prdoc similarity index 100% rename from prdoc/pr_8718.prdoc rename to prdoc/stable2506/pr_8718.prdoc diff --git a/prdoc/pr_8724.prdoc b/prdoc/stable2506/pr_8724.prdoc similarity index 100% rename from prdoc/pr_8724.prdoc rename to prdoc/stable2506/pr_8724.prdoc diff --git a/prdoc/stable2506/pr_8725.prdoc b/prdoc/stable2506/pr_8725.prdoc new file mode 100644 index 0000000000000..0d1ecdef17d3e --- /dev/null +++ b/prdoc/stable2506/pr_8725.prdoc @@ -0,0 +1,15 @@ +title: 'Snowbridge: register polkadot native asset with fee' +doc: +- audience: Runtime Dev + description: To enforce a fee for PNA registration. +crates: +- name: snowbridge-pallet-system-frontend + bump: patch + validate: false +- name: snowbridge-pallet-system-v2 + bump: patch + validate: false +- name: asset-hub-westend-runtime + bump: patch +- name: bridge-hub-westend-integration-tests + bump: none diff --git a/prdoc/pr_8734.prdoc b/prdoc/stable2506/pr_8734.prdoc similarity index 100% rename from prdoc/pr_8734.prdoc rename to prdoc/stable2506/pr_8734.prdoc diff --git a/prdoc/pr_8745.prdoc b/prdoc/stable2506/pr_8745.prdoc similarity index 100% rename from prdoc/pr_8745.prdoc rename to prdoc/stable2506/pr_8745.prdoc diff --git a/prdoc/pr_8750.prdoc b/prdoc/stable2506/pr_8750.prdoc similarity index 100% rename from prdoc/pr_8750.prdoc rename to prdoc/stable2506/pr_8750.prdoc diff --git a/prdoc/pr_8860.prdoc b/prdoc/stable2506/pr_8860.prdoc similarity index 100% rename from prdoc/pr_8860.prdoc rename to prdoc/stable2506/pr_8860.prdoc diff --git a/prdoc/pr_8891.prdoc b/prdoc/stable2506/pr_8891.prdoc similarity index 100% rename from prdoc/pr_8891.prdoc rename to prdoc/stable2506/pr_8891.prdoc diff --git a/prdoc/pr_9094.prdoc b/prdoc/stable2506/pr_9094.prdoc similarity index 100% rename from prdoc/pr_9094.prdoc rename to prdoc/stable2506/pr_9094.prdoc diff --git a/prdoc/stable2506/pr_9102.prdoc b/prdoc/stable2506/pr_9102.prdoc new file mode 100644 index 0000000000000..67d1c25abb5c2 --- /dev/null +++ b/prdoc/stable2506/pr_9102.prdoc @@ -0,0 +1,12 @@ +title: '`polkadot-omni-node`: pass timestamp inherent data for block import' +doc: +- audience: [ Runtime Dev, Node Dev ] + description: |- + This should allow aura runtimes to check timestamp inherent data when syncing/importing blocks + that include timestamp inherent data. + + Runtime developers can check timestamp inherent data while using `polkadot-omni-node-lib`/`polkadot-omni-node`/`polkadot-parachain` binaries. + This change is backwards compatible and doesn't require runtimes to check the timestamp inherent, but they are able to do it now if needed. +crates: +- name: polkadot-omni-node-lib + bump: minor diff --git a/prdoc/pr_9127.prdoc b/prdoc/stable2506/pr_9127.prdoc similarity index 100% rename from prdoc/pr_9127.prdoc rename to prdoc/stable2506/pr_9127.prdoc diff --git a/prdoc/pr_9137.prdoc b/prdoc/stable2506/pr_9137.prdoc similarity index 100% rename from prdoc/pr_9137.prdoc rename to prdoc/stable2506/pr_9137.prdoc diff --git a/prdoc/pr_9139.prdoc b/prdoc/stable2506/pr_9139.prdoc similarity index 100% rename from prdoc/pr_9139.prdoc rename to prdoc/stable2506/pr_9139.prdoc diff --git a/prdoc/pr_9202.prdoc b/prdoc/stable2506/pr_9202.prdoc similarity index 100% rename from prdoc/pr_9202.prdoc rename to prdoc/stable2506/pr_9202.prdoc diff --git a/prdoc/pr_9264.prdoc b/prdoc/stable2506/pr_9264.prdoc similarity index 100% rename from prdoc/pr_9264.prdoc rename to prdoc/stable2506/pr_9264.prdoc diff --git a/substrate/bin/node/bench/src/construct.rs b/substrate/bin/node/bench/src/construct.rs index 5e5b2fa4399b4..4f78097254eaf 100644 --- a/substrate/bin/node/bench/src/construct.rs +++ b/substrate/bin/node/bench/src/construct.rs @@ -144,7 +144,8 @@ impl core::Benchmark for ConstructionBenchmark { let inherent_data = futures::executor::block_on(timestamp_provider.create_inherent_data()) .expect("Create inherent data failed"); - let _block = futures::executor::block_on(proposer.propose( + let _block = futures::executor::block_on(Proposer::propose( + proposer, inherent_data, Default::default(), std::time::Duration::from_secs(20), diff --git a/substrate/bin/node/cli/src/service.rs b/substrate/bin/node/cli/src/service.rs index f42f14de021df..1ef506ddd9c77 100644 --- a/substrate/bin/node/cli/src/service.rs +++ b/substrate/bin/node/cli/src/service.rs @@ -1012,11 +1012,15 @@ mod tests { digest.push(::babe_pre_digest(babe_pre_digest)); let new_block = futures::executor::block_on(async move { - let proposer = proposer_factory.init(&parent_header).await; - proposer - .unwrap() - .propose(inherent_data, digest, std::time::Duration::from_secs(1), None) - .await + let proposer = proposer_factory.init(&parent_header).await.unwrap(); + Proposer::propose( + proposer, + inherent_data, + digest, + std::time::Duration::from_secs(1), + None, + ) + .await }) .expect("Error making test block") .block; diff --git a/substrate/client/basic-authorship/Cargo.toml b/substrate/client/basic-authorship/Cargo.toml index 5595f345e9039..59f0c3a645c58 100644 --- a/substrate/client/basic-authorship/Cargo.toml +++ b/substrate/client/basic-authorship/Cargo.toml @@ -30,6 +30,7 @@ sp-consensus = { workspace = true, default-features = true } sp-core = { workspace = true, default-features = true } sp-inherents = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } +sp-trie = { workspace = true, default-features = true } [dev-dependencies] parking_lot = { workspace = true, default-features = true } diff --git a/substrate/client/basic-authorship/src/basic_authorship.rs b/substrate/client/basic-authorship/src/basic_authorship.rs index 7525529e43303..bd1176baa6bea 100644 --- a/substrate/client/basic-authorship/src/basic_authorship.rs +++ b/substrate/client/basic-authorship/src/basic_authorship.rs @@ -27,10 +27,12 @@ use futures::{ future::{Future, FutureExt}, }; use log::{debug, error, info, trace, warn}; +use prometheus_endpoint::Registry as PrometheusRegistry; use sc_block_builder::{BlockBuilderApi, BlockBuilderBuilder}; +use sc_proposer_metrics::{EndProposingReason, MetricsLink as PrometheusMetrics}; use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_INFO}; use sc_transaction_pool_api::{InPoolTransaction, TransactionPool, TxInvalidityReportMap}; -use sp_api::{ApiExt, CallApiAt, ProvideRuntimeApi}; +use sp_api::{ApiExt, CallApiAt, ProofRecorder, ProvideRuntimeApi}; use sp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed, HeaderBackend}; use sp_consensus::{DisableProofRecording, EnableProofRecording, ProofRecording, Proposal}; use sp_core::traits::SpawnNamed; @@ -39,11 +41,9 @@ use sp_runtime::{ traits::{BlakeTwo256, Block as BlockT, Hash as HashT, Header as HeaderT}, Digest, ExtrinsicInclusionMode, Percent, SaturatedConversion, }; +use sp_trie::recorder::IgnoredNodes; use std::{marker::PhantomData, pin::Pin, sync::Arc, time}; -use prometheus_endpoint::Registry as PrometheusRegistry; -use sc_proposer_metrics::{EndProposingReason, MetricsLink as PrometheusMetrics}; - /// Default block size limit in bytes used by [`Proposer`]. /// /// Can be overwritten by [`ProposerFactory::set_default_block_size_limit`]. @@ -283,28 +283,45 @@ where max_duration: time::Duration, block_size_limit: Option, ) -> Self::Proposal { - let (tx, rx) = oneshot::channel(); - let spawn_handle = self.spawn_handle.clone(); + self.propose_block(ProposeArgs { + inherent_data, + inherent_digests, + max_duration, + block_size_limit, + ignored_nodes_by_proof_recording: None, + }) + .boxed() + } +} - spawn_handle.spawn_blocking( - "basic-authorship-proposer", - None, - Box::pin(async move { - // leave some time for evaluation and block finalization (10%) - let deadline = (self.now)() + max_duration - max_duration / 10; - let res = self - .propose_with(inherent_data, inherent_digests, deadline, block_size_limit) - .await; - if tx.send(res).is_err() { - trace!( - target: LOG_TARGET, - "Could not send block production result to proposer!" - ); - } - }), - ); +/// Arguments for [`Proposer::propose_block`]. +pub struct ProposeArgs { + /// The inherent data to pass to the block production. + pub inherent_data: InherentData, + /// The inherent digests to include in the produced block. + pub inherent_digests: Digest, + /// Max duration for building the block. + pub max_duration: time::Duration, + /// Optional size limit for the produced block. + /// + /// When set, block production ends before hitting this limit. The limit includes the storage + /// proof, when proof recording is activated. + pub block_size_limit: Option, + /// Trie nodes that should not be recorded. + /// + /// Only applies when proof recording is enabled. + pub ignored_nodes_by_proof_recording: Option>, +} - async move { rx.await? }.boxed() +impl Default for ProposeArgs { + fn default() -> Self { + Self { + inherent_data: Default::default(), + inherent_digests: Default::default(), + max_duration: Default::default(), + block_size_limit: None, + ignored_nodes_by_proof_recording: None, + } } } @@ -315,24 +332,60 @@ const MAX_SKIPPED_TRANSACTIONS: usize = 8; impl Proposer where - A: TransactionPool, + A: TransactionPool + 'static, Block: BlockT, C: HeaderBackend + ProvideRuntimeApi + CallApiAt + Send + Sync + 'static, C::Api: ApiExt + BlockBuilderApi, PR: ProofRecording, { + /// Propose a new block. + pub async fn propose_block( + self, + args: ProposeArgs, + ) -> Result, sp_blockchain::Error> { + let (tx, rx) = oneshot::channel(); + let spawn_handle = self.spawn_handle.clone(); + + // Spawn on a new thread, because block production is a blocking operation. + spawn_handle.spawn_blocking( + "basic-authorship-proposer", + None, + async move { + let res = self.propose_with(args).await; + if tx.send(res).is_err() { + trace!( + target: LOG_TARGET, + "Could not send block production result to proposer!" + ); + } + } + .boxed(), + ); + + rx.await?.map_err(Into::into) + } + async fn propose_with( self, - inherent_data: InherentData, - inherent_digests: Digest, - deadline: time::Instant, - block_size_limit: Option, + ProposeArgs { + inherent_data, + inherent_digests, + max_duration, + block_size_limit, + ignored_nodes_by_proof_recording, + }: ProposeArgs, ) -> Result, sp_blockchain::Error> { + // leave some time for evaluation and block finalization (10%) + let deadline = (self.now)() + max_duration - max_duration / 10; let block_timer = time::Instant::now(); let mut block_builder = BlockBuilderBuilder::new(&*self.client) .on_parent_block(self.parent_hash) .with_parent_block_number(self.parent_number) - .with_proof_recording(PR::ENABLED) + .with_proof_recorder(PR::ENABLED.then(|| { + ProofRecorder::::with_ignored_nodes( + ignored_nodes_by_proof_recording.unwrap_or_default(), + ) + })) .with_inherent_digests(inherent_digests) .build()?; @@ -605,7 +658,6 @@ where #[cfg(test)] mod tests { use super::*; - use futures::executor::block_on; use parking_lot::Mutex; use sc_client_api::{Backend, TrieCacheContext}; @@ -613,7 +665,7 @@ mod tests { use sc_transaction_pool_api::{ChainEvent, MaintainedTransactionPool, TransactionSource}; use sp_api::Core; use sp_blockchain::HeaderBackend; - use sp_consensus::{BlockOrigin, Environment, Proposer}; + use sp_consensus::{BlockOrigin, Environment}; use sp_runtime::{generic::BlockId, traits::NumberFor, Perbill}; use substrate_test_runtime_client::{ prelude::*, @@ -689,10 +741,11 @@ mod tests { // when let deadline = time::Duration::from_secs(3); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); + let block = block_on( + proposer.propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .map(|r| r.block) + .unwrap(); // then // block should have some extrinsics although we have some more in the pool. @@ -731,9 +784,11 @@ mod tests { ); let deadline = time::Duration::from_secs(1); - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); + block_on( + proposer.propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .map(|r| r.block) + .unwrap(); } #[test] @@ -770,9 +825,10 @@ mod tests { ); let deadline = time::Duration::from_secs(9); - let proposal = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .unwrap(); + let proposal = block_on( + proposer.propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .unwrap(); assert_eq!(proposal.block.extrinsics().len(), 1); @@ -835,10 +891,12 @@ mod tests { // when let deadline = time::Duration::from_secs(900); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); + let block = block_on( + proposer + .propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .map(|r| r.block) + .unwrap(); // then // block should have some extrinsics although we have some more in the pool. @@ -947,12 +1005,11 @@ mod tests { // Give it enough time let deadline = time::Duration::from_secs(300); - let block = block_on(proposer.propose( - Default::default(), - Default::default(), - deadline, - Some(block_limit), - )) + let block = block_on(proposer.propose_block(ProposeArgs { + max_duration: deadline, + block_size_limit: Some(block_limit), + ..Default::default() + })) .map(|r| r.block) .unwrap(); @@ -961,10 +1018,11 @@ mod tests { let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); + let block = block_on( + proposer.propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .map(|r| r.block) + .unwrap(); // Without a block limit we should include all of them assert_eq!(block.extrinsics().len(), extrinsics_num); @@ -990,12 +1048,11 @@ mod tests { .unwrap(); builder.estimate_block_size(true) + extrinsics[0].encoded_size() }; - let block = block_on(proposer.propose( - Default::default(), - Default::default(), - deadline, - Some(block_limit), - )) + let block = block_on(proposer.propose_block(ProposeArgs { + max_duration: deadline, + block_size_limit: Some(block_limit), + ..Default::default() + })) .map(|r| r.block) .unwrap(); @@ -1065,10 +1122,11 @@ mod tests { // when // give it enough time so that deadline is never triggered. let deadline = time::Duration::from_secs(900); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); + let block = block_on( + proposer.propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .map(|r| r.block) + .unwrap(); // then block should have all non-exhaust resources extrinsics (+ the first one). assert_eq!(block.extrinsics().len(), MAX_SKIPPED_TRANSACTIONS + 1); @@ -1143,10 +1201,11 @@ mod tests { }), ); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); + let block = block_on( + proposer.propose_block(ProposeArgs { max_duration: deadline, ..Default::default() }), + ) + .map(|r| r.block) + .unwrap(); // then the block should have one or two transactions. This maybe random as they are // processed in parallel. The same signer and consecutive nonces for huge and tiny diff --git a/substrate/client/basic-authorship/src/lib.rs b/substrate/client/basic-authorship/src/lib.rs index 13c75fd08c3c8..b08b66e23aa13 100644 --- a/substrate/client/basic-authorship/src/lib.rs +++ b/substrate/client/basic-authorship/src/lib.rs @@ -58,7 +58,8 @@ //! //! // This `Proposer` allows us to create a block proposition. //! // The proposer will grab transactions from the transaction pool, and put them into the block. -//! let future = proposer.propose( +//! let future = Proposer::propose( +//! proposer, //! Default::default(), //! Default::default(), //! Duration::from_secs(2), @@ -72,4 +73,6 @@ mod basic_authorship; -pub use crate::basic_authorship::{Proposer, ProposerFactory, DEFAULT_BLOCK_SIZE_LIMIT}; +pub use crate::basic_authorship::{ + ProposeArgs, Proposer, ProposerFactory, DEFAULT_BLOCK_SIZE_LIMIT, +}; diff --git a/substrate/client/block-builder/src/lib.rs b/substrate/client/block-builder/src/lib.rs index d02d0e3218051..00b82382f5428 100644 --- a/substrate/client/block-builder/src/lib.rs +++ b/substrate/client/block-builder/src/lib.rs @@ -29,8 +29,8 @@ use codec::Encode; use sp_api::{ - ApiExt, ApiRef, CallApiAt, Core, ProvideRuntimeApi, StorageChanges, StorageProof, - TransactionOutcome, + ApiExt, ApiRef, CallApiAt, Core, ProofRecorder, ProvideRuntimeApi, StorageChanges, + StorageProof, TransactionOutcome, }; use sp_blockchain::{ApplyExtrinsicFailed, Error, HeaderBackend}; use sp_core::traits::CallContext; @@ -99,7 +99,7 @@ where Ok(BlockBuilderBuilderStage2 { call_api_at: self.call_api_at, - enable_proof_recording: false, + proof_recorder: None, inherent_digests: Default::default(), parent_block: self.parent_block, parent_number, @@ -116,7 +116,7 @@ where ) -> BlockBuilderBuilderStage2<'a, B, C> { BlockBuilderBuilderStage2 { call_api_at: self.call_api_at, - enable_proof_recording: false, + proof_recorder: None, inherent_digests: Default::default(), parent_block: self.parent_block, parent_number, @@ -130,7 +130,7 @@ where /// [`BlockBuilderBuilder::new`] needs to be used. pub struct BlockBuilderBuilderStage2<'a, B: BlockT, C> { call_api_at: &'a C, - enable_proof_recording: bool, + proof_recorder: Option>, inherent_digests: Digest, parent_block: B::Hash, parent_number: NumberFor, @@ -139,13 +139,19 @@ pub struct BlockBuilderBuilderStage2<'a, B: BlockT, C> { impl<'a, B: BlockT, C> BlockBuilderBuilderStage2<'a, B, C> { /// Enable proof recording for the block builder. pub fn enable_proof_recording(mut self) -> Self { - self.enable_proof_recording = true; + self.proof_recorder = Some(Default::default()); self } /// Enable/disable proof recording for the block builder. pub fn with_proof_recording(mut self, enable: bool) -> Self { - self.enable_proof_recording = enable; + self.proof_recorder = enable.then(|| Default::default()); + self + } + + /// Enable/disable proof recording for the block builder using the given proof recorder. + pub fn with_proof_recorder(mut self, proof_recorder: Option>) -> Self { + self.proof_recorder = proof_recorder; self } @@ -165,7 +171,7 @@ impl<'a, B: BlockT, C> BlockBuilderBuilderStage2<'a, B, C> { self.call_api_at, self.parent_block, self.parent_number, - self.enable_proof_recording, + self.proof_recorder, self.inherent_digests, ) } @@ -221,7 +227,7 @@ where call_api_at: &'a C, parent_hash: Block::Hash, parent_number: NumberFor, - record_proof: bool, + proof_recorder: Option>, inherent_digests: Digest, ) -> Result { let header = <::Header as HeaderT>::new( @@ -236,11 +242,8 @@ where let mut api = call_api_at.runtime_api(); - if record_proof { - api.record_proof(); - let recorder = api - .proof_recorder() - .expect("Proof recording is enabled in the line above; qed."); + if let Some(recorder) = proof_recorder { + api.record_proof_with_recorder(recorder.clone()); api.register_extension(ProofSizeExt::new(recorder)); } diff --git a/substrate/client/consensus/common/src/block_import.rs b/substrate/client/consensus/common/src/block_import.rs index 0fcf96a963682..f90412d677d22 100644 --- a/substrate/client/consensus/common/src/block_import.rs +++ b/substrate/client/consensus/common/src/block_import.rs @@ -165,6 +165,20 @@ impl StateAction { } } +impl From> for StateAction { + fn from(value: StorageChanges) -> Self { + Self::ApplyChanges(value) + } +} + +impl From>> + for StateAction +{ + fn from(value: sp_state_machine::StorageChanges>) -> Self { + Self::ApplyChanges(StorageChanges::Changes(value)) + } +} + /// Data required to import a Block. #[non_exhaustive] pub struct BlockImportParams { diff --git a/substrate/client/executor/wasmtime/Cargo.toml b/substrate/client/executor/wasmtime/Cargo.toml index 410a5a363adff..250bf4a516f52 100644 --- a/substrate/client/executor/wasmtime/Cargo.toml +++ b/substrate/client/executor/wasmtime/Cargo.toml @@ -27,11 +27,15 @@ sc-executor-common = { workspace = true, default-features = true } sp-runtime-interface = { workspace = true, default-features = true } sp-wasm-interface = { features = ["wasmtime"], workspace = true, default-features = true } wasmtime = { features = [ + "addr2line", "cache", "cranelift", - "jitdump", + "demangle", + "gc", + "gc-null", "parallel-compilation", "pooling-allocator", + "threads", ], workspace = true } # Here we include the rustix crate in the exactly same semver-compatible version as used by diff --git a/substrate/client/executor/wasmtime/src/runtime.rs b/substrate/client/executor/wasmtime/src/runtime.rs index 286d134ecd171..fd2b2f9ead5d2 100644 --- a/substrate/client/executor/wasmtime/src/runtime.rs +++ b/substrate/client/executor/wasmtime/src/runtime.rs @@ -41,7 +41,7 @@ use std::{ Arc, }, }; -use wasmtime::{AsContext, Engine, Memory}; +use wasmtime::{AsContext, Cache, CacheConfig, Engine, Memory}; const MAX_INSTANCE_COUNT: u32 = 64; @@ -204,27 +204,13 @@ fn setup_wasmtime_caching( fs::create_dir_all(&wasmtime_cache_root) .map_err(|err| format!("cannot create the dirs to cache: {}", err))?; - // Canonicalize the path after creating the directories. - let wasmtime_cache_root = wasmtime_cache_root - .canonicalize() - .map_err(|err| format!("failed to canonicalize the path: {}", err))?; - - // Write the cache config file - let cache_config_path = wasmtime_cache_root.join("cache-config.toml"); - let config_content = format!( - "\ -[cache] -enabled = true -directory = \"{cache_dir}\" -", - cache_dir = wasmtime_cache_root.display() - ); - fs::write(&cache_config_path, config_content) - .map_err(|err| format!("cannot write the cache config: {}", err))?; + let mut cache_config = CacheConfig::new(); + cache_config.with_directory(cache_path); + + let cache = + Cache::new(cache_config).map_err(|err| format!("failed to initiate Cache: {err:?}"))?; - config - .cache_config_load(cache_config_path) - .map_err(|err| format!("failed to parse the config: {:#}", err))?; + config.cache(Some(cache)); Ok(()) } @@ -234,11 +220,6 @@ fn common_config(semantics: &Semantics) -> std::result::Result wasmtime::ProfilingStrategy::JitDump, None => wasmtime::ProfilingStrategy::None, @@ -272,11 +253,14 @@ fn common_config(semantics: &Semantics) -> std::result::Result (true, true), @@ -313,15 +297,14 @@ fn common_config(semantics: &Semantics) -> std::result::Result String { // We need two limits here since depending on whether the code is compiled in debug // or in release mode the maximum call depth is slightly different. -const CALL_DEPTH_LOWER_LIMIT: usize = 65455; -const CALL_DEPTH_UPPER_LIMIT: usize = 65509; +const CALL_DEPTH_LOWER_LIMIT: usize = 65451; +const CALL_DEPTH_UPPER_LIMIT: usize = 65506; test_wasm_execution!(test_consume_under_1mb_of_stack_does_not_trap); fn test_consume_under_1mb_of_stack_does_not_trap(instantiation_strategy: InstantiationStrategy) { @@ -496,7 +496,7 @@ fn test_rustix_version_matches_with_wasmtime() { let wasmtime_rustix = metadata .packages .iter() - .find(|pkg| pkg.name == "wasmtime-runtime") + .find(|pkg| pkg.name == "wasmtime") .unwrap() .dependencies .iter() diff --git a/substrate/client/mixnet/src/request.rs b/substrate/client/mixnet/src/request.rs index 18a74c7ea5cf1..274b9b8ae5e51 100644 --- a/substrate/client/mixnet/src/request.rs +++ b/substrate/client/mixnet/src/request.rs @@ -93,7 +93,7 @@ impl mixnet::request_manager::Request for Request { fn with_data(&self, f: impl FnOnce(Scattered) -> T, _context: &Self::Context) -> T { match self { Request::SubmitExtrinsic { extrinsic, .. } => - f([&[SUBMIT_EXTRINSIC], extrinsic.as_ref()].as_slice().into()), + f([&[SUBMIT_EXTRINSIC][..], extrinsic.0.as_slice()].as_slice().into()), } } diff --git a/substrate/client/network/src/config.rs b/substrate/client/network/src/config.rs index 5f90a7bfe15ee..fc316e382bb15 100644 --- a/substrate/client/network/src/config.rs +++ b/substrate/client/network/src/config.rs @@ -74,6 +74,21 @@ use std::{ /// are possible in custom nodes through [`NetworkConfiguration`]. pub const DEFAULT_IDLE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(10); +/// Maximum number of locally kept Kademlia provider keys. +/// +/// 10000 keys is enough for a testnet with fast runtime (1-minute epoch) and 13 parachains. +pub const KADEMLIA_MAX_PROVIDER_KEYS: usize = 10000; + +/// Time to keep Kademlia content provider records. +/// +/// 10 h is enough time to keep the parachain bootnode record for two 4-hour epochs. +pub const KADEMLIA_PROVIDER_RECORD_TTL: Duration = Duration::from_secs(10 * 3600); + +/// Interval of republishing Kademlia provider records. +/// +/// 3.5 h means we refresh next epoch provider record 30 minutes before next 4-hour epoch comes. +pub const KADEMLIA_PROVIDER_REPUBLISH_INTERVAL: Duration = Duration::from_secs(12600); + /// Protocol name prefix, transmitted on the wire for legacy protocol names. /// I.e., `dot` in `/dot/sync/2`. Should be unique for each chain. Always UTF-8. /// Deprecated in favour of genesis hash & fork ID based protocol names. diff --git a/substrate/client/network/src/discovery.rs b/substrate/client/network/src/discovery.rs index b0917ed363b65..a5d693f699443 100644 --- a/substrate/client/network/src/discovery.rs +++ b/substrate/client/network/src/discovery.rs @@ -46,7 +46,13 @@ //! active mechanism that asks nodes for the addresses they are listening on. Whenever we learn //! of a node's address, you must call `add_self_reported_address`. -use crate::{config::ProtocolId, utils::LruHashSet}; +use crate::{ + config::{ + ProtocolId, KADEMLIA_MAX_PROVIDER_KEYS, KADEMLIA_PROVIDER_RECORD_TTL, + KADEMLIA_PROVIDER_REPUBLISH_INTERVAL, + }, + utils::LruHashSet, +}; use array_bytes::bytes2hex; use futures::prelude::*; @@ -56,7 +62,7 @@ use libp2p::{ core::{transport::PortUse, Endpoint, Multiaddr}, kad::{ self, - store::{MemoryStore, RecordStore}, + store::{MemoryStore, MemoryStoreConfig, RecordStore}, Behaviour as Kademlia, BucketInserts, Config as KademliaConfig, Event as KademliaEvent, Event, GetClosestPeersError, GetClosestPeersOk, GetProvidersError, GetProvidersOk, GetRecordOk, PeerRecord, QueryId, QueryResult, Quorum, Record, RecordKey, @@ -239,7 +245,18 @@ impl DiscoveryConfig { // auto-insertion and instead add peers manually. config.set_kbucket_inserts(BucketInserts::Manual); config.disjoint_query_paths(kademlia_disjoint_query_paths); - let store = MemoryStore::new(local_peer_id); + + config.set_provider_record_ttl(Some(KADEMLIA_PROVIDER_RECORD_TTL)); + config.set_provider_publication_interval(Some(KADEMLIA_PROVIDER_REPUBLISH_INTERVAL)); + + let store = MemoryStore::with_config( + local_peer_id, + MemoryStoreConfig { + max_provided_keys: KADEMLIA_MAX_PROVIDER_KEYS, + ..Default::default() + }, + ); + let mut kad = Kademlia::with_config(local_peer_id, store, config); kad.set_mode(Some(kad::Mode::Server)); diff --git a/substrate/client/network/src/litep2p/discovery.rs b/substrate/client/network/src/litep2p/discovery.rs index a9f9db79c3933..4a9b84b3a215a 100644 --- a/substrate/client/network/src/litep2p/discovery.rs +++ b/substrate/client/network/src/litep2p/discovery.rs @@ -19,7 +19,10 @@ //! libp2p-related discovery code for litep2p backend. use crate::{ - config::{NetworkConfiguration, ProtocolId}, + config::{ + NetworkConfiguration, ProtocolId, KADEMLIA_MAX_PROVIDER_KEYS, KADEMLIA_PROVIDER_RECORD_TTL, + KADEMLIA_PROVIDER_REPUBLISH_INTERVAL, + }, peer_store::PeerStoreProvider, }; @@ -299,6 +302,9 @@ impl Discovery { .with_known_peers(known_peers) .with_protocol_names(protocol_names) .with_incoming_records_validation_mode(IncomingRecordValidationMode::Manual) + .with_provider_record_ttl(KADEMLIA_PROVIDER_RECORD_TTL) + .with_provider_refresh_interval(KADEMLIA_PROVIDER_REPUBLISH_INTERVAL) + .with_max_provider_keys(KADEMLIA_MAX_PROVIDER_KEYS) .build() }; @@ -493,6 +499,15 @@ impl Discovery { ) -> (bool, Option) { log::trace!(target: LOG_TARGET, "verify new external address: {address}"); + if !self.allow_non_global_addresses && !Discovery::can_add_to_dht(&address) { + log::trace!( + target: LOG_TARGET, + "ignoring externally reported non-global address {address} from {peer}." + ); + + return (false, None); + } + // is the address one of our known addresses if self .listen_addresses diff --git a/substrate/client/network/src/litep2p/mod.rs b/substrate/client/network/src/litep2p/mod.rs index d1801475fcbbe..95229ad5ce126 100644 --- a/substrate/client/network/src/litep2p/mod.rs +++ b/substrate/client/network/src/litep2p/mod.rs @@ -517,6 +517,9 @@ impl NetworkBackend for Litep2pNetworkBac Some(crate::MAX_CONNECTIONS_ESTABLISHED_INCOMING as usize), )) .with_keep_alive_timeout(network_config.idle_connection_timeout) + // Use system DNS resolver to enable intranet domain resolution and administrator + // control over DNS lookup. + .with_system_resolver() .with_executor(executor); if let Some(config) = maybe_mdns_config { diff --git a/substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs b/substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs index 06cb9d3acf9c7..f8048dd0c2940 100644 --- a/substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs +++ b/substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs @@ -208,6 +208,23 @@ where ChainApi: graph::ChainApi + 'static, ::Hash: Unpin, { + // Injects a view for the given block to self. + // + // Helper for the pool new methods. + fn inject_initial_view(self, initial_view_hash: Block::Hash) -> Self { + if let Some(block_number) = + self.api.block_id_to_number(&BlockId::Hash(initial_view_hash)).ok().flatten() + { + let at_best = HashAndNumber { number: block_number, hash: initial_view_hash }; + let tree_route = + &TreeRoute::new(vec![at_best.clone()], 0).expect("tree route is correct; qed"); + let view = self.build_and_plug_view(None, &at_best, &tree_route); + self.view_store.insert_new_view_sync(view.into(), &tree_route); + trace!(target: LOG_TARGET, ?block_number, ?initial_view_hash, "fatp::injected initial view"); + }; + self + } + /// Create new fork aware transaction pool with provided shared instance of `ChainApi` intended /// for tests. pub fn new_test( @@ -304,7 +321,8 @@ where submit_and_watch_stats: DurationSlidingStats::new(Duration::from_secs( STAT_SLIDING_WINDOW, )), - }, + } + .inject_initial_view(best_block_hash), [combined_tasks, mempool_task], ) } @@ -461,6 +479,7 @@ where STAT_SLIDING_WINDOW, )), } + .inject_initial_view(best_block_hash) } /// Get access to the underlying api @@ -718,10 +737,20 @@ where ) -> Result>>, ChainApi::Error> { let xt = Arc::from(xt); - let insertion = match self.mempool.push_watched(source, xt.clone()).await { + let at_number = self + .api + .block_id_to_number(&BlockId::Hash(at)) + .ok() + .flatten() + .unwrap_or_default() + .into() + .as_u64(); + + let insertion = match self.mempool.push_watched(source, at_number, xt.clone()).await { Ok(result) => result, Err(TxPoolApiError::ImmediatelyDropped) => - self.attempt_transaction_replacement(source, true, xt.clone()).await?, + self.attempt_transaction_replacement(source, at_number, true, xt.clone()) + .await?, Err(e) => return Err(e.into()), }; @@ -745,12 +774,21 @@ where /// Refer to [`Self::submit_at`] async fn submit_at_inner( &self, + at: Block::Hash, source: TransactionSource, xts: Vec>, ) -> Result, ChainApi::Error>>, ChainApi::Error> { + let at_number = self + .api + .block_id_to_number(&BlockId::Hash(at)) + .ok() + .flatten() + .unwrap_or_default() + .into() + .as_u64(); let view_store = self.view_store.clone(); let xts = xts.into_iter().map(Arc::from).collect::>(); - let mempool_results = self.mempool.extend_unwatched(source, &xts).await; + let mempool_results = self.mempool.extend_unwatched(source, at_number, &xts).await; if view_store.is_empty() { return Ok(mempool_results @@ -766,7 +804,7 @@ where .map(|(result, xt)| async move { match result { Err(TxPoolApiError::ImmediatelyDropped) => - self.attempt_transaction_replacement(source, false, xt).await, + self.attempt_transaction_replacement(source, at_number, false, xt).await, _ => result, } }) @@ -914,7 +952,7 @@ where /// are reduced to single result. Refer to `reduce_multiview_result` for more details. async fn submit_at( &self, - _: ::Hash, + at: ::Hash, source: TransactionSource, xts: Vec>, ) -> Result, Self::Error>>, Self::Error> { @@ -926,7 +964,7 @@ where "fatp::submit_at" ); log_xt_trace!(target: LOG_TARGET, xts.iter().map(|xt| self.tx_hash(xt)), "fatp::submit_at"); - let result = self.submit_at_inner(source, xts).await; + let result = self.submit_at_inner(at, source, xts).await; insert_and_log_throttled!( Level::DEBUG, target:LOG_TARGET_STAT, @@ -1120,7 +1158,7 @@ where fn submit_local( &self, - _at: Block::Hash, + at: Block::Hash, xt: sc_transaction_pool_api::LocalTransactionFor, ) -> Result { trace!( @@ -1129,12 +1167,20 @@ where "fatp::submit_local" ); let xt = Arc::from(xt); + let at_number = self + .api + .block_id_to_number(&BlockId::Hash(at)) + .ok() + .flatten() + .unwrap_or_default() + .into() + .as_u64(); // note: would be nice to get rid of sync methods one day. See: #8912 let result = self .mempool .clone() - .extend_unwatched_sync(TransactionSource::Local, vec![xt.clone()]) + .extend_unwatched_sync(TransactionSource::Local, at_number, vec![xt.clone()]) .remove(0); let insertion = match result { @@ -1198,7 +1244,7 @@ where } let best_view = self.view_store.find_best_view(tree_route); - let new_view = self.build_new_view(best_view, hash_and_number, tree_route).await; + let new_view = self.build_and_update_view(best_view, hash_and_number, tree_route).await; if let Some(view) = new_view { { @@ -1289,26 +1335,17 @@ where /// If `origin_view` is provided, the new view will be cloned from it. Otherwise an empty view /// will be created. /// - /// The new view will be updated with transactions from the tree_route and the mempool, all - /// required events will be triggered, it will be inserted to the view store. - /// /// This method will also update multi-view listeners with newly created view. - async fn build_new_view( + /// + /// The new view will not be inserted into the view store. + fn build_and_plug_view( &self, origin_view: Option>>, at: &HashAndNumber, tree_route: &TreeRoute, - ) -> Option>> { + ) -> View { let enter = Instant::now(); - debug!( - target: LOG_TARGET, - ?at, - origin_view_at = ?origin_view.as_ref().map(|v| v.at.clone()), - ?tree_route, - "build_new_view" - ); - - let (mut view, view_dropped_stream, view_aggregated_stream) = + let (view, view_dropped_stream, view_aggregated_stream) = if let Some(origin_view) = origin_view { let (mut view, view_dropped_stream, view_aggragated_stream) = View::new_from_other(&origin_view, at); @@ -1337,7 +1374,6 @@ where "build_new_view::clone_view" ); - let start = Instant::now(); // 1. Capture all import notification from the very beginning, so first register all //the listeners. self.import_notification_sink.add_view( @@ -1352,6 +1388,34 @@ where self.view_store .listener .add_view_aggregated_stream(view.at.hash, view_aggregated_stream.boxed()); + + view + } + + /// Builds and updates a new view. + /// + /// This functio uses [`Self::build_new_view`] to create or clone new view. + /// + /// The new view will be updated with transactions from the tree_route and the mempool, all + /// required events will be triggered, it will be inserted to the view store (respecting all + /// pre-insertion actions). + async fn build_and_update_view( + &self, + origin_view: Option>>, + at: &HashAndNumber, + tree_route: &TreeRoute, + ) -> Option>> { + let start = Instant::now(); + debug!( + target: LOG_TARGET, + ?at, + origin_view_at = ?origin_view.as_ref().map(|v| v.at.clone()), + ?tree_route, + "build_new_view" + ); + + let mut view = self.build_and_plug_view(origin_view, at, tree_route); + // sync the transactions statuses and referencing views in all the listeners with newly // cloned view. view.pool.validated_pool().retrigger_notifications(); @@ -1387,7 +1451,7 @@ where debug!( target: LOG_TARGET, - duration = ?enter.elapsed(), + duration = ?start.elapsed(), ?at, "build_new_view" ); @@ -1801,6 +1865,7 @@ where async fn attempt_transaction_replacement( &self, source: TransactionSource, + at_number: u64, watched: bool, xt: ExtrinsicFor, ) -> Result>, TxPoolApiError> { @@ -1828,8 +1893,10 @@ where return Err(TxPoolApiError::ImmediatelyDropped) }; - let insertion_info = - self.mempool.try_insert_with_replacement(xt, priority, source, watched).await?; + let insertion_info = self + .mempool + .try_insert_with_replacement(xt, priority, source, at_number, watched) + .await?; self.post_attempt_transaction_replacement(xt_hash, insertion_info) } @@ -1840,18 +1907,17 @@ where watched: bool, xt: ExtrinsicFor, ) -> Result>, TxPoolApiError> { - let at = self + let HashAndNumber { number: at_number, hash: at_hash } = self .view_store .most_recent_view .read() .as_ref() .ok_or(TxPoolApiError::ImmediatelyDropped)? - .at - .hash; + .at; let ValidTransaction { priority, .. } = self .api - .validate_transaction_blocking(at, TransactionSource::Local, Arc::from(xt.clone())) + .validate_transaction_blocking(at_hash, TransactionSource::Local, Arc::from(xt.clone())) .map_err(|_| TxPoolApiError::ImmediatelyDropped)? .map_err(|e| match e { TransactionValidityError::Invalid(i) => TxPoolApiError::InvalidTransaction(i), @@ -1859,10 +1925,13 @@ where })?; let xt_hash = self.hash_of(&xt); - let insertion_info = self - .mempool - .clone() - .try_insert_with_replacement_sync(xt, priority, source, watched)?; + let insertion_info = self.mempool.clone().try_insert_with_replacement_sync( + xt, + priority, + source, + at_number.into().as_u64(), + watched, + )?; self.post_attempt_transaction_replacement(xt_hash, insertion_info) } diff --git a/substrate/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs b/substrate/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs index 0c9273256b045..bc7c73b4c73e9 100644 --- a/substrate/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs +++ b/substrate/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs @@ -115,13 +115,23 @@ where } /// Creates a new instance of wrapper for unwatched transaction. - fn new_unwatched(source: TransactionSource, tx: ExtrinsicFor, bytes: usize) -> Self { - Self::new(false, source, tx, bytes) + fn new_unwatched( + source: TransactionSource, + tx: ExtrinsicFor, + bytes: usize, + validated_at: u64, + ) -> Self { + Self::new(false, source, tx, bytes, validated_at) } /// Creates a new instance of wrapper for watched transaction. - fn new_watched(source: TransactionSource, tx: ExtrinsicFor, bytes: usize) -> Self { - Self::new(true, source, tx, bytes) + fn new_watched( + source: TransactionSource, + tx: ExtrinsicFor, + bytes: usize, + validated_at: u64, + ) -> Self { + Self::new(true, source, tx, bytes, validated_at) } /// Creates a new instance of wrapper for a transaction with no priority. @@ -130,8 +140,9 @@ where source: TransactionSource, tx: ExtrinsicFor, bytes: usize, + validated_at: u64, ) -> Self { - Self::new_with_optional_priority(watched, source, tx, bytes, None) + Self::new_with_optional_priority(watched, source, tx, bytes, None, validated_at) } /// Creates a new instance of wrapper for a transaction with given priority. @@ -141,8 +152,9 @@ where tx: ExtrinsicFor, bytes: usize, priority: TransactionPriority, + validated_at: u64, ) -> Self { - Self::new_with_optional_priority(watched, source, tx, bytes, Some(priority)) + Self::new_with_optional_priority(watched, source, tx, bytes, Some(priority), validated_at) } /// Creates a new instance of wrapper for a transaction with optional priority. @@ -152,12 +164,13 @@ where tx: ExtrinsicFor, bytes: usize, priority: Option, + validated_at: u64, ) -> Self { Self { watched, tx, source: TimedTransactionSource::from_transaction_source(source, true), - validated_at: AtomicU64::new(0), + validated_at: AtomicU64::new(validated_at), bytes, priority: priority.into(), } @@ -468,10 +481,12 @@ where new_tx: ExtrinsicFor, priority: TransactionPriority, source: TransactionSource, + validated_at: u64, watched: bool, ) -> Result>, sc_transaction_pool_api::error::Error> { let (hash, length) = self.api.hash_and_length(&new_tx); - let new_tx = TxInMemPool::new_with_priority(watched, source, new_tx, length, priority); + let new_tx = + TxInMemPool::new_with_priority(watched, source, new_tx, length, priority, validated_at); if new_tx.bytes > self.max_transactions_total_bytes { return Err(sc_transaction_pool_api::error::Error::ImmediatelyDropped); } @@ -508,6 +523,7 @@ where pub(super) async fn extend_unwatched( &self, source: TransactionSource, + validated_at: u64, xts: &[ExtrinsicFor], ) -> Vec>, sc_transaction_pool_api::error::Error>> { @@ -516,7 +532,8 @@ where let xt = xt.clone(); async move { let (hash, length) = api.hash_and_length(&xt); - self.try_insert(hash, TxInMemPool::new_unwatched(source, xt, length)).await + self.try_insert(hash, TxInMemPool::new_unwatched(source, xt, length, validated_at)) + .await } }); @@ -528,10 +545,11 @@ where pub(super) async fn push_watched( &self, source: TransactionSource, + validated_at: u64, xt: ExtrinsicFor, ) -> Result>, sc_transaction_pool_api::error::Error> { let (hash, length) = self.api.hash_and_length(&xt); - self.try_insert(hash, TxInMemPool::new_watched(source, xt.clone(), length)) + self.try_insert(hash, TxInMemPool::new_watched(source, xt.clone(), length, validated_at)) .await } @@ -574,7 +592,7 @@ where ); let start = Instant::now(); - let (count, input) = { + let (total_count, to_be_validated) = { ( self.transactions.len(), self.with_transactions(|iter| { @@ -593,7 +611,7 @@ where ) }; - let validations_futures = input.into_iter().map(|(xt_hash, xt)| { + let validations_futures = to_be_validated.into_iter().map(|(xt_hash, xt)| { self.api .validate_transaction( finalized_block.hash, @@ -608,7 +626,7 @@ where }) }); let validation_results = futures::future::join_all(validations_futures).await; - let input_len = validation_results.len(); + let validated_count = validation_results.len(); let duration = start.elapsed(); @@ -634,8 +652,8 @@ where debug!( target: LOG_TARGET, ?finalized_block, - input_len, - count, + validated_count, + total_count, invalid_hashes = invalid_hashes.len(), ?duration, "mempool::revalidate_inner" @@ -719,8 +737,7 @@ where ); } - /// Updates the priority of transaction stored in mempool using provided view_store submission - /// outcome. + /// Updates the priority of transaction stored in mempool using provided priority. pub(super) async fn update_transaction_priority( &self, hash: ExtrinsicHash, @@ -768,6 +785,7 @@ where ExtendUnwatched( Arc>, TransactionSource, + u64, Vec>, SyncBridgeSender>, ), @@ -782,6 +800,7 @@ where ExtrinsicFor, TransactionPriority, TransactionSource, + u64, bool, SyncBridgeSender>, ), @@ -803,10 +822,11 @@ where fn extend_unwatched( mempool: Arc>, source: TransactionSource, + validated_at: u64, xts: Vec>, ) -> (SyncBridgeReceiver>, Self) { let (tx, rx) = sync_bridge_channel(); - (rx, Self::ExtendUnwatched(mempool, source, xts, tx)) + (rx, Self::ExtendUnwatched(mempool, source, validated_at, xts, tx)) } fn update_transaction_priority( @@ -823,10 +843,22 @@ where new_tx: ExtrinsicFor, priority: TransactionPriority, source: TransactionSource, + validated_at: u64, watched: bool, ) -> (SyncBridgeReceiver>, Self) { let (tx, rx) = sync_bridge_channel(); - (rx, Self::TryInsertWithReplacement(mempool, new_tx, priority, source, watched, tx)) + ( + rx, + Self::TryInsertWithReplacement( + mempool, + new_tx, + priority, + source, + validated_at, + watched, + tx, + ), + ) } } @@ -850,8 +882,8 @@ where debug!(target: LOG_TARGET, ?error, "RemoveTransaction: sending response failed"); } }, - TxMemPoolSyncRequest::ExtendUnwatched(mempool, source, txs, tx) => { - let result = mempool.extend_unwatched(source, &txs).await; + TxMemPoolSyncRequest::ExtendUnwatched(mempool, source, validated_at, txs, tx) => { + let result = mempool.extend_unwatched(source, validated_at, &txs).await; if let Err(error) = tx.send(result) { debug!(target: LOG_TARGET, ?error, "ExtendUnwatched: sending response failed"); } @@ -867,11 +899,13 @@ where new_tx, priority, source, + validated_at, watched, tx, ) => { - let result = - mempool.try_insert_with_replacement(new_tx, priority, source, watched).await; + let result = mempool + .try_insert_with_replacement(new_tx, priority, source, validated_at, watched) + .await; if let Err(error) = tx.send(result) { debug!(target: LOG_TARGET, ?error, "TryInsertWithReplacementSync: sending response failed"); } @@ -884,6 +918,7 @@ where new_tx: ExtrinsicFor, priority: TransactionPriority, source: TransactionSource, + validated_at: u64, watched: bool, ) -> Result>, sc_transaction_pool_api::error::Error> { let (response, request) = TxMemPoolSyncRequest::try_insert_with_replacement( @@ -891,6 +926,7 @@ where new_tx, priority, source, + validated_at, watched, ); let _ = self.sync_channel.send(request); @@ -900,10 +936,12 @@ where pub(super) fn extend_unwatched_sync( self: Arc, source: TransactionSource, + validated_at: u64, xts: Vec>, ) -> Vec>, sc_transaction_pool_api::error::Error>> { - let (response, request) = TxMemPoolSyncRequest::extend_unwatched(self.clone(), source, xts); + let (response, request) = + TxMemPoolSyncRequest::extend_unwatched(self.clone(), source, validated_at, xts); let _ = self.sync_channel.send(request); response.recv().expect(SYNC_BRIDGE_EXPECT) } @@ -960,7 +998,7 @@ mod tx_mem_pool_tests { let xts = (0..max + 1).map(|x| Arc::from(uxt(x as _))).collect::>(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().take(max).all(Result::is_ok)); assert!(matches!( results.into_iter().last().unwrap().unwrap_err(), @@ -978,7 +1016,7 @@ mod tx_mem_pool_tests { let mut xts = (0..max - 1).map(|x| Arc::from(uxt(x as _))).collect::>(); xts.push(xts.iter().last().unwrap().clone()); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().take(max - 1).all(Result::is_ok)); assert!(matches!( results.into_iter().last().unwrap().unwrap_err(), @@ -994,17 +1032,17 @@ mod tx_mem_pool_tests { let xts = (0..max).map(|x| Arc::from(uxt(x as _))).collect::>(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); let xt = Arc::from(uxt(98)); - let result = mempool.push_watched(TransactionSource::External, xt).await; + let result = mempool.push_watched(TransactionSource::External, 0, xt).await; assert!(matches!( result.unwrap_err(), sc_transaction_pool_api::error::Error::ImmediatelyDropped )); let xt = Arc::from(uxt(99)); - let mut result = mempool.extend_unwatched(TransactionSource::External, &[xt]).await; + let mut result = mempool.extend_unwatched(TransactionSource::External, 0, &[xt]).await; assert!(matches!( result.pop().unwrap().unwrap_err(), sc_transaction_pool_api::error::Error::ImmediatelyDropped @@ -1021,15 +1059,15 @@ mod tx_mem_pool_tests { let xt0 = xts.iter().last().unwrap().clone(); let xt1 = xts.iter().next().unwrap().clone(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); - let result = mempool.push_watched(TransactionSource::External, xt0).await; + let result = mempool.push_watched(TransactionSource::External, 0, xt0).await; assert!(matches!( result.unwrap_err(), sc_transaction_pool_api::error::Error::AlreadyImported(_) )); - let mut result = mempool.extend_unwatched(TransactionSource::External, &[xt1]).await; + let mut result = mempool.extend_unwatched(TransactionSource::External, 0, &[xt1]).await; assert!(matches!( result.pop().unwrap().unwrap_err(), sc_transaction_pool_api::error::Error::AlreadyImported(_) @@ -1049,15 +1087,16 @@ mod tx_mem_pool_tests { let xts0 = (0..10).map(|x| Arc::from(uxt(x as _))).collect::>(); trace!(target:LOG_TARGET,line=line!(),"xxx"); - let results = mempool.extend_unwatched(TransactionSource::External, &xts0).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts0).await; trace!(target:LOG_TARGET,line=line!(),"xxx"); assert!(results.iter().all(Result::is_ok)); trace!(target:LOG_TARGET,line=line!(),"xxx"); let xts1 = (0..5).map(|x| Arc::from(uxt(2 * x))).collect::>(); trace!(target:LOG_TARGET,line=line!(),"xxx"); - let results = - xts1.into_iter().map(|t| mempool.push_watched(TransactionSource::External, t)); + let results = xts1 + .into_iter() + .map(|t| mempool.push_watched(TransactionSource::External, 0, t)); trace!(target:LOG_TARGET,line=line!(),"xxx"); let results = join_all(results).await; trace!(target:LOG_TARGET,line=line!(),"xxx"); @@ -1083,19 +1122,19 @@ mod tx_mem_pool_tests { let total_xts_bytes = xts.iter().fold(0, |r, x| r + api.hash_and_length(&x).1); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); assert_eq!(mempool.bytes(), total_xts_bytes); let xt = Arc::from(large_uxt(98)); - let result = mempool.push_watched(TransactionSource::External, xt).await; + let result = mempool.push_watched(TransactionSource::External, 0, xt).await; assert!(matches!( result.unwrap_err(), sc_transaction_pool_api::error::Error::ImmediatelyDropped )); let xt = Arc::from(large_uxt(99)); - let mut result = mempool.extend_unwatched(TransactionSource::External, &[xt]).await; + let mut result = mempool.extend_unwatched(TransactionSource::External, 0, &[xt]).await; assert!(matches!( result.pop().unwrap().unwrap_err(), sc_transaction_pool_api::error::Error::ImmediatelyDropped @@ -1123,7 +1162,7 @@ mod tx_mem_pool_tests { }) .unzip(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); assert_eq!(mempool.bytes(), total_xts_bytes); @@ -1134,7 +1173,7 @@ mod tx_mem_pool_tests { let xt = Arc::from(large_uxt(98)); let hash = api.hash_and_length(&xt).0; let result = mempool - .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, false) + .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, 0, false) .await .unwrap(); @@ -1163,7 +1202,7 @@ mod tx_mem_pool_tests { }) .unzip(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); assert_eq!(mempool.bytes(), total_xts_bytes); assert_eq!(total_xts_bytes, max * LARGE_XT_SIZE); @@ -1177,7 +1216,7 @@ mod tx_mem_pool_tests { let (hash, length) = api.hash_and_length(&xt); assert_eq!(length, 1130); let result = mempool - .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, false) + .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, 0, false) .await .unwrap(); @@ -1206,7 +1245,7 @@ mod tx_mem_pool_tests { }) .unzip(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); assert_eq!(mempool.bytes(), total_xts_bytes); @@ -1220,7 +1259,7 @@ mod tx_mem_pool_tests { // overhead is 105, thus length: 105 + 2154 assert_eq!(length, 2 * LARGE_XT_SIZE + 1); let result = mempool - .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, false) + .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, 0, false) .await .unwrap(); @@ -1249,7 +1288,7 @@ mod tx_mem_pool_tests { }) .collect::>(); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); assert_eq!(mempool.bytes(), total_xts_bytes); @@ -1259,7 +1298,7 @@ mod tx_mem_pool_tests { let xt = Arc::from(large_uxt(98)); let result = mempool - .try_insert_with_replacement(xt, low_prio, TransactionSource::External, false) + .try_insert_with_replacement(xt, low_prio, TransactionSource::External, 0, false) .await; // lower prio tx is rejected immediately @@ -1282,7 +1321,7 @@ mod tx_mem_pool_tests { let total_xts_bytes = xts.iter().fold(0, |r, x| r + api.hash_and_length(&x).1); - let results = mempool.extend_unwatched(TransactionSource::External, &xts).await; + let results = mempool.extend_unwatched(TransactionSource::External, 0, &xts).await; assert!(results.iter().all(Result::is_ok)); assert_eq!(mempool.bytes(), total_xts_bytes); @@ -1293,7 +1332,7 @@ mod tx_mem_pool_tests { assert_eq!(length, 2 * LARGE_XT_SIZE + 1); let result = mempool - .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, false) + .try_insert_with_replacement(xt, hi_prio, TransactionSource::External, 0, false) .await; // we did not update priorities (update_transaction_priority was not called): diff --git a/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs b/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs index fece54597808b..a8cd923a4ab90 100644 --- a/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs +++ b/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs @@ -521,13 +521,7 @@ where /// Inserts new view into the view store. /// - /// All the views associated with the blocks which are on enacted path (including common - /// ancestor) will be: - /// - moved to the inactive views set (`inactive_views`), - /// - removed from the multi view listeners. - /// - /// The `most_recent_view` is updated with the reference to the newly inserted view. - /// + /// Refer to [`Self::insert_new_view_sync`] more details. /// If there are any pending tx replacments, they are applied to the new view. #[instrument(level = Level::TRACE, skip_all, target = "txpool", name = "view_store::insert_new_view")] pub(super) async fn insert_new_view( @@ -538,7 +532,29 @@ where self.apply_pending_tx_replacements(view.clone()).await; let start = Instant::now(); + self.insert_new_view_sync(view, tree_route); + debug!( + target: LOG_TARGET, + inactive_views = ?self.inactive_views.read().keys(), + duration = ?start.elapsed(), + "insert_new_view" + ); + } + + /// Inserts new view into the view store. + /// + /// All the views associated with the blocks which are on enacted path (including common + /// ancestor) will be: + /// - moved to the inactive views set (`inactive_views`), + /// - removed from the multi view listeners. + /// + /// The `most_recent_view` is updated with the reference to the newly inserted view. + pub(super) fn insert_new_view_sync( + &self, + view: Arc>, + tree_route: &TreeRoute, + ) { //note: most_recent_view must be synced with changes in in/active_views. { let mut most_recent_view_lock = self.most_recent_view.write(); @@ -556,12 +572,6 @@ where active_views.insert(view.at.hash, view.clone()); most_recent_view_lock.replace(view.clone()); }; - debug!( - target: LOG_TARGET, - inactive_views = ?self.inactive_views.read().keys(), - duration = ?start.elapsed(), - "insert_new_view" - ); } /// Returns an optional reference to the view at given hash. diff --git a/substrate/client/transaction-pool/tests/fatp.rs b/substrate/client/transaction-pool/tests/fatp.rs index 49adc9ccc9639..1fd115966ef85 100644 --- a/substrate/client/transaction-pool/tests/fatp.rs +++ b/substrate/client/transaction-pool/tests/fatp.rs @@ -1185,6 +1185,7 @@ fn fatp_no_view_pool_watcher_two_finalized_in_different_block() { assert_eq!( xt1_status, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header03.hash(), 0)), TransactionStatus::Finalized((header03.hash(), 0)) ] @@ -1197,6 +1198,7 @@ fn fatp_no_view_pool_watcher_two_finalized_in_different_block() { assert_eq!( xt0_status, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header02.hash(), 2)), TransactionStatus::Finalized((header02.hash(), 2)) ] @@ -1208,6 +1210,7 @@ fn fatp_no_view_pool_watcher_two_finalized_in_different_block() { assert_eq!( xt2_status, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header02.hash(), 1)), TransactionStatus::Finalized((header02.hash(), 1)) ] @@ -1240,7 +1243,7 @@ fn fatp_watcher_in_block_across_many_blocks() { let _ = block_on(pool.submit_and_watch(invalid_hash(), SOURCE, xt2.clone())).unwrap(); //note 1: transaction is not submitted to views that are not at the tip of the fork assert_eq!(pool.active_views_count(), 1); - assert_eq!(pool.inactive_views_count(), 1); + assert_eq!(pool.inactive_views_count(), 2); //gensis + 01 assert_pool_status!(header02.hash(), &pool, 3, 0); let header03 = api.push_block(3, vec![xt0.clone()], true); @@ -1284,7 +1287,7 @@ fn fatp_watcher_in_block_across_many_blocks2() { let _ = block_on(pool.submit_and_watch(invalid_hash(), SOURCE, xt2.clone())).unwrap(); //note 1: transaction is not submitted to views that are not at the tip of the fork assert_eq!(pool.active_views_count(), 1); - assert_eq!(pool.inactive_views_count(), 1); + assert_eq!(pool.inactive_views_count(), 2); //genesis + 01 assert_pool_status!(header02.hash(), &pool, 3, 0); let header03 = api.push_block(3, vec![xt0.clone()], true); @@ -1457,6 +1460,7 @@ fn fatp_watcher_finalizing_forks() { assert_eq!( xt0_status, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header01.hash(), 0)), TransactionStatus::Finalized((header01.hash(), 0)), ] @@ -1551,6 +1555,7 @@ fn fatp_watcher_best_block_after_finalized2() { assert_eq!( xt0_events, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header01.hash(), 0)), TransactionStatus::Finalized((header01.hash(), 0)), ] @@ -1594,6 +1599,7 @@ fn fatp_watcher_switching_fork_multiple_times_works() { assert_eq!( xt0_status, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header01a.hash(), 0)), TransactionStatus::InBlock((header01b.hash(), 0)), TransactionStatus::Finalized((header01b.hash(), 0)), @@ -1708,6 +1714,7 @@ fn fatp_watcher_delayed_finalization_does_not_retract() { assert_eq!( xt0_status, vec![ + TransactionStatus::Ready, TransactionStatus::InBlock((header02.hash(), 0)), TransactionStatus::Finalized((header02.hash(), 0)), ] @@ -2339,6 +2346,50 @@ fn fatp_ready_light_long_fork_works() { assert!(ready_iterator.next().is_none()); } +#[test] +fn fatp_ready_light_most_recent_view_long_fork_retracted_works() { + sp_tracing::try_init_simple(); + + let (pool, api, _) = pool(); + api.set_nonce(api.genesis_hash(), Bob.into(), 200); + api.set_nonce(api.genesis_hash(), Charlie.into(), 200); + api.set_nonce(api.genesis_hash(), Dave.into(), 200); + api.set_nonce(api.genesis_hash(), Eve.into(), 200); + + let genesis = api.genesis_hash(); + + let xt0 = uxt(Alice, 200); + let xt1 = uxt(Bob, 200); + let xt2 = uxt(Charlie, 200); + let xt3 = uxt(Dave, 200); + let xt4 = uxt(Eve, 200); + + let submissions = vec![pool.submit_at( + genesis, + SOURCE, + vec![xt0.clone(), xt1.clone(), xt2.clone(), xt3.clone()], + )]; + let results = block_on(futures::future::join_all(submissions)); + assert!(results.iter().all(|r| { r.is_ok() })); + + // dirty hack to remove genesis view, so we can check fallback to most-recent-view at header03b. + let header01a = api.push_block_with_parent(genesis, vec![], true); + let event = finalized_block_event(&pool, genesis, header01a.hash()); + block_on(pool.maintain(event)); + + let header02a = api.push_block_with_parent(header01a.hash(), vec![xt4.clone()], true); + let event = new_best_block_event(&pool, Some(genesis), header02a.hash()); + block_on(pool.maintain(event)); + + let header01b = api.push_block_with_parent(genesis, vec![xt0.clone()], true); + let header02b = api.push_block_with_parent(header01b.hash(), vec![xt1.clone()], true); + let header03b = api.push_block_with_parent(header02b.hash(), vec![xt2.clone()], true); + + // Returns the most recent view (`header02a`) ready transactions set. + let ready_iterator = pool.ready_at_light(header03b.hash()).now_or_never().unwrap(); + assert_eq!(ready_iterator.count(), 4); +} + #[test] fn fatp_ready_light_long_fork_retracted_works() { sp_tracing::try_init_simple(); @@ -2373,9 +2424,9 @@ fn fatp_ready_light_long_fork_retracted_works() { let header02b = api.push_block_with_parent(header01b.hash(), vec![xt1.clone()], true); let header03b = api.push_block_with_parent(header02b.hash(), vec![xt2.clone()], true); - // Returns the most recent view (`header01a`) ready transactions set. + // Returns the genesis view ready transactions set with fork txs removed. let ready_iterator = pool.ready_at_light(header03b.hash()).now_or_never().unwrap(); - assert_eq!(ready_iterator.count(), 4); + assert_eq!(ready_iterator.count(), 1); let event = new_best_block_event(&pool, Some(header01a.hash()), header01b.hash()); block_on(pool.maintain(event)); @@ -2389,7 +2440,7 @@ fn fatp_ready_light_long_fork_retracted_works() { } #[test] -fn fatp_ready_light_fallback_gets_triggered() { +fn fatp_ready_light_fallback_for_most_recent_view_gets_triggered() { sp_tracing::try_init_simple(); let (pool, api, _) = pool(); @@ -2410,8 +2461,13 @@ fn fatp_ready_light_fallback_gets_triggered() { let results = block_on(futures::future::join_all(submissions)); assert!(results.iter().all(|r| { r.is_ok() })); - let header01a = api.push_block_with_parent(genesis, vec![xt4.clone()], true); - let event = new_best_block_event(&pool, Some(genesis), header01a.hash()); + // dirty hack to remove genesis view, so we can check fallback to most-recent-view at header01b. + let header01a = api.push_block_with_parent(genesis, vec![], true); + let event = finalized_block_event(&pool, genesis, header01a.hash()); + block_on(pool.maintain(event)); + + let header02a = api.push_block_with_parent(header01a.hash(), vec![xt4.clone()], true); + let event = new_best_block_event(&pool, Some(genesis), header02a.hash()); block_on(pool.maintain(event)); let header01b = api.push_block_with_parent(genesis, vec![xt0.clone()], true); @@ -2424,7 +2480,7 @@ fn fatp_ready_light_fallback_gets_triggered() { let header02b = api.push_block_with_parent(header01b.hash(), vec![xt1.clone()], true); let header03b = api.push_block_with_parent(header02b.hash(), vec![xt2.clone()], true); - // Submit a few more txs to the pool. + // Submit a few more tx to the pool. let submissions = vec![pool.submit_at( // `at` is ignored. genesis, @@ -2437,22 +2493,63 @@ fn fatp_ready_light_fallback_gets_triggered() { // Calling `ready_at_light` now on the last block of a fork, with no block notified as best. // We should still get the ready txs from the most recent view processed by the txpool, // but now with a few more txs which were submitted previously. - let ready_iterator = pool.ready_at_light(header03b.hash()).now_or_never().unwrap(); - assert_eq!(ready_iterator.count(), 4); + assert_ready_at_light_iterator!(header03b.hash(), pool, [xt0, xt1, xt2, xt3]); +} - let event = new_best_block_event(&pool, Some(header01a.hash()), header01b.hash()); +#[test] +fn fatp_ready_light_fallback_gets_triggered() { + sp_tracing::try_init_simple(); + + let (pool, api, _) = pool(); + api.set_nonce(api.genesis_hash(), Bob.into(), 200); + api.set_nonce(api.genesis_hash(), Charlie.into(), 200); + api.set_nonce(api.genesis_hash(), Dave.into(), 200); + api.set_nonce(api.genesis_hash(), Eve.into(), 200); + + let genesis = api.genesis_hash(); + + let xt0 = uxt(Alice, 200); + let xt1 = uxt(Bob, 200); + let xt2 = uxt(Charlie, 200); + let xt3 = uxt(Dave, 200); + let xt4 = uxt(Eve, 200); + + let submissions = vec![pool.submit_at(genesis, SOURCE, vec![xt0.clone(), xt1.clone()])]; + let results = block_on(futures::future::join_all(submissions)); + assert!(results.iter().all(|r| { r.is_ok() })); + + let header01a = api.push_block_with_parent(genesis, vec![xt4.clone()], true); + let event = new_best_block_event(&pool, Some(genesis), header01a.hash()); + block_on(pool.maintain(event)); + + let header01b = api.push_block_with_parent(genesis, vec![xt0.clone()], true); + // Call `ready_at_light` at genesis direct descendent, even if not notified as best or + // finalized. Should still return ready txs based on the view for genesis, taking into account + // transactions from 01b block. + let ready_iterator = pool.ready_at_light(header01b.hash()).now_or_never().unwrap(); + assert_eq!(ready_iterator.count(), 1); + + let header02b = api.push_block_with_parent(header01b.hash(), vec![xt1.clone()], true); + let header03b = api.push_block_with_parent(header02b.hash(), vec![xt2.clone()], true); + + // Submit a few more tx to the pool. + let submissions = vec![pool.submit_at( + // `at` is ignored. + genesis, + SOURCE, + vec![xt2.clone(), xt3.clone()], + )]; + let results = block_on(futures::future::join_all(submissions)); + assert!(results.iter().all(|r| { r.is_ok() })); + + let event = finalized_block_event(&pool, header01a.hash(), header01b.hash()); block_on(pool.maintain(event)); - // Calling `ready_at_light` on the new best block (`header03b`) should consider its fork up to + // Calling `ready_at_light` on the new block (`header03b`) should consider its fork up to // the finalized block for the search of the best view, and coincidentaly, that's the only view - // of the tree route, being the view created for NBB `header03b`. The returned ready txs are the + // of the tree route, being the view created for NBB `header01b`. The returned ready txs are the // ones left in the best view's pool after prunning the txs. - let mut ready_iterator = pool.ready_at_light(header03b.hash()).now_or_never().unwrap(); - let ready01 = ready_iterator.next(); - assert_eq!(ready01.unwrap().hash, api.hash_and_length(&xt3).0); - let ready02 = ready_iterator.next(); - assert_eq!(ready02.unwrap().hash, api.hash_and_length(&xt4).0); - assert!(ready_iterator.next().is_none()); + assert_ready_at_light_iterator!(header03b.hash(), pool, [xt3, xt4]); } #[test] @@ -2501,3 +2598,90 @@ fn fatp_ready_at_with_timeout_works_for_misc_scenarios() { assert_eq!(ready_at2.next().unwrap().hash, api.hash_and_length(&xt2).0); assert!(ready_at2.next().is_none()); } + +#[test] +fn fatp_tx_is_not_prematurely_revalidated() { + sp_tracing::try_init_simple(); + + let (pool, api, _) = pool(); + let genesis = api.genesis_hash(); + + let mut hashes = vec![]; + let mut prev_hash = genesis; + hashes.push(genesis); + for n in 1..=40 { + let header = api.push_block_with_parent(prev_hash, vec![], true); + if n <= 21 { + api.set_nonce(header.hash(), Alice.into(), 199); + block_on(pool.maintain(new_best_block_event(&pool, Some(prev_hash), header.hash()))); + } else { + // not realistic, we only want tx to be invalid, stale is currently the only way in + // TestApi + api.set_nonce(header.hash(), Alice.into(), 199); + } + hashes.push(header.hash()); + prev_hash = header.hash(); + } + + let xt0 = uxt(Alice, 199); + + //note: tx is validated at block 20 (recent best block): + let xt0_watcher = block_on(pool.submit_and_watch(hashes[21], SOURCE, xt0.clone())).unwrap(); + + let header41 = api.push_block_with_parent(hashes[40], vec![xt0.clone()], true); + + //note: tx is still valid at block 21 + block_on(pool.maintain(finalized_block_event(&pool, api.genesis_hash(), hashes[5]))); + block_on(pool.maintain(finalized_block_event(&pool, hashes[5], hashes[10]))); + block_on(pool.maintain(finalized_block_event(&pool, hashes[10], hashes[19]))); + block_on(pool.maintain(finalized_block_event(&pool, hashes[19], header41.hash()))); + + let xt0_events = block_on(xt0_watcher.collect::>()); + assert_eq!( + xt0_events, + vec![ + TransactionStatus::Ready, + TransactionStatus::InBlock((header41.hash(), 0)), + TransactionStatus::Finalized((header41.hash(), 0)), + ] + ); +} + +#[test] +fn fatp_tx_is_revalidated_by_mempool_revalidation() { + sp_tracing::try_init_simple(); + + let (pool, api, _) = pool(); + let genesis = api.genesis_hash(); + + let mut hashes = vec![]; + let mut prev_hash = genesis; + hashes.push(genesis); + for n in 1..=40 { + let header = api.push_block_with_parent(prev_hash, vec![], true); + if n >= 22 { + // not realistic, we only want tx to be invalid, stale is currently the only way in + // TestApi + api.set_nonce(header.hash(), Alice.into(), 210); + } else { + api.set_nonce(header.hash(), Alice.into(), 199); + let event = new_best_block_event(&pool, Some(prev_hash), header.hash()); + block_on(pool.maintain(event)); + } + hashes.push(header.hash()); + prev_hash = header.hash(); + } + + let xt0 = uxt(Alice, 199); + + //note: tx is validated at block 20 (recent best block): + let xt0_watcher = block_on(pool.submit_and_watch(hashes[21], SOURCE, xt0.clone())).unwrap(); + + //note: tx is still valid at block 21 + block_on(pool.maintain(finalized_block_event(&pool, api.genesis_hash(), hashes[21]))); + //note: TXMEMPOOL_REVALIDATION_PERIOD passed, tx is stale on block 32: + block_on(pool.maintain(finalized_block_event(&pool, hashes[21], hashes[32]))); + + let xt0_events = block_on(xt0_watcher.collect::>()); + assert_eq!(xt0_events, vec![TransactionStatus::Ready, TransactionStatus::Invalid,]); +} diff --git a/substrate/client/transaction-pool/tests/fatp_common/mod.rs b/substrate/client/transaction-pool/tests/fatp_common/mod.rs index f41c009a46712..e3b554f5efd86 100644 --- a/substrate/client/transaction-pool/tests/fatp_common/mod.rs +++ b/substrate/client/transaction-pool/tests/fatp_common/mod.rs @@ -198,6 +198,20 @@ macro_rules! assert_pool_status { } } +#[macro_export] +macro_rules! assert_ready_at_light_iterator { + ($hash:expr, $pool:expr, [$( $xt:expr ),*]) => {{ + let ready_iterator = $pool.ready_at_light($hash).now_or_never().unwrap(); + let expected = vec![ $($pool.api().hash_and_length(&$xt).0),*]; + let output: Vec<_> = ready_iterator.collect(); + tracing::debug!(target: LOG_TARGET, ?expected, "expected"); + tracing::debug!(target: LOG_TARGET, ?output, "output"); + let output = output.into_iter().map(|t|t.hash).collect::>(); + assert_eq!(expected.len(), output.len()); + assert_eq!(output,expected); + }}; +} + #[macro_export] macro_rules! assert_ready_iterator { ($hash:expr, $pool:expr, [$( $xt:expr ),*]) => {{ diff --git a/substrate/client/transaction-pool/tests/fatp_invalid.rs b/substrate/client/transaction-pool/tests/fatp_invalid.rs index 3120eb18c61ff..5ba262eeb9499 100644 --- a/substrate/client/transaction-pool/tests/fatp_invalid.rs +++ b/substrate/client/transaction-pool/tests/fatp_invalid.rs @@ -373,33 +373,15 @@ fn fatp_watcher_invalid_single_revalidation2() { let xt0 = uxt(Alice, 200); let xt0_watcher = block_on(pool.submit_and_watch(invalid_hash(), SOURCE, xt0.clone())).unwrap(); assert_eq!(block_on(pool.mempool_len()), (0, 1)); - api.add_invalid(&xt0); - - let header01 = api.push_block(1, vec![], true); - let event = new_best_block_event(&pool, None, header01.hash()); - block_on(pool.maintain(event)); - - let xt0_events = futures::executor::block_on_stream(xt0_watcher).collect::>(); - debug!(target: LOG_TARGET, ?xt0_events, "xt0_events"); - assert_eq!(xt0_events, vec![TransactionStatus::Invalid]); - assert_eq!(block_on(pool.mempool_len()), (0, 0)); -} - -#[test] -fn fatp_watcher_invalid_single_revalidation3() { - sp_tracing::try_init_simple(); - - let (pool, api, _) = pool(); - - let xt0 = uxt(Alice, 150); - let xt0_watcher = block_on(pool.submit_and_watch(invalid_hash(), SOURCE, xt0.clone())).unwrap(); - assert_eq!(block_on(pool.mempool_len()), (0, 1)); let header01 = api.push_block(1, vec![], true); let event = finalized_block_event(&pool, api.genesis_hash(), header01.hash()); block_on(pool.maintain(event)); + api.add_invalid(&xt0); - // wait 10 blocks for revalidation + // note: the tx will be revalidated in view::revalidation, not in mempool revalidation (which + // would require waiting 10 blocks). + // waiting 10 blocks is excessive, but we may want to keep it. let mut prev_header = header01; for n in 2..=11 { let header = api.push_block(n, vec![], true); @@ -410,7 +392,7 @@ fn fatp_watcher_invalid_single_revalidation3() { let xt0_events = futures::executor::block_on_stream(xt0_watcher).collect::>(); debug!(target: LOG_TARGET, ?xt0_events, "xt0_events"); - assert_eq!(xt0_events, vec![TransactionStatus::Invalid]); + assert_eq!(xt0_events, vec![TransactionStatus::Ready, TransactionStatus::Invalid]); assert_eq!(block_on(pool.mempool_len()), (0, 0)); } diff --git a/substrate/frame/bags-list/src/lib.rs b/substrate/frame/bags-list/src/lib.rs index 9ff37b4b1b149..7f64119ea843c 100644 --- a/substrate/frame/bags-list/src/lib.rs +++ b/substrate/frame/bags-list/src/lib.rs @@ -136,7 +136,7 @@ use sp_runtime::TryRuntimeError; #[cfg(any(feature = "runtime-benchmarks", test))] mod benchmarks; -mod list; +pub mod list; pub mod migrations; #[cfg(any(test, feature = "fuzz"))] pub mod mock; diff --git a/substrate/frame/benchmarking/src/v1.rs b/substrate/frame/benchmarking/src/v1.rs index 8f516f4e17524..c6075e447fe77 100644 --- a/substrate/frame/benchmarking/src/v1.rs +++ b/substrate/frame/benchmarking/src/v1.rs @@ -1818,8 +1818,8 @@ pub fn show_benchmark_debug_info( #[macro_export] macro_rules! add_benchmark { ( $params:ident, $batches:ident, $name:path, $location:ty ) => { - let name_string = stringify!($name).as_bytes(); - let instance_string = stringify!($location).as_bytes(); + let pallet_string = stringify!($name).replace(" ", "").into_bytes(); + let instance_string = stringify!($location).replace(" ", "").into_bytes(); let (config, whitelist) = $params; let $crate::BenchmarkConfig { pallet, @@ -1829,7 +1829,7 @@ macro_rules! add_benchmark { verify, internal_repeats, } = config; - if &pallet[..] == &name_string[..] && &instance[..] == &instance_string[..] { + if &pallet[..] == &pallet_string[..] && &instance[..] == &instance_string[..] { let benchmark_result = <$location as $crate::Benchmarking>::run_benchmark( &benchmark[..], &selected_components[..], @@ -1852,7 +1852,7 @@ macro_rules! add_benchmark { }, Err($crate::BenchmarkError::Stop(e)) => { $crate::show_benchmark_debug_info( - instance_string, + &instance_string, benchmark, selected_components, verify, @@ -1883,8 +1883,8 @@ macro_rules! add_benchmark { if let Some(final_results) = final_results { $batches.push($crate::BenchmarkBatch { - pallet: name_string.to_vec(), - instance: instance_string.to_vec(), + pallet: pallet_string, + instance: instance_string, benchmark: benchmark.clone(), results: final_results, }); @@ -1915,12 +1915,12 @@ macro_rules! add_benchmark { #[macro_export] macro_rules! list_benchmark { ( $list:ident, $extra:ident, $name:path, $location:ty ) => { - let pallet_string = stringify!($name).as_bytes(); - let instance_string = stringify!($location).as_bytes(); + let pallet_string = stringify!($name).replace(" ", "").into_bytes(); + let instance_string = stringify!($location).replace(" ", "").into_bytes(); let benchmarks = <$location as $crate::Benchmarking>::benchmarks($extra); let pallet_benchmarks = $crate::BenchmarkList { - pallet: pallet_string.to_vec(), - instance: instance_string.to_vec(), + pallet: pallet_string, + instance: instance_string, benchmarks: benchmarks.to_vec(), }; $list.push(pallet_benchmarks) diff --git a/substrate/frame/bounties/src/lib.rs b/substrate/frame/bounties/src/lib.rs index 6ab4355ceda21..42b52d062d7a7 100644 --- a/substrate/frame/bounties/src/lib.rs +++ b/substrate/frame/bounties/src/lib.rs @@ -140,13 +140,13 @@ type BlockNumberFor = )] pub struct Bounty { /// The account proposing it. - proposer: AccountId, + pub proposer: AccountId, /// The (total) amount that should be paid if the bounty is rewarded. - value: Balance, + pub value: Balance, /// The curator fee. Included in value. - fee: Balance, + pub fee: Balance, /// The deposit of curator. - curator_deposit: Balance, + pub curator_deposit: Balance, /// The amount held on deposit (reserved) for making this proposal. bond: Balance, /// The status of this bounty. diff --git a/substrate/frame/conviction-voting/src/lib.rs b/substrate/frame/conviction-voting/src/lib.rs index 19d1e634b3dd7..9e0300fc2515a 100644 --- a/substrate/frame/conviction-voting/src/lib.rs +++ b/substrate/frame/conviction-voting/src/lib.rs @@ -188,13 +188,21 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { /// An account has delegated their vote to another account. \[who, target\] - Delegated(T::AccountId, T::AccountId), + Delegated(T::AccountId, T::AccountId, ClassOf), /// An \[account\] has cancelled a previous delegation operation. - Undelegated(T::AccountId), + Undelegated(T::AccountId, ClassOf), /// An account has voted - Voted { who: T::AccountId, vote: AccountVote> }, + Voted { + who: T::AccountId, + vote: AccountVote>, + poll_index: PollIndexOf, + }, /// A vote has been removed - VoteRemoved { who: T::AccountId, vote: AccountVote> }, + VoteRemoved { + who: T::AccountId, + vote: AccountVote>, + poll_index: PollIndexOf, + }, /// The lockup period of a conviction vote expired, and the funds have been unlocked. VoteUnlocked { who: T::AccountId, class: ClassOf }, } @@ -458,7 +466,7 @@ impl, I: 'static> Pallet { // Extend the lock to `balance` (rather than setting it) since we don't know what // other votes are in place. Self::extend_lock(who, &class, vote.balance()); - Self::deposit_event(Event::Voted { who: who.clone(), vote }); + Self::deposit_event(Event::Voted { who: who.clone(), vote, poll_index }); Ok(()) }) }) @@ -494,7 +502,11 @@ impl, I: 'static> Pallet { if let Some(approve) = v.1.as_standard() { tally.reduce(approve, *delegations); } - Self::deposit_event(Event::VoteRemoved { who: who.clone(), vote: v.1 }); + Self::deposit_event(Event::VoteRemoved { + who: who.clone(), + vote: v.1, + poll_index, + }); T::VotingHooks::on_remove_vote(who, poll_index, Status::Ongoing); Ok(()) }, @@ -649,7 +661,7 @@ impl, I: 'static> Pallet { Self::extend_lock(&who, &class, balance); Ok(votes) })?; - Self::deposit_event(Event::::Delegated(who, target)); + Self::deposit_event(Event::::Delegated(who, target, class)); Ok(votes) } @@ -688,7 +700,7 @@ impl, I: 'static> Pallet { Voting::Casting(_) => Err(Error::::NotDelegating.into()), } })?; - Self::deposit_event(Event::::Undelegated(who)); + Self::deposit_event(Event::::Undelegated(who, class)); Ok(votes) } diff --git a/substrate/frame/conviction-voting/src/tests.rs b/substrate/frame/conviction-voting/src/tests.rs index 223615218a9f5..96e15730fff4a 100644 --- a/substrate/frame/conviction-voting/src/tests.rs +++ b/substrate/frame/conviction-voting/src/tests.rs @@ -244,12 +244,14 @@ fn basic_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: aye(2, 5), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(10, 0, 2)); assert_ok!(Voting::vote(RuntimeOrigin::signed(1), 3, nay(2, 5))); System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: nay(2, 5), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 10, 0)); assert_eq!(Balances::usable_balance(1), 8); @@ -258,6 +260,7 @@ fn basic_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: aye(5, 1), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(5, 0, 5)); assert_ok!(Voting::vote(RuntimeOrigin::signed(1), 3, nay(5, 1))); @@ -268,6 +271,7 @@ fn basic_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: aye(10, 0), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(1, 0, 10)); @@ -279,6 +283,7 @@ fn basic_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::VoteRemoved { who: 1, vote: nay(10, 0), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 0)); @@ -298,6 +303,7 @@ fn split_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: split(10, 0), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(1, 0, 10)); @@ -305,6 +311,7 @@ fn split_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: split(5, 5), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 5)); assert_eq!(Balances::usable_balance(1), 0); @@ -313,6 +320,7 @@ fn split_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::VoteRemoved { who: 1, vote: split(5, 5), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 0)); @@ -332,6 +340,7 @@ fn abstain_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 1, vote: split_abstain(0, 0, 10), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 10)); @@ -339,6 +348,7 @@ fn abstain_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 6, vote: split_abstain(10, 0, 20), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(1, 0, 40)); @@ -346,6 +356,7 @@ fn abstain_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::Voted { who: 6, vote: split_abstain(0, 0, 40), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 50)); @@ -356,6 +367,7 @@ fn abstain_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::VoteRemoved { who: 1, vote: split_abstain(0, 0, 10), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 40)); @@ -363,6 +375,7 @@ fn abstain_voting_works() { System::assert_last_event(tests::RuntimeEvent::Voting(Event::VoteRemoved { who: 6, vote: split_abstain(0, 0, 40), + poll_index: 3, })); assert_eq!(tally(3), Tally::from_parts(0, 0, 0)); diff --git a/substrate/frame/delegated-staking/src/lib.rs b/substrate/frame/delegated-staking/src/lib.rs index 4923b10ecf275..e12b61d6ddd0c 100644 --- a/substrate/frame/delegated-staking/src/lib.rs +++ b/substrate/frame/delegated-staking/src/lib.rs @@ -131,7 +131,7 @@ pub mod migration; mod mock; #[cfg(test)] mod tests; -mod types; +pub mod types; extern crate alloc; diff --git a/substrate/frame/election-provider-multi-block/src/lib.rs b/substrate/frame/election-provider-multi-block/src/lib.rs index 2c22042f047db..9ae6c46f1e9ff 100644 --- a/substrate/frame/election-provider-multi-block/src/lib.rs +++ b/substrate/frame/election-provider-multi-block/src/lib.rs @@ -1606,7 +1606,7 @@ impl ElectionProvider for Pallet { } } - #[cfg(feature = "runtime-benchmarks")] + #[cfg(any(feature = "runtime-benchmarks", feature = "std"))] fn asap() { // prepare our snapshot so we can "hopefully" run a fallback. Self::create_targets_snapshot(); diff --git a/substrate/frame/election-provider-multi-block/src/signed/mod.rs b/substrate/frame/election-provider-multi-block/src/signed/mod.rs index 7326e58861471..9784cf75a5765 100644 --- a/substrate/frame/election-provider-multi-block/src/signed/mod.rs +++ b/substrate/frame/election-provider-multi-block/src/signed/mod.rs @@ -44,14 +44,11 @@ //! //! ## Future Plans: //! -//! **Lazy deletion**: -//! Overall, this pallet can avoid the need to delete any storage item, by: -//! 1. outsource the storage of solution data to some other pallet. -//! 2. keep it here, but make everything be also a map of the round number, so that we can keep old -//! storage, and it is ONLY EVER removed, when after that round number is over. This can happen -//! for more or less free by the submitter itself, and by anyone else as well, in which case they -//! get a share of the the sum deposit. The share increases as times goes on. +//! **Lazy Deletion In Eject**: While most deletion ops of the signed phase are now lazy, if someone +//! is ejected from the list, we still remove their data in sync. +//! //! **Metadata update**: imagine you mis-computed your score. +//! //! **Permissionless `clear_old_round_data`**: Anyone can clean anyone else's data, and get a part //! of their deposit. @@ -127,7 +124,7 @@ impl SolutionDataProvider for Pallet { .defensive() .and_then(|(who, _score)| { sublog!( - info, + debug, "signed", "returning page {} of {:?}'s submission as leader.", page, @@ -843,7 +840,7 @@ pub mod pallet { /// Retract a submission. /// - /// A portion of the deposit may be returned, based on the [`Config::BailoutGraceRatio`]. + /// A portion of the deposit may be returned, based on the [`Config::EjectGraceRatio`]. /// /// This will fully remove the solution from storage. #[pallet::weight(SignedWeightsOf::::bail())] diff --git a/substrate/frame/election-provider-multi-block/src/types.rs b/substrate/frame/election-provider-multi-block/src/types.rs index 1253fa23f1fd4..4b30dba9e6aad 100644 --- a/substrate/frame/election-provider-multi-block/src/types.rs +++ b/substrate/frame/election-provider-multi-block/src/types.rs @@ -359,7 +359,7 @@ impl Phase { Self::Unsigned(non_zero_left) => Self::Unsigned(non_zero_left.defensive_saturating_sub(One::one())), - // Done + // Done. Wait for export to start. Self::Done => Self::Done, // Export diff --git a/substrate/frame/election-provider-multi-block/src/unsigned/benchmarking.rs b/substrate/frame/election-provider-multi-block/src/unsigned/benchmarking.rs index 574ae8db790a1..2cab1d5997079 100644 --- a/substrate/frame/election-provider-multi-block/src/unsigned/benchmarking.rs +++ b/substrate/frame/election-provider-multi-block/src/unsigned/benchmarking.rs @@ -77,6 +77,25 @@ mod benchmarks { Ok(()) } + #[benchmark(extra, pov_mode = Measured)] + fn mine_solution(p: Linear<1, { T::Pages::get() }>) -> Result<(), BenchmarkError> { + #[cfg(test)] + crate::mock::ElectionStart::set(sp_runtime::traits::Bounded::max_value()); + crate::Pallet::::start().unwrap(); + + // roll to unsigned phase open + crate::Pallet::::roll_until_matches(|| { + matches!(CurrentPhase::::get(), Phase::Unsigned(_)) + }); + + #[block] + { + OffchainWorkerMiner::::mine_solution(p, true).unwrap(); + } + + Ok(()) + } + impl_benchmark_test_suite!( Pallet, crate::mock::ExtBuilder::full().build_unchecked(), diff --git a/substrate/frame/election-provider-multi-block/src/unsigned/miner.rs b/substrate/frame/election-provider-multi-block/src/unsigned/miner.rs index 6f425711e9ec0..6e2e11aa16942 100644 --- a/substrate/frame/election-provider-multi-block/src/unsigned/miner.rs +++ b/substrate/frame/election-provider-multi-block/src/unsigned/miner.rs @@ -719,7 +719,7 @@ impl OffchainWorkerMiner { Ok((voter_pages, all_targets, desired_targets)) } - pub(crate) fn mine_solution( + pub fn mine_solution( pages: PageIndex, do_reduce: bool, ) -> Result, OffchainMinerError> { diff --git a/substrate/frame/election-provider-multi-block/src/verifier/impls.rs b/substrate/frame/election-provider-multi-block/src/verifier/impls.rs index f382e37de98f7..ee67db14fe12f 100644 --- a/substrate/frame/election-provider-multi-block/src/verifier/impls.rs +++ b/substrate/frame/election-provider-multi-block/src/verifier/impls.rs @@ -1000,7 +1000,7 @@ impl AsynchronousVerifier for Pallet { } fn start() -> Result<(), &'static str> { - sublog!(info, "verifier", "start signal received."); + sublog!(debug, "verifier", "start signal received."); if let Status::Nothing = Self::status() { let claimed_score = Self::SolutionDataProvider::get_score(); if Self::ensure_score_quality(claimed_score).is_err() { diff --git a/substrate/frame/election-provider-multi-block/src/weights/mod.rs b/substrate/frame/election-provider-multi-block/src/weights/mod.rs index 5919ea30050ed..2fc9b824c9723 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/mod.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/mod.rs @@ -73,6 +73,10 @@ pub mod traits { pub trait WeightInfo { fn validate_unsigned() -> Weight; fn submit_unsigned() -> Weight; + // This has an auto-impl as the associated benchmark is `#[extra]`. + fn mine_solution(_p: u32) -> Weight { + Default::default() + } } impl WeightInfo for () { diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_dot_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_dot_size.rs index 80f3bfb6aba00..67967eff9d159 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_dot_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_dot_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,17 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 5 // --genesis-builder-preset -// dot_size +// fake-dot // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 // --output -// ./pallet_election_provider_multi_block_dot_size.rs +// ./pallet_election_provider_multi_block_fake-dot.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,60 +63,58 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) fn on_initialize_nothing() -> Weight { // Proof Size summary in bytes: - // Measured: `184` - // Estimated: `3649` - // Minimum execution time: 25_691_000 picoseconds. - Weight::from_parts(26_460_000, 3649) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `250` + // Estimated: `3715` + // Minimum execution time: 24_100_000 picoseconds. + Weight::from_parts(25_330_000, 3715) + .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Staking::ValidatorCount` (r:1 w:0) /// Proof: `Staking::ValidatorCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) /// Storage: `Staking::CounterForValidators` (r:1 w:0) /// Proof: `Staking::CounterForValidators` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `Staking::Validators` (r:1001 w:0) + /// Storage: `Staking::Validators` (r:2001 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:0 w:1) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshotHash` (r:0 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:0 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:0 w:1) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshotHash` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) fn on_initialize_into_snapshot_msp() -> Weight { // Proof Size summary in bytes: - // Measured: `48351` - // Estimated: `2526816` - // Minimum execution time: 9_409_183_000 picoseconds. - Weight::from_parts(9_466_093_000, 2526816) - .saturating_add(T::DbWeight::get().reads(1009_u64)) + // Measured: `95465` + // Estimated: `5048930` + // Minimum execution time: 18_878_131_000 picoseconds. + Weight::from_parts(18_983_212_000, 5048930) + .saturating_add(T::DbWeight::get().reads(2009_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) @@ -135,35 +133,33 @@ impl crate::weights::traits::pallet_election_provider_m /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `Measured`) /// Storage: `Staking::Nominators` (r:703 w:0) /// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `Measured`) - /// Storage: `Staking::Validators` (r:216 w:0) + /// Storage: `Staking::Validators` (r:261 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshotHash` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) /// Storage: `Staking::MinimumActiveStake` (r:0 w:1) /// Proof: `Staking::MinimumActiveStake` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) /// Storage: `VoterList::Lock` (r:0 w:1) /// Proof: `VoterList::Lock` (`max_values`: Some(1), `max_size`: Some(0), added: 495, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshotHash` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) fn on_initialize_into_snapshot_rest() -> Weight { // Proof Size summary in bytes: - // Measured: `1465538` - // Estimated: `3211403` - // Minimum execution time: 50_730_245_000 picoseconds. - Weight::from_parts(51_152_260_000, 3211403) - .saturating_add(T::DbWeight::get().reads(3040_u64)) + // Measured: `1449068` + // Estimated: `3194933` + // Minimum execution time: 45_723_834_000 picoseconds. + Weight::from_parts(45_910_816_000, 3194933) + .saturating_add(T::DbWeight::get().reads(3084_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) @@ -174,99 +170,87 @@ impl crate::weights::traits::pallet_election_provider_m /// Proof: `VoterList::CounterForListNodes` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: `VoterList::ListNodes` (r:705 w:0) /// Proof: `VoterList::ListNodes` (`max_values`: None, `max_size`: Some(154), added: 2629, mode: `Measured`) - /// Storage: `Staking::Bonded` (r:704 w:0) + /// Storage: `Staking::Bonded` (r:703 w:0) /// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `Measured`) - /// Storage: `Staking::Ledger` (r:704 w:0) + /// Storage: `Staking::Ledger` (r:703 w:0) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `Measured`) /// Storage: `Staking::Nominators` (r:703 w:0) /// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `Measured`) /// Storage: `VoterList::ListBags` (r:1 w:0) /// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `Measured`) - /// Storage: `Staking::Validators` (r:38 w:0) + /// Storage: `Staking::Validators` (r:45 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6358acd2035ec4bb863fa981e0c177b9` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6358acd2035ec4bb863fa981e0c177b9` (r:1 w:0) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshotHash` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) /// Storage: `Staking::MinimumActiveStake` (r:0 w:1) /// Proof: `Staking::MinimumActiveStake` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) /// Storage: `VoterList::Lock` (r:0 w:1) /// Proof: `VoterList::Lock` (`max_values`: Some(1), `max_size`: Some(0), added: 495, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshotHash` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) fn on_initialize_into_signed() -> Weight { // Proof Size summary in bytes: - // Measured: `1528197` - // Estimated: `3274062` - // Minimum execution time: 50_330_669_000 picoseconds. - Weight::from_parts(51_965_923_000, 3274062) - .saturating_add(T::DbWeight::get().reads(2865_u64)) + // Measured: `1516243` + // Estimated: `3262108` + // Minimum execution time: 50_546_380_000 picoseconds. + Weight::from_parts(51_815_377_000, 3262108) + .saturating_add(T::DbWeight::get().reads(2869_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) fn on_initialize_into_signed_validation() -> Weight { // Proof Size summary in bytes: - // Measured: `382` - // Estimated: `3847` - // Minimum execution time: 3_789_149_000 picoseconds. - Weight::from_parts(3_886_500_000, 3847) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `444` + // Estimated: `3909` + // Minimum execution time: 3_711_197_000 picoseconds. + Weight::from_parts(3_810_718_000, 3909) + .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) fn on_initialize_into_unsigned() -> Weight { // Proof Size summary in bytes: - // Measured: `378` - // Estimated: `3843` - // Minimum execution time: 3_851_726_000 picoseconds. - Weight::from_parts(3_912_487_000, 3843) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `444` + // Estimated: `3909` + // Minimum execution time: 3_740_878_000 picoseconds. + Weight::from_parts(3_808_557_000, 3909) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Storage: `Staking::CurrentEra` (r:1 w:0) @@ -285,67 +269,67 @@ impl crate::weights::traits::pallet_election_provider_m /// Proof: `Staking::ErasStakersPaged` (`max_values`: None, `max_size`: Some(3152), added: 5627, mode: `Measured`) fn export_non_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `169940` - // Estimated: `1386155` - // Minimum execution time: 13_245_264_000 picoseconds. - Weight::from_parts(13_291_774_000, 1386155) + // Measured: `167757` + // Estimated: `1383972` + // Minimum execution time: 13_949_429_000 picoseconds. + Weight::from_parts(13_983_218_000, 1383972) .saturating_add(T::DbWeight::get().reads(991_u64)) .saturating_add(T::DbWeight::get().writes(1475_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:1) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:32 w:32) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:1) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:32 w:32) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:32 w:32) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshotHash` (r:32 w:32) - /// Proof: `MultiBlock::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshotHash` (r:1 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:32 w:32) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshotHash` (r:32 w:32) + /// Proof: `MultiBlockElection::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshotHash` (r:1 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) /// Storage: `Staking::CurrentEra` (r:1 w:0) /// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: `Staking::ElectableStashes` (r:1 w:1) /// Proof: `Staking::ElectableStashes` (`max_values`: Some(1), `max_size`: Some(32002), added: 32497, mode: `Measured`) - /// Storage: `Staking::ErasStakersOverview` (r:498 w:498) + /// Storage: `Staking::ErasStakersOverview` (r:310 w:310) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `Measured`) - /// Storage: `Staking::ErasStakersPaged` (r:498 w:511) + /// Storage: `Staking::ErasStakersPaged` (r:310 w:345) /// Proof: `Staking::ErasStakersPaged` (`max_values`: None, `max_size`: Some(3152), added: 5627, mode: `Measured`) /// Storage: `Staking::ErasTotalStake` (r:1 w:1) /// Proof: `Staking::ErasTotalStake` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`) - /// Storage: `Staking::Validators` (r:498 w:0) + /// Storage: `Staking::Validators` (r:310 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlock::DesiredTargets` (r:0 w:1) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `Staking::ErasValidatorPrefs` (r:0 w:498) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `Staking::ErasValidatorPrefs` (r:0 w:310) /// Proof: `Staking::ErasValidatorPrefs` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:0 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:0 w:1) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) fn export_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `1130014` - // Estimated: `2363554` - // Minimum execution time: 27_990_573_000 picoseconds. - Weight::from_parts(33_969_464_000, 2363554) - .saturating_add(T::DbWeight::get().reads(1600_u64)) - .saturating_add(T::DbWeight::get().writes(1613_u64)) + // Measured: `770035` + // Estimated: `1538275` + // Minimum execution time: 18_379_354_000 picoseconds. + Weight::from_parts(19_010_697_000, 1538275) + .saturating_add(T::DbWeight::get().reads(1036_u64)) + .saturating_add(T::DbWeight::get().writes(1071_u64)) } fn manage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 280_000 picoseconds. - Weight::from_parts(300_000, 0) + Weight::from_parts(290_000, 0) } } diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_ksm_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_ksm_size.rs index 5361e28dcaa13..367b9e8a7028c 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_ksm_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_ksm_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,17 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 5 // --genesis-builder-preset -// ksm_size +// fake-ksm // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 // --output -// ./pallet_election_provider_multi_block_ksm_size.rs +// ./pallet_election_provider_multi_block_fake-ksm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,60 +63,58 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) fn on_initialize_nothing() -> Weight { // Proof Size summary in bytes: - // Measured: `184` - // Estimated: `3649` - // Minimum execution time: 25_161_000 picoseconds. - Weight::from_parts(25_770_000, 3649) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `250` + // Estimated: `3715` + // Minimum execution time: 24_070_000 picoseconds. + Weight::from_parts(25_070_000, 3715) + .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Staking::ValidatorCount` (r:1 w:0) /// Proof: `Staking::ValidatorCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) /// Storage: `Staking::CounterForValidators` (r:1 w:0) /// Proof: `Staking::CounterForValidators` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `Staking::Validators` (r:1001 w:0) + /// Storage: `Staking::Validators` (r:4001 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:0 w:1) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshotHash` (r:0 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:0 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:0 w:1) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshotHash` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) fn on_initialize_into_snapshot_msp() -> Weight { // Proof Size summary in bytes: - // Measured: `49030` - // Estimated: `2527495` - // Minimum execution time: 9_043_136_000 picoseconds. - Weight::from_parts(9_165_817_000, 2527495) - .saturating_add(T::DbWeight::get().reads(1009_u64)) + // Measured: `189963` + // Estimated: `10093428` + // Minimum execution time: 41_110_812_000 picoseconds. + Weight::from_parts(41_368_864_000, 10093428) + .saturating_add(T::DbWeight::get().reads(4009_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) @@ -135,35 +133,33 @@ impl crate::weights::traits::pallet_election_provider_m /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `Measured`) /// Storage: `Staking::Nominators` (r:781 w:0) /// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `Measured`) - /// Storage: `Staking::Validators` (r:395 w:0) + /// Storage: `Staking::Validators` (r:455 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshotHash` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) /// Storage: `Staking::MinimumActiveStake` (r:0 w:1) /// Proof: `Staking::MinimumActiveStake` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) /// Storage: `VoterList::Lock` (r:0 w:1) /// Proof: `VoterList::Lock` (`max_values`: Some(1), `max_size`: Some(0), added: 495, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshotHash` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) fn on_initialize_into_snapshot_rest() -> Weight { // Proof Size summary in bytes: - // Measured: `1460572` - // Estimated: `3399487` - // Minimum execution time: 50_470_803_000 picoseconds. - Weight::from_parts(50_673_355_000, 3399487) - .saturating_add(T::DbWeight::get().reads(3531_u64)) + // Measured: `1370478` + // Estimated: `3309393` + // Minimum execution time: 55_933_967_000 picoseconds. + Weight::from_parts(56_210_319_000, 3309393) + .saturating_add(T::DbWeight::get().reads(3590_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) @@ -174,174 +170,166 @@ impl crate::weights::traits::pallet_election_provider_m /// Proof: `VoterList::CounterForListNodes` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: `VoterList::ListNodes` (r:783 w:0) /// Proof: `VoterList::ListNodes` (`max_values`: None, `max_size`: Some(154), added: 2629, mode: `Measured`) - /// Storage: `Staking::Bonded` (r:782 w:0) + /// Storage: `Staking::Bonded` (r:781 w:0) /// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `Measured`) - /// Storage: `Staking::Ledger` (r:782 w:0) + /// Storage: `Staking::Ledger` (r:781 w:0) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `Measured`) /// Storage: `Staking::Nominators` (r:781 w:0) /// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `VoterList::ListBags` (r:1 w:0) + /// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `Measured`) + /// Storage: `Staking::Validators` (r:173 w:0) + /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6358acd2035ec4bb863fa981e0c177b9` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6358acd2035ec4bb863fa981e0c177b9` (r:1 w:0) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshotHash` (r:0 w:1) - /// Proof: `MultiBlock::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) /// Storage: `Staking::MinimumActiveStake` (r:0 w:1) /// Proof: `Staking::MinimumActiveStake` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) /// Storage: `VoterList::Lock` (r:0 w:1) /// Proof: `VoterList::Lock` (`max_values`: Some(1), `max_size`: Some(0), added: 495, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshotHash` (r:0 w:1) + /// Proof: `MultiBlockElection::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) fn on_initialize_into_signed() -> Weight { // Proof Size summary in bytes: - // Measured: `1586117` - // Estimated: `3525032` - // Minimum execution time: 49_951_253_000 picoseconds. - Weight::from_parts(51_478_904_000, 3525032) - .saturating_add(T::DbWeight::get().reads(3138_u64)) + // Measured: `1472353` + // Estimated: `3411268` + // Minimum execution time: 55_352_841_000 picoseconds. + Weight::from_parts(55_916_036_000, 3411268) + .saturating_add(T::DbWeight::get().reads(3309_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:0) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) fn on_initialize_into_signed_validation() -> Weight { // Proof Size summary in bytes: - // Measured: `382` - // Estimated: `3847` - // Minimum execution time: 1_786_985_000 picoseconds. - Weight::from_parts(2_471_230_000, 3847) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `444` + // Estimated: `3909` + // Minimum execution time: 202_762_000 picoseconds. + Weight::from_parts(2_761_480_000, 3909) + .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) fn on_initialize_into_unsigned() -> Weight { // Proof Size summary in bytes: - // Measured: `378` - // Estimated: `3843` - // Minimum execution time: 505_464_000 picoseconds. - Weight::from_parts(2_392_569_000, 3843) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `444` + // Estimated: `3909` + // Minimum execution time: 981_606_000 picoseconds. + Weight::from_parts(2_872_530_000, 3909) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Storage: `Staking::CurrentEra` (r:1 w:0) /// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: `Staking::ElectableStashes` (r:1 w:1) /// Proof: `Staking::ElectableStashes` (`max_values`: Some(1), `max_size`: Some(32002), added: 32497, mode: `Measured`) - /// Storage: `Staking::ErasStakersOverview` (r:829 w:829) + /// Storage: `Staking::ErasStakersOverview` (r:792 w:792) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `Measured`) /// Storage: `Staking::ErasTotalStake` (r:1 w:1) /// Proof: `Staking::ErasTotalStake` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`) - /// Storage: `Staking::Validators` (r:829 w:0) + /// Storage: `Staking::Validators` (r:792 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `Staking::ErasValidatorPrefs` (r:0 w:829) + /// Storage: `Staking::ErasValidatorPrefs` (r:0 w:792) /// Proof: `Staking::ErasValidatorPrefs` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `Measured`) - /// Storage: `Staking::ErasStakersPaged` (r:0 w:806) + /// Storage: `Staking::ErasStakersPaged` (r:0 w:740) /// Proof: `Staking::ErasStakersPaged` (`max_values`: None, `max_size`: Some(3152), added: 5627, mode: `Measured`) fn export_non_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `168580` - // Estimated: `2221345` - // Minimum execution time: 22_613_149_000 picoseconds. - Weight::from_parts(23_424_133_000, 2221345) - .saturating_add(T::DbWeight::get().reads(1667_u64)) - .saturating_add(T::DbWeight::get().writes(2467_u64)) + // Measured: `233920` + // Estimated: `2195110` + // Minimum execution time: 24_478_931_000 picoseconds. + Weight::from_parts(24_520_800_000, 2195110) + .saturating_add(T::DbWeight::get().reads(1593_u64)) + .saturating_add(T::DbWeight::get().writes(2327_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:1) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:16 w:16) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:1) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:16 w:16) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:16 w:16) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshotHash` (r:16 w:16) - /// Proof: `MultiBlock::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshotHash` (r:1 w:1) - /// Proof: `MultiBlock::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:16 w:16) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedVoterSnapshotHash` (r:16 w:16) + /// Proof: `MultiBlockElection::PagedVoterSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshotHash` (r:1 w:1) + /// Proof: `MultiBlockElection::PagedTargetSnapshotHash` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `Measured`) /// Storage: `Staking::CurrentEra` (r:1 w:0) /// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) /// Storage: `Staking::ElectableStashes` (r:1 w:1) /// Proof: `Staking::ElectableStashes` (`max_values`: Some(1), `max_size`: Some(32002), added: 32497, mode: `Measured`) - /// Storage: `Staking::ErasStakersOverview` (r:955 w:955) + /// Storage: `Staking::ErasStakersOverview` (r:580 w:580) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `Measured`) - /// Storage: `Staking::ErasStakersPaged` (r:955 w:956) + /// Storage: `Staking::ErasStakersPaged` (r:580 w:580) /// Proof: `Staking::ErasStakersPaged` (`max_values`: None, `max_size`: Some(3152), added: 5627, mode: `Measured`) /// Storage: `Staking::ErasTotalStake` (r:1 w:1) /// Proof: `Staking::ErasTotalStake` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`) - /// Storage: `Staking::Validators` (r:955 w:0) + /// Storage: `Staking::Validators` (r:580 w:0) /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `Measured`) - /// Storage: `MultiBlock::DesiredTargets` (r:0 w:1) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `Staking::ErasValidatorPrefs` (r:0 w:955) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `Staking::ErasValidatorPrefs` (r:0 w:580) /// Proof: `Staking::ErasValidatorPrefs` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:0 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:0 w:1) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) fn export_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `1918340` - // Estimated: `4282955` - // Minimum execution time: 50_064_025_000 picoseconds. - Weight::from_parts(50_383_919_000, 4282955) - .saturating_add(T::DbWeight::get().reads(2923_u64)) - .saturating_add(T::DbWeight::get().writes(2924_u64)) + // Measured: `1168790` + // Estimated: `2605280` + // Minimum execution time: 31_737_516_000 picoseconds. + Weight::from_parts(31_793_526_000, 2605280) + .saturating_add(T::DbWeight::get().reads(1798_u64)) + .saturating_add(T::DbWeight::get().writes(1798_u64)) } fn manage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 290_000 picoseconds. - Weight::from_parts(340_000, 0) + // Minimum execution time: 250_000 picoseconds. + Weight::from_parts(300_000, 0) } } diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_dot_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_dot_size.rs index a03718223d998..1ec37eea09351 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_dot_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_dot_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,17 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 5 // --genesis-builder-preset -// dot_size +// fake-dot // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 // --output -// ./pallet_election_provider_multi_block_signed_dot_size.rs +// ./pallet_election_provider_multi_block_signed_fake-dot.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,140 +63,140 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block_signed`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block_signed::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:0 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:0 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) fn register_not_full() -> Weight { // Proof Size summary in bytes: - // Measured: `3074` - // Estimated: `6539` - // Minimum execution time: 139_781_000 picoseconds. - Weight::from_parts(141_441_000, 6539) + // Measured: `3312` + // Estimated: `6777` + // Minimum execution time: 143_730_000 picoseconds. + Weight::from_parts(146_621_000, 6777) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:2) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:32 w:32) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:2) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:32 w:32) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) fn register_eject() -> Weight { // Proof Size summary in bytes: - // Measured: `7674` - // Estimated: `87864` - // Minimum execution time: 345_362_000 picoseconds. - Weight::from_parts(351_381_000, 87864) + // Measured: `7846` + // Estimated: `88036` + // Minimum execution time: 345_252_000 picoseconds. + Weight::from_parts(348_112_000, 88036) .saturating_add(T::DbWeight::get().reads(39_u64)) .saturating_add(T::DbWeight::get().writes(37_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) fn submit_page() -> Weight { // Proof Size summary in bytes: - // Measured: `3607` - // Estimated: `7072` - // Minimum execution time: 6_454_547_000 picoseconds. - Weight::from_parts(6_585_090_000, 7072) + // Measured: `3845` + // Estimated: `7310` + // Minimum execution time: 5_672_789_000 picoseconds. + Weight::from_parts(6_445_424_000, 7310) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) fn unset_page() -> Weight { // Proof Size summary in bytes: - // Measured: `15537` - // Estimated: `19002` - // Minimum execution time: 6_424_309_000 picoseconds. - Weight::from_parts(8_822_282_000, 19002) + // Measured: `6737` + // Estimated: `10202` + // Minimum execution time: 8_071_243_000 picoseconds. + Weight::from_parts(8_089_732_000, 10202) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:32 w:32) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:32 w:32) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) fn bail() -> Weight { // Proof Size summary in bytes: - // Measured: `4539` - // Estimated: `84729` - // Minimum execution time: 230_051_000 picoseconds. - Weight::from_parts(232_931_000, 84729) + // Measured: `4777` + // Estimated: `84967` + // Minimum execution time: 234_231_000 picoseconds. + Weight::from_parts(240_031_000, 84967) .saturating_add(T::DbWeight::get().reads(38_u64)) .saturating_add(T::DbWeight::get().writes(35_u64)) } - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:32 w:32) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:32 w:32) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) /// The range of component `p` is `[1, 32]`. fn clear_old_round_data(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3531 + p * (32 ±0)` - // Estimated: `6996 + p * (2507 ±0)` - // Minimum execution time: 141_670_000 picoseconds. - Weight::from_parts(142_005_262, 6996) - // Standard Error: 17_673 - .saturating_add(Weight::from_parts(1_930_735, 0).saturating_mul(p.into())) + // Measured: `3767 + p * (32 ±0)` + // Estimated: `7232 + p * (2507 ±0)` + // Minimum execution time: 143_121_000 picoseconds. + Weight::from_parts(141_105_005, 7232) + // Standard Error: 44_586 + .saturating_add(Weight::from_parts(1_987_686, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_ksm_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_ksm_size.rs index 6d122aa221535..7719f44f5a439 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_ksm_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_signed_ksm_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,17 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 5 // --genesis-builder-preset -// ksm_size +// fake-ksm // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 // --output -// ./pallet_election_provider_multi_block_signed_ksm_size.rs +// ./pallet_election_provider_multi_block_signed_fake-ksm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,140 +63,140 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block_signed`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block_signed::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:0 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:0 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) fn register_not_full() -> Weight { // Proof Size summary in bytes: - // Measured: `3140` - // Estimated: `6605` - // Minimum execution time: 139_291_000 picoseconds. - Weight::from_parts(140_741_000, 6605) + // Measured: `3180` + // Estimated: `6645` + // Minimum execution time: 141_781_000 picoseconds. + Weight::from_parts(144_891_000, 6645) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:2) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:16 w:16) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:2) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:16 w:16) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) fn register_eject() -> Weight { // Proof Size summary in bytes: - // Measured: `7072` - // Estimated: `47662` - // Minimum execution time: 308_522_000 picoseconds. - Weight::from_parts(314_313_000, 47662) + // Measured: `7144` + // Estimated: `47734` + // Minimum execution time: 303_662_000 picoseconds. + Weight::from_parts(306_382_000, 47734) .saturating_add(T::DbWeight::get().reads(23_u64)) .saturating_add(T::DbWeight::get().writes(21_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) fn submit_page() -> Weight { // Proof Size summary in bytes: - // Measured: `3657` - // Estimated: `7122` - // Minimum execution time: 2_269_015_000 picoseconds. - Weight::from_parts(3_552_353_000, 7122) + // Measured: `3697` + // Estimated: `7162` + // Minimum execution time: 2_316_144_000 picoseconds. + Weight::from_parts(2_483_425_000, 7162) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) fn unset_page() -> Weight { // Proof Size summary in bytes: - // Measured: `17806` - // Estimated: `21271` - // Minimum execution time: 3_049_939_000 picoseconds. - Weight::from_parts(3_492_703_000, 21271) + // Measured: `8620` + // Estimated: `12085` + // Minimum execution time: 2_016_652_000 picoseconds. + Weight::from_parts(2_284_763_000, 12085) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:16 w:16) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:16 w:16) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) fn bail() -> Weight { // Proof Size summary in bytes: - // Measured: `4070` - // Estimated: `44660` - // Minimum execution time: 195_501_000 picoseconds. - Weight::from_parts(197_231_000, 44660) + // Measured: `4110` + // Estimated: `44700` + // Minimum execution time: 200_051_000 picoseconds. + Weight::from_parts(201_981_000, 44700) .saturating_add(T::DbWeight::get().reads(22_u64)) .saturating_add(T::DbWeight::get().writes(19_u64)) } - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:16 w:16) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:16 w:16) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) /// The range of component `p` is `[1, 16]`. fn clear_old_round_data(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3584 + p * (31 ±0)` - // Estimated: `7049 + p * (2507 ±0)` - // Minimum execution time: 140_690_000 picoseconds. - Weight::from_parts(141_436_730, 7049) - // Standard Error: 49_308 - .saturating_add(Weight::from_parts(1_794_932, 0).saturating_mul(p.into())) + // Measured: `3622 + p * (31 ±0)` + // Estimated: `7089 + p * (2507 ±0)` + // Minimum execution time: 141_960_000 picoseconds. + Weight::from_parts(142_125_963, 7089) + // Standard Error: 117_080 + .saturating_add(Weight::from_parts(1_784_427, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_dot_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_dot_size.rs index c5a0eea5db430..0eebcb65f1688 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_dot_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_dot_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `3`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,18 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 3 // --genesis-builder-preset -// dot_size +// fake-dot // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 +// --extra // --output -// ./pallet_election_provider_multi_block_unsigned_dot_size.rs +// ./pallet_election_provider_multi_block_unsigned_fake-dot.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,55 +64,88 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block_unsigned`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block_unsigned::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) - /// Storage: `MultiBlockVerifier::MinimumScore` (r:1 w:0) - /// Proof: `MultiBlockVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::MinimumScore` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) fn validate_unsigned() -> Weight { // Proof Size summary in bytes: - // Measured: `365` - // Estimated: `3830` - // Minimum execution time: 2_976_183_000 picoseconds. - Weight::from_parts(4_693_571_000, 3830) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `378` + // Estimated: `3843` + // Minimum execution time: 3_343_638_000 picoseconds. + Weight::from_parts(3_863_700_000, 3843) + .saturating_add(T::DbWeight::get().reads(8_u64)) } + /// Storage: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) - /// Storage: `MultiBlockVerifier::MinimumScore` (r:1 w:0) - /// Proof: `MultiBlockVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:4 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::MinimumScore` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:4 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionY` (r:0 w:4) - /// Proof: `MultiBlockVerifier::QueuedSolutionY` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionY` (r:0 w:4) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionY` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) fn submit_unsigned() -> Weight { // Proof Size summary in bytes: - // Measured: `1462493` - // Estimated: `1473383` - // Minimum execution time: 32_392_063_000 picoseconds. - Weight::from_parts(35_743_638_000, 1473383) - .saturating_add(T::DbWeight::get().reads(12_u64)) + // Measured: `1451085` + // Estimated: `1461975` + // Minimum execution time: 27_632_103_000 picoseconds. + Weight::from_parts(27_843_954_000, 1461975) + .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) + /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:32 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) + /// The range of component `p` is `[1, 32]`. + fn mine_solution(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + p * (360895 ±0)` + // Estimated: `332140 + p * (348312 ±2_731)` + // Minimum execution time: 926_273_131_000 picoseconds. + Weight::from_parts(926_273_131_000, 332140) + // Standard Error: 303_324_142_965 + .saturating_add(Weight::from_parts(6_610_814_674_792, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 348312).saturating_mul(p.into())) + } } diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_ksm_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_ksm_size.rs index 7635b9cf4cdfe..1c614472fe91a 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_ksm_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_unsigned_ksm_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-18, STEPS: `5`, REPEAT: `3`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,18 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 3 // --genesis-builder-preset -// ksm_size +// fake-ksm // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 +// --extra // --output -// ./pallet_election_provider_multi_block_unsigned_ksm_size.rs +// ./pallet_election_provider_multi_block_unsigned_fake-ksm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,55 +64,88 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block_unsigned`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block_unsigned::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:0) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) - /// Storage: `MultiBlockVerifier::MinimumScore` (r:1 w:0) - /// Proof: `MultiBlockVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:0) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::MinimumScore` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) fn validate_unsigned() -> Weight { // Proof Size summary in bytes: - // Measured: `365` - // Estimated: `3830` - // Minimum execution time: 3_958_575_000 picoseconds. - Weight::from_parts(3_984_285_000, 3830) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `378` + // Estimated: `3843` + // Minimum execution time: 2_236_486_000 picoseconds. + Weight::from_parts(2_276_596_000, 3843) + .saturating_add(T::DbWeight::get().reads(8_u64)) } + /// Storage: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x33ed3d010c1fea25c2adbfba9297161f` (r:1 w:0) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) - /// Storage: `MultiBlockVerifier::MinimumScore` (r:1 w:0) - /// Proof: `MultiBlockVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:4 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::MinimumScore` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::MinimumScore` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:4 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionY` (r:0 w:4) - /// Proof: `MultiBlockVerifier::QueuedSolutionY` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionY` (r:0 w:4) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionY` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) fn submit_unsigned() -> Weight { // Proof Size summary in bytes: - // Measured: `1395131` - // Estimated: `1406021` - // Minimum execution time: 32_324_705_000 picoseconds. - Weight::from_parts(32_944_719_000, 1406021) - .saturating_add(T::DbWeight::get().reads(12_u64)) + // Measured: `1440523` + // Estimated: `1451413` + // Minimum execution time: 30_959_432_000 picoseconds. + Weight::from_parts(31_005_092_000, 1451413) + .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) + /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:16 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) + /// The range of component `p` is `[1, 16]`. + fn mine_solution(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `39458 + p * (349682 ±0)` + // Estimated: `26136 + p * (352057 ±1_160)` + // Minimum execution time: 3_353_004_496_000 picoseconds. + Weight::from_parts(3_353_004_496_000, 26136) + // Standard Error: 376_745_635_821 + .saturating_add(Weight::from_parts(6_831_608_018_289, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 352057).saturating_mul(p.into())) + } } diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_dot_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_dot_size.rs index a53ef8dc7c158..36d782c70c47f 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_dot_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_dot_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,17 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 5 // --genesis-builder-preset -// dot_size +// fake-dot // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 // --output -// ./pallet_election_provider_multi_block_verifier_dot_size.rs +// ./pallet_election_provider_multi_block_verifier_fake-dot.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,180 +63,180 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block_verifier`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block_verifier::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:1 w:0) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) fn on_initialize_valid_non_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `328720` - // Estimated: `332185` - // Minimum execution time: 4_525_797_000 picoseconds. - Weight::from_parts(4_601_537_000, 332185) + // Measured: `337306` + // Estimated: `340771` + // Minimum execution time: 4_050_122_000 picoseconds. + Weight::from_parts(4_070_462_000, 340771) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:32 w:32) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:32 w:32) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:33 w:32) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:33 w:32) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) fn on_initialize_valid_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `1223191` - // Estimated: `1305856` - // Minimum execution time: 31_229_565_000 picoseconds. - Weight::from_parts(31_839_841_000, 1305856) + // Measured: `1184612` + // Estimated: `1267277` + // Minimum execution time: 17_111_945_000 picoseconds. + Weight::from_parts(17_278_715_000, 1267277) .saturating_add(T::DbWeight::get().reads(80_u64)) .saturating_add(T::DbWeight::get().writes(72_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:32 w:32) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:32 w:32) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:33 w:32) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:33 w:32) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:31 w:32) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:31 w:32) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) fn on_initialize_invalid_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `1224212` - // Estimated: `1306877` - // Minimum execution time: 31_394_976_000 picoseconds. - Weight::from_parts(32_094_625_000, 1306877) + // Measured: `1185633` + // Estimated: `1268298` + // Minimum execution time: 17_293_481_000 picoseconds. + Weight::from_parts(17_381_352_000, 1268298) .saturating_add(T::DbWeight::get().reads(110_u64)) .saturating_add(T::DbWeight::get().writes(101_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:32 w:32) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:32 w:32) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(45072), added: 47547, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(64026), added: 66501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(388785), added: 391260, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:31 w:31) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:31 w:31) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:31 w:31) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(33794026), added: 33796501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:31 w:31) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) /// The range of component `v` is `[0, 31]`. fn on_initialize_invalid_non_terminal(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `353985 + v * (2260 ±0)` - // Estimated: `459489 + v * (3052 ±323)` - // Minimum execution time: 1_115_777_000 picoseconds. - Weight::from_parts(1_305_809_580, 459489) - // Standard Error: 631_886 - .saturating_add(Weight::from_parts(4_251_321, 0).saturating_mul(v.into())) + // Measured: `341548 + v * (4932 ±0)` + // Estimated: `443308 + v * (4988 ±806)` + // Minimum execution time: 1_165_016_000 picoseconds. + Weight::from_parts(1_057_101_975, 443308) + // Standard Error: 4_684_378 + .saturating_add(Weight::from_parts(27_427_295, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(46_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(v.into()))) .saturating_add(T::DbWeight::get().writes(37_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(v.into()))) - .saturating_add(Weight::from_parts(0, 3052).saturating_mul(v.into())) + .saturating_add(Weight::from_parts(0, 4988).saturating_mul(v.into())) } } diff --git a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_ksm_size.rs b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_ksm_size.rs index 63e4fecc7dd25..5243dc3d27c2f 100644 --- a/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_ksm_size.rs +++ b/substrate/frame/election-provider-multi-block/src/weights/pallet_election_provider_multi_block_verifier_ksm_size.rs @@ -22,7 +22,7 @@ // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-30, STEPS: `10`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-17, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -39,17 +39,17 @@ // --runtime // ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm // --steps -// 10 +// 5 // --repeat -// 20 +// 5 // --genesis-builder-preset -// ksm_size +// fake-ksm // --template // ../../../../../substrate/frame/election-provider-multi-block/src/template.hbs // --heap-pages // 65000 // --output -// ./pallet_election_provider_multi_block_verifier_ksm_size.rs +// ./pallet_election_provider_multi_block_verifier_fake-ksm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,178 +63,178 @@ use core::marker::PhantomData; /// Weights for `pallet_election_provider_multi_block_verifier`. pub struct WeightInfo(PhantomData); impl crate::weights::traits::pallet_election_provider_multi_block_verifier::WeightInfo for WeightInfo { - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:0) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:1 w:0) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:1 w:0) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) fn on_initialize_valid_non_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `283256` - // Estimated: `286721` - // Minimum execution time: 7_641_515_000 picoseconds. - Weight::from_parts(9_430_295_000, 286721) + // Measured: `350585` + // Estimated: `354050` + // Minimum execution time: 8_603_879_000 picoseconds. + Weight::from_parts(8_934_521_000, 354050) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:16 w:16) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:16 w:16) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:17 w:16) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionScore` (r:1 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:17 w:16) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionScore` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionScore` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:0 w:1) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:0 w:1) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) fn on_initialize_valid_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `1196889` - // Estimated: `1239954` - // Minimum execution time: 31_903_473_000 picoseconds. - Weight::from_parts(32_118_905_000, 1239954) + // Measured: `1183276` + // Estimated: `1226341` + // Minimum execution time: 18_426_816_000 picoseconds. + Weight::from_parts(18_490_837_000, 1226341) .saturating_add(T::DbWeight::get().reads(48_u64)) .saturating_add(T::DbWeight::get().writes(40_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:16 w:16) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:16 w:16) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:17 w:16) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:17 w:16) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:15 w:16) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:15 w:16) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) fn on_initialize_invalid_terminal() -> Weight { // Proof Size summary in bytes: - // Measured: `1197238` - // Estimated: `1240303` - // Minimum execution time: 31_537_693_000 picoseconds. - Weight::from_parts(31_987_188_000, 1240303) + // Measured: `1183625` + // Estimated: `1226690` + // Minimum execution time: 18_057_114_000 picoseconds. + Weight::from_parts(18_334_996_000, 1226690) .saturating_add(T::DbWeight::get().reads(62_u64)) .saturating_add(T::DbWeight::get().writes(53_u64)) } - /// Storage: `MultiBlock::CurrentPhase` (r:1 w:1) - /// Proof: `MultiBlock::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlockVerifier::StatusStorage` (r:1 w:1) - /// Proof: `MultiBlockVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) - /// Storage: `MultiBlock::Round` (r:1 w:0) - /// Proof: `MultiBlock::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) - /// Storage: `MultiBlockSigned::SortedScores` (r:1 w:1) - /// Proof: `MultiBlockSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionStorage` (r:16 w:16) - /// Proof: `MultiBlockSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) + /// Storage: `MultiBlockElection::CurrentPhase` (r:1 w:1) + /// Proof: `MultiBlockElection::CurrentPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::StatusStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionVerifier::StatusStorage` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `Measured`) + /// Storage: `MultiBlockElection::Round` (r:1 w:0) + /// Proof: `MultiBlockElection::Round` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SortedScores` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SortedScores` (`max_values`: None, `max_size`: Some(653), added: 3128, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionStorage` (r:16 w:16) + /// Proof: `MultiBlockElectionSigned::SubmissionStorage` (`max_values`: None, `max_size`: Some(50064), added: 52539, mode: `Measured`) /// Storage: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) /// Proof: UNKNOWN KEY `0xa143099d7a337c5fd879b91b2b157c2d` (r:1 w:0) - /// Storage: `MultiBlock::PagedTargetSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(32026), added: 34501, mode: `Measured`) - /// Storage: `MultiBlock::PagedVoterSnapshot` (r:1 w:0) - /// Proof: `MultiBlock::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) + /// Storage: `MultiBlockElection::PagedTargetSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedTargetSnapshot` (`max_values`: None, `max_size`: Some(128026), added: 130501, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x5640fd84ada5e16d1b6739279282536c` (r:1 w:0) + /// Storage: `MultiBlockElection::PagedVoterSnapshot` (r:1 w:0) + /// Proof: `MultiBlockElection::PagedVoterSnapshot` (`max_values`: None, `max_size`: Some(431919), added: 434394, mode: `Measured`) /// Storage: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) /// Proof: UNKNOWN KEY `0x6f320d44e42312c78638e6c92dff65af` (r:1 w:0) - /// Storage: `MultiBlock::DesiredTargets` (r:1 w:0) - /// Proof: `MultiBlock::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedValidVariant` (r:1 w:0) - /// Proof: `MultiBlockVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionX` (r:15 w:15) - /// Proof: `MultiBlockVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) - /// Storage: `MultiBlockVerifier::QueuedSolutionBackings` (r:15 w:15) - /// Proof: `MultiBlockVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) - /// Storage: `MultiBlockSigned::SubmissionMetadataStorage` (r:1 w:1) - /// Proof: `MultiBlockSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) + /// Storage: `MultiBlockElection::DesiredTargets` (r:1 w:0) + /// Proof: `MultiBlockElection::DesiredTargets` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedValidVariant` (r:1 w:0) + /// Proof: `MultiBlockElectionVerifier::QueuedValidVariant` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionX` (r:15 w:15) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionX` (`max_values`: None, `max_size`: Some(37538026), added: 37540501, mode: `Measured`) + /// Storage: `MultiBlockElectionVerifier::QueuedSolutionBackings` (r:15 w:15) + /// Proof: `MultiBlockElectionVerifier::QueuedSolutionBackings` (`max_values`: None, `max_size`: Some(52026), added: 54501, mode: `Measured`) + /// Storage: `MultiBlockElectionSigned::SubmissionMetadataStorage` (r:1 w:1) + /// Proof: `MultiBlockElectionSigned::SubmissionMetadataStorage` (`max_values`: None, `max_size`: Some(165), added: 2640, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `Measured`) /// Storage: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) /// Proof: UNKNOWN KEY `0x48384a816e4f71a936cb76dc9e303f2a` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xc209f5d8eb920681b56c64b8694ea78c` (r:1 w:0) /// The range of component `v` is `[0, 15]`. fn on_initialize_invalid_non_terminal(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `372628 + v * (6011 ±0)` - // Estimated: `385475 + v * (7288 ±1_424)` - // Minimum execution time: 1_318_647_000 picoseconds. - Weight::from_parts(4_794_918_600, 385475) + // Measured: `384413 + v * (8974 ±0)` + // Estimated: `502395 + v * (7186 ±2_803)` + // Minimum execution time: 1_502_809_000 picoseconds. + Weight::from_parts(4_607_201_267, 502395) .saturating_add(T::DbWeight::get().reads(30_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(v.into()))) .saturating_add(T::DbWeight::get().writes(21_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(v.into()))) - .saturating_add(Weight::from_parts(0, 7288).saturating_mul(v.into())) + .saturating_add(Weight::from_parts(0, 7186).saturating_mul(v.into())) } } diff --git a/substrate/frame/election-provider-support/src/lib.rs b/substrate/frame/election-provider-support/src/lib.rs index 4d50d9934710d..83ee955468905 100644 --- a/substrate/frame/election-provider-support/src/lib.rs +++ b/substrate/frame/election-provider-support/src/lib.rs @@ -530,7 +530,7 @@ pub trait ElectionProvider { /// Signal the election provider that we are about to call `elect` asap, and it should prepare /// itself. - #[cfg(feature = "runtime-benchmarks")] + #[cfg(any(feature = "runtime-benchmarks", feature = "std"))] fn asap() {} } diff --git a/substrate/frame/im-online/src/benchmarking.rs b/substrate/frame/im-online/src/benchmarking.rs index 439720bcab38a..06b7231b1f485 100644 --- a/substrate/frame/im-online/src/benchmarking.rs +++ b/substrate/frame/im-online/src/benchmarking.rs @@ -29,8 +29,6 @@ use sp_runtime::{ use crate::*; -const MAX_KEYS: u32 = 1000; - pub fn create_heartbeat( k: u32, ) -> Result< @@ -67,7 +65,7 @@ mod benchmarks { use super::*; #[benchmark(extra)] - fn heartbeat(k: Linear<1, MAX_KEYS>) -> Result<(), BenchmarkError> { + fn heartbeat(k: Linear<1, { ::MaxKeys::get() }>) -> Result<(), BenchmarkError> { let (input_heartbeat, signature) = create_heartbeat::(k)?; #[extrinsic_call] @@ -77,7 +75,9 @@ mod benchmarks { } #[benchmark(extra)] - fn validate_unsigned(k: Linear<1, MAX_KEYS>) -> Result<(), BenchmarkError> { + fn validate_unsigned( + k: Linear<1, { ::MaxKeys::get() }>, + ) -> Result<(), BenchmarkError> { let (input_heartbeat, signature) = create_heartbeat::(k)?; let call = Call::heartbeat { heartbeat: input_heartbeat, signature }; @@ -91,7 +91,9 @@ mod benchmarks { } #[benchmark] - fn validate_unsigned_and_then_heartbeat(k: Linear<1, MAX_KEYS>) -> Result<(), BenchmarkError> { + fn validate_unsigned_and_then_heartbeat( + k: Linear<1, { ::MaxKeys::get() }>, + ) -> Result<(), BenchmarkError> { let (input_heartbeat, signature) = create_heartbeat::(k)?; let call = Call::heartbeat { heartbeat: input_heartbeat, signature }; let call_enc = call.encode(); diff --git a/substrate/frame/multisig/src/lib.rs b/substrate/frame/multisig/src/lib.rs index d6694893974ce..c95dbaaac303d 100644 --- a/substrate/frame/multisig/src/lib.rs +++ b/substrate/frame/multisig/src/lib.rs @@ -104,7 +104,18 @@ pub struct Timepoint { } /// An open multisig operation. -#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Eq, + PartialEq, + Encode, + Decode, + Default, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + DecodeWithMemTracking, +)] #[scale_info(skip_type_params(MaxApprovals))] pub struct Multisig where diff --git a/substrate/frame/nomination-pools/src/lib.rs b/substrate/frame/nomination-pools/src/lib.rs index b6171071a10ae..2bb2e0a325388 100644 --- a/substrate/frame/nomination-pools/src/lib.rs +++ b/substrate/frame/nomination-pools/src/lib.rs @@ -1357,6 +1357,7 @@ impl BondedPool { Encode, Decode, MaxEncodedLen, + DecodeWithMemTracking, TypeInfo, CloneNoBound, PartialEqNoBound, @@ -1526,6 +1527,7 @@ impl RewardPool { Encode, Decode, MaxEncodedLen, + DecodeWithMemTracking, TypeInfo, DefaultNoBound, RuntimeDebugNoBound, @@ -1578,6 +1580,7 @@ impl UnbondPool { Encode, Decode, MaxEncodedLen, + DecodeWithMemTracking, TypeInfo, DefaultNoBound, RuntimeDebugNoBound, diff --git a/substrate/frame/preimage/src/lib.rs b/substrate/frame/preimage/src/lib.rs index e397d7a43b5ea..584a9fbe3aa2a 100644 --- a/substrate/frame/preimage/src/lib.rs +++ b/substrate/frame/preimage/src/lib.rs @@ -65,7 +65,17 @@ use frame_system::pallet_prelude::*; pub use pallet::*; /// A type to note whether a preimage is owned by a user or the system. -#[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive( + Clone, + Eq, + PartialEq, + Encode, + Decode, + TypeInfo, + MaxEncodedLen, + RuntimeDebug, + DecodeWithMemTracking, +)] pub enum OldRequestStatus { /// The associated preimage has not yet been requested by the system. The given deposit (if /// some) is being held until either it becomes requested or the user retracts the preimage. @@ -77,7 +87,17 @@ pub enum OldRequestStatus { } /// A type to note whether a preimage is owned by a user or the system. -#[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive( + Clone, + Eq, + PartialEq, + Encode, + Decode, + TypeInfo, + MaxEncodedLen, + RuntimeDebug, + DecodeWithMemTracking, +)] pub enum RequestStatus { /// The associated preimage has not yet been requested by the system. The given deposit (if /// some) is being held until either it becomes requested or the user retracts the preimage. diff --git a/substrate/frame/referenda/src/migration.rs b/substrate/frame/referenda/src/migration.rs index c94896649beab..22b834ea32f23 100644 --- a/substrate/frame/referenda/src/migration.rs +++ b/substrate/frame/referenda/src/migration.rs @@ -48,7 +48,17 @@ pub mod v0 { >; /// Info regarding a referendum, present or past. - #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive( + Encode, + Decode, + Clone, + PartialEq, + Eq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + DecodeWithMemTracking, + )] pub enum ReferendumInfo< TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index 5b29390ff0d9e..3fca74ad82958 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -1129,7 +1129,7 @@ where let origin = &self.origin.account_id()?; let ed = >::min_balance(); - frame.nested_storage.record_charge(&StorageDeposit::Charge(ed)); + frame.nested_storage.record_charge(&StorageDeposit::Charge(ed))?; if self.skip_transfer { T::Currency::set_balance(account_id, ed); } else { @@ -1379,41 +1379,36 @@ where to: &T::AccountId, value: U256, storage_meter: &mut storage::meter::GenericMeter, - ) -> ExecResult { + ) -> DispatchResult { fn transfer_with_dust( from: &AccountIdOf, to: &AccountIdOf, value: BalanceWithDust>, - ) -> Result<(), ExecError> { + ) -> DispatchResult { let (value, dust) = value.deconstruct(); fn transfer_balance( from: &AccountIdOf, to: &AccountIdOf, value: BalanceOf, - ) -> Result<(), ExecError> { + ) -> DispatchResult { T::Currency::transfer(from, to, value, Preservation::Preserve) .map_err(|err| { log::debug!(target: crate::LOG_TARGET, "Transfer failed: from {from:?} to {to:?} (value: ${value:?}). Err: {err:?}"); - ExecError::from(Error::::TransferFailed) + Error::::TransferFailed })?; - return Ok(()) + Ok(()) } fn transfer_dust( from: &mut AccountInfo, to: &mut AccountInfo, dust: u32, - ) -> Result<(), ExecError> { - from.dust = from - .dust - .checked_sub(dust) - .ok_or_else(|| ExecError::from(Error::::TransferFailed))?; - to.dust = to - .dust - .checked_add(dust) - .ok_or_else(|| ExecError::from(Error::::TransferFailed))?; - Ok::<(), ExecError>(()) + ) -> DispatchResult { + from.dust = + from.dust.checked_sub(dust).ok_or_else(|| Error::::TransferFailed)?; + to.dust = to.dust.checked_add(dust).ok_or_else(|| Error::::TransferFailed)?; + Ok(()) } if dust.is_zero() { @@ -1438,24 +1433,20 @@ where ) .map_err(|err| { log::debug!(target: crate::LOG_TARGET, "Burning 1 plank from {from:?} failed. Err: {err:?}"); - ExecError::from(Error::::TransferFailed) + Error::::TransferFailed })?; - from_info.dust = from_info - .dust - .checked_add(plank) - .ok_or_else(|| ExecError::from(Error::::TransferFailed))?; + from_info.dust = + from_info.dust.checked_add(plank).ok_or_else(|| Error::::TransferFailed)?; } transfer_balance::(from, to, value)?; transfer_dust::(&mut from_info, &mut to_info, dust)?; - if to_info.dust.saturating_add(dust) >= plank { + if to_info.dust >= plank { T::Currency::mint_into(to, 1u32.into())?; - to_info.dust = to_info - .dust - .checked_sub(plank) - .ok_or_else(|| ExecError::from(Error::::TransferFailed))?; + to_info.dust = + to_info.dust.checked_sub(plank).ok_or_else(|| Error::::TransferFailed)?; } AccountInfoOf::::set(&from_addr, Some(from_info)); @@ -1466,26 +1457,25 @@ where let value = BalanceWithDust::>::from_value::(value)?; if value.is_zero() { - return Ok(Default::default()); + return Ok(()); } if >::account_exists(to) { - return transfer_with_dust::(from, to, value).map(|_| Default::default()) + return transfer_with_dust::(from, to, value) } let origin = origin.account_id()?; let ed = ::Currency::minimum_balance(); - with_transaction(|| -> TransactionOutcome { - match T::Currency::transfer(origin, to, ed, Preservation::Preserve) - .map_err(|_| Error::::StorageDepositNotEnoughFunds.into()) + with_transaction(|| -> TransactionOutcome { + match storage_meter + .record_charge(&StorageDeposit::Charge(ed)) + .and_then(|_| { + T::Currency::transfer(origin, to, ed, Preservation::Preserve) + .map_err(|_| Error::::StorageDepositNotEnoughFunds.into()) + }) .and_then(|_| transfer_with_dust::(from, to, value)) { - Ok(_) => { - // ed is taken from the transaction signer so it should be - // limited by the storage deposit - storage_meter.record_charge(&StorageDeposit::Charge(ed)); - TransactionOutcome::Commit(Ok(Default::default())) - }, + Ok(_) => TransactionOutcome::Commit(Ok(())), Err(err) => TransactionOutcome::Rollback(Err(err)), } }) @@ -1507,6 +1497,8 @@ where Origin::Root => return Err(DispatchError::RootNotAllowed.into()), }; Self::transfer(origin, from, to, value, storage_meter) + .map(|_| Default::default()) + .map_err(Into::into) } /// Reference to the current (top) frame. diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index c7dc0d5ab21ac..b89223c1f86d4 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -1093,11 +1093,7 @@ where let try_call = || { let origin = Origin::from_runtime_origin(origin)?; - let mut storage_meter = match storage_deposit_limit { - DepositLimit::Balance(limit) => StorageMeter::new(limit), - DepositLimit::UnsafeOnlyForDryRun => - StorageMeter::new_unchecked(BalanceOf::::max_value()), - }; + let mut storage_meter = StorageMeter::new(storage_deposit_limit.limit()); let result = ExecStack::>::run_call( origin.clone(), dest, @@ -1152,11 +1148,7 @@ where let mut gas_meter = GasMeter::new(gas_limit); let mut storage_deposit = Default::default(); let unchecked_deposit_limit = storage_deposit_limit.is_unchecked(); - let mut storage_deposit_limit = match storage_deposit_limit { - DepositLimit::Balance(limit) => limit, - DepositLimit::UnsafeOnlyForDryRun => BalanceOf::::max_value(), - }; - + let mut storage_deposit_limit = storage_deposit_limit.limit(); let try_instantiate = || { let instantiate_account = T::InstantiateOrigin::ensure_origin(origin.clone())?; @@ -1177,12 +1169,7 @@ where (ContractBlob::from_storage(code_hash, &mut gas_meter)?, Default::default()), }; let instantiate_origin = Origin::from_account_id(instantiate_account.clone()); - let mut storage_meter = if unchecked_deposit_limit { - StorageMeter::new_unchecked(storage_deposit_limit) - } else { - StorageMeter::new(storage_deposit_limit) - }; - + let mut storage_meter = StorageMeter::new(storage_deposit_limit); let result = ExecStack::>::run_instantiate( instantiate_account, executable, diff --git a/substrate/frame/revive/src/primitives.rs b/substrate/frame/revive/src/primitives.rs index b7185f0e3109f..5bebe36b444ea 100644 --- a/substrate/frame/revive/src/primitives.rs +++ b/substrate/frame/revive/src/primitives.rs @@ -23,6 +23,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::weights::Weight; use pallet_revive_uapi::ReturnFlags; use scale_info::TypeInfo; +use sp_arithmetic::traits::Bounded; use sp_core::Get; use sp_runtime::{ traits::{One, Saturating, Zero}, @@ -53,6 +54,15 @@ impl From for DepositLimit { } } +impl DepositLimit { + pub fn limit(&self) -> T { + match self { + Self::UnsafeOnlyForDryRun => T::max_value(), + Self::Balance(limit) => *limit, + } + } +} + /// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and /// `ContractsApi::instantiate`. /// diff --git a/substrate/frame/revive/src/storage/meter.rs b/substrate/frame/revive/src/storage/meter.rs index 6a4738a6c1df8..f002b1f8b108d 100644 --- a/substrate/frame/revive/src/storage/meter.rs +++ b/substrate/frame/revive/src/storage/meter.rs @@ -33,7 +33,7 @@ use frame_support::{ }; use sp_runtime::{ traits::{Saturating, Zero}, - DispatchError, FixedPointNumber, FixedU128, + DispatchError, DispatchResult, FixedPointNumber, FixedU128, }; /// Deposit that uses the native fungible's balance type. @@ -104,6 +104,10 @@ pub struct RawMeter { /// We only have one charge per contract hence the size of this vector is /// limited by the maximum call depth. charges: Vec>, + /// True if this is the root meter. + /// + /// Sometimes we cannot know at compile time. + is_root: bool, /// Type parameter only used in impls. _phantom: PhantomData<(E, S)>, } @@ -308,8 +312,18 @@ where /// /// This will not perform a charge. It just records it to reflect it in the /// total amount of storage required for a transaction. - pub fn record_charge(&mut self, amount: &DepositOf) { - self.total_deposit = self.total_deposit.saturating_add(&amount); + pub fn record_charge(&mut self, amount: &DepositOf) -> DispatchResult { + let total_deposit = self.total_deposit.saturating_add(&amount); + + // Limits are enforced at the end of each frame. But plain balance transfers + // do not sapwn a frame. This is specifically to enforce the limit for those. + if self.is_root && total_deposit.charge_or_zero() > self.limit { + log::debug!( target: LOG_TARGET, "Storage deposit limit exhausted: {:?} > {:?}", amount, self.limit); + return Err(>::StorageDepositLimitExhausted.into()) + } + + self.total_deposit = total_deposit; + Ok(()) } /// The amount of balance that is still available from the original `limit`. @@ -338,12 +352,7 @@ where /// If the limit larger then what the origin can afford we will just fail /// when collecting the deposits in `try_into_deposit`. pub fn new(limit: BalanceOf) -> Self { - Self { limit, ..Default::default() } - } - - /// Create new storage meter without checking the limit. - pub fn new_unchecked(limit: BalanceOf) -> Self { - return Self { limit, ..Default::default() } + Self { limit, is_root: true, ..Default::default() } } /// The total amount of deposit that should change hands as result of the execution @@ -401,7 +410,8 @@ impl> RawMeter { /// If this functions is used the amount of the charge has to be stored by the caller somewhere /// alese in order to be able to refund it. pub fn charge_deposit(&mut self, contract: T::AccountId, amount: DepositOf) { - self.record_charge(&amount); + // will not fail in a nested meter + self.record_charge(&amount).ok(); self.charges.push(Charge { contract, amount, state: ContractState::Alive }); } diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs index 8e38d19339868..955c8b9c352ac 100644 --- a/substrate/frame/revive/src/tests.rs +++ b/substrate/frame/revive/src/tests.rs @@ -32,7 +32,7 @@ use crate::{ weights::WeightInfo, AccountId32Mapper, AccountInfo, AccountInfoOf, BalanceOf, BalanceWithDust, BumpNonce, Code, CodeInfoOf, Config, ContractInfo, DeletionQueueCounter, DepositLimit, Error, EthTransactError, - HoldReason, Origin, Pallet, PristineCode, H160, + HoldReason, Origin, Pallet, PristineCode, StorageDeposit, H160, }; use assert_matches::assert_matches; use codec::Encode; @@ -518,6 +518,15 @@ fn transfer_with_dust_works() { expected_to_balance: BalanceWithDust::new_unchecked::(2, 0), total_issuance_diff: -1, }, + TestCase { + description: "receiver dust less than 1 plank", + from_balance: BalanceWithDust::new_unchecked::(100, plank / 10), + to_balance: BalanceWithDust::new_unchecked::(0, plank / 2), + amount: BalanceWithDust::new_unchecked::(1, plank / 10 * 3), + expected_from_balance: BalanceWithDust::new_unchecked::(98, plank / 10 * 8), + expected_to_balance: BalanceWithDust::new_unchecked::(1, plank / 10 * 8), + total_issuance_diff: 1, + }, ]; for TestCase { @@ -603,6 +612,41 @@ fn contract_call_transfer_with_dust_works() { }); } +#[test] +fn deposit_limit_enforced_on_plain_transfer() { + ExtBuilder::default().existential_deposit(200).build().execute_with(|| { + let _ = ::Currency::set_balance(&ALICE, 1_000_000); + let _ = ::Currency::set_balance(&BOB, 1_000_000); + + // sending balance to a new account should fail when the limit is lower than the ed + let result = builder::bare_call(CHARLIE_ADDR) + .native_value(1) + .storage_deposit_limit(190.into()) + .build(); + assert_err!(result.result, >::StorageDepositLimitExhausted); + assert_eq!(result.storage_deposit, StorageDeposit::Charge(0)); + assert_eq!(test_utils::get_balance(&CHARLIE), 0); + + // works when the account is prefunded + let result = builder::bare_call(BOB_ADDR) + .native_value(1) + .storage_deposit_limit(0.into()) + .build(); + assert_ok!(result.result); + assert_eq!(result.storage_deposit, StorageDeposit::Charge(0)); + assert_eq!(test_utils::get_balance(&BOB), 1_000_001); + + // also works allowing enough deposit + let result = builder::bare_call(CHARLIE_ADDR) + .native_value(1) + .storage_deposit_limit(200.into()) + .build(); + assert_ok!(result.result); + assert_eq!(result.storage_deposit, StorageDeposit::Charge(200)); + assert_eq!(test_utils::get_balance(&CHARLIE), 201); + }); +} + #[test] fn instantiate_and_call_and_deposit_event() { let (binary, code_hash) = compile_module("event_and_return_on_deploy").unwrap(); diff --git a/substrate/frame/scheduler/src/lib.rs b/substrate/frame/scheduler/src/lib.rs index cd11e0dd3333c..94d675581d636 100644 --- a/substrate/frame/scheduler/src/lib.rs +++ b/substrate/frame/scheduler/src/lib.rs @@ -140,11 +140,11 @@ pub type BlockNumberFor = )] pub struct RetryConfig { /// Initial amount of retries allowed. - total_retries: u8, + pub total_retries: u8, /// Amount of retries left. - remaining: u8, + pub remaining: u8, /// Period of time between retry attempts. - period: Period, + pub period: Period, } #[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq))] @@ -157,7 +157,17 @@ struct ScheduledV1 { } /// Information regarding an item to be executed in the future. -#[derive(Clone, RuntimeDebug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive( + Clone, + RuntimeDebug, + PartialEq, + Eq, + Encode, + Decode, + MaxEncodedLen, + TypeInfo, + DecodeWithMemTracking, +)] pub struct Scheduled { /// The unique identity for this task, if there is one. pub maybe_id: Option, diff --git a/substrate/frame/staking-async/Cargo.toml b/substrate/frame/staking-async/Cargo.toml index cdd9ca4c3fab8..84dae83b0a412 100644 --- a/substrate/frame/staking-async/Cargo.toml +++ b/substrate/frame/staking-async/Cargo.toml @@ -28,6 +28,7 @@ serde = { features = ["alloc", "derive"], workspace = true } sp-application-crypto = { features = ["serde"], workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } +sp-npos-elections = { workspace = true } sp-runtime = { features = ["serde"], workspace = true } sp-staking = { features = ["serde"], workspace = true } @@ -35,18 +36,21 @@ sp-staking = { features = ["serde"], workspace = true } frame-benchmarking = { optional = true, workspace = true } [dev-dependencies] +anyhow = { workspace = true } +env_logger = { workspace = true } frame-benchmarking = { workspace = true, default-features = true } frame-support = { features = ["experimental"], workspace = true, default-features = true } +log = { workspace = true } pallet-bags-list = { workspace = true, default-features = true } pallet-balances = { workspace = true, default-features = true } rand_chacha = { workspace = true, default-features = true } -sp-npos-elections = { workspace = true, default-features = true } sp-tracing = { workspace = true, default-features = true } substrate-test-utils = { workspace = true } [features] default = ["std"] std = [ + "anyhow/std", "codec/std", "frame-benchmarking?/std", "frame-election-provider-support/std", diff --git a/substrate/frame/staking-async/ahm-test/src/ah/mock.rs b/substrate/frame/staking-async/ahm-test/src/ah/mock.rs index aee4e304ef747..baeef5f1d4f72 100644 --- a/substrate/frame/staking-async/ahm-test/src/ah/mock.rs +++ b/substrate/frame/staking-async/ahm-test/src/ah/mock.rs @@ -121,7 +121,7 @@ pub(crate) fn roll_until_next_active(mut end_index: SessionIndex) -> Vec::era_start_session_index(1), Some(5)); + // 1 era is reserved for the application of slashes. + let oldest_reportable_era = + Rotator::::active_era() - (SlashDeferredDuration::get() - 1); + assert_eq!(oldest_reportable_era, 2); + // WHEN we report an offence older than Era 2 (oldest reportable era). assert_ok!(rc_client::Pallet::::relay_new_offence( RuntimeOrigin::root(), // offence is in era 1 5, + vec![rc_client::Offence { + offender: 3, + reporters: vec![], + slash_fraction: Perbill::from_percent(30), + }] + )); + + // THEN offence is ignored. + assert_eq!( + staking_events_since_last_call(), + vec![staking_async::Event::OffenceTooOld { + offence_era: 1, + validator: 3, + fraction: Perbill::from_percent(30) + }] + ); + + // WHEN: report an offence for the session belonging to the previous era + assert_eq!(Rotator::::era_start_session_index(2), Some(10)); + assert_ok!(rc_client::Pallet::::relay_new_offence( + RuntimeOrigin::root(), + // offence is in era 2 + 10, vec![rc_client::Offence { offender: 3, reporters: vec![], @@ -688,29 +717,40 @@ fn on_offence_previous_era() { }] )); - // reported + // THEN: offence is reported. assert_eq!( staking_events_since_last_call(), vec![staking_async::Event::OffenceReported { - offence_era: 1, + offence_era: 2, validator: 3, fraction: Perbill::from_percent(50) }] ); - // computed, and instantly applied, as we are already on era 3 (slash era = 1, defer = 2) + // computed in the next block (will be applied in era 4) roll_next(); assert_eq!( staking_events_since_last_call(), - vec![ - staking_async::Event::SlashComputed { - offence_era: 1, - slash_era: 3, - offender: 3, - page: 0 - }, - staking_async::Event::Slashed { staker: 3, amount: 50 } - ] + vec![staking_async::Event::SlashComputed { + offence_era: 2, + slash_era: 4, + offender: 3, + page: 0 + },] + ); + + // roll to the next era. + roll_until_next_active(15); + // ensure we are in era 4. + assert_eq!(Rotator::::active_era(), 4); + // clear staking events. + let _ = staking_events_since_last_call(); + + // the next block applies the slashes. + roll_next(); + assert_eq!( + staking_events_since_last_call(), + vec![staking_async::Event::Slashed { staker: 3, amount: 50 }] ); // nothing left diff --git a/substrate/frame/staking-async/rc-client/src/lib.rs b/substrate/frame/staking-async/rc-client/src/lib.rs index e60c99d0d9962..a76aab2c593aa 100644 --- a/substrate/frame/staking-async/rc-client/src/lib.rs +++ b/substrate/frame/staking-async/rc-client/src/lib.rs @@ -473,12 +473,28 @@ pub trait AHStakingInterface { type MaxValidatorSet: Get; /// New session report from the relay chain. - fn on_relay_session_report(report: SessionReport); + fn on_relay_session_report(report: SessionReport) -> Weight; + + /// Return the weight of `on_relay_session_report` call without executing it. + /// + /// This will return the worst case estimate of the weight. The actual execution will return the + /// accurate amount. + fn weigh_on_relay_session_report(report: &SessionReport) -> Weight; /// Report one or more offences on the relay chain. + fn on_new_offences( + slash_session: SessionIndex, + offences: Vec>, + ) -> Weight; + + /// Return the weight of `on_new_offences` call without executing it. /// - /// This returns its consumed weight because its complexity is hard to measure. - fn on_new_offences(slash_session: SessionIndex, offences: Vec>); + /// This will return the worst case estimate of the weight. The actual execution will return the + /// accurate amount. + fn weigh_on_new_offences( + slash_session: SessionIndex, + offences: &[Offence], + ) -> Weight; } /// The communication trait of `pallet-staking-async` -> `pallet-staking-async-rc-client`. @@ -602,15 +618,15 @@ pub mod pallet { #[pallet::weight( // `LastSessionReportEndingIndex`: rw // `IncompleteSessionReport`: rw - // NOTE: what happens inside `AHStakingInterface` is benchmarked and registered in `pallet-staking-async` - T::DbWeight::get().reads_writes(2, 2) + T::DbWeight::get().reads_writes(2, 2) + T::AHStakingInterface::weigh_on_relay_session_report(report) )] pub fn relay_session_report( origin: OriginFor, report: SessionReport, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { log!(debug, "Received session report: {}", report); T::RelayChainOrigin::ensure_origin_or_root(origin)?; + let local_weight = T::DbWeight::get().reads_writes(2, 2); match LastSessionReportEndingIndex::::get() { None => { @@ -638,7 +654,7 @@ pub mod pallet { ); Self::deposit_event(Event::Unexpected(UnexpectedKind::SessionAlreadyProcessed)); IncompleteSessionReport::::kill(); - return Ok(()); + return Ok(Some(local_weight).into()); }, } @@ -661,35 +677,34 @@ pub mod pallet { IncompleteSessionReport::::get().is_none(), "we have ::take() it above, we don't want to keep the old data" ); - return Ok(()); + return Ok(().into()); } let new_session_report = maybe_new_session_report.expect("checked above; qed"); if new_session_report.leftover { // this is still not final -- buffer it. IncompleteSessionReport::::put(new_session_report); + Ok(().into()) } else { // this is final, report it. LastSessionReportEndingIndex::::put(new_session_report.end_index); - T::AHStakingInterface::on_relay_session_report(new_session_report); + let weight = T::AHStakingInterface::on_relay_session_report(new_session_report); + Ok((Some(local_weight + weight)).into()) } - - Ok(()) } /// Called to report one or more new offenses on the relay chain. #[pallet::call_index(1)] #[pallet::weight( - // `on_new_offences` is benchmarked by `pallet-staking-async` // events are free // origin check is negligible. - Weight::default() + T::AHStakingInterface::weigh_on_new_offences(*slash_session, offences) )] pub fn relay_new_offence( origin: OriginFor, slash_session: SessionIndex, offences: Vec>, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { log!(info, "Received new offence at slash_session: {:?}", slash_session); T::RelayChainOrigin::ensure_origin_or_root(origin)?; @@ -698,8 +713,8 @@ pub mod pallet { offences_count: offences.len() as u32, }); - T::AHStakingInterface::on_new_offences(slash_session, offences); - Ok(()) + let weight = T::AHStakingInterface::on_new_offences(slash_session, offences); + Ok(Some(weight).into()) } } } diff --git a/substrate/frame/staking-async/runtimes/papi-tests/.gitignore b/substrate/frame/staking-async/runtimes/papi-tests/.gitignore new file mode 100644 index 0000000000000..fd0c5bcc4e311 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/.gitignore @@ -0,0 +1,39 @@ +# dependencies (bun install) +node_modules + +# output +out +dist +*.tgz + +# code coverage +coverage +*.lcov + +# logs +logs +_.log +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# caches +.eslintcache +.cache +*.tsbuildinfo + +# IntelliJ based IDEs +.idea + +# Finder (MacOS) folder config +.DS_Store +.papi + +rc.json +parachain.json +miner.log diff --git a/substrate/frame/staking-async/runtimes/papi-tests/.prettierrc b/substrate/frame/staking-async/runtimes/papi-tests/.prettierrc new file mode 100644 index 0000000000000..5bf93bc164708 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/.prettierrc @@ -0,0 +1,5 @@ +{ + "tabWidth": 4, + "useTabs": true, + "printWidth": 100 +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/README.md b/substrate/frame/staking-async/runtimes/papi-tests/README.md new file mode 100644 index 0000000000000..9085d370f0194 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/README.md @@ -0,0 +1,201 @@ +# Staking Async Test Parachain + +- [Staking Async Test Parachain](#staking-async-test-parachain) + - [Runtime Overview](#runtime-overview) + - [Runtime Presets + Other Hacks](#runtime-presets--other-hacks) + - [`parameter_types! { pub storage }` FTW](#parameter_types--pub-storage--ftw) + - [Optionally Ignoring New Validators](#optionally-ignoring-new-validators) + - [Presets](#presets) + - [Setup](#setup) + - [Quick Start](#quick-start) + - [Development Workflow](#development-workflow) + - [How To Write Tests](#how-to-write-tests) + - [Log Formatting](#log-formatting) + +This folder contains a Node+PAPI+Bun setup to: + +1. run the `pallet-staking-async-runtimes` parachain and relay-chain. It uses Zombienet under the + hood. +2. Contains integration tests, based on ZN as well, that spawns a particular test, submits + transactions, and inspects the chain state (notably events) for verification. + +The [next section](#runtime-overview) describes the runtimes and further details. To jump right into +the setup, see [Setup](#setup). + +## Runtime Overview + +This parachain runtime is a fake fork of the asset-hub next (created originally by Dónal). It is here +to test the async-staking pallet in a real environment. + +This parachain contains: + +- `pallet-staking-async` +- `pallet-staking-async-rc-client` +- `pallet-election-provider-multi-block` and family +- aux staking pallets `pallet-nomination-pools`, `pallet-fast-unstake`, `pallet-bags-list`, and + `pallet-delegated-staking`. + +All of the above are means to stake and select validators for the RELAY-CHAIN, which is eventually +communicated to it via the `pallet-staking-async-rc-client` pallet. + +A lot more is in the runtime, and can be eventually removed. + +Note that the parachain runtime also contains a `pallet-session` that works with +`pallet-collator-selection` for the PARACHAIN block author selection. + +The counterpart `rc` runtime is a relay chain that is meant to host the parachain. It contains: + +- `pallet-staking-async-ah-client` +- `pallet-session` +- `pallet-authorship` +- And all of the consensus pallets that feed the authority set from the session, such as + aura/babe/grandpa/beefy and so on. + +### Runtime Presets + Other Hacks + +The above runtimes contain a number of hacks, and `genesis presets` that allow them to be quickly +adapted to a specific scenario. This section covers these topics. + +#### `parameter_types! { pub storage }` FTW + +In both runtimes, we extensively use `parameter_types! { pub storage }` as a shorthand for +`pallet-parameters`. This allows us to stick values that are fed into different pallets' `trait +Config`, such as `type SignedPhase` (the duration of a phase) into an orphan storage item. This has +two benefits: + +1. In manual testing, we can update them on the fly via `sudo(system.set_storage)` calls. + [This](https://paritytech.github.io/polkadot-sdk/master/src/frame_support/lib.rs.html#357) is how + the key for these is generated. +2. We can easily tweak them based on startup. + +#### Optionally Ignoring New Validators + +The relay chain runtime contains an important hack. A type called `MaybeUsePreviousValidatorsElse`. +This type looks into `parameter_types! { pub storage UsePreviousValidators: bool = true }`, and + +- If set to `true`, it will ignore the new validators coming from AH, and use the previous ones. + **Why is this needed**? Because in ZN, our test relay chain is running with usually a set of known + validators run by ZN (often alice and bob). If AH sends us back a validator set that contains a + large new validator set, the setup will break. As seen in the next section, a number of runtime + presets are designed to generate large validator/nominator sets to mimic the behavior of Polkadot + and Kusama. We thereofre must use this hack in such cases. +- If set to `false`, it will use the new validator set. + +#### Presets + +The runtime presets are generally divided into few categories: + +- `real-s` / `real-m`: imply that the relay chain will not use `MaybeUsePreviousValidatorsElse`. + Consequently, AH will NOT generate random validators, and instead use 2 or 4 well know keys + (alice, bob, dave, eve) as validator candidates. This setup is useful for slashing testing. + `real-s` uses 2 validators, while `real-m` uses 4 validators. The latter is useful for testing + disabling. Note that we need at least 2 non-disabled validators to run a parachain. +- `fake-x`: these presets instruct asset-hub to generate various number of fake validators and + nominators. Useful for testing large elections. `MaybeUsePreviousValidatorsElse` is used in the + relay runtime to ignore the new validators, and stick to alice and bob. + +More concretely, the presets are: + +- Parachain: + - `fake-dev`: 4 page, small number of fake validators and nominators. + - `fake-dot`: 32 pages, large number of fake validators and nominators. + - `fake-ksm`: 16 pages, large number of fake validators and nominators. + - `real-s`: 4 pages, alice and bob as validators, 500 fake nominators + - `real-m`: 4 pages, alice, bob, dave, eve as validators, 2000 fake nominators. +- Relay Chain + - `fake-s`: alice and bob as relay validators, `UsePreviousValidators` set to true. Should be + used with all 3 `fake-x` presets in the parachain. + - `real-s`: alice and bob as relay validators, `UsePreviousValidators` set to false. Should be + used with `real-s` presets in the parachain. + - `real-m`: alice, bob, dave, eve as relay validators, `UsePreviousValidators` set to false. + Should be used with `real-m` presets in the parachain. + +See `genesis_config_presets.rs`, and `fn build_state` in each runtime for more details. + +## Setup + +This section describes how to set up and run this code. Make sure to have the latest version of +node, bun and [just](https://github.com/casey/just) installed. Moreover, you are expected to have +`zombienet`, `polkadot`, `polkadot-parachain`, `polkadot-prepare-worker` and +`polkadot-execution-worker` in your `PATH` already. Rest of the binaries (`chain-spec-builder`) are +compiled from the sdk. + +> verified compatible zombienet version: 1.3.126 + +### Quick Start + +For first-time setup, run: + +```bash +just setup +``` + +This single command will: + +- Start the chains and generate fresh metadata +- Generate PAPI descriptors from the running chains +- Install all dependencies including the generated descriptors +- Clean up chain processes + +After this, you can use regular `just install` (or `bun install`) commands without issues. + +### Development Workflow + +```bash +# First time setup. Compiles the binaries, spawns ZN, generates PAPI types against it. +just setup + +# Regular development - install dependencies +just install # or equivalently: bun install + +# Run tests +just test + +# Running specific tests +bun test tests/example.test.ts +bun test tests/unsigned-dev.ts +# and so on.. +``` + +Further useful commands: + +```bash +# Generate fresh descriptors (when chains are running) +just generate-descriptors + +# Run with a specific preset +just run + +# See available presets +just presets + +# Clean everything and start fresh +just reset + +# See all available commands +just help +``` + + +## How To Write Tests + +See `tests/example.test.ts`. + +## Log Formatting + +The tests, for each block which contains an event in which we are interested in, will emit a log like this: + +``` +verbose: [Rely#91][⛓ 2,039ms / 777 kb] Processing event: ... +verbose: [Para#71][⛓ 38ms / 852 kb][✍️ hd=0.22, xt=4.07, st=6.82, sum=11.11, cmp=9.74, time=2ms] Processing event: ... +``` + +- `Rely` indicates the relay chain (truncated to be 4 chars), `Para` indicates the parachain. +- Both chains' logs contain onchain (⛓) weight information, obtained from `frame-system`. +- `Para` logs contain more information from the collator/author's logs (✍️). They are: + - `hd` header size, + - `xt` extrinsics siz + - `st` storage proof size + - `sum` total PoV, + - `cmp` compressed PoV + - and `time`, authoring time in the collator. diff --git a/substrate/frame/staking-async/runtimes/papi-tests/bun.lock b/substrate/frame/staking-async/runtimes/papi-tests/bun.lock new file mode 100644 index 0000000000000..d02e09b547f85 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/bun.lock @@ -0,0 +1,576 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "papi-tests", + "dependencies": { + "@polkadot-labs/hdkd": "^0.0.16", + "commander": "^14.0.0", + "polkadot-api": "^1.13.1", + "strip-ansi": "^7.1.0", + "winston": "^3.17.0", + }, + "devDependencies": { + "@polkadot-api/cli": "^0.14.0", + "@types/bun": "latest", + }, + "optionalDependencies": { + "@polkadot-api/descriptors": "file:.papi/descriptors", + }, + "peerDependencies": { + "typescript": "^5", + }, + }, + }, + "packages": { + "@babel/code-frame": ["@babel/code-frame@7.27.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="], + + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], + + "@colors/colors": ["@colors/colors@1.6.0", "", {}, "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA=="], + + "@commander-js/extra-typings": ["@commander-js/extra-typings@14.0.0", "", { "peerDependencies": { "commander": "~14.0.0" } }, "sha512-hIn0ncNaJRLkZrxBIp5AsW/eXEHNKYQBh0aPdoUqNgD+Io3NIykQqpKFyKcuasZhicGaEZJX/JBSIkZ4e5x8Dg=="], + + "@dabh/diagnostics": ["@dabh/diagnostics@2.0.3", "", { "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", "kuler": "^2.0.0" } }, "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA=="], + + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.25.5", "", { "os": "android", "cpu": "arm" }, "sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.5", "", { "os": "android", "cpu": "arm64" }, "sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.25.5", "", { "os": "android", "cpu": "x64" }, "sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.5", "", { "os": "darwin", "cpu": "x64" }, "sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.5", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.5", "", { "os": "linux", "cpu": "arm" }, "sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.5", "", { "os": "linux", "cpu": "ia32" }, "sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.5", "", { "os": "linux", "cpu": "none" }, "sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.5", "", { "os": "linux", "cpu": "none" }, "sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.5", "", { "os": "linux", "cpu": "ppc64" }, "sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.5", "", { "os": "linux", "cpu": "none" }, "sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.5", "", { "os": "linux", "cpu": "s390x" }, "sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.5", "", { "os": "linux", "cpu": "x64" }, "sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.5", "", { "os": "none", "cpu": "arm64" }, "sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.5", "", { "os": "none", "cpu": "x64" }, "sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.5", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.5", "", { "os": "openbsd", "cpu": "x64" }, "sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.5", "", { "os": "sunos", "cpu": "x64" }, "sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.5", "", { "os": "win32", "cpu": "x64" }, "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g=="], + + "@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="], + + "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.8", "", { "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/set-array": ["@jridgewell/set-array@1.2.1", "", {}, "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="], + + "@noble/curves": ["@noble/curves@1.9.2", "", { "dependencies": { "@noble/hashes": "1.8.0" } }, "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g=="], + + "@noble/hashes": ["@noble/hashes@1.8.0", "", {}, "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A=="], + + "@pkgjs/parseargs": ["@pkgjs/parseargs@0.11.0", "", {}, "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="], + + "@polkadot-api/cli": ["@polkadot-api/cli@0.14.0", "", { "dependencies": { "@commander-js/extra-typings": "^14.0.0", "@polkadot-api/codegen": "0.16.3", "@polkadot-api/ink-contracts": "0.3.4", "@polkadot-api/json-rpc-provider": "0.0.4", "@polkadot-api/known-chains": "0.9.0", "@polkadot-api/metadata-compatibility": "0.3.0", "@polkadot-api/observable-client": "0.12.0", "@polkadot-api/polkadot-sdk-compat": "2.3.2", "@polkadot-api/sm-provider": "0.1.7", "@polkadot-api/smoldot": "0.3.10", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/substrate-client": "0.4.1", "@polkadot-api/utils": "0.2.0", "@polkadot-api/wasm-executor": "^0.2.1", "@polkadot-api/ws-provider": "0.4.0", "@types/node": "^22.15.30", "commander": "^14.0.0", "execa": "^9.6.0", "fs.promises.exists": "^1.1.4", "ora": "^8.2.0", "read-pkg": "^9.0.1", "rxjs": "^7.8.2", "tsc-prog": "^2.3.0", "tsup": "^8.5.0", "typescript": "^5.8.3", "write-package": "^7.1.0" }, "bin": { "papi": "dist/main.js", "polkadot-api": "dist/main.js" } }, "sha512-bDNWSbSVWNRYYjOQgCWp321Rut4/yDxjfn0wJcACcCiWboJNu4ErZ6370yLovkbTDrOUqMPO+Mnq7cnN4xPzGA=="], + + "@polkadot-api/codegen": ["@polkadot-api/codegen@0.16.3", "", { "dependencies": { "@polkadot-api/ink-contracts": "0.3.4", "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/metadata-compatibility": "0.3.0", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-vZy4r/AlkYdTPIxgvifmC2YqwVQgBA2RRLV7apGF2WzmqTTIGjLITAw+6M78X4pKZEkPR35+gVE4Wgvk+TvliQ=="], + + "@polkadot-api/descriptors": ["@polkadot-api/descriptors@file:.papi/descriptors", { "peerDependencies": { "polkadot-api": ">=1.11.2" } }], + + "@polkadot-api/ink-contracts": ["@polkadot-api/ink-contracts@0.3.4", "", { "dependencies": { "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-JnCIX3GCV47u9h9poUJUJMcZ+wr1/2wCbg6NftmpqeQfin5BsWYOnKSkrMY7SEWpXC4EfACK8ucub9oo2rv/jg=="], + + "@polkadot-api/json-rpc-provider": ["@polkadot-api/json-rpc-provider@0.0.4", "", {}, "sha512-9cDijLIxzHOBuq6yHqpqjJ9jBmXrctjc1OFqU+tQrS96adQze3mTIH6DTgfb/0LMrqxzxffz1HQGrIlEH00WrA=="], + + "@polkadot-api/json-rpc-provider-proxy": ["@polkadot-api/json-rpc-provider-proxy@0.2.4", "", {}, "sha512-nuGoY9QpBAiRU7xmXN3nugFvPcnSu3IxTLm1OWcNTGlZ1LW5bvdQHz3JLk56+Jlyb3GJ971hqdg2DJsMXkKCOg=="], + + "@polkadot-api/known-chains": ["@polkadot-api/known-chains@0.9.0", "", {}, "sha512-m/YF29FJBX9rTEgBKo63JHEg13Kw5EHbLRM9QCNMmT/mkvKlCgj5pm/T38Y8w3NS+4M8TRCyoXrUDXKUL1lX7g=="], + + "@polkadot-api/logs-provider": ["@polkadot-api/logs-provider@0.0.6", "", { "dependencies": { "@polkadot-api/json-rpc-provider": "0.0.4" } }, "sha512-4WgHlvy+xee1ADaaVf6+MlK/+jGMtsMgAzvbQOJZnP4PfQuagoTqaeayk8HYKxXGphogLlPbD06tANxcb+nvAg=="], + + "@polkadot-api/merkleize-metadata": ["@polkadot-api/merkleize-metadata@1.1.18", "", { "dependencies": { "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-WKP4urGv6YDO9rGeCLX+I/I0uJCXunytNzyPfBMOK9dwJD48UpX+oHf2aNnWvP4j9zQImY/oaBQQ9Sp89ABZOw=="], + + "@polkadot-api/metadata-builders": ["@polkadot-api/metadata-builders@0.12.2", "", { "dependencies": { "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-Mmivj1YZve1fCkM90eIIo73B0jkiqMA3zwhFcqYaBfuAu4x5t0rt+Ucfx76t4qxJOhG8wXp/tmdbzWIrWG909A=="], + + "@polkadot-api/metadata-compatibility": ["@polkadot-api/metadata-compatibility@0.3.0", "", { "dependencies": { "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/substrate-bindings": "0.14.0" } }, "sha512-9GNHY7YM5Jb3/TAphwd6iy46Vl1n4m7IEVwLZVZ9ZLlJLJrW+gxVOz1htE+iIHVohDak4lIJiXioza3mNKAvaw=="], + + "@polkadot-api/observable-client": ["@polkadot-api/observable-client@0.12.0", "", { "dependencies": { "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" }, "peerDependencies": { "@polkadot-api/substrate-client": "0.4.1", "rxjs": ">=7.8.0" } }, "sha512-2edI5Ke3EOWT5F4+m13alJx3zTQGJd9CPvL9iHvwyBpgJ+5T+VNf69lHpTQ16ruWGnravPG0ixkz1FhFh8ZOKA=="], + + "@polkadot-api/pjs-signer": ["@polkadot-api/pjs-signer@0.6.9", "", { "dependencies": { "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/polkadot-signer": "0.1.6", "@polkadot-api/signers-common": "0.1.10", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-WXWiIbYnN2N9VgUlGT5M1qKJBHB2EvrxPo/eHm9gjwsTwWU/x0RvInAE4P1lcNztCtyqZL41FiwEyYZnNzh1CQ=="], + + "@polkadot-api/polkadot-sdk-compat": ["@polkadot-api/polkadot-sdk-compat@2.3.2", "", { "dependencies": { "@polkadot-api/json-rpc-provider": "0.0.4" } }, "sha512-rLCveP3a6Xd0r218yRqVY34lJ8bXVmE12cArbU4JFp9p8e8Jbb6xdqOdu7bQtjlZUsahhcmfIHYQSXKziST7PA=="], + + "@polkadot-api/polkadot-signer": ["@polkadot-api/polkadot-signer@0.1.6", "", {}, "sha512-X7ghAa4r7doETtjAPTb50IpfGtrBmy3BJM5WCfNKa1saK04VFY9w+vDn+hwEcM4p0PcDHt66Ts74hzvHq54d9A=="], + + "@polkadot-api/signer": ["@polkadot-api/signer@0.2.2", "", { "dependencies": { "@noble/hashes": "^1.8.0", "@polkadot-api/merkleize-metadata": "1.1.18", "@polkadot-api/polkadot-signer": "0.1.6", "@polkadot-api/signers-common": "0.1.10", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-COIOOCgnwHwcwVle4eBmHNHbrqjIL7Bff94GZQlOMaOULlY1ajSthVGOZQ2b04rda6r3mlhNE+sAoDBPXPpq7w=="], + + "@polkadot-api/signers-common": ["@polkadot-api/signers-common@0.1.10", "", { "dependencies": { "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/polkadot-signer": "0.1.6", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/utils": "0.2.0" } }, "sha512-Or2wTrbnc6FXHbjPDf8OU2mPoFYdkcr3tx35W4FYML4OTsSnDORX+h3Q6cGbWSHdWp0VeT6QcEj6ewfaTuLREA=="], + + "@polkadot-api/sm-provider": ["@polkadot-api/sm-provider@0.1.7", "", { "dependencies": { "@polkadot-api/json-rpc-provider": "0.0.4", "@polkadot-api/json-rpc-provider-proxy": "0.2.4" }, "peerDependencies": { "@polkadot-api/smoldot": ">=0.3" } }, "sha512-BhNKVeIFZdawpPVadXszLl8IP4EDjcLHe/GchfRRFkvoNFuwS2nNv/npYIqCviXV+dd2R8VnEELxwScsf380Og=="], + + "@polkadot-api/smoldot": ["@polkadot-api/smoldot@0.3.10", "", { "dependencies": { "@types/node": "^22.15.30", "smoldot": "2.0.36" } }, "sha512-oL0Qsq2p3h2mU1/+gNq4h2rC/S99WoDiqkpmxg/phzknjXcbYXouYLSvhGbECygE1vWPVPl3IWAOjW/gcKdYKw=="], + + "@polkadot-api/substrate-bindings": ["@polkadot-api/substrate-bindings@0.14.0", "", { "dependencies": { "@noble/hashes": "^1.8.0", "@polkadot-api/utils": "0.2.0", "@scure/base": "^1.2.6", "scale-ts": "^1.6.1" } }, "sha512-ZmZnw4IbxCXIqI1thEtQ83WrXwsvkqnbo0S6GRzbmrfZFh2JyVxGckPrMMLPH3ScqGgNJJkEdGGU/jSFffqTCA=="], + + "@polkadot-api/substrate-client": ["@polkadot-api/substrate-client@0.4.1", "", { "dependencies": { "@polkadot-api/json-rpc-provider": "0.0.4", "@polkadot-api/utils": "0.2.0" } }, "sha512-g88H0ksYNxNyfidgDNpE5QvTUGb8dC5NNx12bICbMCWu4NGokbH6jW6eucWNLI0VxWCAfzGjxzibCw5NDl/6+g=="], + + "@polkadot-api/utils": ["@polkadot-api/utils@0.2.0", "", {}, "sha512-nY3i5fQJoAxU4n3bD7Fs208/KR2J95SGfVc58kDjbRYN5a84kWaGEqzjBNtP9oqht49POM8Bm9mbIrkvC1Bzuw=="], + + "@polkadot-api/wasm-executor": ["@polkadot-api/wasm-executor@0.2.1", "", {}, "sha512-EN3qtu9Aurz1PoEjvrvL/Z9lSMrLkRU2K1fOjzWFpI5siBgQ2eN/tMLbX1VjaSk1VhvXmbXPaqBrkfdMCxLdsg=="], + + "@polkadot-api/ws-provider": ["@polkadot-api/ws-provider@0.4.0", "", { "dependencies": { "@polkadot-api/json-rpc-provider": "0.0.4", "@polkadot-api/json-rpc-provider-proxy": "0.2.4", "ws": "^8.18.1" } }, "sha512-ZurjUHHAlQ1Ux8HiZz7mtkg1qjq6LmqxcHljcZxne0U7foCZrXdWHsohwlV8kUQUir5kXuDsNvdZN/MFCUMaVw=="], + + "@polkadot-labs/hdkd": ["@polkadot-labs/hdkd@0.0.16", "", { "dependencies": { "@polkadot-labs/hdkd-helpers": "0.0.16" } }, "sha512-72vOaxBUzzEXdR5nPbsgbA3ReJ0uuBpt6ZU9TNMYACKVIRH0ivjBtsH6HRo0YGEmNbWLCma40hJ2HfVd16xgTQ=="], + + "@polkadot-labs/hdkd-helpers": ["@polkadot-labs/hdkd-helpers@0.0.16", "", { "dependencies": { "@noble/curves": "^1.9.1", "@noble/hashes": "^1.8.0", "@scure/base": "^1.2.5", "micro-sr25519": "^0.1.3", "scale-ts": "^1.6.1" } }, "sha512-Lc6ydojO2X93+LyxG0sMJStP340xlqaHweLbClZXqt33himfTSba+X6cX+8bzi8tCx/sFwgWVKQpsZ55UlFgMQ=="], + + "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.44.0", "", { "os": "android", "cpu": "arm" }, "sha512-xEiEE5oDW6tK4jXCAyliuntGR+amEMO7HLtdSshVuhFnKTYoeYMyXQK7pLouAJJj5KHdwdn87bfHAR2nSdNAUA=="], + + "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.44.0", "", { "os": "android", "cpu": "arm64" }, "sha512-uNSk/TgvMbskcHxXYHzqwiyBlJ/lGcv8DaUfcnNwict8ba9GTTNxfn3/FAoFZYgkaXXAdrAA+SLyKplyi349Jw=="], + + "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.44.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-VGF3wy0Eq1gcEIkSCr8Ke03CWT+Pm2yveKLaDvq51pPpZza3JX/ClxXOCmTYYq3us5MvEuNRTaeyFThCKRQhOA=="], + + "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.44.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-fBkyrDhwquRvrTxSGH/qqt3/T0w5Rg0L7ZIDypvBPc1/gzjJle6acCpZ36blwuwcKD/u6oCE/sRWlUAcxLWQbQ=="], + + "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.44.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-u5AZzdQJYJXByB8giQ+r4VyfZP+walV+xHWdaFx/1VxsOn6eWJhK2Vl2eElvDJFKQBo/hcYIBg/jaKS8ZmKeNQ=="], + + "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.44.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-qC0kS48c/s3EtdArkimctY7h3nHicQeEUdjJzYVJYR3ct3kWSafmn6jkNCA8InbUdge6PVx6keqjk5lVGJf99g=="], + + "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.44.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x+e/Z9H0RAWckn4V2OZZl6EmV0L2diuX3QB0uM1r6BvhUIv6xBPL5mrAX2E3e8N8rEHVPwFfz/ETUbV4oW9+lQ=="], + + "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.44.0", "", { "os": "linux", "cpu": "arm" }, "sha512-1exwiBFf4PU/8HvI8s80icyCcnAIB86MCBdst51fwFmH5dyeoWVPVgmQPcKrMtBQ0W5pAs7jBCWuRXgEpRzSCg=="], + + "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.44.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-ZTR2mxBHb4tK4wGf9b8SYg0Y6KQPjGpR4UWwTFdnmjB4qRtoATZ5dWn3KsDwGa5Z2ZBOE7K52L36J9LueKBdOQ=="], + + "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.44.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-GFWfAhVhWGd4r6UxmnKRTBwP1qmModHtd5gkraeW2G490BpFOZkFtem8yuX2NyafIP/mGpRJgTJ2PwohQkUY/Q=="], + + "@rollup/rollup-linux-loongarch64-gnu": ["@rollup/rollup-linux-loongarch64-gnu@4.44.0", "", { "os": "linux", "cpu": "none" }, "sha512-xw+FTGcov/ejdusVOqKgMGW3c4+AgqrfvzWEVXcNP6zq2ue+lsYUgJ+5Rtn/OTJf7e2CbgTFvzLW2j0YAtj0Gg=="], + + "@rollup/rollup-linux-powerpc64le-gnu": ["@rollup/rollup-linux-powerpc64le-gnu@4.44.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-bKGibTr9IdF0zr21kMvkZT4K6NV+jjRnBoVMt2uNMG0BYWm3qOVmYnXKzx7UhwrviKnmK46IKMByMgvpdQlyJQ=="], + + "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.44.0", "", { "os": "linux", "cpu": "none" }, "sha512-vV3cL48U5kDaKZtXrti12YRa7TyxgKAIDoYdqSIOMOFBXqFj2XbChHAtXquEn2+n78ciFgr4KIqEbydEGPxXgA=="], + + "@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.44.0", "", { "os": "linux", "cpu": "none" }, "sha512-TDKO8KlHJuvTEdfw5YYFBjhFts2TR0VpZsnLLSYmB7AaohJhM8ctDSdDnUGq77hUh4m/djRafw+9zQpkOanE2Q=="], + + "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.44.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-8541GEyktXaw4lvnGp9m84KENcxInhAt6vPWJ9RodsB/iGjHoMB2Pp5MVBCiKIRxrxzJhGCxmNzdu+oDQ7kwRA=="], + + "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.44.0", "", { "os": "linux", "cpu": "x64" }, "sha512-iUVJc3c0o8l9Sa/qlDL2Z9UP92UZZW1+EmQ4xfjTc1akr0iUFZNfxrXJ/R1T90h/ILm9iXEY6+iPrmYB3pXKjw=="], + + "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.44.0", "", { "os": "linux", "cpu": "x64" }, "sha512-PQUobbhLTQT5yz/SPg116VJBgz+XOtXt8D1ck+sfJJhuEsMj2jSej5yTdp8CvWBSceu+WW+ibVL6dm0ptG5fcA=="], + + "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.44.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-M0CpcHf8TWn+4oTxJfh7LQuTuaYeXGbk0eageVjQCKzYLsajWS/lFC94qlRqOlyC2KvRT90ZrfXULYmukeIy7w=="], + + "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.44.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-3XJ0NQtMAXTWFW8FqZKcw3gOQwBtVWP/u8TpHP3CRPXD7Pd6s8lLdH3sHWh8vqKCyyiI8xW5ltJScQmBU9j7WA=="], + + "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.44.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Q2Mgwt+D8hd5FIPUuPDsvPR7Bguza6yTkJxspDGkZj7tBRn2y4KSWYuIXpftFSjBra76TbKerCV7rgFPQrn+wQ=="], + + "@rx-state/core": ["@rx-state/core@0.1.4", "", { "peerDependencies": { "rxjs": ">=7" } }, "sha512-Z+3hjU2xh1HisLxt+W5hlYX/eGSDaXXP+ns82gq/PLZpkXLu0uwcNUh9RLY3Clq4zT+hSsA3vcpIGt6+UAb8rQ=="], + + "@scure/base": ["@scure/base@1.2.6", "", {}, "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg=="], + + "@sec-ant/readable-stream": ["@sec-ant/readable-stream@0.4.1", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="], + + "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="], + + "@types/bun": ["@types/bun@1.2.16", "", { "dependencies": { "bun-types": "1.2.16" } }, "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ=="], + + "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + + "@types/node": ["@types/node@22.15.32", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-3jigKqgSjsH6gYZv2nEsqdXfZqIFGAV36XYYjf9KGZ3PSG+IhLecqPnI310RvjutyMwifE2hhhNEklOUrvx/wA=="], + + "@types/normalize-package-data": ["@types/normalize-package-data@2.4.4", "", {}, "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA=="], + + "@types/triple-beam": ["@types/triple-beam@1.3.5", "", {}, "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="], + + "acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="], + + "ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="], + + "ansi-styles": ["ansi-styles@6.2.1", "", {}, "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug=="], + + "any-promise": ["any-promise@1.3.0", "", {}, "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="], + + "async": ["async@3.2.6", "", {}, "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA=="], + + "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + + "brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + + "bun-types": ["bun-types@1.2.16", "", { "dependencies": { "@types/node": "*" } }, "sha512-ciXLrHV4PXax9vHvUrkvun9VPVGOVwbbbBF/Ev1cXz12lyEZMoJpIJABOfPcN9gDJRaiKF9MVbSygLg4NXu3/A=="], + + "bundle-require": ["bundle-require@5.1.0", "", { "dependencies": { "load-tsconfig": "^0.2.3" }, "peerDependencies": { "esbuild": ">=0.18" } }, "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA=="], + + "cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="], + + "chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="], + + "chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="], + + "cli-cursor": ["cli-cursor@5.0.0", "", { "dependencies": { "restore-cursor": "^5.0.0" } }, "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw=="], + + "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="], + + "color": ["color@3.2.1", "", { "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" } }, "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA=="], + + "color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="], + + "color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], + + "color-string": ["color-string@1.9.1", "", { "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" } }, "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg=="], + + "colorspace": ["colorspace@1.1.4", "", { "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" } }, "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w=="], + + "commander": ["commander@14.0.0", "", {}, "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA=="], + + "confbox": ["confbox@0.1.8", "", {}, "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w=="], + + "consola": ["consola@3.4.2", "", {}, "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA=="], + + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + + "debug": ["debug@4.4.1", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ=="], + + "deepmerge-ts": ["deepmerge-ts@7.1.5", "", {}, "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw=="], + + "detect-indent": ["detect-indent@7.0.1", "", {}, "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g=="], + + "eastasianwidth": ["eastasianwidth@0.2.0", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="], + + "emoji-regex": ["emoji-regex@10.4.0", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="], + + "enabled": ["enabled@2.0.0", "", {}, "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="], + + "esbuild": ["esbuild@0.25.5", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.5", "@esbuild/android-arm": "0.25.5", "@esbuild/android-arm64": "0.25.5", "@esbuild/android-x64": "0.25.5", "@esbuild/darwin-arm64": "0.25.5", "@esbuild/darwin-x64": "0.25.5", "@esbuild/freebsd-arm64": "0.25.5", "@esbuild/freebsd-x64": "0.25.5", "@esbuild/linux-arm": "0.25.5", "@esbuild/linux-arm64": "0.25.5", "@esbuild/linux-ia32": "0.25.5", "@esbuild/linux-loong64": "0.25.5", "@esbuild/linux-mips64el": "0.25.5", "@esbuild/linux-ppc64": "0.25.5", "@esbuild/linux-riscv64": "0.25.5", "@esbuild/linux-s390x": "0.25.5", "@esbuild/linux-x64": "0.25.5", "@esbuild/netbsd-arm64": "0.25.5", "@esbuild/netbsd-x64": "0.25.5", "@esbuild/openbsd-arm64": "0.25.5", "@esbuild/openbsd-x64": "0.25.5", "@esbuild/sunos-x64": "0.25.5", "@esbuild/win32-arm64": "0.25.5", "@esbuild/win32-ia32": "0.25.5", "@esbuild/win32-x64": "0.25.5" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ=="], + + "execa": ["execa@9.6.0", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-jpWzZ1ZhwUmeWRhS7Qv3mhpOhLfwI+uAX4e5fOcXqwMR7EcJ0pj2kV1CVzHVMX/LphnKWD3LObjZCoJ71lKpHw=="], + + "fdir": ["fdir@6.4.6", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w=="], + + "fecha": ["fecha@4.2.3", "", {}, "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="], + + "figures": ["figures@6.1.0", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="], + + "fix-dts-default-cjs-exports": ["fix-dts-default-cjs-exports@1.0.1", "", { "dependencies": { "magic-string": "^0.30.17", "mlly": "^1.7.4", "rollup": "^4.34.8" } }, "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg=="], + + "fn.name": ["fn.name@1.1.0", "", {}, "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="], + + "foreground-child": ["foreground-child@3.3.1", "", { "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" } }, "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw=="], + + "fs.promises.exists": ["fs.promises.exists@1.1.4", "", {}, "sha512-lJzUGWbZn8vhGWBedA+RYjB/BeJ+3458ljUfmplqhIeb6ewzTFWNPCR1HCiYCkXV9zxcHz9zXkJzMsEgDLzh3Q=="], + + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "get-east-asian-width": ["get-east-asian-width@1.3.0", "", {}, "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ=="], + + "get-stream": ["get-stream@9.0.1", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="], + + "glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="], + + "hosted-git-info": ["hosted-git-info@7.0.2", "", { "dependencies": { "lru-cache": "^10.0.1" } }, "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w=="], + + "human-signals": ["human-signals@8.0.1", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="], + + "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], + + "index-to-position": ["index-to-position@1.1.0", "", {}, "sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "is-arrayish": ["is-arrayish@0.3.2", "", {}, "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "is-interactive": ["is-interactive@2.0.0", "", {}, "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ=="], + + "is-plain-obj": ["is-plain-obj@4.1.0", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="], + + "is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], + + "is-unicode-supported": ["is-unicode-supported@2.1.0", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="], + + "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + + "jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="], + + "joycon": ["joycon@3.1.1", "", {}, "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw=="], + + "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "kuler": ["kuler@2.0.0", "", {}, "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="], + + "lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="], + + "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], + + "load-tsconfig": ["load-tsconfig@0.2.5", "", {}, "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg=="], + + "lodash.sortby": ["lodash.sortby@4.7.0", "", {}, "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA=="], + + "log-symbols": ["log-symbols@6.0.0", "", { "dependencies": { "chalk": "^5.3.0", "is-unicode-supported": "^1.3.0" } }, "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw=="], + + "logform": ["logform@2.7.0", "", { "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", "fecha": "^4.2.0", "ms": "^2.1.1", "safe-stable-stringify": "^2.3.1", "triple-beam": "^1.3.0" } }, "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ=="], + + "lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], + + "magic-string": ["magic-string@0.30.17", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } }, "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA=="], + + "micro-sr25519": ["micro-sr25519@0.1.3", "", { "dependencies": { "@noble/curves": "~1.8.0", "@noble/hashes": "~1.7.1" } }, "sha512-Tw1I3Yjq9XySsU3hsgPVkQTG3NIje070VUWtT4tb9d1tVwQqpCIBH4SM5h4Mxp2Ua4PUyPsot2F40eyJ0QnzTg=="], + + "mimic-function": ["mimic-function@5.0.1", "", {}, "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA=="], + + "minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + + "minipass": ["minipass@7.1.2", "", {}, "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="], + + "mlly": ["mlly@1.7.4", "", { "dependencies": { "acorn": "^8.14.0", "pathe": "^2.0.1", "pkg-types": "^1.3.0", "ufo": "^1.5.4" } }, "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "mz": ["mz@2.7.0", "", { "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", "thenify-all": "^1.0.0" } }, "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q=="], + + "normalize-package-data": ["normalize-package-data@6.0.2", "", { "dependencies": { "hosted-git-info": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g=="], + + "npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="], + + "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], + + "one-time": ["one-time@1.0.0", "", { "dependencies": { "fn.name": "1.x.x" } }, "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g=="], + + "onetime": ["onetime@7.0.0", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="], + + "ora": ["ora@8.2.0", "", { "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^5.0.0", "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.0.0", "log-symbols": "^6.0.0", "stdin-discarder": "^0.2.2", "string-width": "^7.2.0", "strip-ansi": "^7.1.0" } }, "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw=="], + + "package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="], + + "parse-json": ["parse-json@8.3.0", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "index-to-position": "^1.1.0", "type-fest": "^4.39.1" } }, "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ=="], + + "parse-ms": ["parse-ms@4.0.0", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="], + + "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], + + "path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], + + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@4.0.2", "", {}, "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg=="], + + "pirates": ["pirates@4.0.7", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="], + + "pkg-types": ["pkg-types@1.3.1", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="], + + "polkadot-api": ["polkadot-api@1.14.0", "", { "dependencies": { "@polkadot-api/cli": "0.14.0", "@polkadot-api/ink-contracts": "0.3.4", "@polkadot-api/json-rpc-provider": "0.0.4", "@polkadot-api/known-chains": "0.9.0", "@polkadot-api/logs-provider": "0.0.6", "@polkadot-api/metadata-builders": "0.12.2", "@polkadot-api/metadata-compatibility": "0.3.0", "@polkadot-api/observable-client": "0.12.0", "@polkadot-api/pjs-signer": "0.6.9", "@polkadot-api/polkadot-sdk-compat": "2.3.2", "@polkadot-api/polkadot-signer": "0.1.6", "@polkadot-api/signer": "0.2.2", "@polkadot-api/sm-provider": "0.1.7", "@polkadot-api/smoldot": "0.3.10", "@polkadot-api/substrate-bindings": "0.14.0", "@polkadot-api/substrate-client": "0.4.1", "@polkadot-api/utils": "0.2.0", "@polkadot-api/ws-provider": "0.4.0", "@rx-state/core": "^0.1.4" }, "peerDependencies": { "rxjs": ">=7.8.0" }, "bin": { "papi": "bin/cli.mjs", "polkadot-api": "bin/cli.mjs" } }, "sha512-9mHj6V5/lwslwtHIEXi9xoqWOJSTy+GVtSGmJ1hhUlunhYMs6w8JiiIf4WZB8P/er2+S53QNCaegbYWCFdMBgA=="], + + "postcss-load-config": ["postcss-load-config@6.0.1", "", { "dependencies": { "lilconfig": "^3.1.1" }, "peerDependencies": { "jiti": ">=1.21.0", "postcss": ">=8.0.9", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "postcss", "tsx", "yaml"] }, "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g=="], + + "pretty-ms": ["pretty-ms@9.2.0", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg=="], + + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + + "read-pkg": ["read-pkg@9.0.1", "", { "dependencies": { "@types/normalize-package-data": "^2.4.3", "normalize-package-data": "^6.0.0", "parse-json": "^8.0.0", "type-fest": "^4.6.0", "unicorn-magic": "^0.1.0" } }, "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA=="], + + "readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], + + "readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], + + "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], + + "restore-cursor": ["restore-cursor@5.1.0", "", { "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" } }, "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA=="], + + "rollup": ["rollup@4.44.0", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.44.0", "@rollup/rollup-android-arm64": "4.44.0", "@rollup/rollup-darwin-arm64": "4.44.0", "@rollup/rollup-darwin-x64": "4.44.0", "@rollup/rollup-freebsd-arm64": "4.44.0", "@rollup/rollup-freebsd-x64": "4.44.0", "@rollup/rollup-linux-arm-gnueabihf": "4.44.0", "@rollup/rollup-linux-arm-musleabihf": "4.44.0", "@rollup/rollup-linux-arm64-gnu": "4.44.0", "@rollup/rollup-linux-arm64-musl": "4.44.0", "@rollup/rollup-linux-loongarch64-gnu": "4.44.0", "@rollup/rollup-linux-powerpc64le-gnu": "4.44.0", "@rollup/rollup-linux-riscv64-gnu": "4.44.0", "@rollup/rollup-linux-riscv64-musl": "4.44.0", "@rollup/rollup-linux-s390x-gnu": "4.44.0", "@rollup/rollup-linux-x64-gnu": "4.44.0", "@rollup/rollup-linux-x64-musl": "4.44.0", "@rollup/rollup-win32-arm64-msvc": "4.44.0", "@rollup/rollup-win32-ia32-msvc": "4.44.0", "@rollup/rollup-win32-x64-msvc": "4.44.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-qHcdEzLCiktQIfwBq420pn2dP+30uzqYxv9ETm91wdt2R9AFcWfjNAmje4NWlnCIQ5RMTzVf0ZyisOKqHR6RwA=="], + + "rxjs": ["rxjs@7.8.2", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA=="], + + "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "safe-stable-stringify": ["safe-stable-stringify@2.5.0", "", {}, "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="], + + "scale-ts": ["scale-ts@1.6.1", "", {}, "sha512-PBMc2AWc6wSEqJYBDPcyCLUj9/tMKnLX70jLOSndMtcUoLQucP/DM0vnQo1wJAYjTrQiq8iG9rD0q6wFzgjH7g=="], + + "semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + + "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], + + "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + + "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], + + "simple-swizzle": ["simple-swizzle@0.2.2", "", { "dependencies": { "is-arrayish": "^0.3.1" } }, "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg=="], + + "smoldot": ["smoldot@2.0.36", "", { "dependencies": { "ws": "^8.8.1" } }, "sha512-0GtHgxOs1VGs+WzpUgTQ52Zg92/q4mnIPEl+smArI4pis6aduQ6ZiXRllbDafsIb18wWYsxaBLNjBkNOB8xBrw=="], + + "sort-keys": ["sort-keys@5.1.0", "", { "dependencies": { "is-plain-obj": "^4.0.0" } }, "sha512-aSbHV0DaBcr7u0PVHXzM6NbZNAtrr9sF6+Qfs9UUVG7Ll3jQ6hHi8F/xqIIcn2rvIVbr0v/2zyjSdwSV47AgLQ=="], + + "source-map": ["source-map@0.8.0-beta.0", "", { "dependencies": { "whatwg-url": "^7.0.0" } }, "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA=="], + + "spdx-correct": ["spdx-correct@3.2.0", "", { "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA=="], + + "spdx-exceptions": ["spdx-exceptions@2.5.0", "", {}, "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w=="], + + "spdx-expression-parse": ["spdx-expression-parse@3.0.1", "", { "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q=="], + + "spdx-license-ids": ["spdx-license-ids@3.0.21", "", {}, "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg=="], + + "stack-trace": ["stack-trace@0.0.10", "", {}, "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg=="], + + "stdin-discarder": ["stdin-discarder@0.2.2", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="], + + "string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], + + "string-width-cjs": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], + + "strip-ansi": ["strip-ansi@7.1.0", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ=="], + + "strip-ansi-cjs": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "strip-final-newline": ["strip-final-newline@4.0.0", "", {}, "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw=="], + + "sucrase": ["sucrase@3.35.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "glob": "^10.3.10", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" } }, "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA=="], + + "text-hex": ["text-hex@1.0.0", "", {}, "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="], + + "thenify": ["thenify@3.3.1", "", { "dependencies": { "any-promise": "^1.0.0" } }, "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw=="], + + "thenify-all": ["thenify-all@1.6.0", "", { "dependencies": { "thenify": ">= 3.1.0 < 4" } }, "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA=="], + + "tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="], + + "tinyglobby": ["tinyglobby@0.2.14", "", { "dependencies": { "fdir": "^6.4.4", "picomatch": "^4.0.2" } }, "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ=="], + + "tr46": ["tr46@1.0.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA=="], + + "tree-kill": ["tree-kill@1.2.2", "", { "bin": { "tree-kill": "cli.js" } }, "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A=="], + + "triple-beam": ["triple-beam@1.4.1", "", {}, "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg=="], + + "ts-interface-checker": ["ts-interface-checker@0.1.13", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="], + + "tsc-prog": ["tsc-prog@2.3.0", "", { "peerDependencies": { "typescript": ">=4" } }, "sha512-ycET2d75EgcX7y8EmG4KiZkLAwUzbY4xRhA6NU0uVbHkY4ZjrAAuzTMxXI85kOwATqPnBI5C/7y7rlpY0xdqHA=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "tsup": ["tsup@8.5.0", "", { "dependencies": { "bundle-require": "^5.1.0", "cac": "^6.7.14", "chokidar": "^4.0.3", "consola": "^3.4.0", "debug": "^4.4.0", "esbuild": "^0.25.0", "fix-dts-default-cjs-exports": "^1.0.0", "joycon": "^3.1.1", "picocolors": "^1.1.1", "postcss-load-config": "^6.0.1", "resolve-from": "^5.0.0", "rollup": "^4.34.8", "source-map": "0.8.0-beta.0", "sucrase": "^3.35.0", "tinyexec": "^0.3.2", "tinyglobby": "^0.2.11", "tree-kill": "^1.2.2" }, "peerDependencies": { "@microsoft/api-extractor": "^7.36.0", "@swc/core": "^1", "postcss": "^8.4.12", "typescript": ">=4.5.0" }, "optionalPeers": ["@microsoft/api-extractor", "@swc/core", "postcss", "typescript"], "bin": { "tsup": "dist/cli-default.js", "tsup-node": "dist/cli-node.js" } }, "sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ=="], + + "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], + + "typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="], + + "ufo": ["ufo@1.6.1", "", {}, "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="], + + "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + + "unicorn-magic": ["unicorn-magic@0.1.0", "", {}, "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ=="], + + "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + + "validate-npm-package-license": ["validate-npm-package-license@3.0.4", "", { "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew=="], + + "webidl-conversions": ["webidl-conversions@4.0.2", "", {}, "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="], + + "whatwg-url": ["whatwg-url@7.1.0", "", { "dependencies": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", "webidl-conversions": "^4.0.2" } }, "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg=="], + + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + + "winston": ["winston@3.17.0", "", { "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", "logform": "^2.7.0", "one-time": "^1.0.0", "readable-stream": "^3.4.0", "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", "winston-transport": "^4.9.0" } }, "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw=="], + + "winston-transport": ["winston-transport@4.9.0", "", { "dependencies": { "logform": "^2.7.0", "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" } }, "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A=="], + + "wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="], + + "wrap-ansi-cjs": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], + + "write-file-atomic": ["write-file-atomic@5.0.1", "", { "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" } }, "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw=="], + + "write-json-file": ["write-json-file@6.0.0", "", { "dependencies": { "detect-indent": "^7.0.1", "is-plain-obj": "^4.1.0", "sort-keys": "^5.0.0", "write-file-atomic": "^5.0.1" } }, "sha512-MNHcU3f9WxnNyR6MxsYSj64Jz0+dwIpisWKWq9gqLj/GwmA9INg3BZ3vt70/HB3GEwrnDQWr4RPrywnhNzmUFA=="], + + "write-package": ["write-package@7.1.0", "", { "dependencies": { "deepmerge-ts": "^7.1.0", "read-pkg": "^9.0.1", "sort-keys": "^5.0.0", "type-fest": "^4.23.0", "write-json-file": "^6.0.0" } }, "sha512-DqUx8GI3r9BFWwU2DPKddL1E7xWfbFED82mLVhGXKlFEPe8IkBftzO7WfNwHtk7oGDHDeuH/o8VMpzzfMwmLUA=="], + + "ws": ["ws@8.18.2", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ=="], + + "yoctocolors": ["yoctocolors@2.1.1", "", {}, "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ=="], + + "@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], + + "bun-types/@types/node": ["@types/node@24.0.3", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="], + + "color-string/color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + + "execa/is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="], + + "get-stream/is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="], + + "log-symbols/is-unicode-supported": ["is-unicode-supported@1.3.0", "", {}, "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ=="], + + "micro-sr25519/@noble/curves": ["@noble/curves@1.8.2", "", { "dependencies": { "@noble/hashes": "1.7.2" } }, "sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g=="], + + "micro-sr25519/@noble/hashes": ["@noble/hashes@1.7.2", "", {}, "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ=="], + + "npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="], + + "npm-run-path/unicorn-magic": ["unicorn-magic@0.3.0", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="], + + "string-width-cjs/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "string-width-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "strip-ansi-cjs/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "sucrase/commander": ["commander@4.1.1", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="], + + "wrap-ansi/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], + + "wrap-ansi-cjs/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "wrap-ansi-cjs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "wrap-ansi-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "@isaacs/cliui/string-width/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="], + + "bun-types/@types/node/undici-types": ["undici-types@7.8.0", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="], + + "string-width-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "wrap-ansi-cjs/ansi-styles/color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "wrap-ansi-cjs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "wrap-ansi-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "wrap-ansi/string-width/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="], + + "wrap-ansi-cjs/ansi-styles/color-convert/color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + } +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/justfile b/substrate/frame/staking-async/runtimes/papi-tests/justfile new file mode 100644 index 0000000000000..751381f85cdb4 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/justfile @@ -0,0 +1,133 @@ +# PAPI Tests Development Workflow + +# Install dependencies (descriptors needs to be generated and installed the 1st time only via `setup`) +install: + echo "🔄 Install bun dependencies" + bun install + +# Generate fresh metadata and descriptors, then install all dependencies +setup: + #!/usr/bin/env bash + set -euo pipefail + + echo "🧹 Killing any existing zombienet or chain processes..." + just killall + + just install || echo "🚧 Generate and installed missing descriptors..." + just build-and-generate-chains + + # Start zombienet and wait for ws endpoints to be ready + zombienet --provider native -l text spawn zn-s.toml 2>&1 & + CHAINS_PID=$! + + echo "⏳ Waiting for chains to be ready (ws endpoints on 9944, 9945 and 9946)..." + for port in 9944 9945 9946; do + for i in {1..24}; do + if nc -z localhost $port; then + echo "✅ Port $port is open." + break + fi + sleep 10 + if [ $i -eq 24 ]; then + echo "❌ Timeout waiting for port $port" + kill $CHAINS_PID || true + pkill -f zombienet || true + exit 1 + fi + done + done + + just generate-descriptors + + echo "🧹 Cleaning up chain processes..." + kill $CHAINS_PID || true + just killall + + echo "✅ Setup complete! You can now run tests or development commands." + +# Clean generated files and dependencies +clean: + #!/usr/bin/env bash + set -euo pipefail + rm -rf .papi node_modules bun.lockb + echo "🧹 Cleaned .papi, node_modules, and lockfile" + +# Generate descriptors from running chains (assumes chains are already running) +generate-descriptors: + #!/usr/bin/env bash + set -euo pipefail + echo "📋 Generating PAPI descriptors from ws endpoints..." + npx papi add -w ws://localhost:9946 parachain + npx papi add -w ws://localhost:9945 rc + npx papi + bun install --only-missing + + echo "📋 Descriptors generated and dependencies updated" + + +# Run tests +test: + bun test + +# Build and generate chain specs (shared logic) +build-and-generate-chains: + #!/usr/bin/env bash + set -euo pipefail + echo "🔧 Building chain-spec-builder and runtimes..." + LOG="runtime::multiblock-election=info,runtime::staking=info" + RUST_LOG=${LOG} cargo build --release -p pallet-staking-async-rc-runtime -p pallet-staking-async-parachain-runtime -p staging-chain-spec-builder + echo "✅ Removing any old chain-spec file" + rm -f ./parachain.json + rm -f ./rc.json + echo "✅ Creating parachain chain specs" + RUST_LOG=${LOG} ../../../../../target/release/chain-spec-builder \ + create \ + -t development \ + --runtime ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.compressed.wasm \ + --relay-chain rococo-local \ + --para-id 1100 \ + named-preset fake-dot + mv ./chain_spec.json ./parachain.json + echo "✅ Creating rc chain specs" + RUST_LOG=${LOG} ../../../../../target/release/chain-spec-builder \ + create \ + -t development \ + --runtime ../../../../../target/release/wbuild/pallet-staking-async-rc-runtime/fast_runtime_binary.rs.wasm \ + named-preset fake-s + mv ./chain_spec.json ./rc.json + +# Run a specific runtime preset, or print presets if none is given +run preset='': + #!/usr/bin/env bash + if [ -z "{{preset}}" ]; then + echo "⚠️ Please specify a preset." + just presets + else + bun run src/index.ts run --para-preset {{preset}} + fi + +# Show available presets +presets: + @echo "Available parachain presets:" + @echo " fake-dev - 4 pages, small number of fake validators and nominators" + @echo " fake-dot - 32 pages, large number of fake validators and nominators" + @echo " fake-ksm - 16 pages, large number of fake validators and nominators" + @echo " real-s - 4 pages, alice and bob as validators, 500 fake nominators" + @echo " real-m - 4 pages, alice, bob, dave, eve as validators, 2000 fake nominators" + +# Full development setup (clean + setup) +reset: clean setup + +# Show help +help: + just --list + +# kill all relevant processes. This is useful in case you see weird errors, most likely it is +# because you have other old stale ones running. +killall: + #!/usr/bin/env bash + set -euo pipefail + pkill -f zombienet || true + pkill -f chain-spec-builder || true + pkill -f polkadot || true + pkill -f polkadot-parachain || true diff --git a/substrate/frame/staking-async/runtimes/papi-tests/package.json b/substrate/frame/staking-async/runtimes/papi-tests/package.json new file mode 100644 index 0000000000000..56401cfaffc81 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/package.json @@ -0,0 +1,23 @@ +{ + "name": "papi-tests", + "module": "index.ts", + "type": "module", + "private": true, + "devDependencies": { + "@polkadot-api/cli": "^0.14.0", + "@types/bun": "latest" + }, + "peerDependencies": { + "typescript": "^5" + }, + "dependencies": { + "@polkadot-labs/hdkd": "^0.0.16", + "commander": "^14.0.0", + "polkadot-api": "^1.13.1", + "strip-ansi": "^7.1.0", + "winston": "^3.17.0" + }, + "optionalDependencies": { + "@polkadot-api/descriptors": "file:.papi/descriptors" + } +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/src/cmd.ts b/substrate/frame/staking-async/runtimes/papi-tests/src/cmd.ts new file mode 100644 index 0000000000000..ff907ff6d519e --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/src/cmd.ts @@ -0,0 +1,170 @@ +import { spawn, spawnSync } from "child_process"; +import { Presets } from "./index"; +import { logger } from "./utils"; +import { join } from "path"; +import stripAnsi from "strip-ansi"; +import { createWriteStream } from "fs"; + +export function rcPresetFor(paraPreset: Presets): string { + return paraPreset == Presets.FakeDev || + paraPreset == Presets.FakeDot || + paraPreset == Presets.FakeKsm + ? "fake-s" + : paraPreset; +} + +export function znConfigFor(paraPreset: Presets): string { + return paraPreset == Presets.RealM ? "../zn-m.toml" : "../zn-s.toml"; +} + +/// Returns the parachain log file. +export async function runPreset(paraPreset: Presets): Promise { + prepPreset(paraPreset); + const znConfig = znConfigFor(paraPreset); + logger.info(`Launching ZN config for preset: ${paraPreset}, config: ${znConfig}`); + cmd("zombienet", ["--provider", "native", "-l", "text", "spawn", znConfig], "inherit"); +} + +export async function runPresetUntilLaunched( + paraPreset: Presets +): Promise<{ killZn: () => void; paraLog: string | null }> { + prepPreset(paraPreset); + const znConfig = znConfigFor(paraPreset); + logger.info(`Launching ZN config for preset: ${paraPreset}, config: ${znConfig}`); + const child = spawn("zombienet", ["--provider", "native", "-l", "text", "spawn", znConfig], { + stdio: "pipe", + cwd: __dirname, + }); + + return new Promise<{ killZn: () => void; paraLog: string | null }>((resolve, reject) => { + const logCmds: string[] = []; + child.stdout.on("data", (data) => { + const raw: string = stripAnsi(data.toString()); + if (raw.includes("Log Cmd : ")) { + raw.split("\n") + .filter((line) => line.includes("Log Cmd : ")) + .forEach((line) => { + logCmds.push(line.replace("Log Cmd : ", "").trim()); + }); + } + // our hacky way to know ZN is done. + if (raw.includes("Parachain ID : 1100")) { + for (const cmd of logCmds) { + logger.info(`${cmd}`); + } + logger.info(`Launched ZN: ${paraPreset}`); + + // Extract log path from the last log command + const lastCmd = logCmds[logCmds.length - 1]; + const paraLog = lastCmd ? lastCmd.match(/tail -f\s+(.+\.log)/)?.[1] || null : null; + + resolve({ + killZn: () => { + child.kill(); + logger.verbose(`Killed zn process`); + }, + paraLog, + }); + } + }); + + child.on("error", (err) => { + reject(err); + }); + }); +} + +export async function spawnMiner(): Promise<() => void> { + logger.info(`Spawning miner in background`); + + const logFile = createWriteStream(join(__dirname, "miner.log"), { flags: "a" }); + + const child = spawn( + "polkadot-staking-miner", + [ + "--uri", + "ws://127.0.0.1:9946", + "experimental-monitor-multi-block", + "--seed-or-path", + "//Bob", + ], + { stdio: "pipe", cwd: __dirname } + ); + + child.stdout?.pipe(logFile); + child.stderr?.pipe(logFile); + + return new Promise<() => void>((resolve, reject) => { + child.on("error", (err) => { + logger.error(`Error in miner miner: ${err}`); + reject(err); + }); + resolve(() => { + logger.verbose(`Killing miner process`); + logFile.end(); + child.kill(); + }); + }); +} + +function prepPreset(paraPreset: Presets): void { + const rcPreset = rcPresetFor(paraPreset); + const targetDir = "../../../../../../target"; + + logger.info(`Running para-preset: ${paraPreset}, rc-preset: ${rcPreset}`); + cmd("cargo", [ + "build", + "--release", + `-p`, + `pallet-staking-async-rc-runtime`, + `-p`, + `pallet-staking-async-parachain-runtime`, + `-p`, + `staging-chain-spec-builder`, + ]); + + cmd("rm", ["./parachain.json"]); + cmd("rm", ["./rc.json"]); + + cmd(join(targetDir, "/release/chain-spec-builder"), [ + "create", + "-t", + "development", + "--runtime", + join( + targetDir, + "/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.compressed.wasm" + ), + "--relay-chain", + "rococo-local", + "--para-id", + "1100", + "named-preset", + paraPreset, + ]); + cmd("mv", ["chain_spec.json", "parachain.json"]); + + cmd(join(targetDir, "/release/chain-spec-builder"), [ + "create", + "-t", + "development", + "--runtime", + join( + targetDir, + "/release/wbuild/pallet-staking-async-rc-runtime/fast_runtime_binary.rs.wasm" + ), + "named-preset", + rcPreset, + ]); + cmd("mv", ["chain_spec.json", "rc.json"]); +} + +function cmd(cmd: string, args: string[], stdio: string = "ignore"): void { + logger.info(`Running command: ${cmd} ${args.join(" ")}`); + // @ts-ignore + const result = spawnSync(cmd, args, { stdio: stdio, cwd: __dirname }); + if (result.error) { + logger.error(`Error running command: ${cmd} ${args.join(" ")}`, result.error); + throw result.error; + } +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/src/index.ts b/substrate/frame/staking-async/runtimes/papi-tests/src/index.ts new file mode 100644 index 0000000000000..44b20c121eb50 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/src/index.ts @@ -0,0 +1,34 @@ +import { rcPresetFor, runPreset } from "./cmd"; +import { logger } from "./utils"; +import { Command } from "commander"; + +export enum Presets { + FakeDev = "fake-dev", + FakeDot = "fake-dot", + FakeKsm = "fake-ksm", + RealS = "real-s", + RealM = "real-m", +} + +if (require.main === module) { + const program = new Command(); + program + .name("staking-async-papi-tests") + .description("Run staking-async PAPI tests") + .version("0.1.0"); + + program + .command("run") + .description("Run a given preset. This just sets up the ZN env and runs it") + .option( + "-p, --para-preset ", + "run the given parachain preset. The right relay preset, and zn-toml file are auto-chosen.", + Presets.FakeDev + ) + .action(async (options) => { + const { paraPreset } = options; + runPreset(paraPreset); + }); + + program.parse(process.argv); +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/src/test-case.ts b/substrate/frame/staking-async/runtimes/papi-tests/src/test-case.ts new file mode 100644 index 0000000000000..40466bbc276ca --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/src/test-case.ts @@ -0,0 +1,452 @@ +import { readFileSync } from "fs"; +import { logger, safeJsonStringify, type ApiDeclarations } from "./utils"; +import { exit } from "process"; +import chalk from "chalk"; + +export enum Chain { + Relay = "Rely", + Parachain = "Para", +} + +interface IEvent { + module: string; + event: string; + data: any | undefined; +} + +interface IBlock { + chain: Chain; + number: number; + hash: string; + events: IEvent[]; + weights: any; + authorship: IAuthorshipData | null; +} + +/// The on-chain weight consumed in a block, exactly as stored by `frame-system` +interface IWeight { + normal: { + ref_time: bigint; + proof_size: bigint; + }; + operational: { + ref_time: bigint; + proof_size: bigint; + }; + mandatory: { + ref_time: bigint; + proof_size: bigint; + }; +} + +/// Information obtained from the collator about authorship of a block. +interface IAuthorshipData { + /// The header size in PoV in kb. + header: number; + /// The extrinsics size in PoV in kb. + extrinsics: number; + /// The storage proof size in PoV in kb. + proof: number; + /// The compressed PoV size (sum of all the above) in kb. + compressed: number; + /// The time it took to author the block in ms. + time: number; +} + +/// Print an event. +function pe(e: IEvent): string { + return `${e.module} ${e.event} ${e.data ? safeJsonStringify(e.data) : "no data"}`; +} + +interface IObservableEvent { + chain: Chain; + module: string; + event: string; + dataCheck: ((data: any) => boolean) | undefined; + byBlock: number | undefined; +} + +export class Observe { + e: IObservableEvent; + onPass: () => void = () => {}; + + constructor( + chain: Chain, + module: string, + event: string, + dataCheck: ((data: any) => boolean) | undefined = undefined, + byBlock: number | undefined = undefined, + onPass: () => void = () => {} + ) { + this.e = { chain, module, event, dataCheck, byBlock }; + this.onPass = onPass; + } + + toString(): string { + return `Observe(${this.e.chain}, ${this.e.module}, ${this.e.event}, ${ + this.e.dataCheck ? "dataCheck" : "no dataCheck" + }, ${this.e.byBlock ? this.e.byBlock : "no byBlock"})`; + } + + static on(chain: Chain, mod: string, event: string): ObserveBuilder { + return new ObserveBuilder(chain, mod, event); + } +} + +export class ObserveBuilder { + private chain: Chain; + private module: string; + private event: string; + private dataCheck?: (data: any) => boolean; + private byBlockVal?: number; + private onPassCallback: () => void = () => {}; + + constructor(chain: Chain, module: string, event: string) { + this.chain = chain; + this.module = module; + this.event = event; + } + + withDataCheck(check: (data: any) => boolean): ObserveBuilder { + this.dataCheck = check; + return this; + } + + byBlock(blockNumber: number): ObserveBuilder { + this.byBlockVal = blockNumber; + return this; + } + + onPass(callback: () => void): ObserveBuilder { + this.onPassCallback = callback; + return this; + } + + build(): Observe { + if (!this.module || !this.event) { + throw new Error("Module and event are required"); + } + + return new Observe( + this.chain, + this.module, + this.event, + this.dataCheck, + this.byBlockVal, + this.onPassCallback + ); + } +} + +export enum EventOutcome { + TimedOut = "TimedOut", + Done = "Done", +} + +export class TestCase { + eventSequence: Observe[]; + onKill: () => void; + allowPerChainInterleavedEvents: boolean = false; + private resolveTestPromise: (outcome: EventOutcome) => void = () => {}; + + /// See `example.test.ts` for more info. + constructor(e: Observe[], interleave: boolean = false, onKill: () => void = () => {}) { + this.eventSequence = e; + this.onKill = onKill; + this.allowPerChainInterleavedEvents = interleave; + } + + setTestPromiseResolvers(resolve: (outcome: EventOutcome) => void) { + this.resolveTestPromise = resolve; + } + + match(ours: IObservableEvent, theirs: IEvent, theirsChain: Chain): boolean { + const trivialComp = + ours.chain === theirsChain && + ours.module === theirs.module && + ours.event === theirs.event; + if (trivialComp) { + // note: only run data check if it is defined and all other criteria match + const dataComp = ours.dataCheck === undefined ? true : ours.dataCheck!(theirs.data); + return trivialComp && dataComp; + } else { + return false; + } + } + + notTimedOut(ours: IObservableEvent, block: number): boolean { + return ours.byBlock === undefined ? true : block <= ours.byBlock; + } + + // with thousand separator! + wts(num: bigint): string { + return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + } + + formatWeight(weight: IWeight): string { + const weightPerMs = BigInt(Math.pow(10, 9)); + const WeightPerKb = BigInt(1024); + const refTime = + weight.normal.ref_time + weight.operational.ref_time + weight.mandatory.ref_time; + const proofSize = + weight.normal.proof_size + weight.operational.proof_size + weight.mandatory.proof_size; + + return `${this.wts(refTime / weightPerMs)}ms / ${this.wts(proofSize / WeightPerKb)} kb`; + } + + formatAuthorship(authorship: IAuthorshipData): string { + return `hd=${authorship.header.toFixed(2)}, xt=${authorship.extrinsics.toFixed( + 2 + )}, st=${authorship.proof.toFixed(2)}, sum=${( + authorship.header + + authorship.extrinsics + + authorship.proof + ).toFixed(2)}, cmp=${authorship.compressed.toFixed(2)}, time=${authorship.time}ms`; + } + + commonLog(blockData: IBlock): string { + const number = `#${blockData.number}`; + const chain = blockData.chain === Chain.Relay + ? chalk.blue(blockData.chain) // Blue for Relay - works well in both modes + : chalk.green(blockData.chain); // Green for Parachain - works well in both modes + const weight = `⛓ ${this.formatWeight(blockData.weights)}`; + const authorship = blockData.authorship + ? `[✍️ ${this.formatAuthorship(blockData.authorship)}]` + : ""; + return `[${chain}${number}][${weight}]${authorship}`; + } + + // returns a [`primary`, `maybeSecondary`] event to check. `primary` should always be checked first, and if not secondary is checked. + nextEvent(chain: Chain): [Observe, Observe | undefined] { + const next = this.eventSequence[0]!; + if (this.allowPerChainInterleavedEvents && this.eventSequence.length > 1) { + // get the next event in our list that is of type `chain`. + const nextOfChain = this.eventSequence.slice(1).find((e) => e.e.chain === chain); + return [next, nextOfChain]; + } else { + return [next, undefined]; + } + } + + removeEvent(e: Observe): void { + const index = this.eventSequence.findIndex((x) => x.e === e.e); + if (index !== -1) { + this.eventSequence.splice(index, 1); + } else { + logger.warn(`Event not found for removal: ${e.toString()}`); + exit(1); + } + } + + onBlock(blockData: IBlock) { + // sort from small to big + logger.debug(`${this.commonLog(blockData)} events: ${blockData.events.length}`); + const firstTimeOut = this.eventSequence + .filter((e) => e.e.byBlock) + .sort((x, y) => x.e.byBlock! - y.e.byBlock!); + if (firstTimeOut.length > 0 && blockData.number > firstTimeOut[0]!.e.byBlock!) { + logger.error( + `Block ${blockData.number} is past the first timeout at block ${firstTimeOut[0]}, exiting.` + ); + this.resolveTestPromise(EventOutcome.TimedOut); + } + + for (const e of blockData.events) { + this.onEvent(e, blockData); + } + } + + onEvent(e: IEvent, blockData: IBlock) { + if (!this.eventSequence.length) { + logger.warn(`No events to process for ${blockData.chain}, event: ${pe(e)}`); + return; + } + logger.verbose(`${this.commonLog(blockData)} Processing event: ${pe(e)}`); + const [primary, maybeSecondary] = this.nextEvent(blockData.chain); + + if (this.match(primary.e, e, blockData.chain)) { + primary.onPass(); + this.removeEvent(primary); + logger.info(`Primary event passed`); + if (this.eventSequence.length === 0) { + logger.info("All events processed."); + this.resolveTestPromise(EventOutcome.Done); + } else { + logger.verbose( + `Next expected event: ${this.eventSequence[0]!.toString()}, remaining events: ${ + this.eventSequence.length + }` + ); + } + } else if (maybeSecondary && this.match(maybeSecondary.e, e, blockData.chain)) { + maybeSecondary.onPass(); + this.removeEvent(maybeSecondary); + logger.info(`Secondary event passed`); + // when we check secondary events, we must have at least 2 items in the list, so no + // need to check for the end of list. + } else { + logger.debug(`event not relevant`); + } + } +} + +// Extract information about the authoring of `block` number from the given `logFile`. This will +// work in 3 steps: +// 1. After filtering for `[Parachain]`, and looking at the log file from end to start, it will find +// the line containing `Prepared block for proposing at ${block}`. From this, we extract the +// authoring time in ms +// 2. Them, we only keep the rest of the log file (optimization). We find the first line thereafter +// containing `PoV size header_kb=... extrinsics_kb=... storage_proof_kb=...` and extract the +// sizes of the header, extrinsics and storage proof. +// 3. Finally, we find the first line thereafter containing `Compressed PoV size: ...kb` and extract +// the compressed size. +// +// Note: `logFile` must always relate to a parachain. +function extractAuthorshipData(block: number, logFile: string): IAuthorshipData | null { + if (block == 0) { + return null; + } + + const log = readFileSync(logFile) + .toString() + .split("\n") + .filter((l) => l.includes("[Parachain]")) + .reverse(); + const target = `Prepared block for proposing at ${block}`; + const findTime = (log: string[]): { time: number; readStack: string[] } => { + const readStack: string[] = []; + for (let i = 0; i < log.length; i++) { + const line = log[i]; + if (!line) { + continue; + } + readStack.push(line); + if (line?.includes(target)) { + const match = line.match("([0-9]+) ms"); + if (match) { + return { time: Number(match.at(1)!), readStack }; + } + } + } + throw `Could not find authorship line ${target}`; + }; + + const findProofs = ( + readStack: string[] + ): { header: number; extrinsics: number; proof: number } => { + for (let i = 0; i < readStack.length; i++) { + const line = readStack[i]; + const match = line?.match( + "PoV size header_kb=([0-9]+.[0-9]+) extrinsics_kb=([0-9]+.[0-9]+) storage_proof_kb=([0-9]+.[0-9]+)" + ); + if (match) { + return { + header: Number(match[1]!), + extrinsics: Number(match[2]!), + proof: Number(match[3])!, + }; + } + } + throw "Could not find the expected PoV data in log file."; + }; + + const findCompressed = (readStack: string[]): number => { + for (let i = 0; i < readStack.length; i++) { + const line = readStack[i]; + const match = line?.match("Compressed PoV size: ([0-9]+.[0-9]+)kb"); + if (match) { + return Number(match[1]!); + } + } + throw "Could not find the expected compressed data in log file."; + }; + + const { time, readStack } = findTime(log); + // reverse the read stack again, as we want the first proof related prints after we `findTime`. + readStack.reverse(); + const { header, extrinsics, proof } = findProofs(readStack); + const compressed = findCompressed(readStack); + return { time, header, extrinsics, proof, compressed }; +} + +export async function runTest( + test: TestCase, + apis: ApiDeclarations, + paraLog: string | null +): Promise { + const { rcClient, paraClient, rcApi, paraApi } = apis; + + let completionPromise: Promise = new Promise((resolve, _) => { + // Pass the resolve/reject functions to the TestCase instance + test.setTestPromiseResolvers(resolve); + + rcClient.finalizedBlock$.subscribe(async (block) => { + const events = await rcApi.query.System.Events.getValue({ at: block.hash }); + const weights = await rcApi.query.System.BlockWeight.getValue({ at: block.hash }); + const interested = events + .filter( + (e) => + e.event.type === "Session" || + e.event.type === "RootOffences" || + e.event.type === "StakingAhClient" + ) + .map((e) => ({ + module: e.event.type, + event: e.event.value.type, + data: e.event.value.value, + })); + test.onBlock({ + chain: Chain.Relay, + number: block.number, + hash: block.hash, + events: interested, + weights: weights, + authorship: null, + }); + }); + + paraClient.finalizedBlock$.subscribe(async (block) => { + const events = await paraApi.query.System.Events.getValue({ at: block.hash }); + const weights = await paraApi.query.System.BlockWeight.getValue({ at: block.hash }); + const interested = events + .filter( + (e) => + e.event.type == "Staking" || + e.event.type == "MultiBlockElection" || + e.event.type == "MultiBlockElectionSigned" || + e.event.type == "MultiBlockElectionVerifier" || + e.event.type == "StakingRcClient" + ) + .map((e) => ({ + module: e.event.type, + event: e.event.value.type, + data: e.event.value.value, + })); + test.onBlock({ + chain: Chain.Parachain, + number: block.number, + hash: block.hash, + events: interested, + weights: weights, + authorship: paraLog ? extractAuthorshipData(block.number, paraLog!) : null, + }); + }); + }); + + // Handle graceful exit on SIGINT + process.on("SIGINT", () => { + console.log("Exiting on Ctrl+C..."); + rcClient.destroy(); + paraClient.destroy(); + test.onKill(); + process.exit(0); + }); + + // Wait for the completionPromise to resolve/reject + const finalOutcome = await completionPromise; + rcClient.destroy(); + paraClient.destroy(); + logger.info(`Test completed with outcome: ${finalOutcome}, calling onKill...`); + test.onKill(); + return finalOutcome; +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/src/utils.ts b/substrate/frame/staking-async/runtimes/papi-tests/src/utils.ts new file mode 100644 index 0000000000000..e44c130e6b174 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/src/utils.ts @@ -0,0 +1,123 @@ +import { parachain, rc } from "@polkadot-api/descriptors"; +import { + Binary, + createClient, + type PolkadotClient, + type PolkadotSigner, + type TypedApi, +} from "polkadot-api"; +import { withPolkadotSdkCompat } from "polkadot-api/polkadot-sdk-compat"; +import { getWsProvider } from "polkadot-api/ws-provider/web"; +import { createLogger, format, log, transports } from "winston"; +import { sr25519CreateDerive } from "@polkadot-labs/hdkd"; +import { DEV_PHRASE, entropyToMiniSecret, mnemonicToEntropy } from "@polkadot-labs/hdkd-helpers"; +import { getPolkadotSigner } from "polkadot-api/signer"; + +export const GlobalTimeout = 30 * 60 * 1000; +export const aliceStash = "5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY"; + + +export const logger = createLogger({ + level: process.env.LOG_LEVEL || "verbose", + format: format.combine(format.timestamp(), format.cli()), + defaultMeta: { service: "staking-papi-tests" }, + transports: [new transports.Console()], +}); + +const miniSecret = entropyToMiniSecret(mnemonicToEntropy(DEV_PHRASE)); +const derive = sr25519CreateDerive(miniSecret); +const aliceKeyPair = derive("//Alice"); +export const alice = getPolkadotSigner(aliceKeyPair.publicKey, "Sr25519", aliceKeyPair.sign); + +export type ApiDeclarations = { + rcClient: PolkadotClient; + paraClient: PolkadotClient; + rcApi: TypedApi; + paraApi: TypedApi; +}; + +export async function nullifySigned( + paraApi: TypedApi, + signer: PolkadotSigner = alice +): Promise { + // signed and signed validation phase to 0 + const call = paraApi.tx.System.set_storage({ + items: [ + // SignedPhase key + [ + Binary.fromBytes( + Uint8Array.from([ + 99, 88, 172, 210, 3, 94, 196, 187, 134, 63, 169, 129, 224, 193, 119, 185, + ]) + ), + Binary.fromBytes(Uint8Array.from([0, 0, 0, 0])), + ], + // SignedValidation key + [ + Binary.fromBytes( + Uint8Array.from([ + 72, 56, 74, 129, 110, 79, 113, 169, 54, 203, 118, 220, 158, 48, 63, 42, + ]) + ), + Binary.fromBytes(Uint8Array.from([0, 0, 0, 0])), + ], + ], + }).decodedCall; + const res = await paraApi.tx.Sudo.sudo({ call }).signAndSubmit(alice); + return res.ok; +} + +export async function nullifyUnsigned( + paraApi: TypedApi, + signer: PolkadotSigner = alice +): Promise { + // signed and signed validation phase to 0 + const call = paraApi.tx.System.set_storage({ + items: [ + // UnsignedPhase key + [ + Binary.fromBytes( + Uint8Array.from([ + 194, 9, 245, 216, 235, 146, 6, 129, 181, 108, 100, 184, 105, 78, 167, 140, + ]) + ), + Binary.fromBytes(Uint8Array.from([0, 0, 0, 0])), + ], + ], + }).decodedCall; + const res = await paraApi.tx.Sudo.sudo({ call }).signAndSubmit(alice); + return res.ok; +} + +export async function getApis(): Promise { + const rcClient = createClient(withPolkadotSdkCompat(getWsProvider("ws://localhost:9945"))); + const rcApi = rcClient.getTypedApi(rc); + + const paraClient = createClient(withPolkadotSdkCompat(getWsProvider("ws://localhost:9946"))); + const paraApi = paraClient.getTypedApi(parachain); + + logger.info(`Connected to ${(await rcApi.constants.System.Version()).spec_name}`); + logger.info(`Connected to ${(await paraApi.constants.System.Version()).spec_name}`); + + return { rcApi, paraApi, rcClient, paraClient }; +} + +// Safely convert anything to a string so we can compare them. +export function safeJsonStringify(data: any): string { + const bigIntReplacer = (key: string, value: any): any => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; + + try { + return JSON.stringify(data, bigIntReplacer); + } catch (error: any) { + // Handle potential errors during stringification (e.g., circular references) + console.error("Error during JSON stringification:", error.message); + throw new Error( + "Failed to stringify data due to unsupported types or circular references." + ); + } +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/common.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/common.ts new file mode 100644 index 0000000000000..d168608b69a0d --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/common.ts @@ -0,0 +1,122 @@ +import { Chain, Observe } from "../src/test-case"; +import { logger, nullifySigned, nullifyUnsigned, type ApiDeclarations } from "../src/utils"; + +// An unsigned solution scenario: +// +// When no staking-miner is running (and for simplicity the signed phase is also set to zero). We +// expect an unsigned solution to successfullly proceed and submit a solution with `minerPages` out +// of the total `pages`. +export function commonUnsignedSteps( + expectedValidatorSetCount: number, + minerPages: number, + pages: number, + doNullifySigned: boolean, + apis: ApiDeclarations +): Observe[] { + return [ + // first relay session change at block 11 + Observe.on(Chain.Relay, "Session", "NewSession").byBlock(11), + // by block 10 we will plan a new era + Observe.on(Chain.Parachain, "Staking", "SessionRotated") + .withDataCheck((x: any) => x.active_era == 0 && x.planned_era == 1) + .onPass(() => { + if (doNullifySigned) { + nullifySigned(apis.paraApi).then((ok) => { + logger.verbose("Nullified signed phase:", ok); + }); + } + }), + // eventually we will verify all pages + ...Array.from({ length: minerPages }, (_, __) => { + return Observe.on(Chain.Parachain, "MultiBlockElectionVerifier", "Verified"); + }), + // eventually it will be queued + Observe.on(Chain.Parachain, "MultiBlockElectionVerifier", "Queued"), + // eventually multiblock election will transition to `Done` + Observe.on(Chain.Parachain, "MultiBlockElection", "PhaseTransitioned").withDataCheck( + (x: any) => x.to.type === "Done" + ), + // eventually we will export all 4 pages to staking + // export events. + ...Array.from({ length: pages }, (_, __) => { + return Observe.on(Chain.Parachain, "Staking", "PagedElectionProceeded"); + }), + // eventually multiblock goes back to `Off` + Observe.on(Chain.Parachain, "MultiBlockElection", "PhaseTransitioned").withDataCheck( + (x: any) => x.to.type === "Off" + ), + // eventually we will send it back to RC + Observe.on(Chain.Relay, "StakingAhClient", "ValidatorSetReceived").withDataCheck( + (x: any) => x.id === 1 && x.new_validator_set_count === expectedValidatorSetCount + ), + Observe.on(Chain.Relay, "Session", "NewQueued"), + // eventually we will receive a session report back in AH with activation timestamp + Observe.on(Chain.Parachain, "StakingRcClient", "SessionReportReceived").withDataCheck( + (x) => x.activation_timestamp !== undefined + ), + // eventually we will have era paid (inflation) + Observe.on(Chain.Parachain, "Staking", "EraPaid"), + ].map((s) => s.build()); +} + +// A signed solution scenario. +// +// This test expect you to call `spawnMiner` in the final test code. A full solution of `pages` is +// expected to be submitted. +export function commonSignedSteps( + pages: number, + expectedValidatorSetCount: number, + apis: ApiDeclarations +): Observe[] { + return [ + // first relay session change at block 11 + Observe.on(Chain.Relay, "Session", "NewSession").byBlock(11), + // by block 10 we will plan a new era + Observe.on(Chain.Parachain, "Staking", "SessionRotated") + .withDataCheck((x: any) => x.active_era == 0 && x.planned_era == 1) + .onPass(() => { + nullifyUnsigned(apis.paraApi).then((ok) => { + logger.verbose("Nullified unsigned phase:", ok); + }); + }), + + // Eventually a signed submission is registered... + Observe.on(Chain.Parachain, "MultiBlockElectionSigned", "Registered"), + // ... and exact number of pages are generated + ...Array.from({ length: pages }, () => + Observe.on(Chain.Parachain, "MultiBlockElectionSigned", "Stored") + ), + // ... and exact number of pages are verified + ...Array.from({ length: pages }, () => + Observe.on(Chain.Parachain, "MultiBlockElectionVerifier", "Verified") + ), + // eventually it will be queued + Observe.on(Chain.Parachain, "MultiBlockElectionVerifier", "Queued"), + // eventually the signed submitter is rewarded. + // TODO: check rewarded account is Bob + Observe.on(Chain.Parachain, "MultiBlockElectionSigned", "Rewarded"), + // eventually multiblock election will transition to `Done` + Observe.on(Chain.Parachain, "MultiBlockElection", "PhaseTransitioned").withDataCheck( + (x: any) => x.to.type === "Done" + ), + // eventually we will export all pages. + ...Array.from({ length: pages }, () => + Observe.on(Chain.Parachain, "Staking", "PagedElectionProceeded") + ), + // eventually multiblock goes back to `Off` + Observe.on(Chain.Parachain, "MultiBlockElection", "PhaseTransitioned").withDataCheck( + (x: any) => x.to.type === "Off" + ), + // eventually we will send it back to RC + Observe.on(Chain.Relay, "StakingAhClient", "ValidatorSetReceived").withDataCheck( + (x: any) => x.id === 1 && x.new_validator_set_count === expectedValidatorSetCount + ), + Observe.on(Chain.Relay, "Session", "NewQueued"), + // eventually we will receive a session report back in AH with activation timestamp + Observe.on(Chain.Parachain, "StakingRcClient", "SessionReportReceived").withDataCheck( + (x) => x.activation_timestamp !== undefined + ), + // eventually we will have era paid (inflation) + Observe.on(Chain.Parachain, "Staking", "EraPaid"), + ].map((s) => s.build()); +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/example.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/example.test.ts new file mode 100644 index 0000000000000..a1477bd7a4aa2 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/example.test.ts @@ -0,0 +1,67 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched } from "../src/cmd"; +import { Chain, EventOutcome, Observe, runTest, TestCase } from "../src/test-case"; +import { getApis, GlobalTimeout, logger, nullifySigned } from "../src/utils"; + +/// This is the preset against which your test will run. See the README or `PResets` for more info. +const PRESET: Presets = Presets.FakeKsm; + +test( + `example test with preset ${PRESET}`, + async () => { + /// We run the test with our defined preset. + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + /// Grab PAPI Apis to both relay and parachain instance of the ZN. + const apis = await getApis(); + + // Our test is defined here. We expect a sequence of events to be observed in RC or + // Parachain. The events that we can observe are defined in `test-case.ts`'s `runTest`. In + // short, they are all of the events related to staking. + const testCase = new TestCase( + [ + Observe.on(Chain.Relay, "Session", "NewSession") + // An event can be expected to happen by a certain block + .byBlock(11) + // And it can execute a callback when it passes. + .onPass(() => { + logger.verbose("New session observed on relay chain"); + }) + // and we can check the data of the event. + .withDataCheck((x: any) => { + logger.verbose("shall we check the data? maybe", x); + return true + }), + // add more `Observe`s here + ].map((s) => s.build()), + // Passing this to true will allow events to be _interleaved_. If set to `false`, the + // above sequence of events are expected to happen in a strict order. If `true`, the + // events of each `Chain` must happen in a strict order, but intra-chain events can come + // in any order. For example, assume we have the following 4 observes in our test case: + // 1. Observe.on(Chain.Relay, "Module", "Event1") + // 2. Observe.on(Chain.Relay, "Module", "Event2") + // 3. Observe.on(Chain.Para, "Module", "Event3") + // 4. Observe.on(Chain.Para, "Module", "Event4") + // + // Without interleaving, 1 -> 4 has to be observed as-is. + // + // With interleaving, at any point in time, the first unobserved event of each chain + // type is acceptable. For example, the following is valid: + // + // 3 -> 1 -> 4 -> 2 + // + // In some sense, with `interleave = true`, we break apart the test case into two stacks + // that need to be popped in order, while in interleave = false, it is one stack. + true, + // Something to happen when the test is over. Always kill ZN, and any other processes + // you might spawn. + () => { + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/prune-full-era.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/prune-full-era.test.ts new file mode 100644 index 0000000000000..70b786d12ed05 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/prune-full-era.test.ts @@ -0,0 +1 @@ +// TODO diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-dev.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-dev.test.ts new file mode 100644 index 0000000000000..05e14640c94ca --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-dev.test.ts @@ -0,0 +1,32 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched, spawnMiner } from "../src/cmd"; +import { EventOutcome, runTest, TestCase } from "../src/test-case"; +import { + getApis, + GlobalTimeout, +} from "../src/utils"; +import { commonSignedSteps } from "./common"; + +const PRESET: Presets = Presets.FakeDev; +test( + `signed solution on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + const killMiner = await spawnMiner(); + + const testCase = new TestCase( + commonSignedSteps(4, 10, apis), + true, + () => { + killMiner(); + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-dot.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-dot.test.ts new file mode 100644 index 0000000000000..37a553b1bb61b --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-dot.test.ts @@ -0,0 +1,30 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched, spawnMiner } from "../src/cmd"; +import { EventOutcome, runTest, TestCase } from "../src/test-case"; +import { getApis, GlobalTimeout} from "../src/utils"; +import { commonSignedSteps } from "./common"; + +const PRESET: Presets = Presets.FakeDot; + +test( + `signed solution on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + const killMiner = await spawnMiner(); + + const testCase = new TestCase( + commonSignedSteps(32, 500, apis), + true, + () => { + killMiner(); + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-ksm.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-ksm.test.ts new file mode 100644 index 0000000000000..20794c40ff5b7 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/signed-ksm.test.ts @@ -0,0 +1,30 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched, spawnMiner } from "../src/cmd"; +import { EventOutcome, runTest, TestCase } from "../src/test-case"; +import { getApis, GlobalTimeout } from "../src/utils"; +import { commonSignedSteps } from "./common"; + +const PRESET: Presets = Presets.FakeKsm; + +test( + `signed solution on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + const killMiner = await spawnMiner(); + + const testCase = new TestCase( + commonSignedSteps(16, 1000, apis), + true, + () => { + killMiner(); + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/slashing-disable.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/slashing-disable.test.ts new file mode 100644 index 0000000000000..adaac77bd9a1c --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/slashing-disable.test.ts @@ -0,0 +1,103 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched } from "../src/cmd"; +import { Chain, EventOutcome, Observe, runTest, TestCase } from "../src/test-case"; +import { alice, getApis, GlobalTimeout, logger, nullifySigned, aliceStash } from "../src/utils"; + +// Note the `RealM` preset as this test MUST run with enough validators such that we can disable one. +const PRESET: Presets = Presets.RealM; + +test( + `slashing with disabling on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + let aliceExposedNominators = 0; + let pages = 0; + + const steps = [ + // first relay session change at block 11 + Observe.on(Chain.Relay, "Session", "NewSession").byBlock(11), + // eventually AH will will be instructed to plan a new session. + Observe.on(Chain.Parachain, "Staking", "SessionRotated") + .withDataCheck((x: any) => x.active_era == 0 && x.planned_era == 1) + .onPass(() => { + nullifySigned(apis.paraApi); + }), + // Eventually we will receive an activation timestamp in AH, meaning the first era was complete. + Observe.on(Chain.Parachain, "StakingRcClient", "SessionReportReceived") + .withDataCheck((x) => x.activation_timestamp !== undefined) + .onPass(() => { + // upon completion, submit a slash to rc + logger.info("Submitting slash to RC"); + const call = apis.rcApi.tx.RootOffences.create_offence({ + offenders: [ + // alice//Stash, 50%, which will cause any disabling. See `DisablingStrategy` in `./runtimes/parachain`. + [aliceStash, 500000000], + ], + maybe_identifications: undefined, + maybe_session_index: undefined, + }).decodedCall; + apis.rcApi.tx.Sudo.sudo({ call }) + .signAndSubmit(alice) + .then((res: any) => { + logger.verbose("Slash submission result:", res.ok); + }); + }), + // we will receive the root offence event + Observe.on(Chain.Relay, "RootOffences", "OffenceCreated"), + // Session pallet has insta-disabled this validator. + Observe.on(Chain.Relay, "Session", "ValidatorDisabled").withDataCheck( + (x: any) => x.validator === aliceStash + ), + + // Rest of the events are the same as in the non-disabling test. + + // eventually we will receive an offence in the parachain, first the rc-client + Observe.on(Chain.Parachain, "StakingRcClient", "OffenceReceived").withDataCheck( + (x: any) => x.offences_count === 1 + ), + // then staking + Observe.on(Chain.Parachain, "Staking", "OffenceReported") + .withDataCheck((x: any) => x.offence_era === 1 && x.fraction === 500000000) + .onPass(async () => { + // let's calculate how many pages of exposure alice has -- this will impact the number of next events. + const overview = await apis.paraApi.query.Staking.ErasStakersOverview.getValue( + 1, + aliceStash + ); + pages = overview?.page_count || 0; + aliceExposedNominators = overview?.nominator_count || 0; + // TODO: lazily create the `Slashed` and `SlashComputed` based on this + logger.verbose( + `Alice has ${aliceExposedNominators} exposed nominators (${pages}) whom we expect to slash later` + ); + }), + + // then staking will calculate the slashes, we only check 1 page + Observe.on(Chain.Parachain, "Staking", "SlashComputed").withDataCheck( + (x: any) => x.page === 0 + ), + + // staking will eventually bump to active era 2, where slashes will be applied. + Observe.on(Chain.Parachain, "Staking", "EraPaid"), + Observe.on(Chain.Parachain, "Staking", "SessionRotated").withDataCheck( + (x: any) => x.active_era === 2 + ), + + // staking will apply slashes, we only check one slash. + Observe.on(Chain.Parachain, "Staking", "Slashed"), + ]; + const testCase = new TestCase( + steps.map((s) => s.build()), + true, + () => { + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/slashing-no-disable.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/slashing-no-disable.test.ts new file mode 100644 index 0000000000000..6dbce7e9a0c6a --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/slashing-no-disable.test.ts @@ -0,0 +1,96 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched } from "../src/cmd"; +import { Chain, EventOutcome, Observe, runTest, TestCase } from "../src/test-case"; +import { alice, getApis, GlobalTimeout, logger, nullifySigned, aliceStash } from "../src/utils"; + +const PRESET: Presets = Presets.RealS; + +test( + `slashing without disabling on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + let aliceExposedNominators = 0; + let pages = 0; + + const steps = [ + // first relay session change at block 11 + Observe.on(Chain.Relay, "Session", "NewSession").byBlock(11), + // eventually AH will will be instructed to plan a new session. + Observe.on(Chain.Parachain, "Staking", "SessionRotated") + .withDataCheck((x: any) => x.active_era == 0 && x.planned_era == 1) + .onPass(() => { + nullifySigned(apis.paraApi); + }), + // Eventually we will receive an activation timestamp in AH, meaning the first era was complete. + Observe.on(Chain.Parachain, "StakingRcClient", "SessionReportReceived") + .withDataCheck((x) => x.activation_timestamp !== undefined) + .onPass(() => { + // upon completion, submit a slash to rc + logger.info("Submitting slash to RC"); + const call = apis.rcApi.tx.RootOffences.create_offence({ + offenders: [ + // alice//Stash, 10%, which will NOT cause any disabling. See `DisablingStrategy` in `./runtimes/parachain`. + [aliceStash, 100000000], + ], + maybe_identifications: undefined, + maybe_session_index: undefined, + }).decodedCall; + apis.rcApi.tx.Sudo.sudo({ call }) + .signAndSubmit(alice) + .then((res: any) => { + logger.verbose("Slash submission result:", res.ok); + }); + }), + // we will receive the root offence event + Observe.on(Chain.Relay, "RootOffences", "OffenceCreated"), + + // eventually we will receive an offence in the parachain, first the rc-client + Observe.on(Chain.Parachain, "StakingRcClient", "OffenceReceived").withDataCheck( + (x: any) => x.offences_count === 1 + ), + // then staking + Observe.on(Chain.Parachain, "Staking", "OffenceReported") + .withDataCheck((x: any) => x.offence_era === 1 && x.fraction === 100000000) + .onPass(async () => { + // let's calculate how many pages of exposure alice has -- this will impact the number of next events. + const overview = await apis.paraApi.query.Staking.ErasStakersOverview.getValue( + 1, + aliceStash + ); + pages = overview?.page_count || 0; + aliceExposedNominators = overview?.nominator_count || 0; + // TODO: lazily create the `Slashed` and `SlashComputed` based on this + logger.verbose( + `Alice has ${aliceExposedNominators} exposed nominators (${pages}) whom we expect to slash later` + ); + }), + + // then staking will calculate the slasheh, we only check 1 page + Observe.on(Chain.Parachain, "Staking", "SlashComputed").withDataCheck( + (x: any) => x.page === 0 + ), + + // staking will eventually bump to active era 2, where slashes will be applied. + Observe.on(Chain.Parachain, "Staking", "EraPaid"), + Observe.on(Chain.Parachain, "Staking", "SessionRotated").withDataCheck( + (x: any) => x.active_era === 2 + ), + + // staking will apply slashes, we only check one slash. + Observe.on(Chain.Parachain, "Staking", "Slashed"), + ]; + const testCase = new TestCase( + steps.map((s) => s.build()), + true, + () => { + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-dev.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-dev.test.ts new file mode 100644 index 0000000000000..57fc3b4acab8e --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-dev.test.ts @@ -0,0 +1,26 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched } from "../src/cmd"; +import { EventOutcome, runTest, TestCase } from "../src/test-case"; +import { getApis, GlobalTimeout} from "../src/utils"; +import { commonUnsignedSteps } from "./common"; + +const PRESET: Presets = Presets.FakeDev; + +test( + `unsigned solution on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + + const apis = await getApis(); + const steps = commonUnsignedSteps(10, 4, 4, false, apis); + + const testCase = new TestCase(steps, true, () => { + killZn(); + }); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-dot.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-dot.test.ts new file mode 100644 index 0000000000000..f04e74f2edc95 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-dot.test.ts @@ -0,0 +1,33 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched } from "../src/cmd"; +import { EventOutcome, runTest, TestCase } from "../src/test-case"; +import { getApis, GlobalTimeout } from "../src/utils"; +import { commonUnsignedSteps } from "./common"; + +const PRESET: Presets = Presets.FakeDot; + +test( + `unsigned solution on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + + const expectedValidatorSetCount = await apis.paraApi.query.Staking.ValidatorCount.getValue(); + const pages = 32; + const minerPages = 4; + const steps = commonUnsignedSteps(expectedValidatorSetCount, minerPages, pages, true, apis); + + const testCase = new TestCase( + steps, + true, + () => { + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-ksm.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-ksm.test.ts new file mode 100644 index 0000000000000..39fa43d87f6c9 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/unsigned-ksm.test.ts @@ -0,0 +1,33 @@ +import { test, expect } from "bun:test"; +import { Presets } from "../src"; +import { runPresetUntilLaunched } from "../src/cmd"; +import { EventOutcome, runTest, TestCase } from "../src/test-case"; +import { getApis, GlobalTimeout } from "../src/utils"; +import { commonUnsignedSteps } from "./common"; + +const PRESET: Presets = Presets.FakeKsm; + +test( + `unsigned solution on ${PRESET}`, + async () => { + const { killZn, paraLog } = await runPresetUntilLaunched(PRESET); + const apis = await getApis(); + + const expectedValidatorSetCount = await apis.paraApi.query.Staking.ValidatorCount.getValue(); + const pages = 16; + const minerPages = 4; + const steps = commonUnsignedSteps(expectedValidatorSetCount, minerPages, pages, true, apis); + + const testCase = new TestCase( + steps, + true, + () => { + killZn(); + } + ); + + const outcome = await runTest(testCase, apis, paraLog); + expect(outcome).toEqual(EventOutcome.Done); + }, + { timeout: GlobalTimeout } +); diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tests/vmp.spamming.test.ts b/substrate/frame/staking-async/runtimes/papi-tests/tests/vmp.spamming.test.ts new file mode 100644 index 0000000000000..70b786d12ed05 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tests/vmp.spamming.test.ts @@ -0,0 +1 @@ +// TODO diff --git a/substrate/frame/staking-async/runtimes/papi-tests/tsconfig.json b/substrate/frame/staking-async/runtimes/papi-tests/tsconfig.json new file mode 100644 index 0000000000000..ab0f0b0964d4e --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + // Environment setup & latest features + "lib": ["esnext"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } +} diff --git a/substrate/frame/staking-async/runtimes/papi-tests/zn-m.toml b/substrate/frame/staking-async/runtimes/papi-tests/zn-m.toml new file mode 100644 index 0000000000000..817b46ba3121e --- /dev/null +++ b/substrate/frame/staking-async/runtimes/papi-tests/zn-m.toml @@ -0,0 +1,37 @@ +[relaychain] +default_command = "polkadot" +chain_spec_path = "./rc.json" + +[[relaychain.nodes]] +name = "alice" +validator = true +rpc_port = 9942 + +[[relaychain.nodes]] +name = "bob" +validator = true +rpc_port = 9943 +args = [ + "-lruntime::system=debug,runtime::session=trace,runtime::staking::ah-client=trace,runtime::ah-client=debug", +] + +[[relaychain.nodes]] +name = "eve" +validator = true +rpc_port = 9944 + +[[relaychain.nodes]] +name = "dave" +validator = true +rpc_port = 9945 + +[[parachains]] +id = 1100 +chain_spec_path = "./parachain.json" + +[parachains.collator] +name = "charlie" +rpc_port = 9946 +args = [ + "-lruntime::system=debug,runtime::multiblock-election=trace,runtime::staking=debug,runtime::staking::rc-client=trace,runtime::rc-client=debug", +] diff --git a/substrate/frame/staking-async/runtimes/parachain/zombienet-staking-runtimes.toml b/substrate/frame/staking-async/runtimes/papi-tests/zn-s.toml similarity index 100% rename from substrate/frame/staking-async/runtimes/parachain/zombienet-staking-runtimes.toml rename to substrate/frame/staking-async/runtimes/papi-tests/zn-s.toml diff --git a/substrate/frame/staking-async/runtimes/parachain/.gitignore b/substrate/frame/staking-async/runtimes/parachain/.gitignore deleted file mode 100644 index a6c57f5fb2ffb..0000000000000 --- a/substrate/frame/staking-async/runtimes/parachain/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.json diff --git a/substrate/frame/staking-async/runtimes/parachain/Cargo.toml b/substrate/frame/staking-async/runtimes/parachain/Cargo.toml index 9469a5dece502..59d3a3a96fee7 100644 --- a/substrate/frame/staking-async/runtimes/parachain/Cargo.toml +++ b/substrate/frame/staking-async/runtimes/parachain/Cargo.toml @@ -7,6 +7,7 @@ description = "A parachain runtime for staking-async" license.workspace = true homepage.workspace = true repository.workspace = true +publish = false [lints] workspace = true @@ -56,6 +57,7 @@ pallet-referenda = { workspace = true } pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-staking-async = { workspace = true } +pallet-staking-async-preset-store = { workspace = true } pallet-staking-async-rc-client = { workspace = true } pallet-staking-async-runtime-api = { workspace = true } pallet-state-trie-migration = { workspace = true } @@ -129,7 +131,14 @@ bp-bridge-hub-westend = { workspace = true } pallet-xcm-bridge-hub-router = { workspace = true } [dev-dependencies] +asset-test-utils = { workspace = true, default-features = true } +frame-try-runtime = { workspace = true, default-features = true } +pallet-bags-list-remote-tests = { workspace = true, default-features = true } +parachains-runtimes-test-utils = { workspace = true, default-features = true } +remote-externalities = { workspace = true, default-features = true } +sp-io = { workspace = true, default-features = true } sp-tracing = { workspace = true, default-features = true } +tokio = { features = ["macros"], workspace = true, default-features = true } [build-dependencies] substrate-wasm-builder = { optional = true, workspace = true, default-features = true } @@ -310,6 +319,7 @@ std = [ "pallet-referenda/std", "pallet-scheduler/std", "pallet-session/std", + "pallet-staking-async-preset-store/std", "pallet-staking-async-rc-client/std", "pallet-staking-async-runtime-api/std", "pallet-staking-async/std", diff --git a/substrate/frame/staking-async/runtimes/parachain/README.md b/substrate/frame/staking-async/runtimes/parachain/README.md deleted file mode 100644 index e23a9538a15f4..0000000000000 --- a/substrate/frame/staking-async/runtimes/parachain/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Staking Async Parachain - -## Overview - -This parachain runtime is a fake fork of the asset-hub next (created original by Donál). It is here -to test the async-staking pallet in a real environment. - -This parachain contains: - -- `pallet-staking-async` -- `pallet-staking-async-rc-client` -- `pallet-election-provider-multi-block` and family -- aux staking pallets `pallet-nomination-pools`, `pallet-fast-unstake`, `pallet-bags-list`, and - `pallet-delegated-staking`. - -All of the above are means to stake and select validators for the RELAY-CHAIN, which is eventually -communicated to it via the `pallet-staking-async-rc-client` pallet. - -A lot more is in the runtime, and can be eventually removed. - -Note that the parachain runtime also contains a `pallet-session` that works with -`pallet-collator-selection` for the PARACHAIN block author selection. - -The counterpart `rc` runtime is a relay chain that is meant to host the parachain. It contains: - -- `pallet-staking-async-ah-client` -- `pallet-session` -- `pallet-authorship` -- And all of the consensus pallets that feed the authority set from the session, such as - aura/babe/grandpa/beefy and so on. - -## Run - -To run this, a one-click script is provided: - -``` -bash build-and-run-zn.sh -``` - -This script will generate chain-specs for both runtimes, and run them with zombie-net. - -> Make sure you have all Polkadot binaries (`polkadot`, `polkadot-execution-worker` and -> `polkadot-prepare-worker`) and `polkadot-parachain` installed in your PATH. You can usually -> download them from the Polkadot-sdk release page. - -You also need `chain-spec-builder`, but the script builds that and uses a fresh one. - -## Chain-spec presets - -We have tried to move as much of the configuration as possible to different chain-specifications, so -that manually tweaking the code is not needed. - -The parachain comes with 3 main chain-spec presets. - -- `development`: 100 validator, 2000 nominators, all 2000 nominators in the snapshot, 10 validator - to be elected, 4 pages -- `dot_size`: 2000 validator, 25_000 nominators, 22_500 nominators in the snapshot, 500 validator to - be elected, 32 pages -- `ksm_size`: 4000 validator, 20_000 nominators, 12_500 nominators in the snapshot, 1000 validator - to be elected, 16 pages - -Both when running the benchmarks (`bench.sh`) and the chain (`build-and-run-zn.sh`), you can specify -the chain-spec preset. See each file for more info as to how. diff --git a/substrate/frame/staking-async/runtimes/parachain/Staking-Justfile b/substrate/frame/staking-async/runtimes/parachain/Staking-Justfile deleted file mode 100644 index cbb9a4c2c0d29..0000000000000 --- a/substrate/frame/staking-async/runtimes/parachain/Staking-Justfile +++ /dev/null @@ -1,37 +0,0 @@ -default: build create-specs launch - -# Set default values for the named preset -named-preset := "development" -log := "runtime::multiblock-election=info,runtime::staking=info" -para-id := "1100" -relay-chain := "rococo-local" -parachain-runtime-path := "../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.compressed.wasm" -rc-runtime-path := "../../../../../target/release/wbuild/pallet-staking-async-rc-runtime/fast_runtime_binary.rs.wasm" - - -build: - RUST_LOG={{log}} cargo build --release -p pallet-staking-async-rc-runtime -p pallet-staking-async-parachain-runtime -p staging-chain-spec-builder - -create-specs: - rm -f ./parachain.json ./rc.json - - RUST_LOG={{log}} ../../../../../target/release/chain-spec-builder \ - create \ - -t development \ - --runtime {{parachain-runtime-path}} \ - --relay-chain {{relay-chain}} \ - --para-id {{para-id}} \ - named-preset {{named-preset}} - mv ./chain_spec.json ./parachain.json - - RUST_LOG={{log}} ../../../../../target/release/chain-spec-builder \ - create \ - -t development \ - --runtime {{rc-runtime-path}} \ - named-preset local_testnet - mv ./chain_spec.json ./rc.json - -launch: - zombienet --provider native -l text spawn zombienet-staking-runtimes.toml - -no-compile: create-specs launch diff --git a/substrate/frame/staking-async/runtimes/parachain/bench_all.sh b/substrate/frame/staking-async/runtimes/parachain/bench_all.sh index 7b022d326245a..f3b7efb7018ab 100755 --- a/substrate/frame/staking-async/runtimes/parachain/bench_all.sh +++ b/substrate/frame/staking-async/runtimes/parachain/bench_all.sh @@ -5,13 +5,13 @@ STEPS=2 REPEAT=2 # if any of the command line arguments are equal to `--log=X`, set X to the below log levels -LOG="runtime::multiblock-election=debug,runtime::staking-async=debug,polkadot_sdk_frame::benchmark=debug" +LOG="runtime::multiblock-election=info,runtime::staking-async=info,polkadot_sdk_frame::benchmark=info" if [[ "${NO_COMPILE}" == "1" ]]; then echo "Skipping compilation because 'NO_COMPILE' was set" else cargo build --release -p frame-omni-bencher - FORCE_WASM_BUILD=$RANDOM WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} cargo build --release -p pallet-staking-async-parachain-runtime --features runtime-benchmarks + FORCE_WASM_BUILD=$RANDOM WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} cargo build --release -p pallet-staking-async-parachain-runtime --features runtime-benchmarks fi WASM_BLOB_PATH=../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.wasm @@ -41,14 +41,14 @@ run_benchmark() { --output "$output_file" } -# run_benchmark "pallet_staking_async" "dot_size" -run_benchmark "pallet_election_provider_multi_block" "dot_size" -run_benchmark "pallet_election_provider_multi_block_signed" "dot_size" -run_benchmark "pallet_election_provider_multi_block_unsigned" "dot_size" -run_benchmark "pallet_election_provider_multi_block_verifier" "dot_size" - -# run_benchmark "pallet_staking_async" "ksm_size" -run_benchmark "pallet_election_provider_multi_block" "ksm_size" -run_benchmark "pallet_election_provider_multi_block_signed" "ksm_size" -run_benchmark "pallet_election_provider_multi_block_unsigned" "ksm_size" -run_benchmark "pallet_election_provider_multi_block_verifier" "ksm_size" +# run_benchmark "pallet_staking_async" "fake-dot" +run_benchmark "pallet_election_provider_multi_block" "fake-dot" +run_benchmark "pallet_election_provider_multi_block_signed" "fake-dot" +run_benchmark "pallet_election_provider_multi_block_unsigned" "fake-dot" +run_benchmark "pallet_election_provider_multi_block_verifier" "fake-dot" + +# run_benchmark "pallet_staking_async" "fake-ksm" +run_benchmark "pallet_election_provider_multi_block" "fake-ksm" +run_benchmark "pallet_election_provider_multi_block_signed" "fake-ksm" +run_benchmark "pallet_election_provider_multi_block_unsigned" "fake-ksm" +run_benchmark "pallet_election_provider_multi_block_verifier" "fake-ksm" diff --git a/substrate/frame/staking-async/runtimes/parachain/build-and-run-zn.sh b/substrate/frame/staking-async/runtimes/parachain/build-and-run-zn.sh deleted file mode 100755 index 7fea9e75e40ec..0000000000000 --- a/substrate/frame/staking-async/runtimes/parachain/build-and-run-zn.sh +++ /dev/null @@ -1,34 +0,0 @@ -echo "✅ building chain-spec-builder and pallet-staking-async-rc-runtime and pallet-staking-async-parachain-runtime" - -LOG="runtime::multiblock-election=info,runtime::staking=info" - -if [ "$1" != "no-compile" ]; then - RUST_LOG=${LOG} cargo build --release -p pallet-staking-async-rc-runtime -p pallet-staking-async-parachain-runtime -p staging-chain-spec-builder -else - echo "Skipping compilation because 'no-compile' argument was provided." -fi - -echo "✅ removing any old chain-spec file" -rm ./parachain.json -rm ./rc.json - -echo "✅ creating parachain chain specs" -RUST_LOG=${LOG} ../../../../../target/release/chain-spec-builder \ - create \ - -t development \ - --runtime ../../../../../target/release/wbuild/pallet-staking-async-parachain-runtime/pallet_staking_async_parachain_runtime.compact.compressed.wasm \ - --relay-chain rococo-local \ - named-preset development - # change this as per your needs ^^^ options: development / dot_size / ksm_size -mv ./chain_spec.json ./parachain.json - -echo "✅ creating rc chain specs" -RUST_LOG=${LOG} ../../../../../target/release/chain-spec-builder \ - create \ - -t development \ - --runtime ../../../../../target/release/wbuild/pallet-staking-async-rc-runtime/fast_runtime_binary.rs.wasm \ - named-preset local_testnet -mv ./chain_spec.json ./rc.json - -echo "✅ launching ZN" -zombienet --provider native -l text spawn zombienet-staking-runtimes.toml diff --git a/substrate/frame/staking-async/runtimes/parachain/src/genesis_config_presets.rs b/substrate/frame/staking-async/runtimes/parachain/src/genesis_config_presets.rs index 5e2411011cac8..a81bbfa424ba9 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/genesis_config_presets.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/genesis_config_presets.rs @@ -18,12 +18,18 @@ //! # Staking Async Runtime genesis config presets use crate::*; -use alloc::{vec, vec::Vec}; +use alloc::{ + string::{String, ToString}, + vec, + vec::Vec, +}; use cumulus_primitives_core::ParaId; use frame_support::build_struct_json_patch; use parachains_common::{AccountId, AuraId}; +use sp_core::{crypto::get_public_from_string_or_panic, sr25519}; use sp_genesis_builder::PresetId; use sp_keyring::Sr25519Keyring; +use sp_staking::StakerStatus; use testnet_parachains_constants::westend::{ currency::UNITS as WND, xcm_version::SAFE_XCM_VERSION, }; @@ -35,24 +41,21 @@ struct GenesisParams { endowed_accounts: Vec, endowment: Balance, dev_stakers: Option<(u32, u32)>, - pages: u32, - max_electing_voters: u32, + validators: Vec, validator_count: u32, root: AccountId, id: ParaId, } -fn staking_async_parachain_genesis(params: GenesisParams) -> serde_json::Value { +fn staking_async_parachain_genesis(params: GenesisParams, preset: String) -> serde_json::Value { let GenesisParams { invulnerables, endowed_accounts, endowment, dev_stakers, + validators, validator_count, root, - // TODO: find a way to set these here, but for now we will set them directly in the runtime. - pages: _pages, - max_electing_voters: _max_electing_voters, id, } = params; build_struct_json_patch!(RuntimeGenesisConfig { @@ -66,6 +69,7 @@ fn staking_async_parachain_genesis(params: GenesisParams) -> serde_json::Value { }, session: SessionConfig { keys: invulnerables + .clone() .into_iter() .map(|(acc, aura)| { ( @@ -78,40 +82,76 @@ fn staking_async_parachain_genesis(params: GenesisParams) -> serde_json::Value { }, polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION) }, sudo: SudoConfig { key: Some(root) }, - staking: StakingConfig { validator_count, dev_stakers, ..Default::default() } + preset_store: crate::PresetStoreConfig { preset, ..Default::default() }, + staking: StakingConfig { + validator_count, + dev_stakers, + stakers: validators + .into_iter() + .map(|acc| (acc, endowment / 2, StakerStatus::Validator)) + .collect(), + ..Default::default() + } }) } /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &PresetId) -> Option> { - let mut dev_and_testnet_params = GenesisParams { + let mut params = GenesisParams { invulnerables: vec![ - (Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into()), - (Sr25519Keyring::Bob.to_account_id(), Sr25519Keyring::Bob.public().into()), + // in all cases, our local collators is just charlie. ZN seems to override these + // anyways. + ( + get_public_from_string_or_panic::("Charlie").into(), + get_public_from_string_or_panic::("Charlie").into(), + ), ], endowed_accounts: Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect(), endowment: WND * 1_000_000, dev_stakers: Some((100, 2000)), + validators: Default::default(), validator_count: 10, root: Sr25519Keyring::Alice.to_account_id(), id: 1100.into(), - max_electing_voters: 2000, - pages: 4, }; let patch = match id.as_ref() { - sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => - staking_async_parachain_genesis(dev_and_testnet_params), - sp_genesis_builder::DEV_RUNTIME_PRESET => - staking_async_parachain_genesis(dev_and_testnet_params), - "ksm_size" => { - dev_and_testnet_params.validator_count = 1_000; - dev_and_testnet_params.dev_stakers = Some((4_000, 20_000)); - staking_async_parachain_genesis(dev_and_testnet_params) + "real-s" => { + params.validator_count = 2; + // generate no new "fake" validators. + params.dev_stakers = Some((0, 500)); + // set expected relay validators in genesis so they are elected + params.validators = vec![ + Sr25519Keyring::AliceStash.to_account_id(), + Sr25519Keyring::BobStash.to_account_id(), + ]; + staking_async_parachain_genesis(params, id.to_string()) + }, + "real-m" => { + params.validator_count = 4; + // generate no new "fake" validators. + params.dev_stakers = Some((0, 2000)); + // set expected relay validators in genesis so they are elected + params.validators = vec![ + Sr25519Keyring::AliceStash.to_account_id(), + Sr25519Keyring::BobStash.to_account_id(), + Sr25519Keyring::EveStash.to_account_id(), + Sr25519Keyring::DaveStash.to_account_id(), + ]; + staking_async_parachain_genesis(params, id.to_string()) + }, + "fake-dev" => { + // nada + staking_async_parachain_genesis(params, id.to_string()) + }, + "fake-dot" => { + params.validator_count = 500; + params.dev_stakers = Some((2_500, 25_000)); + staking_async_parachain_genesis(params, id.to_string()) }, - "dot_size" => { - dev_and_testnet_params.validator_count = 500; - dev_and_testnet_params.dev_stakers = Some((2_000, 25_000)); - staking_async_parachain_genesis(dev_and_testnet_params) + "fake-ksm" => { + params.validator_count = 1_000; + params.dev_stakers = Some((4_500, 15_000)); + staking_async_parachain_genesis(params, id.to_string()) }, _ => panic!("unrecognized genesis preset!"), }; @@ -126,9 +166,10 @@ pub fn get_preset(id: &PresetId) -> Option> { /// List of supported presets. pub fn preset_names() -> Vec { vec![ - PresetId::from(sp_genesis_builder::DEV_RUNTIME_PRESET), - PresetId::from(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET), - PresetId::from("ksm_size"), - PresetId::from("dot_size"), + PresetId::from("real-s"), + PresetId::from("real-m"), + PresetId::from("fake-dev"), + PresetId::from("fake-dot"), + PresetId::from("fake-ksm"), ] } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs index 29a297ac8dc07..df0996a66f210 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs @@ -1107,9 +1107,7 @@ impl pallet_sudo::Config for Runtime { type WeightInfo = pallet_sudo::weights::SubstrateWeight; } -// impl pallet_root_offences::Config for Runtime { -// type RuntimeEvent = RuntimeEvent; -// } +impl pallet_staking_async_preset_store::Config for Runtime {} // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( @@ -1196,7 +1194,7 @@ construct_runtime!( // AHN specific. Sudo: pallet_sudo = 110, - // RootOffences: pallet_root_offences = 111, + PresetStore: pallet_staking_async_preset_store = 111, // TODO: the pallet instance should be removed once all pools have migrated // to the new account IDs. @@ -1849,9 +1847,6 @@ impl_runtime_apis! { frame_benchmarking::benchmarking::add_to_whitelist( crate::staking::Pages::key().to_vec().into() ); - frame_benchmarking::benchmarking::add_to_whitelist( - crate::staking::SolutionImprovementThreshold::key().to_vec().into() - ); frame_benchmarking::benchmarking::add_to_whitelist( crate::staking::SignedPhase::key().to_vec().into() ); @@ -2166,26 +2161,32 @@ impl_runtime_apis! { impl sp_genesis_builder::GenesisBuilder for Runtime { fn build_state(config: Vec) -> sp_genesis_builder::Result { let res = build_state::(config); - // tweak some of our parameter-types as well.. - match pallet_staking_async::ValidatorCount::::get() { - 500 => { - log::info!(target: "runtime", "detected a polkadot-like chain during `build_state`"); - // this is a polkadot-like chain - crate::staking::MaxElectingVoters::set(&22_500); - crate::staking::Pages::set(&32); + match PresetStore::preset().unwrap().as_str() { + "real-s" => { + log::info!(target: "runtime", "detected a real-s preset"); + // used for slashing, better make it faster. + crate::staking::SignedPhase::set(&0); + crate::staking::SignedValidationPhase::set(&0); }, - 1000 => { - log::info!(target: "runtime", "detected a kusama-like chain during `build_state`"); - // this is a kusama-like chain - crate::staking::MaxElectingVoters::set(&12_500); - crate::staking::Pages::set(&16); + "real-m" => { + log::info!(target: "runtime", "detected a real-m preset"); + crate::staking::SignedPhase::set(&0); + crate::staking::SignedValidationPhase::set(&0); } - 10 => { - log::info!(target: "runtime", "detected a dev chain during `build_state`"); - // this is a dev-chain -- no change needed + "fake-dev" => { + log::info!(target: "runtime", "detected a fake-dev preset"); + // noop, default values are for dev. + }, + "fake-ksm" => { + log::info!(target: "runtime", "detected fake-ksm preset"); + crate::staking::enable_ksm_preset(true); + }, + "fake-dot" => { + log::info!(target: "runtime", "detected fake-dot preset"); + crate::staking::enable_dot_preset(true); }, _ => { - panic!("Unrecognized validator count -- genesis-config and this block should match"); + panic!("Unrecognized preset to build"); } } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/staking.rs b/substrate/frame/staking-async/runtimes/parachain/src/staking.rs index 7603f27d4ff3d..ab5c8f7fe4104 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/staking.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/staking.rs @@ -24,47 +24,224 @@ use pallet_election_provider_multi_block::{self as multi_block, SolutionAccuracy use pallet_staking_async::UseValidatorsMap; use pallet_staking_async_rc_client as rc_client; use polkadot_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; +use sp_core::Get; +use sp_npos_elections::BalancingConfig; use sp_runtime::{ traits::Convert, transaction_validity::TransactionPriority, FixedPointNumber, FixedU128, SaturatedConversion, }; use xcm::latest::prelude::*; +pub(crate) fn enable_dot_preset(fast: bool) { + Pages::set(&32); + MinerPages::set(&4); + MaxElectingVoters::set(&22_500); + TargetSnapshotPerBlock::set(&2000); + if !fast { + SignedValidationPhase::set(&(8 * Pages::get())); + SignedPhase::set(&(20 * MINUTES)); + } +} + +pub(crate) fn enable_ksm_preset(fast: bool) { + Pages::set(&16); + MinerPages::set(&4); + MaxElectingVoters::set(&12_500); + TargetSnapshotPerBlock::set(&4000); + if !fast { + SignedValidationPhase::set(&(4 * Pages::get())); + SignedPhase::set(&(20 * MINUTES)); + } +} + +// This macro contains all of the variable parameters that we intend to use for Polkadot and +// Kusama. +// +// Note that this runtime has 3 broad presets: +// +// 1. dev: fast development preset. +// 2. dot-size: as close to Polkadot as possible. +// 3. ksm-size: as close to Kusama as possible. +// +// The default values here are related to `dev`. The above helper functions are used at launch (see +// `build_state` runtime-api) to enable dot/ksm presets. parameter_types! { + /// Number of election pages that we operate upon. + /// + /// * Polkadot: 32 (3.2m snapshot) + /// * Kusama: 16 (1.6m snapshot) + /// + /// Reasoning: Both leads to around 700 nominators per-page, yielding the weights in + /// https://github.com/paritytech/polkadot-sdk/pull/8704, the maximum of which being around 1mb + /// compressed PoV and 2mb uncompressed. + /// + /// NOTE: in principle, there is nothing preventing us from stretching these values further, it + /// will only reduce the per-page POVs. Although, some operations like the first snapshot, and + /// the last page of export (where we operate on `MaxValidatorSet` validators) will not get any + /// better. + pub storage Pages: u32 = 4; + + /// * Polkadot: 8 * 32 (256 blocks, 25.6m). Enough time to verify up to 8 solutions. + /// * Kusama: 4 * 16 (64 blocks, 6.4m). Enough time to verify up to 4 solutions. + /// + /// Reasoning: Less security needed in Kusama, to compensate for the shorter session duration. + pub storage SignedValidationPhase: u32 = Pages::get() * 2; + + /// * Polkadot: 200 blocks, 20m. + /// * Kusama: 100 blocks, 10m. + /// + /// Reasoning: + /// + /// * Polkadot wishes at least 8 submitters to be able to submit. That is 8 * 32 = 256 pages + /// for all submitters. Weight of each submission page is roughly 0.0007 of block weight. 200 + /// blocks is more than enough. + /// * Kusama wishes at least 4 submitters to be able to submit. That is 4 * 16 = 64 pages for + /// all submitters. Weight of each submission page is roughly 0.0007 of block weight. 100 + /// blocks is more than enough. + /// + /// See `signed_weight_ratios` test below for more info. pub storage SignedPhase: u32 = 4 * MINUTES; + + /// * Polkadot: 4 + /// * Kusama: 4 + /// + /// Reasoning: with 4 pages, the `ElectionScore` computed in both Kusama and Polkadot is pretty + /// good. See and run `run_election_with_pages` below to see. With 4 pages, roughly 2800 + /// nominators will be elected. This is not great for staking reward, but is good enough for + /// chain's economic security. + pub storage MinerPages: u32 = 4; + + /// * Polkadot: 300 blocks, 30m + /// * Kusama: 150 blocks, 15m + /// + /// Reasoning: The only criteria is for the phase to be long enough such that the OCW miner is + /// able to run the mining code at least twice. Note that `OffchainRepeat` limits execution of + /// the OCW to at most 4 times per round, for faster collators. + /// + /// Benchmarks logs from tests below are: + /// + /// * exec_time of polkadot miner in WASM with 4 pages is 27369ms + /// * exec_time of kusama miner in WASM with 4 pages is 23848ms + /// + /// See `max_ocw_miner_pages_as_per_weights` test below. pub storage UnsignedPhase: u32 = MINUTES; - pub storage SignedValidationPhase: u32 = Pages::get() *2; + /// * Polkadot: 22_500 + /// * Kusama: 12_500 + /// + /// Reasoning: Yielding 703 nominators per page in both. See [`Pages`] for more info. Path to + /// Upgrade: We may wish to increase the number of "active nominators" in both networks by 1) + /// increasing the `Pages` and `MaxElectingVoters` in sync. This update needs to happen while an + /// election is NOT ongoing. pub storage MaxElectingVoters: u32 = 1000; - /// Maximum number of validators that we may want to elect. 1000 is the end target. - pub const MaxValidatorSet: u32 = 1000; + /// * Polkadot: 2000 (always equal to `staking.maxValidatorCount`) + /// * Kusama: 4000 (always equal to `staking.maxValidatorCount`) + /// + /// Reasoning: As of now, we don't have a way to sort validators, so we wish to select all of + /// them. In case this limit is reached, governance should introduce `minValidatorBond`, and + /// validators would have to compete with their self-stake to force-chill one another. More + /// info: SRL-417 + pub storage TargetSnapshotPerBlock: u32 = 4000; - /// Number of election pages that we operate upon. - pub storage Pages: u32 = 4; + // NOTE: rest of the parameters are computed identically in both Kusama and Polkadot. - /// Number of nominators per page of the snapshot, and consequently number of backers in the solution. - pub VoterSnapshotPerBlock: u32 = MaxElectingVoters::get() / Pages::get(); + /// Allow OCW miner to at most run 4 times in the entirety of the 10m Unsigned Phase. + pub OffchainRepeat: u32 = UnsignedPhase::get() / 4; + + /// Upper bound of `Staking.ValidatorCount`, which translates to + /// `ElectionProvider::DesiredTargets`. 1000 is the end-game for both Kusama and Polkadot for + /// the foreseeable future. + pub const MaxValidatorSet: u32 = 1000; - /// Number of validators per page of the snapshot. - pub const TargetSnapshotPerBlock: u32 = MaxValidatorSet::get(); + /// Number of nominators per page of the snapshot, and consequently number of backers in the + /// solution. + /// + /// 703 in both Polkadot and Kusama. + pub VoterSnapshotPerBlock: u32 = MaxElectingVoters::get() / Pages::get(); /// In each page, we may observe up to all of the validators. pub const MaxWinnersPerPage: u32 = MaxValidatorSet::get(); - /// In each page of the election, we allow up to all of the nominators of that page to be present. + /// In each page of the election, we allow up to all of the nominators of that page to be + /// present. + /// + /// This in essence translates to "no limit on this as of now". pub MaxBackersPerWinner: u32 = VoterSnapshotPerBlock::get(); - /// Total number of backers per winner across all pages. This is not used in the code yet. + /// Total number of backers per winner across all pages. + /// + /// This in essence translates to "no limit on this as of now". pub MaxBackersPerWinnerFinal: u32 = MaxElectingVoters::get(); - /// Size of the exposures. This should be small enough to make the reward payouts feasible. - pub const MaxExposurePageSize: u32 = 64; + /// Size of the exposures. This should be small enough to make the reward payouts cheap and + /// lightweight per-page. + // TODO: this is currently 512 in all networks, but 64 might yield better PoV, need to check logs. + pub const MaxExposurePageSize: u32 = 512; + + /// Each solution is considered "better" if it is an epsilon better than the previous one. + pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(1u32, 10_000); +} + +// Signed phase parameters. +parameter_types! { + /// * Polkadot: 16 + /// * Kusama: 8 + /// + /// Reasoning: This is double the capacity of verification. There is no point for someone to be + /// a submitter if they cannot be verified, yet, it is beneficial to act as a "reserve", in case + /// someone bails out last minute. + pub MaxSubmissions: u32 = 8; + + /// * Polkadot: Geometric progression with starting value 4 DOT, common factor 2. For 16 + /// submissions, it will be [4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, + /// 32768, 65536, 131072]. Sum is `262140 DOT` for all 16 submissions. + /// * Kusama: Geometric progression with with starting value 0.1 KSM, common factor 4. For 8 + /// submissions, values will be: `[0.1, 0.4, 1.6, 6.4, 25.6, 102.4, 409.6, 1638.4]`. Sum is + /// `2184.5 KSM` for all 8 submissions. + pub DepositBase: Balance = 5 * UNITS; + + /// * Polkadot: standard byte deposit configured in PAH. + /// * Kusama: standard byte deposit configured in KAH. + /// + /// TODO: need a maximum solution length for each runtime. + pub DepositPerPage: Balance = 1 * UNITS; + + /// * Polkadot: 20 DOT + /// * Kusama: 1 KSM + /// + /// + /// Fixed deposit for invulnerable accounts. + pub InvulnerableDeposit: Balance = UNITS; + + /// * Polkadot: 20% + /// * Kusama: 10% + /// + /// Reasoning: The weight/fee of the `bail` transaction is already assuming you delete all pages + /// of your solution while bailing, and charges you accordingly. So the chain is being + /// compensated. The risk would be for an attacker to submit a lot of high score pages, and bail + /// at the end to avoid getting slashed. + pub BailoutGraceRatio: Perbill = Perbill::from_percent(5); + + /// * Polkadot: 100% + /// * Kusama: 100% + /// + /// The transaction fee of `register` takes into account the cost of possibly ejecting another + /// submission into account. In the scenario that the honest submitter is being ejected by an + /// attacker, the cost is on the attacker, and having 100% grace ratio here is only to the + /// benefit of the honest submitter. + pub EjectGraceRatio: Perbill = Perbill::from_percent(50); - /// Each solution is considered "better" if it is 0.01% better. - pub storage SolutionImprovementThreshold: Perbill = Perbill::from_rational(1u32, 10_000); + /// * Polkadot: 5 DOTs per era/day + /// * Kusama: 1 KSM per era/6h + pub RewardBase: Balance = 10 * UNITS; } +// * Polkadot: as seen here. +// * Kusama, we will use a similar type, but with 24 as the maximum filed length. +// +// Reasoning: using u16, we can have up to 65,536 nominators and validators represented in the +// snapshot. If we every go beyond this, we have to first adjust this type. frame_election_provider_support::generate_solution_type!( #[compact] pub struct NposCompactSolution16::< @@ -128,16 +305,6 @@ impl multi_block::verifier::Config for Runtime { type WeightInfo = multi_block::weights::polkadot::MultiBlockVerifierWeightInfo; } -parameter_types! { - pub BailoutGraceRatio: Perbill = Perbill::from_percent(50); - pub EjectGraceRatio: Perbill = Perbill::from_percent(50); - pub DepositBase: Balance = 5 * UNITS; - pub DepositPerPage: Balance = 1 * UNITS; - pub InvulnerableDeposit: Balance = 1 * UNITS; - pub RewardBase: Balance = 10 * UNITS; - pub MaxSubmissions: u32 = 8; -} - impl multi_block::signed::Config for Runtime { type Currency = Balances; type BailoutGraceRatio = BailoutGraceRatio; @@ -154,17 +321,21 @@ impl multi_block::signed::Config for Runtime { parameter_types! { /// Priority of the offchain miner transactions. pub MinerTxPriority: TransactionPriority = TransactionPriority::max_value() / 2; +} - /// 1 hour session, 15 minutes unsigned phase, 4 offchain executions. - pub OffchainRepeat: BlockNumber = UnsignedPhase::get() / 4; +pub struct Balancing; +impl Get> for Balancing { + fn get() -> Option { + Some(BalancingConfig { iterations: 10, tolerance: 0 }) + } } impl multi_block::unsigned::Config for Runtime { - type MinerPages = ConstU32<4>; - type OffchainStorage = ConstBool; - type OffchainSolver = SequentialPhragmen>; + type MinerPages = MinerPages; + type OffchainSolver = SequentialPhragmen, Balancing>; type MinerTxPriority = MinerTxPriority; type OffchainRepeat = OffchainRepeat; + type OffchainStorage = ConstBool; type WeightInfo = multi_block::weights::polkadot::MultiBlockUnsignedWeightInfo; } @@ -485,8 +656,16 @@ where #[cfg(test)] mod tests { use super::*; + use frame_election_provider_support::ElectionProvider; use frame_support::weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MILLIS}; - use pallet_staking_async::WeightInfo; + use pallet_election_provider_multi_block::{ + self as mb, signed::WeightInfo as _, unsigned::WeightInfo as _, + }; + use pallet_staking_async::weights::WeightInfo; + use remote_externalities::{ + Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport, + }; + use std::env::var; fn weight_diff(block: Weight, op: Weight) { log::info!( @@ -518,4 +697,130 @@ mod tests { let block_weight = ::BlockWeights::get().max_block; weight_diff(block_weight, prune_era); } + + #[test] + fn signed_weight_ratios() { + sp_tracing::try_init_simple(); + let block_weight = ::BlockWeights::get().max_block; + let polkadot_signed_submission = + mb::weights::polkadot::MultiBlockSignedWeightInfo::::submit_page(); + let kusama_signed_submission = + mb::weights::kusama::MultiBlockSignedWeightInfo::::submit_page(); + + log::info!(target: "runtime", "Polkadot:"); + weight_diff(block_weight, polkadot_signed_submission); + log::info!(target: "runtime", "Kusama:"); + weight_diff(block_weight, kusama_signed_submission); + } + + #[test] + fn election_duration() { + sp_tracing::try_init_simple(); + sp_io::TestExternalities::default().execute_with(|| { + super::enable_dot_preset(false); + let duration = mb::Pallet::::average_election_duration(); + let polkadot_session = 6 * HOURS; + log::info!( + target: "runtime", + "Polkadot election duration: {:?}, session: {:?} ({} sessions)", + duration, + polkadot_session, + duration / polkadot_session + ); + }); + + sp_io::TestExternalities::default().execute_with(|| { + super::enable_ksm_preset(false); + let duration = mb::Pallet::::average_election_duration(); + let kusama_session = 1 * HOURS; + log::info!( + target: "runtime", + "Kusama election duration: {:?}, session: {:?} ({} sessions)", + duration, + kusama_session, + duration / kusama_session + ); + }); + } + + #[test] + fn max_ocw_miner_pages_as_per_weights() { + sp_tracing::try_init_simple(); + for p in 1..=32 { + log::info!( + target: "runtime", + "exec_time of polkadot miner in WASM with {} pages is {:?}ms", + p, + mb::weights::polkadot::MultiBlockUnsignedWeightInfo::::mine_solution(p).ref_time() / WEIGHT_REF_TIME_PER_MILLIS + ); + } + for p in 1..=16 { + log::info!( + target: "runtime", + "exec_time of kusama miner in WASM with {} pages is {:?}ms", + p, + mb::weights::kusama::MultiBlockUnsignedWeightInfo::::mine_solution(p).ref_time() / WEIGHT_REF_TIME_PER_MILLIS + ); + } + } + + /// Run it like: + /// + /// ```text + /// RUST_BACKTRACE=full \ + /// RUST_LOG=remote-ext=info,runtime::staking-async=debug \ + /// REMOTE_TESTS=1 \ + /// WS=ws://127.0.0.1:9999 \ + /// cargo test --release -p pallet-staking-async-parachain-runtime \ + /// --features try-runtime run_try + /// ``` + /// + /// Just replace the node with your local node. + /// + /// Pass `SNAP=polkadot` or similar to store and reuse a snapshot. + #[tokio::test] + async fn run_election_with_pages() { + if var("REMOTE_TESTS").is_err() { + return; + } + sp_tracing::try_init_simple(); + + let transport: Transport = + var("WS").unwrap_or("wss://westend-rpc.polkadot.io:443".to_string()).into(); + let maybe_state_snapshot: Option = var("SNAP").map(|s| s.into()).ok(); + + let mut ext = Builder::::default() + .mode(if let Some(state_snapshot) = maybe_state_snapshot { + Mode::OfflineOrElseOnline( + OfflineConfig { state_snapshot: state_snapshot.clone() }, + OnlineConfig { + transport, + hashed_prefixes: vec![vec![]], + state_snapshot: Some(state_snapshot), + ..Default::default() + }, + ) + } else { + Mode::Online(OnlineConfig { + hashed_prefixes: vec![vec![]], + transport, + ..Default::default() + }) + }) + .build() + .await + .unwrap(); + ext.execute_with(|| { + sp_core::crypto::set_default_ss58_version(1u8.into()); + super::enable_dot_preset(true); + + // prepare all snapshot in EPMB pallet. + mb::Pallet::::asap(); + for page in 1..=32 { + mb::unsigned::miner::OffchainWorkerMiner::::mine_solution(page, true) + .inspect(|p| log::info!(target: "runtime", "{:?}", p.score.pretty("DOT", 10))) + .unwrap(); + } + }); + } } diff --git a/substrate/frame/staking-async/runtimes/preset-store/Cargo.toml b/substrate/frame/staking-async/runtimes/preset-store/Cargo.toml new file mode 100644 index 0000000000000..95f5520d0d58b --- /dev/null +++ b/substrate/frame/staking-async/runtimes/preset-store/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "pallet-staking-async-preset-store" +version = "0.1.0" +publish = false +authors.workspace = true +edition.workspace = true +description = "Simple pallet to store the preset used to generate a runtime's genesis in state" +license.workspace = true +homepage.workspace = true +repository.workspace = true + + +[dependencies] +codec = { workspace = true } +frame = { workspace = true, features = ["runtime"] } +scale-info = { workspace = true } + +[features] +default = ["std"] +std = [ + "codec/std", + "frame/std", + "scale-info/std", +] diff --git a/substrate/frame/staking-async/runtimes/preset-store/src/lib.rs b/substrate/frame/staking-async/runtimes/preset-store/src/lib.rs new file mode 100644 index 0000000000000..bd5f63b0d9150 --- /dev/null +++ b/substrate/frame/staking-async/runtimes/preset-store/src/lib.rs @@ -0,0 +1,53 @@ +// This file is part of Substrate. + +// 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. + +//! Simple pallet that stores the preset that was used to generate the genesis state in the state. + +#![cfg_attr(not(feature = "std"), no_std)] + +pub use pallet::*; + +#[frame::pallet] +pub mod pallet { + extern crate alloc; + use frame::prelude::*; + + #[pallet::storage] + #[pallet::getter(fn preset)] + #[pallet::unbounded] + pub type Preset = StorageValue<_, alloc::string::String, OptionQuery>; + + #[pallet::genesis_config] + #[derive(DefaultNoBound, DebugNoBound, CloneNoBound, PartialEqNoBound, EqNoBound)] + pub struct GenesisConfig { + pub preset: alloc::string::String, + pub _marker: core::marker::PhantomData, + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + Preset::::put(self.preset.clone()); + } + } + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet(_); +} diff --git a/substrate/frame/staking-async/runtimes/rc/Cargo.toml b/substrate/frame/staking-async/runtimes/rc/Cargo.toml index 32a0f40477e79..5f9987431b3c6 100644 --- a/substrate/frame/staking-async/runtimes/rc/Cargo.toml +++ b/substrate/frame/staking-async/runtimes/rc/Cargo.toml @@ -8,6 +8,7 @@ edition.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true +publish = false [lints] workspace = true @@ -76,11 +77,13 @@ pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } pallet-recovery = { workspace = true } pallet-referenda = { workspace = true } +pallet-root-offences = { workspace = true } pallet-root-testing = { workspace = true } pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-staking = { workspace = true } pallet-staking-async-ah-client = { workspace = true } +pallet-staking-async-preset-store = { workspace = true } pallet-staking-async-rc-client = { workspace = true } pallet-staking-async-rc-runtime-constants = { workspace = true } pallet-sudo = { workspace = true } @@ -167,11 +170,13 @@ std = [ "pallet-proxy/std", "pallet-recovery/std", "pallet-referenda/std", + "pallet-root-offences/std", "pallet-root-testing/std", "pallet-scheduler/std", "pallet-session-benchmarking?/std", "pallet-session/std", "pallet-staking-async-ah-client/std", + "pallet-staking-async-preset-store/std", "pallet-staking-async-rc-client/std", "pallet-staking-async-rc-runtime-constants/std", "pallet-staking/std", @@ -249,6 +254,7 @@ runtime-benchmarks = [ "pallet-proxy/runtime-benchmarks", "pallet-recovery/runtime-benchmarks", "pallet-referenda/runtime-benchmarks", + "pallet-root-offences/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-session-benchmarking/runtime-benchmarks", "pallet-staking-async-ah-client/runtime-benchmarks", @@ -305,6 +311,7 @@ try-runtime = [ "pallet-proxy/try-runtime", "pallet-recovery/try-runtime", "pallet-referenda/try-runtime", + "pallet-root-offences/try-runtime", "pallet-root-testing/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", diff --git a/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs b/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs index 5eef94721a726..33eb3791efb0a 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs @@ -22,7 +22,8 @@ use crate::{ }; #[cfg(not(feature = "std"))] use alloc::format; -use alloc::{vec, vec::Vec}; +use alloc::{string::ToString, vec, vec::Vec}; +use core::panic; use frame_support::build_struct_json_patch; use pallet_staking_async_rc_runtime_constants::currency::UNITS as WND; use polkadot_primitives::{AccountId, AssignmentId, SchedulerParams, ValidatorId}; @@ -75,10 +76,6 @@ fn get_authority_keys_from_seed_no_beefy( ) } -fn testnet_accounts() -> Vec { - Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect() -} - fn westend_session_keys( babe: BabeId, grandpa: GrandpaId, @@ -164,9 +161,10 @@ fn westend_testnet_genesis( BeefyId, )>, root_key: AccountId, - endowed_accounts: Option>, + preset: alloc::string::String, ) -> serde_json::Value { - let endowed_accounts: Vec = endowed_accounts.unwrap_or_else(testnet_accounts); + let endowed_accounts = + Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect::>(); const ENDOWMENT: u128 = 1_000_000 * WND; @@ -197,6 +195,7 @@ fn westend_testnet_genesis( sudo: SudoConfig { key: Some(root_key) }, configuration: ConfigurationConfig { config: default_parachains_host_configuration() }, registrar: RegistrarConfig { next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID }, + preset_store: crate::PresetStoreConfig { preset, ..Default::default() }, staking_ah_client: StakingAhClientConfig { operating_mode: pallet_staking_async_ah_client::OperatingMode::Active, ..Default::default() @@ -204,192 +203,30 @@ fn westend_testnet_genesis( }) } -// staging_testnet -fn westend_staging_testnet_config_genesis() -> serde_json::Value { - use hex_literal::hex; - use sp_core::crypto::UncheckedInto; - - // Following keys are used in genesis config for development chains. - // DO NOT use them in production chains as the secret seed is public. - // - // SECRET_SEED="slow awkward present example safe bundle science ocean cradle word tennis earn" - // subkey inspect -n polkadot "$SECRET_SEED" - let endowed_accounts: Vec = vec![ - // 15S75FkhCWEowEGfxWwVfrW3LQuy8w8PNhVmrzfsVhCMjUh1 - hex!["c416837e232d9603e83162ef4bda08e61580eeefe60fe92fc044aa508559ae42"].into(), - ]; - // SECRET=$SECRET_SEED ./scripts/prepare-test-net.sh 4 - let initial_authorities: Vec<( - AccountId, - AccountId, - BabeId, - GrandpaId, - ValidatorId, - AssignmentId, - AuthorityDiscoveryId, - BeefyId, - )> = Vec::from([ - ( - //5EvydUTtHvt39Khac3mMxNPgzcfu49uPDzUs3TL7KEzyrwbw - hex!["7ecfd50629cdd246649959d88d490b31508db511487e111a52a392e6e458f518"].into(), - //5HQyX5gyy77m9QLXguAhiwjTArHYjYspeY98dYDu1JDetfZg - hex!["eca2cca09bdc66a7e6d8c3d9499a0be2ad4690061be8a9834972e17d13d2fe7e"].into(), - //5G13qYRudTyttwTJvHvnwp8StFtcfigyPnwfD4v7LNopsnX4 - hex!["ae27367cb77850fb195fe1f9c60b73210409e68c5ad953088070f7d8513d464c"] - .unchecked_into(), - //5Eb7wM65PNgtY6e33FEAzYtU5cRTXt6WQvZTnzaKQwkVcABk - hex!["6faae44b21c6f2681a7f60df708e9f79d340f7d441d28bd987fab8d05c6487e8"] - .unchecked_into(), - //5FqMLAgygdX9UqzukDp15Uid9PAKdFAR621U7xtp5ut2NfrW - hex!["a6c1a5b501985a83cb1c37630c5b41e6b0a15b3675b2fd94694758e6cfa6794d"] - .unchecked_into(), - //5DhXAV75BKvF9o447ikWqLttyL2wHtLMFSX7GrsKF9Ny61Ta - hex!["485051748ab9c15732f19f3fbcf1fd00a6d9709635f084505107fbb059c33d2f"] - .unchecked_into(), - //5GNHfmrtWLTawnGCmc39rjAEiW97vKvE7DGePYe4am5JtE4i - hex!["be59ed75a72f7b47221ce081ba4262cf2e1ea7867e30e0b3781822f942b97677"] - .unchecked_into(), - //5DA6Z8RUF626stn94aTRBCeobDCYcFbU7Pdk4Tz1R9vA8B8F - hex!["0207e43990799e1d02b0507451e342a1240ff836ea769c57297589a5fd072ad8f4"] - .unchecked_into(), - ), - ( - //5DFpvDUdCgw54E3E357GR1PyJe3Ft9s7Qyp7wbELAoJH9RQa - hex!["34b7b3efd35fcc3c1926ca065381682b1af29b57dabbcd091042c6de1d541b7d"].into(), - //5DZSSsND5wCjngvyXv27qvF3yPzt3MCU8rWnqNy4imqZmjT8 - hex!["4226796fa792ac78875e023ff2e30e3c2cf79f0b7b3431254cd0f14a3007bc0e"].into(), - //5CPrgfRNDQvQSnLRdeCphP3ibj5PJW9ESbqj2fw29vBMNQNn - hex!["0e9b60f04be3bffe362eb2212ea99d2b909b052f4bff7c714e13c2416a797f5d"] - .unchecked_into(), - //5FXFsPReTUEYPRNKhbTdUathcWBsxTNsLbk2mTpYdKCJewjA - hex!["98f4d81cb383898c2c3d54dab28698c0f717c81b509cb32dc6905af3cc697b18"] - .unchecked_into(), - //5CZjurB78XbSHf6SLkLhCdkqw52Zm7aBYUDdfkLqEDWJ9Zhj - hex!["162508accd470e379b04cb0c7c60b35a7d5357e84407a89ed2dd48db4b726960"] - .unchecked_into(), - //5DkAqCtSjUMVoJFauuGoAbSEgn2aFCRGziKJiLGpPwYgE1pS - hex!["4a559c028b69a7f784ce553393e547bec0aa530352157603396d515f9c83463b"] - .unchecked_into(), - //5GsBt9MhGwkg8Jfb1F9LAy2kcr88WNyNy4L5ezwbCr8NWKQU - hex!["d464908266c878acbf181bf8fda398b3aa3fd2d05508013e414aaece4cf0d702"] - .unchecked_into(), - //5DtJVkz8AHevEnpszy3X4dUcPvACW6x1qBMQZtFxjexLr5bq - hex!["02fdf30222d2cb88f2376d558d3de9cb83f9fde3aa4b2dd40c93e3104e3488bcd2"] - .unchecked_into(), - ), - ( - //5E2cob2jrXsBkTih56pizwSqENjE4siaVdXhaD6akLdDyVq7 - hex!["56e0f73c563d49ee4a3971c393e17c44eaa313dabad7fcf297dc3271d803f303"].into(), - //5D4rNYgP9uFNi5GMyDEXTfiaFLjXyDEEX2VvuqBVi3f1qgCh - hex!["2c58e5e1d5aef77774480cead4f6876b1a1a6261170166995184d7f86140572b"].into(), - //5Ea2D65KXqe625sz4uV1jjhSfuigVnkezC8VgEj9LXN7ERAk - hex!["6ed45cb7af613be5d88a2622921e18d147225165f24538af03b93f2a03ce6e13"] - .unchecked_into(), - //5G4kCbgqUhEyrRHCyFwFEkgBZXoYA8sbgsRxT9rY8Tp5Jj5F - hex!["b0f8d2b9e4e1eafd4dab6358e0b9d5380d78af27c094e69ae9d6d30ca300fd86"] - .unchecked_into(), - //5CS7thd2n54WfqeKU3cjvZzK4z5p7zku1Zw97mSzXgPioAAs - hex!["1055100a283968271a0781450b389b9093231be809be1e48a305ebad2a90497e"] - .unchecked_into(), - //5DSaL4ZmSYarZSazhL5NQh7LT6pWhNRDcefk2QS9RxEXfsJe - hex!["3cea4ab74bab4adf176cf05a6e18c1599a7bc217d4c6c217275bfbe3b037a527"] - .unchecked_into(), - //5CaNLkYEbFYXZodXhd3UjV6RNLjFGNLiYafc8X5NooMkZiAq - hex!["169faa81aebfe74533518bda28567f2e2664014c8905aa07ea003336afda5a58"] - .unchecked_into(), - //5ERwhKiePayukzZStMuzGzRJGxGRFpwxYUXVarQpMSMrXzDS - hex!["03429d0d20f6ac5ca8b349f04d014f7b5b864acf382a744104d5d9a51108156c0f"] - .unchecked_into(), - ), - ( - //5H6j9ovzYk9opckVjvM9SvVfaK37ASTtPTzWeRfqk1tgLJUN - hex!["deb804ed2ed2bb696a3dd4ed7de4cd5c496528a2b204051c6ace385bacd66a3a"].into(), - //5DJ51tMW916mGwjMpfS1o9skcNt6Sb28YnZQXaKVg4h89agE - hex!["366da6a748afedb31f07902f2de36ab265beccee37762d3ae1f237de234d9c36"].into(), - //5CSPYDYoCDGSoSLgSp4EHkJ52YasZLHG2woqhPZkdbtNQpke - hex!["1089bc0cd60237d061872925e81d36c9d9205d250d5d8b542c8e08a8ecf1b911"] - .unchecked_into(), - //5ChfdrAqmLjCeDJvynbMjcxYLHYzPe8UWXd3HnX9JDThUMbn - hex!["1c309a70b4e274314b84c9a0a1f973c9c4fc084df5479ef686c54b1ae4950424"] - .unchecked_into(), - //5D8C3HHEp5E8fJsXRD56494F413CdRSR9QKGXe7v5ZEfymdj - hex!["2ee4d78f328db178c54f205ac809da12e291a33bcbd4f29f081ce7e74bdc5044"] - .unchecked_into(), - //5GxeTYCGmp1C3ZRLDkRWqJc6gB2GYmuqnygweuH3vsivMQq6 - hex!["d88e40e3c2c7a7c5abf96ffdd8f7b7bec8798cc277bc97e255881871ab73b529"] - .unchecked_into(), - //5DoGpsgSLcJsHa9B8V4PKjxegWAqDZttWfxicAd68prUX654 - hex!["4cb3863271b70daa38612acd5dae4f5afcb7c165fa277629e5150d2214df322a"] - .unchecked_into(), - //5G1KLjqFyMsPAodnjSRkwRFJztTTEzmZWxow2Q3ZSRCPdthM - hex!["03be5ec86d10a94db89c9b7a396d3c7742e3bec5f85159d4cf308cef505966ddf5"] - .unchecked_into(), - ), - ]); - - const ENDOWMENT: u128 = 1_000_000 * WND; - const STASH: u128 = 100 * WND; - - build_struct_json_patch!(RuntimeGenesisConfig { - balances: BalancesConfig { - balances: endowed_accounts - .iter() - .map(|k: &AccountId| (k.clone(), ENDOWMENT)) - .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) - .collect::>(), - }, - session: SessionConfig { - keys: 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::>(), - }, - - babe: BabeConfig { epoch_config: BABE_GENESIS_EPOCH_CONFIG }, - sudo: SudoConfig { key: Some(endowed_accounts[0].clone()) }, - configuration: ConfigurationConfig { config: default_parachains_host_configuration() }, - registrar: RegistrarConfig { next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID }, - }) -} - -//development -fn westend_development_config_genesis() -> serde_json::Value { - westend_testnet_genesis( - Vec::from([get_authority_keys_from_seed("Alice")]), - Sr25519Keyring::Alice.to_account_id(), - None, - ) -} - -//local_testnet -fn westend_local_testnet_genesis() -> serde_json::Value { - westend_testnet_genesis( - Vec::from([get_authority_keys_from_seed("Alice"), get_authority_keys_from_seed("Bob")]), - Sr25519Keyring::Alice.to_account_id(), - None, - ) -} - /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &PresetId) -> Option> { let patch = match id.as_ref() { - sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => westend_local_testnet_genesis(), - sp_genesis_builder::DEV_RUNTIME_PRESET => westend_development_config_genesis(), - "staging_testnet" => westend_staging_testnet_config_genesis(), - _ => return None, + "real-m" => westend_testnet_genesis( + vec![ + get_authority_keys_from_seed("Alice"), + get_authority_keys_from_seed("Bob"), + get_authority_keys_from_seed("Eve"), + get_authority_keys_from_seed("Dave"), + ], + Sr25519Keyring::Alice.to_account_id(), + id.to_string(), + ), + "real-s" => westend_testnet_genesis( + vec![get_authority_keys_from_seed("Alice"), get_authority_keys_from_seed("Bob")], + Sr25519Keyring::Alice.to_account_id(), + id.to_string(), + ), + "fake-s" => westend_testnet_genesis( + vec![get_authority_keys_from_seed("Alice"), get_authority_keys_from_seed("Bob")], + Sr25519Keyring::Alice.to_account_id(), + id.to_string(), + ), + _ => panic!("Unknown preset ID: {}", id), }; Some( serde_json::to_string(&patch) @@ -400,9 +237,5 @@ pub fn get_preset(id: &PresetId) -> Option> { /// List of supported presets. pub fn preset_names() -> Vec { - vec![ - PresetId::from(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET), - PresetId::from(sp_genesis_builder::DEV_RUNTIME_PRESET), - PresetId::from("staging_testnet"), - ] + vec![PresetId::from("real-m"), PresetId::from("real-s"), PresetId::from("fake-s")] } diff --git a/substrate/frame/staking-async/runtimes/rc/src/lib.rs b/substrate/frame/staking-async/runtimes/rc/src/lib.rs index 00aeb78939d59..9837448fe3827 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/lib.rs @@ -50,7 +50,10 @@ use frame_system::{EnsureRoot, EnsureSigned}; pub use pallet_balances::Call as BalancesCall; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; use pallet_identity::legacy::IdentityInfo; -use pallet_session::historical as session_historical; +use pallet_session::{ + disabling::{DisablingDecision, DisablingStrategy}, + historical as session_historical, +}; use pallet_staking_async_ah_client::{self as ah_client}; use pallet_staking_async_rc_client::{self as rc_client}; pub use pallet_timestamp::Call as TimestampCall; @@ -111,7 +114,7 @@ use sp_runtime::{ transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, FixedU128, KeyTypeId, Percent, Permill, }; -use sp_staking::SessionIndex; +use sp_staking::{offence::OffenceSeverity, SessionIndex}; #[cfg(any(feature = "std", test))] use sp_version::NativeVersion; use sp_version::RuntimeVersion; @@ -343,7 +346,7 @@ impl pallet_preimage::Config for Runtime { parameter_types! { pub const EpochDuration: u64 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS as u64, - 1 * MINUTES as u64 + MINUTES as u64 ); pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; pub const ReportLongevity: u64 = 256 * EpochDuration::get(); @@ -526,16 +529,21 @@ impl sp_runtime::traits::Convert> for IdentityValid /// A testing type that implements SessionManager, it receives a new validator set from /// `StakingAhClient`, but it prevents them from being passed over to the session pallet and /// just uses the previous session keys. -pub struct AckButPreviousSessionValidatorsPersist(core::marker::PhantomData); +pub struct MaybeUsePreviousValidatorsElse(core::marker::PhantomData); impl> pallet_session::SessionManager - for AckButPreviousSessionValidatorsPersist + for MaybeUsePreviousValidatorsElse { fn end_session(end_index: SessionIndex) { >::end_session(end_index); } fn new_session(new_index: SessionIndex) -> Option> { - match >::new_session(new_index) { + let force_use_previous = UsePreviousValidators::get(); + let actual_session_manager = + >::new_session(new_index); + + match actual_session_manager { + Some(new_used) if !force_use_previous => Some(new_used), Some(_new_ignored) => { let current_validators = pallet_session::Validators::::get(); log::info!(target: "runtime", ">> received {} validators, but overriding with {} old ones", _new_ignored.len(), current_validators.len()); @@ -552,18 +560,57 @@ impl> pallet_session::SessionManage } } +parameter_types! { + pub DisablingLimit: Perbill = Perbill::from_percent(25); + pub storage UsePreviousValidators: bool = false; +} + +/// A naive disabling strategy that always disables the offender for any slash more than `S` +/// severity. +/// +/// Only useful for testing. +/// +/// Never re-enables any validators. +pub struct AlwaysDisableForSlashGreaterThan(core::marker::PhantomData); +impl> DisablingStrategy for AlwaysDisableForSlashGreaterThan { + fn decision( + offender_stash: &AccountId, + offender_slash_severity: OffenceSeverity, + _currently_disabled: &Vec<(u32, OffenceSeverity)>, + ) -> DisablingDecision { + let meets_threshold = offender_slash_severity.0 >= S::get(); + let offender_index = pallet_session::Validators::::get() + .iter() + .position(|v| v == offender_stash) + .map(|i| i as u32); + let disable = match offender_index { + Some(index) if meets_threshold => Some(index), + _ => { + log::warn!( + target: "runtime", + "Offender {:?} (index = {:?}) with severity {:?} does not meet the threshold of {:?}, or index not found", + offender_stash, offender_index, offender_slash_severity, S::get() + ); + None + }, + }; + + DisablingDecision { disable, reenable: None } + } +} + impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type ValidatorIdOf = IdentityValidatorIdeOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - type SessionManager = AckButPreviousSessionValidatorsPersist< + type SessionManager = MaybeUsePreviousValidatorsElse< session_historical::NoteHistoricalRoot, >; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; - type DisablingStrategy = pallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy; + type DisablingStrategy = AlwaysDisableForSlashGreaterThan; type WeightInfo = weights::pallet_session::WeightInfo; type Currency = Balances; type KeyDeposit = (); @@ -575,6 +622,11 @@ impl session_historical::Config for Runtime { type FullIdentificationOf = ah_client::DefaultExposureOf; } +impl pallet_root_offences::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OffenceHandler = StakingAhClient; +} + pub struct AssetHubLocation; impl Get for AssetHubLocation { fn get() -> Location { @@ -685,7 +737,7 @@ impl pallet_staking_async_ah_client::Config for Runtime { type AdminOrigin = EnsureRoot; type SessionInterface = Self; type SendToAssetHub = StakingXcmToAssetHub; - type MinimumValidatorSetSize = ConstU32<10>; + type MinimumValidatorSetSize = ConstU32<1>; type UnixTime = Timestamp; type PointsPerBlock = ConstU32<20>; type MaxOffenceBatchSize = MaxOffenceBatchSize; @@ -1672,6 +1724,8 @@ impl OnSwap for SwapLeases { } } +impl pallet_staking_async_preset_store::Config for Runtime {} + #[frame_support::runtime(legacy_ordering)] mod runtime { #[runtime::runtime] @@ -1834,6 +1888,8 @@ mod runtime { #[runtime::pallet_index(67)] pub type StakingAhClient = pallet_staking_async_ah_client; + #[runtime::pallet_index(68)] + pub type PresetStore = pallet_staking_async_preset_store; // Migrations pallet #[runtime::pallet_index(98)] @@ -1855,6 +1911,10 @@ mod runtime { #[runtime::pallet_index(102)] pub type RootTesting = pallet_root_testing; + // Root offences pallet + #[runtime::pallet_index(103)] + pub type RootOffences = pallet_root_offences; + // BEEFY Bridges support. #[runtime::pallet_index(200)] pub type Beefy = pallet_beefy; @@ -2855,7 +2915,38 @@ sp_api::impl_runtime_apis! { impl sp_genesis_builder::GenesisBuilder for Runtime { fn build_state(config: Vec) -> sp_genesis_builder::Result { - build_state::(config) + let res = build_state::(config); + + match PresetStore::preset().unwrap().as_str() { + "real-m" => { + log::info!(target: "runtime", "detected real-m preset"); + assert_eq!( + pallet_session::Validators::::get().len(), 4, + "incorrect validator count for real-m preset" + ); + }, + "real-s" => { + log::info!(target: "runtime", "detected real-s preset"); + assert_eq!( + pallet_session::Validators::::get().len(), 2, + "incorrect validator count for real-s preset" + ); + }, + "fake-s" => { + log::info!(target: "runtime", "detected fake-s preset"); + assert_eq!( + pallet_session::Validators::::get().len(), 2, + "incorrect validator count for fake-s preset" + ); + UsePreviousValidators::set(&true); + }, + _ => { + panic!("unrecognized min nominator bond in genesis config: {}", + pallet_staking::MinNominatorBond::::get() + ); + } + } + res } fn get_preset(id: &Option) -> Option> { diff --git a/substrate/frame/staking-async/src/benchmarking.rs b/substrate/frame/staking-async/src/benchmarking.rs index 2b741414fda5e..a004824f7b7c5 100644 --- a/substrate/frame/staking-async/src/benchmarking.rs +++ b/substrate/frame/staking-async/src/benchmarking.rs @@ -24,7 +24,6 @@ use crate::{ ConfigOp, Pallet as Staking, }; use alloc::collections::BTreeMap; -use codec::Decode; pub use frame_benchmarking::{ impl_benchmark_test_suite, v2::*, whitelist_account, whitelisted_caller, BenchmarkError, }; @@ -38,14 +37,13 @@ use frame_support::{ use frame_system::RawOrigin; use pallet_staking_async_rc_client as rc_client; use sp_runtime::{ - traits::{Bounded, One, StaticLookup, TrailingZeroInput, Zero}, + traits::{Bounded, One, StaticLookup, Zero}, Perbill, Percent, Saturating, }; use sp_staking::currency_to_vote::CurrencyToVote; use testing_utils::*; const SEED: u32 = 0; -const MAX_SLASHES: u32 = 1000; // This function clears all existing validators and nominators from the set, and generates one new // validator being nominated by n nominators, and returns the validator stash account and the @@ -312,7 +310,7 @@ mod benchmarks { let (_, controller) = create_stash_controller::(0, 100, RewardDestination::Staked)?; let amount = asset::existential_deposit::() * 5u32.into(); // Half of total Staking::::unbond(RawOrigin::Signed(controller.clone()).into(), amount)?; - CurrentEra::::put(EraIndex::max_value()); + set_active_era::(EraIndex::max_value()); let ledger = Ledger::::get(&controller).ok_or("ledger not created before")?; let original_total: BalanceOf = ledger.total; whitelist_account!(controller); @@ -346,7 +344,7 @@ mod benchmarks { let mut ledger = Ledger::::get(&controller).unwrap(); ledger.active = ed - One::one(); Ledger::::insert(&controller, ledger); - CurrentEra::::put(EraIndex::max_value()); + set_active_era::(EraIndex::max_value()); whitelist_account!(controller); @@ -667,34 +665,39 @@ mod benchmarks { } #[benchmark] - fn cancel_deferred_slash(s: Linear<1, MAX_SLASHES>) { + fn cancel_deferred_slash(s: Linear<1, { T::MaxValidatorSet::get() }>) { let era = EraIndex::one(); - let dummy_account = || T::AccountId::decode(&mut TrailingZeroInput::zeroes()).unwrap(); - - // Insert `s` unapplied slashes with the new key structure - for i in 0..s { - let slash_key = (dummy_account(), Perbill::from_percent(i as u32 % 100), i); - let unapplied_slash = UnappliedSlash:: { - validator: slash_key.0.clone(), - own: Zero::zero(), - others: WeakBoundedVec::default(), - reporter: Default::default(), - payout: Zero::zero(), - }; - UnappliedSlashes::::insert(era, slash_key.clone(), unapplied_slash); - } - let slash_keys: Vec<_> = (0..s) - .map(|i| (dummy_account(), Perbill::from_percent(i as u32 % 100), i)) + // Create validators and insert slashes + let validators: Vec<_> = (0..s) + .map(|i| { + let validator: T::AccountId = account("validator", i, SEED); + + // Insert slash for this validator + let slash_key = (validator.clone(), Perbill::from_percent(10), 0); + let unapplied_slash = UnappliedSlash:: { + validator: validator.clone(), + own: Zero::zero(), + others: WeakBoundedVec::default(), + reporter: Default::default(), + payout: Zero::zero(), + }; + UnappliedSlashes::::insert(era, slash_key, unapplied_slash); + + validator + }) .collect(); + // Convert validators to tuples with 10% slash fraction (matching the slashes created above) + let validator_slashes: Vec<_> = + validators.into_iter().map(|v| (v, Perbill::from_percent(10))).collect(); + #[extrinsic_call] - _(RawOrigin::Root, era, slash_keys.clone()); + _(RawOrigin::Root, era, validator_slashes.clone()); - // Ensure all `s` slashes are removed - for key in &slash_keys { - assert!(UnappliedSlashes::::get(era, key).is_none()); - } + // Ensure cancelled slashes are stored correctly + let cancelled_slashes = CancelledSlashes::::get(era); + assert_eq!(cancelled_slashes.len(), s as usize); } #[benchmark] diff --git a/substrate/frame/staking-async/src/lib.rs b/substrate/frame/staking-async/src/lib.rs index 981acd6ba574d..80c32b06ca251 100644 --- a/substrate/frame/staking-async/src/lib.rs +++ b/substrate/frame/staking-async/src/lib.rs @@ -43,9 +43,136 @@ //! //! TODO //! -//! ## Slashing of Validators and Exposures +//! ## Slashing Pipeline and Withdrawal Restrictions //! -//! TODO +//! This pallet implements a robust slashing mechanism that ensures the integrity of the staking +//! system while preventing stakers from withdrawing funds that might still be subject to slashing. +//! +//! ### Overview of the Slashing Pipeline +//! +//! The slashing process consists of multiple phases: +//! +//! 1. **Offence Reporting**: Offences are reported from the relay chain through `on_new_offences` +//! 2. **Queuing**: Valid offences are added to the `OffenceQueue` for processing +//! 3. **Processing**: Offences are processed incrementally over multiple blocks +//! 4. **Application**: Slashes are either applied immediately or deferred based on configuration +//! +//! ### Phase 1: Offence Reporting +//! +//! Offences are reported from the relay chain (e.g., from BABE, GRANDPA, BEEFY, or parachain +//! modules) through the `on_new_offences` function: +//! +//! ```text +//! struct Offence { +//! offender: AccountId, // The validator being slashed +//! reporters: Vec, // Who reported the offence (may be empty) +//! slash_fraction: Perbill, // Percentage of stake to slash +//! } +//! ``` +//! +//! **Reporting Deadlines**: +//! - With deferred slashing: Offences must be reported within `SlashDeferDuration - 1` eras +//! - With immediate slashing: Offences can be reported up to `BondingDuration` eras old +//! +//! Example: If `SlashDeferDuration = 27` and current era is 100: +//! - Oldest reportable offence: Era 74 (100 - 26) +//! - Offences from era 73 or earlier are rejected +//! +//! ### Phase 2: Queuing +//! +//! When an offence passes validation, it's added to the queue: +//! +//! 1. **Storage**: Added to `OffenceQueue`: `(EraIndex, AccountId) -> OffenceRecord` +//! 2. **Era Tracking**: Era added to `OffenceQueueEras` (sorted vector of eras with offences) +//! 3. **Duplicate Handling**: If an offence already exists for the same validator in the same era, +//! only the higher slash fraction is kept +//! +//! ### Phase 3: Processing +//! +//! Offences are processed incrementally in `on_initialize` each block: +//! +//! ```text +//! 1. Load oldest offence from queue +//! 2. Move to `ProcessingOffence` storage +//! 3. For each exposure page (from last to first): +//! - Calculate slash for validator's own stake +//! - Calculate slash for each nominator (pro-rata based on exposure) +//! - Track total slash and reward amounts +//! 4. Once all pages processed, create `UnappliedSlash` +//! ``` +//! +//! **Key Features**: +//! - **Page-by-page processing**: Large validator sets don't overwhelm a single block +//! - **Pro-rata slashing**: Nominators slashed proportionally to their stake +//! - **Reward calculation**: A portion goes to reporters (if any) +//! +//! ### Phase 4: Application +//! +//! Based on `SlashDeferDuration`, slashes are either: +//! +//! **Immediate (SlashDeferDuration = 0)**: +//! - Applied right away in the same block +//! - Funds deducted from staking ledger immediately +//! +//! **Deferred (SlashDeferDuration > 0)**: +//! - Stored in `UnappliedSlashes` for future application +//! - Applied at era: `offence_era + SlashDeferDuration` +//! - Can be cancelled by governance before application +//! +//! ### Storage Items Involved +//! +//! - `OffenceQueue`: Pending offences to process +//! - `OffenceQueueEras`: Sorted list of eras with offences +//! - `ProcessingOffence`: Currently processing offence +//! - `ValidatorSlashInEra`: Tracks highest slash per validator per era +//! - `UnappliedSlashes`: Deferred slashes waiting for application +//! +//! ### Withdrawal Restrictions +//! +//! To maintain slashing guarantees, withdrawals are restricted: +//! +//! **Withdrawal Era Calculation**: +//! ```text +//! earliest_era_to_withdraw = min( +//! active_era, +//! last_fully_processed_offence_era + BondingDuration +//! ) +//! ``` +//! +//! **Example**: +//! - Active era: 100 +//! - Oldest unprocessed offence: Era 70 +//! - BondingDuration: 28 +//! - Withdrawal allowed only for chunks with era ≤ 97 (70 - 1 + 28) +//! +//! **Withdrawal Timeline Example with an Offence**: +//! ```text +//! Era: 90 91 92 93 94 95 96 97 98 99 100 ... 117 118 +//! | | | | | | | | | | | | | +//! Unbond: U +//! Offence: X +//! Reported: R +//! Processed: P (within next few blocks) +//! Slash Applied: S +//! Withdraw: ❌ ✓ +//! +//! With BondingDuration = 28 and SlashDeferDuration = 27: +//! - User unbonds in era 90 +//! - Offence occurs in era 90 +//! - Reported in era 92 (typically within 2 days, but reportable until Era 116) +//! - Processed in era 92 (within next few blocks after reporting) +//! - Slash deferred for 27 eras, applied at era 117 (90 + 27) +//! - Cannot withdraw unbonded chunks until era 118 (90 + 28) +//! +//! The 28-era bonding duration ensures that any offences committed before or during +//! unbonding have time to be reported, processed, and applied before funds can be +//! withdrawn. This provides a window for governance to cancel slashes that may have +//! resulted from software bugs. +//! ``` +//! +//! **Key Restrictions**: +//! 1. Cannot withdraw if previous era has unapplied slashes +//! 2. Cannot withdraw funds from eras with unprocessed offences #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] @@ -222,7 +349,7 @@ pub struct ValidatorPrefs { } /// Status of a paged snapshot progress. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, Default)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, Default)] pub enum SnapshotStatus { /// Paged snapshot is in progress, the `AccountId` was the last staker iterated in the list. Ongoing(AccountId), @@ -302,7 +429,7 @@ impl { /// The stash ID of the offending validator. diff --git a/substrate/frame/staking-async/src/mock.rs b/substrate/frame/staking-async/src/mock.rs index 279ca6eab8e16..875402d4dee09 100644 --- a/substrate/frame/staking-async/src/mock.rs +++ b/substrate/frame/staking-async/src/mock.rs @@ -1005,3 +1005,22 @@ pub(crate) fn restrict(who: &AccountId) { pub(crate) fn remove_from_restrict_list(who: &AccountId) { RestrictedAccounts::mutate(|l| l.retain(|x| x != who)); } + +pub(crate) fn era_unprocessed_offence_count(era: EraIndex) -> u32 { + OffenceQueue::::iter_prefix_values(era).count() as u32 +} + +pub(crate) fn era_unapplied_slash_count(era: EraIndex) -> u32 { + UnappliedSlashes::::iter_prefix_values(era).count() as u32 +} + +/// A pending slash from the previous era blocks withdrawal. Use this to apply them. +pub(crate) fn apply_pending_slashes_from_previous_era() { + apply_pending_slashes_from_era(active_era() - 1); +} + +pub(crate) fn apply_pending_slashes_from_era(era: EraIndex) { + for (key, _) in UnappliedSlashes::::iter_prefix(era) { + assert_ok!(Staking::apply_slash(RuntimeOrigin::signed(1), era, key)); + } +} diff --git a/substrate/frame/staking-async/src/pallet/impls.rs b/substrate/frame/staking-async/src/pallet/impls.rs index 54bdc8195f1a5..e07daa4b80644 100644 --- a/substrate/frame/staking-async/src/pallet/impls.rs +++ b/substrate/frame/staking-async/src/pallet/impls.rs @@ -42,6 +42,7 @@ use frame_support::{ OnUnbalanced, }, weights::Weight, + StorageDoubleMap, }; use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use pallet_staking_async_rc_client::{self as rc_client}; @@ -209,13 +210,60 @@ impl Pallet { Ok(()) } + /// Calculate the earliest era that withdrawals are allowed for, considering: + /// - The current active era + /// - Any unprocessed offences in the queue + fn calculate_earliest_withdrawal_era(active_era: EraIndex) -> EraIndex { + // get lowest era for which all offences are processed and withdrawals can be allowed. + let earliest_unlock_era_by_offence_queue = OffenceQueueEras::::get() + .as_ref() + .and_then(|eras| eras.first()) + .copied() + // if nothing in queue, use the active era. + .unwrap_or(active_era) + // above returns earliest era for which offences are NOT processed yet, so we subtract + // one from it which gives us the oldest era for which all offences are processed. + .saturating_sub(1) + // Unlock chunks are keyed by the era they were initiated plus Bonding Duration. + // We do the same to processed offence era so they can be compared. + .saturating_add(T::BondingDuration::get()); + + // If there are unprocessed offences older than the active era, withdrawals are only + // allowed up to the last era for which offences have been processed. + // Note: This situation is extremely unlikely, since offences have `SlashDeferDuration` eras + // to be processed. If it ever occurs, it likely indicates offence spam and that we're + // struggling to keep up with processing. + active_era.min(earliest_unlock_era_by_offence_queue) + } + pub(super) fn do_withdraw_unbonded(controller: &T::AccountId) -> Result { let mut ledger = Self::ledger(Controller(controller.clone()))?; let (stash, old_total) = (ledger.stash.clone(), ledger.total); - if let Some(current_era) = CurrentEra::::get() { - ledger = ledger.consolidate_unlocked(current_era) + let active_era = Rotator::::active_era(); + + // Ensure last era slashes are applied. Else we block the withdrawals. + if active_era > 1 { + Self::ensure_era_slashes_applied(active_era.saturating_sub(1))?; } + + let earliest_era_to_withdraw = Self::calculate_earliest_withdrawal_era(active_era); + + log!( + debug, + "Withdrawing unbonded stake. Active_era is: {:?} | \ + Earliest era we can allow withdrawing: {:?}", + active_era, + earliest_era_to_withdraw + ); + + // withdraw unbonded balance from the ledger until earliest_era_to_withdraw. + ledger = ledger.consolidate_unlocked(earliest_era_to_withdraw); + let new_total = ledger.total; + debug_assert!( + new_total <= old_total, + "consolidate_unlocked should never increase the total balance of the ledger" + ); let used_weight = if ledger.unlocking.is_empty() && (ledger.active < Self::min_chilled_bond() || ledger.active.is_zero()) @@ -248,6 +296,14 @@ impl Pallet { Ok(used_weight) } + fn ensure_era_slashes_applied(era: EraIndex) -> Result<(), DispatchError> { + ensure!( + !UnappliedSlashes::::contains_prefix(era), + Error::::UnappliedSlashesInPreviousEra + ); + Ok(()) + } + pub(super) fn do_payout_stakers( validator_stash: T::AccountId, era: EraIndex, @@ -923,11 +979,13 @@ impl ElectionDataProvider for Pallet { log!( debug, - "[page {}, (next) status {:?}, bounds {:?}] generated {} npos voters", + "[page {}, (next) status {:?}, bounds {:?}] generated {} npos voters [first: {:?}, last: {:?}]", page, status, bounds, voters.len(), + voters.first().map(|(x, y, _)| (x, y)), + voters.last().map(|(x, y, _)| (x, y)), ); match status { @@ -958,8 +1016,6 @@ impl ElectionDataProvider for Pallet { } let targets = Self::get_npos_targets(bounds); - // We can't handle this case yet -- return an error. WIP to improve handling this case in - // . if bounds.exhausted(None, CountBound(targets.len() as u32).into()) { return Err("Target snapshot too big") } @@ -1068,9 +1124,8 @@ impl rc_client::AHStakingInterface for Pallet { /// 3. Activate Next Era: When we receive an activation timestamp in the session report, it /// implies a new validator set has been applied, and we must increment the active era to keep /// the systems in sync. - fn on_relay_session_report(report: rc_client::SessionReport) { + fn on_relay_session_report(report: rc_client::SessionReport) -> Weight { log!(debug, "Received session report: {}", report,); - let consumed_weight = T::WeightInfo::rc_on_session_report(); let rc_client::SessionReport { end_index, @@ -1080,26 +1135,40 @@ impl rc_client::AHStakingInterface for Pallet { } = report; debug_assert!(!leftover); + // note: weight for `reward_active_era` is taken care of inside `end_session` Eras::::reward_active_era(validator_points.into_iter()); - session_rotation::Rotator::::end_session(end_index, activation_timestamp); - // NOTE: we might want to either return these weights so that they are registered in the - // rc-client pallet, or directly benchmarked there, such that we can use them in the - // "pre-dispatch" fashion. That said, since these are all `Mandatory` weights, it doesn't - // make that big of a difference. - Self::register_weight(consumed_weight); + session_rotation::Rotator::::end_session(end_index, activation_timestamp) } + fn weigh_on_relay_session_report( + _report: &rc_client::SessionReport, + ) -> Weight { + // worst case weight of this is always + T::WeightInfo::rc_on_session_report() + .saturating_add(T::WeightInfo::prune_era(ValidatorCount::::get())) + } + + /// Accepts offences only if they are from era `active_era - (SlashDeferDuration - 1)` or newer. + /// + /// Slashes for offences are applied `SlashDeferDuration` eras after the offence occurred. + /// Accepting offences older than this range would not leave enough time for slashes to be + /// applied. + /// + /// Note: The validator set report that we send to the relay chain contains the pruning + /// information for a relay chain, but we conservatively keep some extra sessions, so it is + /// possible that an offence report is created for a session between SlashDeferDuration and + /// BondingDuration eras before the active era. But they will be dropped here. fn on_new_offences( slash_session: SessionIndex, offences: Vec>, - ) { + ) -> Weight { log!(debug, "🦹 on_new_offences: {:?}", offences); - let consumed_weight = T::WeightInfo::rc_on_offence(offences.len() as u32); + let weight = T::WeightInfo::rc_on_offence(offences.len() as u32); // Find the era to which offence belongs. let Some(active_era) = ActiveEra::::get() else { log!(warn, "🦹 on_new_offences: no active era; ignoring offence"); - return + return T::WeightInfo::rc_on_offence(0); }; let active_era_start_session = Rotator::::active_era_start_session_index(); @@ -1120,11 +1189,21 @@ impl rc_client::AHStakingInterface for Pallet { // defensive: this implies offence is for a discarded era, and should already be // filtered out. log!(warn, "🦹 on_offence: no era found for slash_session; ignoring offence"); - return + return T::WeightInfo::rc_on_offence(0); }, } }; + let oldest_reportable_offence_era = if T::SlashDeferDuration::get() == 0 { + // this implies that slashes are applied immediately, so we can accept any offence up to + // bonding duration old. + active_era.index.saturating_sub(T::BondingDuration::get()) + } else { + // slashes are deffered, so we only accept offences that are not older than the + // defferal duration. + active_era.index.saturating_sub(T::SlashDeferDuration::get().saturating_sub(1)) + }; + let invulnerables = Invulnerables::::get(); for o in offences { @@ -1136,6 +1215,17 @@ impl rc_client::AHStakingInterface for Pallet { continue } + // ignore offence if too old to report. + if offence_era < oldest_reportable_offence_era { + log!(warn, "🦹 on_new_offences: offence era {:?} too old; Can only accept offences from era {:?} or newer", offence_era, oldest_reportable_offence_era); + Self::deposit_event(Event::::OffenceTooOld { + validator: validator.clone(), + fraction: slash_fraction, + offence_era, + }); + // will emit an event for each validator in the report. + continue; + } let Some(exposure_overview) = >::get(&offence_era, &validator) else { // defensive: this implies offence is for a discarded era, and should already be @@ -1224,7 +1314,7 @@ impl rc_client::AHStakingInterface for Pallet { ) }); } else { - let mut eras = BoundedVec::default(); + let mut eras = WeakBoundedVec::default(); log!(debug, "🦹 inserting offence era {} into empty queue", offence_era); let _ = eras .try_push(offence_era) @@ -1251,7 +1341,14 @@ impl rc_client::AHStakingInterface for Pallet { } } - Self::register_weight(consumed_weight); + weight + } + + fn weigh_on_new_offences( + _slash_session: SessionIndex, + offences: &[pallet_staking_async_rc_client::Offence], + ) -> Weight { + T::WeightInfo::rc_on_offence(offences.len() as u32) } } @@ -1682,6 +1779,7 @@ impl Pallet { Self::check_payees()?; Self::check_paged_exposures()?; Self::check_count()?; + Self::check_slash_health()?; Ok(()) } @@ -1915,6 +2013,70 @@ impl Pallet { .collect::>() } + /// Ensures offence pipeline and slashing is in a healthy state. + fn check_slash_health() -> Result<(), TryRuntimeError> { + // (1) Ensure offence queue is sorted + let offence_queue_eras = OffenceQueueEras::::get().unwrap_or_default().into_inner(); + let mut sorted_offence_queue_eras = offence_queue_eras.clone(); + sorted_offence_queue_eras.sort(); + ensure!( + sorted_offence_queue_eras == offence_queue_eras, + "Offence queue eras are not sorted" + ); + drop(sorted_offence_queue_eras); + + // (2) Ensure oldest offence queue era is old enough. + let active_era = Rotator::::active_era(); + let oldest_unprocessed_offence_era = + offence_queue_eras.first().cloned().unwrap_or(active_era); + + // how old is the oldest unprocessed offence era? + // given bonding duration = 28, the ideal value is between 0 and 2 eras. + // anything close to bonding duration is terrible. + let oldest_unprocessed_offence_age = + active_era.saturating_sub(oldest_unprocessed_offence_era); + + // warn if less than 26 eras old. + if oldest_unprocessed_offence_age > 2.min(T::BondingDuration::get()) { + log!( + warn, + "Offence queue has unprocessed offences from older than 2 eras: oldest offence era in queue {:?} (active era: {:?})", + oldest_unprocessed_offence_era, + active_era + ); + } + + // error if the oldest unprocessed offence era closer to bonding duration. + ensure!( + oldest_unprocessed_offence_age < T::BondingDuration::get() - 1, + "offences from era less than 3 eras old from active era not processed yet" + ); + + // (3) Report count of offences in the queue. + for e in offence_queue_eras { + let count = OffenceQueue::::iter_prefix(e).count(); + ensure!(count > 0, "Offence queue is empty for era listed in offence queue eras"); + log!(info, "Offence queue for era {:?} has {:?} offences queued", e, count); + } + + // (4) Ensure all slashes older than (active era - 1) are applied. + // We will look at all eras before the active era as it can take 1 era for slashes + // to be applied. + for era in (active_era.saturating_sub(T::BondingDuration::get()))..(active_era) { + // all unapplied slashes are expected to be applied until the active era. If this is not + // the case, then we need to use a permissionless call to apply all of them. + // See `Call::apply_slash` for more details. + Self::ensure_era_slashes_applied(era)?; + } + + // (5) Ensure no canceled slashes exist in the past eras. + for (era, _) in CancelledSlashes::::iter() { + ensure!(era >= active_era, "Found cancelled slashes for era before active era"); + } + + Ok(()) + } + fn ensure_ledger_role_and_min_bond(ctrl: &T::AccountId) -> Result<(), TryRuntimeError> { let ledger = Self::ledger(StakingAccount::Controller(ctrl.clone()))?; let stash = ledger.stash; diff --git a/substrate/frame/staking-async/src/pallet/mod.rs b/substrate/frame/staking-async/src/pallet/mod.rs index 8664f3faad774..1eaf56e58328f 100644 --- a/substrate/frame/staking-async/src/pallet/mod.rs +++ b/substrate/frame/staking-async/src/pallet/mod.rs @@ -733,7 +733,7 @@ pub mod pallet { /// This eliminates the need for expensive iteration and sorting when fetching the next offence /// to process. #[pallet::storage] - pub type OffenceQueueEras = StorageValue<_, BoundedVec>; + pub type OffenceQueueEras = StorageValue<_, WeakBoundedVec>; /// Tracks the currently processed offence record from the `OffenceQueue`. /// @@ -764,6 +764,20 @@ pub mod pallet { OptionQuery, >; + /// Cancelled slashes by era and validator with maximum slash fraction to be cancelled. + /// + /// When slashes are cancelled by governance, this stores the era and the validators + /// whose slashes should be cancelled, along with the maximum slash fraction that should + /// be cancelled for each validator. + #[pallet::storage] + pub type CancelledSlashes = StorageMap< + _, + Twox64Concat, + EraIndex, + BoundedVec<(T::AccountId, Perbill), T::MaxValidatorSet>, + ValueQuery, + >; + /// All slashing events on validators, mapped by era to the highest slash proportion /// and slash value of the era. #[pallet::storage] @@ -986,6 +1000,8 @@ pub mod pallet { )); }); + // This allows us to work with configs like `dev_stakers: (0, 10)`. Don't create new + // validators, just add a bunch of nominators. Useful for slashing tests. let all_validators = Validators::::iter_keys().collect::>(); (0..nominators).for_each(|index| { @@ -1140,8 +1156,7 @@ pub mod pallet { /// An unapplied slash has been cancelled. SlashCancelled { slash_era: EraIndex, - slash_key: (T::AccountId, Perbill, u32), - payout: BalanceOf, + validator: T::AccountId, }, /// Session change has been triggered. /// @@ -1155,6 +1170,16 @@ pub mod pallet { /// Something occurred that should never happen under normal operation. /// Logged as an event for fail-safe observability. Unexpected(UnexpectedKind), + /// An offence was reported that was too old to be processed, and thus was dropped. + OffenceTooOld { + offence_era: EraIndex, + validator: T::AccountId, + fraction: Perbill, + }, + /// An old era with the given index was pruned. + EraPruned { + index: EraIndex, + }, } /// Represents unexpected or invariant-breaking conditions encountered during execution. @@ -1244,6 +1269,9 @@ pub mod pallet { /// Account is restricted from participation in staking. This may happen if the account is /// staking in another way already, such as via pool. Restricted, + /// Unapplied slashes in the recently concluded era is blocking this operation. + /// See `Call::apply_slash` to apply them. + UnappliedSlashesInPreviousEra, } impl Pallet { @@ -1257,12 +1285,37 @@ pub mod pallet { slash, active_era, ); - let offence_era = active_era.saturating_sub(T::SlashDeferDuration::get()); - slashing::apply_slash::(slash, offence_era); - // remove the slash + + // Check if this slash has been cancelled + let cancelled_slashes = CancelledSlashes::::get(&active_era); + let is_cancelled = cancelled_slashes.iter().any(|(validator, cancel_fraction)| { + *validator == key.0 && *cancel_fraction >= key.1 + }); + + if is_cancelled { + crate::log!( + debug, + "🦹 slash for {:?} in era {:?} was cancelled, skipping", + key.0, + active_era, + ); + } else { + let offence_era = active_era.saturating_sub(T::SlashDeferDuration::get()); + slashing::apply_slash::(slash, offence_era); + } + + // Always remove the slash from UnappliedSlashes UnappliedSlashes::::remove(&active_era, &key); + + // Check if there are more slashes for this era + if UnappliedSlashes::::iter_prefix(&active_era).next().is_none() { + // No more slashes for this era, clear CancelledSlashes + CancelledSlashes::::remove(&active_era); + } + T::WeightInfo::apply_slash() } else { + // No slashes found for this era T::DbWeight::get().reads(1) } } @@ -1414,8 +1467,8 @@ pub mod pallet { let unlocking = Self::ledger(Controller(controller.clone())).map(|l| l.unlocking.len())?; - // if there are no unlocking chunks available, try to withdraw chunks older than - // `BondingDuration` to proceed with the unbonding. + // if there are no unlocking chunks available, try to remove any chunks by withdrawing + // funds that have fully unbonded. let maybe_withdraw_weight = { if unlocking == T::MaxUnlockingChunks::get() as usize { Some(Self::do_withdraw_unbonded(&controller)?) @@ -1457,10 +1510,11 @@ pub mod pallet { // If a user runs into this error, they should chill first. ensure!(ledger.active >= min_active_bond, Error::::InsufficientBond); - // Note: in case there is no current era it is fine to bond one era more. - let era = CurrentEra::::get() - .unwrap_or(0) - .defensive_saturating_add(T::BondingDuration::get()); + // Note: we used current era before, but that is meant to be used for only election. + // The right value to use here is the active era. + + let era = session_rotation::Rotator::::active_era() + .saturating_add(T::BondingDuration::get()); if let Some(chunk) = ledger.unlocking.last_mut().filter(|chunk| chunk.era == era) { // To keep the chunk count down, we only keep one chunk per era. Since // `unlocking` is a FiFo queue, if a chunk exists for `era` we know that it will @@ -1492,10 +1546,14 @@ pub mod pallet { Ok(actual_weight.into()) } - /// Remove any unlocked chunks from the `unlocking` queue from our management. + /// Remove any stake that has been fully unbonded and is ready for withdrawal. /// - /// This essentially frees up that balance to be used by the stash account to do whatever - /// it wants. + /// Stake is considered fully unbonded once [`Config::BondingDuration`] has elapsed since + /// the unbonding was initiated. In rare cases—such as when offences for the unbonded era + /// have been reported but not yet processed—withdrawal is restricted to eras for which + /// all offences have been processed. + /// + /// The unlocked stake will be returned as free balance in the stash account. /// /// The dispatch origin for this call must be _Signed_ by the controller. /// @@ -1505,8 +1563,8 @@ pub mod pallet { /// /// ## Parameters /// - /// - `num_slashing_spans`: **Deprecated**. This parameter is retained for backward - /// compatibility. It no longer has any effect. + /// - `num_slashing_spans`: **Deprecated**. Retained only for backward compatibility; this + /// parameter has no effect. #[pallet::call_index(3)] #[pallet::weight(T::WeightInfo::withdraw_unbonded_kill())] pub fn withdraw_unbonded( @@ -1856,33 +1914,47 @@ pub mod pallet { /// Cancels scheduled slashes for a given era before they are applied. /// - /// This function allows `T::AdminOrigin` to selectively remove pending slashes from - /// the `UnappliedSlashes` storage, preventing their enactment. + /// This function allows `T::AdminOrigin` to cancel pending slashes for specified validators + /// in a given era. The cancelled slashes are stored and will be checked when applying + /// slashes. /// /// ## Parameters - /// - `era`: The staking era for which slashes were deferred. - /// - `slash_keys`: A list of slash keys identifying the slashes to remove. This is a tuple - /// of `(stash, slash_fraction, page_index)`. + /// - `era`: The staking era for which slashes should be cancelled. + /// - `validator_slashes`: A list of validator stash accounts and their slash fractions to + /// be cancelled. #[pallet::call_index(17)] - #[pallet::weight(T::WeightInfo::cancel_deferred_slash(slash_keys.len() as u32))] + #[pallet::weight(T::WeightInfo::cancel_deferred_slash(validator_slashes.len() as u32))] pub fn cancel_deferred_slash( origin: OriginFor, era: EraIndex, - slash_keys: Vec<(T::AccountId, Perbill, u32)>, + validator_slashes: Vec<(T::AccountId, Perbill)>, ) -> DispatchResult { T::AdminOrigin::ensure_origin(origin)?; - ensure!(!slash_keys.is_empty(), Error::::EmptyTargets); - - // Remove the unapplied slashes. - slash_keys.into_iter().for_each(|i| { - UnappliedSlashes::::take(&era, &i).map(|unapplied_slash| { - Self::deposit_event(Event::::SlashCancelled { - slash_era: era, - slash_key: i, - payout: unapplied_slash.payout, - }); - }); - }); + ensure!(!validator_slashes.is_empty(), Error::::EmptyTargets); + + // Get current cancelled slashes for this era + let mut cancelled_slashes = CancelledSlashes::::get(&era); + + // Process each validator slash + for (validator, slash_fraction) in validator_slashes { + // Since this is gated by admin origin, we don't need to check if they are really + // validators and trust governance to correctly set the parameters. + + // Remove any existing entry for this validator + cancelled_slashes.retain(|(v, _)| v != &validator); + + // Add the validator with the specified slash fraction + cancelled_slashes + .try_push((validator.clone(), slash_fraction)) + .map_err(|_| Error::::BoundNotMet) + .defensive_proof("cancelled_slashes should have capacity for all validators")?; + + Self::deposit_event(Event::::SlashCancelled { slash_era: era, validator }); + } + + // Update storage + CancelledSlashes::::insert(&era, cancelled_slashes); + Ok(()) } @@ -2440,11 +2512,21 @@ pub mod pallet { Ok(Pays::No.into()) } - /// Manually applies a deferred slash for a given era. + /// Manually and permissionlessly applies a deferred slash for a given era. /// /// Normally, slashes are automatically applied shortly after the start of the `slash_era`. - /// This function exists as a **fallback mechanism** in case slashes were not applied due to - /// unexpected reasons. It allows anyone to manually apply an unapplied slash. + /// The automatic application of slashes is handled by the pallet's internal logic, and it + /// tries to apply one slash page per block of the era. + /// If for some reason, one era is not enough for applying all slash pages, the remaining + /// slashes need to be manually (permissionlessly) applied. + /// + /// For a given era x, if at era x+1, slashes are still unapplied, all withdrawals get + /// blocked, and these need to be manually applied by calling this function. + /// This function exists as a **fallback mechanism** for this extreme situation, but we + /// never expect to encounter this in normal scenarios. + /// + /// The parameters for this call can be queried by looking at the `UnappliedSlashes` storage + /// for eras older than the active era. /// /// ## Parameters /// - `slash_era`: The staking era in which the slash was originally scheduled. @@ -2455,7 +2537,8 @@ pub mod pallet { /// /// ## Behavior /// - The function is **permissionless**—anyone can call it. - /// - The `slash_era` **must be the current era or a past era**. If it is in the future, the + /// - The `slash_era` **must be the current era or a past era**. + /// If it is in the future, the /// call fails with `EraNotStarted`. /// - The fee is waived if the slash is successfully applied. /// diff --git a/substrate/frame/staking-async/src/session_rotation.rs b/substrate/frame/staking-async/src/session_rotation.rs index 21e38f26ffc69..2e1e000e6cb87 100644 --- a/substrate/frame/staking-async/src/session_rotation.rs +++ b/substrate/frame/staking-async/src/session_rotation.rs @@ -121,8 +121,8 @@ impl Eras { >::remove(era); >::remove(era); - // register the weight of the pruning. - Pallet::::register_weight(T::WeightInfo::prune_era(ValidatorCount::::get())); + // weight is registered in the main `relay_session_report` code path. + Pallet::::deposit_event(Event::::EraPruned { index: era }); } pub(crate) fn set_validator_prefs(era: EraIndex, stash: &T::AccountId, prefs: ValidatorPrefs) { @@ -552,10 +552,16 @@ impl Rotator { } /// End the session and start the next one. - pub(crate) fn end_session(end_index: SessionIndex, activation_timestamp: Option<(u64, u32)>) { + pub(crate) fn end_session( + end_index: SessionIndex, + activation_timestamp: Option<(u64, u32)>, + ) -> Weight { + // baseline weight -- if we start a new era, we will add the pruning weight to it. + let mut weight = T::WeightInfo::rc_on_session_report(); + let Some(active_era) = ActiveEra::::get() else { defensive!("Active era must always be available."); - return; + return weight; }; let current_planned_era = Self::is_planning(); let starting = end_index + 1; @@ -576,6 +582,8 @@ impl Rotator { Some((time, id)) if Some(id) == current_planned_era => { // We rotate the era if we have the activation timestamp. Self::start_era(active_era, starting, time); + // accumulate pruning weight. + weight.saturating_accrue(T::WeightInfo::prune_era(ValidatorCount::::get())); }, Some((_time, id)) => { // RC has done something wrong -- we received the wrong ID. Don't start a new era. @@ -634,6 +642,8 @@ impl Rotator { active_era: Self::active_era(), planned_era: Self::planned_era(), }); + + weight } pub(crate) fn start_era( diff --git a/substrate/frame/staking-async/src/testing_utils.rs b/substrate/frame/staking-async/src/testing_utils.rs index a5ef580414aba..3028b3a4e55aa 100644 --- a/substrate/frame/staking-async/src/testing_utils.rs +++ b/substrate/frame/staking-async/src/testing_utils.rs @@ -259,3 +259,11 @@ pub fn migrate_to_old_currency(who: T::AccountId) { // replicate old behaviour of explicit increment of consumer. frame_system::Pallet::::inc_consumers(&who).expect("increment consumer failed"); } + +/// Set active era to the given era index. +pub fn set_active_era(era: EraIndex) { + // set the current era. + CurrentEra::::put(era); + // set the active era. + ActiveEra::::put(ActiveEraInfo { index: era, start: None }); +} diff --git a/substrate/frame/staking-async/src/tests/bonding.rs b/substrate/frame/staking-async/src/tests/bonding.rs index 28fc6c7229624..3f8b66ff3f774 100644 --- a/substrate/frame/staking-async/src/tests/bonding.rs +++ b/substrate/frame/staking-async/src/tests/bonding.rs @@ -15,6 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//! Tests concerning bond, bond_extra, unbond, rebond, withdraw and chill for stakers. + use super::*; use frame_support::{hypothetically_ok, traits::Currency}; diff --git a/substrate/frame/staking-async/src/tests/era_rotation.rs b/substrate/frame/staking-async/src/tests/era_rotation.rs index 5c1406ff8ec21..84823d5236c3f 100644 --- a/substrate/frame/staking-async/src/tests/era_rotation.rs +++ b/substrate/frame/staking-async/src/tests/era_rotation.rs @@ -323,6 +323,15 @@ fn era_cleanup_history_depth_works() { assert_ok!(Eras::::era_present(2)); // .. assert_ok!(Eras::::era_present(HistoryDepth::get() + 1)); + assert!(matches!( + &staking_events_since_last_call()[..], + &[ + .., + Event::EraPaid { era_index: 80, validator_payout: 7500, remainder: 7500 }, + Event::EraPruned { index: 0 }, + Event::SessionRotated { starting_session: 243, active_era: 81, planned_era: 81 } + ] + )); Session::roll_until_active_era(HistoryDepth::get() + 2); assert_ok!(Eras::::era_absent(1)); @@ -330,6 +339,15 @@ fn era_cleanup_history_depth_works() { assert_ok!(Eras::::era_present(3)); // .. assert_ok!(Eras::::era_present(HistoryDepth::get() + 2)); + assert!(matches!( + &staking_events_since_last_call()[..], + &[ + .., + Event::EraPaid { era_index: 81, validator_payout: 7500, remainder: 7500 }, + Event::EraPruned { index: 1 }, + Event::SessionRotated { starting_session: 246, active_era: 82, planned_era: 82 } + ] + )); }); } diff --git a/substrate/frame/staking-async/src/tests/slashing.rs b/substrate/frame/staking-async/src/tests/slashing.rs index c55004cc9c409..db965c5a9bd39 100644 --- a/substrate/frame/staking-async/src/tests/slashing.rs +++ b/substrate/frame/staking-async/src/tests/slashing.rs @@ -627,6 +627,92 @@ fn only_slash_validator_for_max_in_era() { }) } +#[test] +fn really_old_offences_are_ignored() { + ExtBuilder::default() + .slash_defer_duration(27) + .bonding_duration(28) + .build_and_execute(|| { + Session::roll_until_active_era(100); + + let expected_oldest_reportable_offence = active_era() - (SlashDeferDuration::get() - 1); + + assert_eq!(expected_oldest_reportable_offence, 74); + + // clear staking events until now + staking_events_since_last_call(); + + // WHEN: reporting offence for era 72 and 73, which are too old. + add_slash_in_era(11, 72, Perbill::from_percent(10)); + add_slash_in_era(21, 73, Perbill::from_percent(10)); + + // THEN: offence is ignored. + assert_eq!( + staking_events_since_last_call(), + vec![ + Event::OffenceTooOld { + offence_era: 72, + validator: 11, + fraction: Perbill::from_percent(10) + }, + Event::OffenceTooOld { + offence_era: 73, + validator: 21, + fraction: Perbill::from_percent(10) + }, + ] + ); + + // also check that the ignored offences are not stored anywhere + assert!(OffenceQueue::::iter_prefix(72).next().is_none()); + assert!(OffenceQueue::::iter_prefix(73).next().is_none()); + assert!(!OffenceQueueEras::::get().unwrap_or_default().contains(&72)); + assert!(!OffenceQueueEras::::get().unwrap_or_default().contains(&73)); + + // WHEN: reporting offence for era 74. + add_slash_in_era(11, 74, Perbill::from_percent(10)); + + // THEN: offence is reported. + assert_eq!( + staking_events_since_last_call(), + vec![Event::OffenceReported { + offence_era: 74, + validator: 11, + fraction: Perbill::from_percent(10) + }] + ); + + // AND: computed in the next block. + Session::roll_next(); + + assert_eq!( + staking_events_since_last_call(), + vec![Event::SlashComputed { + offence_era: 74, + slash_era: 101, + offender: 11, + page: 0 + },] + ); + + // Slash is applied at the start of the next era. + Session::roll_until_active_era(101); + // clear staking events until now + staking_events_since_last_call(); + + // this should apply the slash. + Session::roll_next(); + assert_eq!( + staking_events_since_last_call(), + vec![ + Event::Slashed { staker: 11, amount: 100 }, + // Nominator 101 is exposed to 11, so they are slashed too. + Event::Slashed { staker: 101, amount: 25 } + ] + ); + }); +} + #[test] fn nominator_is_slashed_by_max_for_validator_in_era() { ExtBuilder::default().build_and_execute(|| { @@ -984,37 +1070,56 @@ fn remove_deferred() { // fails if empty assert_noop!( - Staking::cancel_deferred_slash(RuntimeOrigin::root(), 1, vec![]), + Staking::cancel_deferred_slash(RuntimeOrigin::root(), 3, vec![]), Error::::EmptyTargets ); - // cancel the slash with 10%. + // cancel the slash with 12% (which covers the 10% slash but not the 15% slash) assert_ok!(Staking::cancel_deferred_slash( RuntimeOrigin::root(), 3, - vec![(11, Perbill::from_percent(10), 0)] + vec![(11, Perbill::from_percent(12))], )); - assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 1); + + // validator 11 slash is set to be cancelled for era 3 with upto 12% cancellation. + assert_eq!(CancelledSlashes::::get(&3), vec![(11, Perbill::from_percent(12))]); + assert_eq!( staking_events_since_last_call(), - vec![Event::SlashCancelled { - slash_era: 3, - slash_key: (11, Perbill::from_percent(10), 0), - payout: 12 - }] + vec![Event::SlashCancelled { slash_era: 3, validator: 11 }] ); - // apply the one with 15%. + // roll to the slashing era. Session::roll_until_active_era(3); + // slash still exists in unapplied. + assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 2); + + // clear events from session rotation let _ = staking_events_since_last_call(); + Session::roll_next(); - assert_eq!( - staking_events_since_last_call(), - vec![ - Event::Slashed { staker: 11, amount: 50 }, - Event::Slashed { staker: 101, amount: 12 } - ] - ); + // first slash (10%) is cancelled, no events + assert_eq!(staking_events_since_last_call(), vec![]); + // one slash processed, one more to go + assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 1); + + Session::roll_next(); + // second slash (15%) is NOT cancelled, so it gets applied + let events = staking_events_since_last_call(); + assert_eq!(events.len(), 2); + // The 15% slash already has computed amounts in the UnappliedSlash + // Based on the test setup, it has own: 50, others: [(101, 12)] + assert_eq!(events[0], Event::Slashed { staker: 11, amount: 50 }); + assert_eq!(events[1], Event::Slashed { staker: 101, amount: 12 }); + + // check balances after 15% slash + assert_eq!(asset::stakeable_balance::(&11), 950); + assert_eq!(asset::stakeable_balance::(&101), 488); + + // all unapplied slashes should have been removed + assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 0); + // cancelled slashes should have been cleared after all era slashes are applied. + assert_eq!(CancelledSlashes::::get(&3), vec![]); }) } @@ -1062,15 +1167,133 @@ fn remove_multi_deferred() { // there are 3 slashes to be applied in era 3. assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 3); - // lets cancel 2 of them. + // lets cancel 2 of them with their respective slash percentages. assert_ok!(Staking::cancel_deferred_slash( RuntimeOrigin::root(), 3, - vec![(11, Perbill::from_percent(10), 0), (21, Perbill::from_percent(10), 0),] + vec![(11, Perbill::from_percent(10)), (21, Perbill::from_percent(10))] )); + // check cancelled slashes are stored correctly + let cancelled = CancelledSlashes::::get(&3); + assert_eq!(cancelled.len(), 2); + assert!(cancelled.contains(&(11, Perbill::from_percent(10)))); + assert!(cancelled.contains(&(21, Perbill::from_percent(10)))); + let slashes = UnappliedSlashes::::iter_prefix(&3).collect::>(); - assert_eq!(slashes.len(), 1); + assert_eq!(slashes.len(), 3); + + // go to slash era. + Session::roll_until_active_era(3); + let _ = staking_events_since_last_call(); + + // Process all slashes - they are processed one per block + let mut slash_events = vec![]; + for _ in 0..3 { + Session::roll_next(); + let events = staking_events_since_last_call(); + for event in events { + if let Event::Slashed { .. } = event { + slash_events.push(event); + } + } + } + + // Only validator 41 should have been slashed + assert_eq!(slash_events.len(), 1); + // Validator 41's exposure is 4000, with 25% slash = 1000 + assert_eq!(slash_events[0], Event::Slashed { staker: 41, amount: 1000 }); + + // all unapplied slashes are cleared + assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 0); + + // also the cancelled slashes are removed since after this era they are no longer + // needed. + assert_eq!(CancelledSlashes::::get(&3), vec![]); + }) +} + +#[test] +fn cancel_all_slashes_with_100_percent() { + // This demonstrates that when a validator has multiple slash entries in the same era, + // governance can cancel them all with a 100% cancellation. + ExtBuilder::default() + .validator_count(4) + .slash_defer_duration(2) + .build_and_execute(|| { + // our validator + assert_eq!(asset::stakeable_balance::(&11), 1000); + // nominator exposed to our validator + assert_eq!(asset::stakeable_balance::(&101), 500); + + // Check current era + assert_eq!(active_era(), 1); + + // Add 10 slashes in era 1 + for i in 1..=10 { + add_slash_with_percent(11, i * 5); + // Process the offence + Session::roll_next(); + } + + // Collect all events + let events = staking_events_since_last_call(); + + // Count reported and computed events + let reported_count = + events.iter().filter(|e| matches!(e, Event::OffenceReported { .. })).count(); + let computed_count = + events.iter().filter(|e| matches!(e, Event::SlashComputed { .. })).count(); + + // Verify all 10 offences were reported and computed + assert_eq!(reported_count, 10); + assert_eq!(computed_count, 10); + + // With defer duration 2, slashes from era 1 will be applied in era 3 + // All 10 slash entries should exist + assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 10); + + // Governance cancels all slashes for validator 11 by setting 100% cancellation + assert_ok!(Staking::cancel_deferred_slash( + RuntimeOrigin::root(), + 3, + vec![(11, Perbill::from_percent(100))], + )); + + // Verify the cancellation event + assert_eq!( + staking_events_since_last_call(), + vec![Event::SlashCancelled { slash_era: 3, validator: 11 }] + ); + + // Verify CancelledSlashes storage contains our cancellation + let cancelled = CancelledSlashes::::get(&3); + assert_eq!(cancelled.len(), 1); + assert_eq!(cancelled[0], (11, Perbill::from_percent(100))); + + // Roll to the slash era + Session::roll_until_active_era(3); + // clear staking events + let _ = staking_events_since_last_call(); + + // Process all 10 slashes - they are processed one per block + for _ in 0..10 { + Session::roll_next(); + + // Verify no slash was applied + let events = staking_events_since_last_call(); + let slash_events: Vec<_> = + events.iter().filter(|e| matches!(e, Event::Slashed { .. })).collect(); + assert_eq!(slash_events.len(), 0); + } + + // Verify balances remain unchanged + assert_eq!(asset::stakeable_balance::(&11), 1000); + assert_eq!(asset::stakeable_balance::(&101), 500); + + // Verify all storages are cleaned up + assert_eq!(UnappliedSlashes::::iter_prefix(&3).count(), 0); + assert_eq!(CancelledSlashes::::get(&3), vec![]); }) } @@ -1320,6 +1543,142 @@ fn proportional_ledger_slash_works() { }); } +#[test] +fn withdrawals_are_blocked_for_unprocessed_and_unapplied_slashes() { + ExtBuilder::default() + .slash_defer_duration(2) + .bonding_duration(3) + .add_staker(61, 1000, StakerStatus::Validator) + .add_staker(71, 1000, StakerStatus::Validator) + .add_staker(81, 1000, StakerStatus::Validator) + .add_staker(91, 1000, StakerStatus::Validator) + // we want to replicate a scenario where all offences could not be processed in 1 era, so we + // reduce the era length to 1 block. + .session_per_era(1) + .period(1) + .validator_count(6) + .build_and_execute(|| { + // NOTE for curious reader: Era change still takes 2 blocks... don't ask why ¯\_(ツ)_/¯ + let _expected_era_length = 2; + + // Set up nominator. + let validator = 11; + let nominator = 301; + bond_nominator(nominator, 500, vec![validator]); + + // create unbonding chunks for the next two eras. + Session::roll_until_active_era(2); + assert_ok!(Staking::unbond(RuntimeOrigin::signed(nominator), 100)); + Session::roll_until_active_era(3); + assert_ok!(Staking::unbond(RuntimeOrigin::signed(nominator), 150)); + + // Rationale: We want to simulate a backlog of offences from era 3 that remain + // unprocessed by the time unbonding becomes possible in era 6. + // + // Offences for era 3 must be reported no later than era 4, since slashing application + // starts in era 5. To achieve this, we flood era 3 with more than 4 offences, all + // reported just before the end of era 4. Given there are only 2 blocks per era + // (limiting processing throughput), this ensures not all offences will be processed by + // era 6 — blocking withdrawal as intended. + + // go to era 4. + Session::roll_until_active_era(4); + + // roll one block of 2 of era 4. + Session::roll_next(); + + // flood offence pipeline with offences for era 3. + // Note: our validator 11 is not slashed. + add_slash_in_era(21, 3, Perbill::from_percent(10)); + add_slash_in_era(61, 3, Perbill::from_percent(10)); + add_slash_in_era(71, 3, Perbill::from_percent(10)); + add_slash_in_era(81, 3, Perbill::from_percent(10)); + add_slash_in_era(91, 3, Perbill::from_percent(10)); + + // lets roll to era 6 where all unbonding chunks are available to withdraw. + Session::roll_until_active_era(6); + assert_eq!(active_era(), 6); + + // Ensure unbonding chunks can all be withdrawn by era 6. + let expected_chunks: BoundedVec, MaxUnlockingChunks> = bounded_vec![ + // era is unbond_era + bonding_duration, starting from era 2 + 3. + UnlockChunk { era: 5, value: 100 }, + UnlockChunk { era: 6, value: 150 }, + ]; + assert_eq!(Ledger::::get(nominator).unwrap().unlocking, expected_chunks); + + // and we created 5 offences, of which 3 would be processed in last block of era 4, and + // 2 blocks of era 5. + assert_eq!(era_unprocessed_offence_count(3), 5 - 3); + assert_eq!(OffenceQueueEras::::get().unwrap(), vec![3]); + + // all nominator balance other than ED is staked. + let nominator_balance_pre_withdraw = Balances::free_balance(&nominator); + assert_eq!(nominator_balance_pre_withdraw, 1); + + // Since the eras are too short, the offences that needed to be applied for last era 5 + // are still unapplied. This will block the withdrawal. + assert_eq!(era_unapplied_slash_count(5), 1); + + // WHEN: the nominator tries to withdraw unbonded funds while there are unapplied + // offence in the last era. + assert_noop!( + Staking::withdraw_unbonded(RuntimeOrigin::signed(nominator), 0), + Error::::UnappliedSlashesInPreviousEra + ); + + // let's clear the slashes by manually applying them. + apply_pending_slashes_from_previous_era(); + // ensure unapplied slashes are cleared. + assert_eq!(era_unapplied_slash_count(5), 0); + + // WHEN: the nominator tries to withdraw unbonded funds. + assert_ok!(Staking::withdraw_unbonded(RuntimeOrigin::signed(nominator), 0)); + + // THEN: only the first unbonding chunk is withdrawn, as the second one is blocked by + // unprocessed offences. + let nominator_balance_post_withdraw_1 = Balances::free_balance(&nominator); + // free balance increases by unlock chunk 1 value. + assert_eq!(nominator_balance_post_withdraw_1, nominator_balance_pre_withdraw + 100); + + // rolling a block creates another unapplied slash for era 3 as well as process a + // remaining offence. + Session::roll_next(); + assert_eq!(era_unapplied_slash_count(5), 1); + // clear the pending slashes. + apply_pending_slashes_from_previous_era(); + + // there is still one offence unprocessed for era 3. + assert_eq!(era_unprocessed_offence_count(3), 1); + + // withdrawals are still not possible for era (3 + 3 =) 6. + assert_ok!(Staking::withdraw_unbonded(RuntimeOrigin::signed(nominator), 0)); + assert_eq!(Balances::free_balance(&nominator), nominator_balance_post_withdraw_1); + + // WHEN: all offences are processed. + Session::roll_next(); + // Note that active_era has bumped to 7. + assert_eq!(active_era(), 7); + // The previous block created another unapplied slash for era 5, but we only block + // withdrawals upto 1 block (to give enough time for offchain actors to apply slashes + // manually). So, we dont need to apply pending slashes for era 5. + assert_eq!(era_unapplied_slash_count(5), 1); + // But era 6 (last era) has no unapplied slashes. + assert_eq!(era_unapplied_slash_count(6), 0); + // We also ensure all offences in the queue for era 3 are now processed. + assert_eq!(era_unprocessed_offence_count(3), 0); + assert_eq!(OffenceQueueEras::::get(), None); + + // Withdrawing for era 3 should be possible. + assert_ok!(Staking::withdraw_unbonded(RuntimeOrigin::signed(nominator), 0)); + assert_eq!(Balances::free_balance(&nominator), nominator_balance_post_withdraw_1 + 150); + + // Finally, we clear the unapplied slashes for era 5. Otherwise our try state checks + // will fail. (Try by commenting the next line :)) + apply_pending_slashes_from_era(5); + }); +} + mod paged_slashing { use super::*; use crate::slashing::OffenceRecord; diff --git a/substrate/frame/staking/src/lib.rs b/substrate/frame/staking/src/lib.rs index 93a29f8ad20f3..6e21c2c38e05e 100644 --- a/substrate/frame/staking/src/lib.rs +++ b/substrate/frame/staking/src/lib.rs @@ -1080,7 +1080,7 @@ impl Default for Forcing { /// /// Active exposure is the exposure of the validator set currently validating, i.e. in /// `active_era`. It can differ from the latest planned exposure in `current_era`. -#[deprecated(note = "Use `ExistenceOf` or `ExistenceOrLegacyExposureOf` instead")] +#[deprecated(note = "Use `DefaultExposureOf` instead")] pub struct ExposureOf(core::marker::PhantomData); #[allow(deprecated)] diff --git a/substrate/frame/support/src/traits/tokens/fungible/mod.rs b/substrate/frame/support/src/traits/tokens/fungible/mod.rs index 691176f9dd75b..31f8e0150ca6e 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/mod.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/mod.rs @@ -51,8 +51,9 @@ //! distinct from the Spendable Balance, which represents how much Balance the user can actually //! transfer. //! -//! - **Held Balance**: Held balance still belongs to the account holder, but is suspended. It can -//! be slashed, but only after all the free balance has been slashed. +//! - **Held Balance**: Held balance still belongs to the account holder, but is suspended — it +//! cannot be transferred or used for most operations. It may be slashed by the pallet that placed +//! the hold. //! //! Multiple holds stack rather than overlay. This means that if an account has //! 3 holds for 100 units, the account can spend its funds for any reason down to 300 units, at diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index 21e2d77367906..27cb0d1c08947 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -991,10 +991,12 @@ pub mod pallet { /// Total extrinsics count for the current block. #[pallet::storage] + #[pallet::whitelist_storage] pub(super) type ExtrinsicCount = StorageValue<_, u32>; /// Whether all inherents have been applied. #[pallet::storage] + #[pallet::whitelist_storage] pub type InherentsApplied = StorageValue<_, bool, ValueQuery>; /// The current weight for the block. @@ -1914,7 +1916,6 @@ impl Pallet { >::put(digest); >::put(parent_hash); >::insert(*number - One::one(), parent_hash); - >::kill(); // Remove previous block data from storage BlockWeight::::kill(); diff --git a/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs b/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs index f517eebf86679..76e26cce2653e 100644 --- a/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs +++ b/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs @@ -324,6 +324,10 @@ fn generate_runtime_api_base_structures() -> Result { self.recorder = std::option::Option::Some(std::default::Default::default()); } + fn record_proof_with_recorder(&mut self, recorder: #crate_::ProofRecorder) { + self.recorder = std::option::Option::Some(recorder); + } + fn proof_recorder(&self) -> std::option::Option<#crate_::ProofRecorder> { std::clone::Clone::clone(&self.recorder) } diff --git a/substrate/primitives/api/proc-macro/src/mock_impl_runtime_apis.rs b/substrate/primitives/api/proc-macro/src/mock_impl_runtime_apis.rs index 1761e0ac9dbf4..81d4a290f8471 100644 --- a/substrate/primitives/api/proc-macro/src/mock_impl_runtime_apis.rs +++ b/substrate/primitives/api/proc-macro/src/mock_impl_runtime_apis.rs @@ -99,6 +99,10 @@ fn implement_common_api_traits(block_type: TypePath, self_ty: Type) -> Result) { + unimplemented!("`record_proof_with_recorder` not implemented for runtime api mocks") + } + fn extract_proof( &mut self, ) -> Option<#crate_::StorageProof> { diff --git a/substrate/primitives/api/src/lib.rs b/substrate/primitives/api/src/lib.rs index 2fbf5f864e77d..c8f419770f5f0 100644 --- a/substrate/primitives/api/src/lib.rs +++ b/substrate/primitives/api/src/lib.rs @@ -524,6 +524,9 @@ pub use sp_api_proc_macro::mock_impl_runtime_apis; #[cfg(feature = "std")] pub type ProofRecorder = sp_trie::recorder::Recorder>; +#[cfg(feature = "std")] +pub type ProofRecorderIgnoredNodes = sp_trie::recorder::IgnoredNodes<::Hash>; + #[cfg(feature = "std")] pub type StorageChanges = sp_state_machine::StorageChanges>; @@ -612,9 +615,16 @@ pub trait ApiExt { where Self: Sized; - /// Start recording all accessed trie nodes for generating proofs. + /// Start recording all accessed trie nodes. + /// + /// The recorded trie nodes can be converted into a proof using [`Self::extract_proof`]. fn record_proof(&mut self); + /// Start recording all accessed trie nodes using the given proof recorder. + /// + /// The recorded trie nodes can be converted into a proof using [`Self::extract_proof`]. + fn record_proof_with_recorder(&mut self, recorder: ProofRecorder); + /// Extract the recorded proof. /// /// This stops the proof recording. diff --git a/substrate/primitives/npos-elections/src/lib.rs b/substrate/primitives/npos-elections/src/lib.rs index 2d3841747819c..aa92502602ba7 100644 --- a/substrate/primitives/npos-elections/src/lib.rs +++ b/substrate/primitives/npos-elections/src/lib.rs @@ -187,6 +187,27 @@ pub struct ElectionScore { pub sum_stake_squared: ExtendedBalance, } +#[cfg(feature = "std")] +impl ElectionScore { + /// format the election score in a pretty way with the given `token` symbol and `decimals`. + pub fn pretty(&self, token: &str, decimals: u32) -> String { + format!( + "ElectionScore (minimal_stake: {}, sum_stake: {}, sum_stake_squared: {})", + pretty_balance(self.minimal_stake, token, decimals), + pretty_balance(self.sum_stake, token, decimals), + pretty_balance(self.sum_stake_squared, token, decimals), + ) + } +} + +/// Format a single [`ExtendedBalance`] into a pretty string with the given `token` symbol and +/// `decimals`. +#[cfg(feature = "std")] +pub fn pretty_balance>(b: B, token: &str, decimals: u32) -> String { + let b: u128 = b.into(); + format!("{} {}", b / 10u128.pow(decimals), token) +} + impl ElectionScore { /// Iterate over the inner items, first visiting the most significant one. fn iter_by_significance(self) -> impl Iterator { diff --git a/substrate/primitives/runtime/src/traits/mod.rs b/substrate/primitives/runtime/src/traits/mod.rs index bf6a25c942a49..3650b5a1f0c31 100644 --- a/substrate/primitives/runtime/src/traits/mod.rs +++ b/substrate/primitives/runtime/src/traits/mod.rs @@ -2216,7 +2216,7 @@ macro_rules! impl_opaque_keys_inner { () > { let res = ($( - $crate::RuntimeAppPublic::sign(&self.$field, &owner).ok_or(())? + $crate::RuntimeAppPublic::generate_proof_of_possession(&mut self.$field.clone()).ok_or(())? ),*); Ok(res) @@ -2269,7 +2269,8 @@ macro_rules! impl_opaque_keys_inner { // Verify that all the signatures signed `owner`. $( - let valid = $crate::RuntimeAppPublic::verify(&self.$field, &owner, &$field); + + let valid = $crate::RuntimeAppPublic::verify_proof_of_possession(&self.$field, &$field); if !valid { // We found an invalid signature. diff --git a/substrate/primitives/staking/src/offence.rs b/substrate/primitives/staking/src/offence.rs index 973f5616d18e7..8ca1a2e903847 100644 --- a/substrate/primitives/staking/src/offence.rs +++ b/substrate/primitives/staking/src/offence.rs @@ -259,7 +259,7 @@ impl OffenceReportSystem for () { Encode, Decode, MaxEncodedLen, - sp_runtime::RuntimeDebug, + core::fmt::Debug, scale_info::TypeInfo, )] pub struct OffenceSeverity(pub Perbill); diff --git a/substrate/primitives/state-machine/src/trie_backend.rs b/substrate/primitives/state-machine/src/trie_backend.rs index 9499ecc1f55ae..f7bfa72c575aa 100644 --- a/substrate/primitives/state-machine/src/trie_backend.rs +++ b/substrate/primitives/state-machine/src/trie_backend.rs @@ -1502,7 +1502,7 @@ pub mod tests { for (key, value) in new_data { assert_eq!( value.unwrap(), - cache.lookup_value_for_key(key).unwrap().data().flatten().unwrap().as_ref() + &*cache.lookup_value_for_key(key).unwrap().data().flatten().unwrap() ); } } diff --git a/substrate/primitives/trie/src/recorder.rs b/substrate/primitives/trie/src/recorder.rs index 4ec13066ded7f..de21142d89068 100644 --- a/substrate/primitives/trie/src/recorder.rs +++ b/substrate/primitives/trie/src/recorder.rs @@ -20,9 +20,10 @@ //! Provides an implementation of the [`TrieRecorder`](trie_db::TrieRecorder) trait. It can be used //! to record storage accesses to the state to generate a [`StorageProof`]. -use crate::{NodeCodec, StorageProof}; +use crate::{GenericMemoryDB, NodeCodec, StorageProof}; use codec::Encode; use hash_db::Hasher; +use memory_db::KeyFunction; use parking_lot::{Mutex, MutexGuard}; use std::{ collections::{HashMap, HashSet}, @@ -38,6 +39,56 @@ use trie_db::{RecordedForKey, TrieAccess}; const LOG_TARGET: &str = "trie-recorder"; +/// A list of ignored nodes for [`Recorder`]. +/// +/// These nodes when passed to a recorder will be ignored and not recorded by the recorder. +#[derive(Clone)] +pub struct IgnoredNodes { + nodes: HashSet, +} + +impl Default for IgnoredNodes { + fn default() -> Self { + Self { nodes: HashSet::default() } + } +} + +impl IgnoredNodes { + /// Initialize from the given storage proof. + /// + /// So, all recorded nodes of the proof will be the ignored nodes. + pub fn from_storage_proof>(proof: &StorageProof) -> Self { + Self { nodes: proof.iter_nodes().map(|n| Hasher::hash(&n)).collect() } + } + + /// Initialize from the given memory db. + /// + /// All nodes that have a reference count > 0 will be used as ignored nodes. + pub fn from_memory_db, KF: KeyFunction>( + mut memory_db: GenericMemoryDB, + ) -> Self { + Self { + nodes: memory_db + .drain() + .into_iter() + // We do not want to add removed nodes. + .filter(|(_, (_, counter))| *counter > 0) + .map(|(_, (data, _))| Hasher::hash(&data)) + .collect(), + } + } + + /// Extend `self` with the other instance of ignored nodes. + pub fn extend(&mut self, other: Self) { + self.nodes.extend(other.nodes.into_iter()); + } + + /// Returns `true` if the node is ignored. + pub fn is_ignored(&self, node: &H) -> bool { + self.nodes.contains(node) + } +} + /// Stores all the information per transaction. #[derive(Default)] struct Transaction { @@ -66,6 +117,9 @@ struct RecorderInner { /// /// Mapping: `Hash(Node) -> Node`. accessed_nodes: HashMap>, + + /// Nodes that should be ignored and not recorded. + ignored_nodes: IgnoredNodes, } impl Default for RecorderInner { @@ -74,6 +128,7 @@ impl Default for RecorderInner { recorded_keys: Default::default(), accessed_nodes: Default::default(), transactions: Vec::new(), + ignored_nodes: Default::default(), } } } @@ -107,10 +162,20 @@ impl Clone for Recorder { } impl Recorder { + /// Create a new instance with the given `ingored_nodes`. + /// + /// These ignored nodes are not recorded when accessed. + pub fn with_ignored_nodes(ignored_nodes: IgnoredNodes) -> Self { + Self { + inner: Arc::new(Mutex::new(RecorderInner { ignored_nodes, ..Default::default() })), + ..Default::default() + } + } + /// Returns [`RecordedForKey`] per recorded key per trie. /// /// There are multiple tries when working with e.g. child tries. - pub fn recorded_keys(&self) -> HashMap<::Out, HashMap, RecordedForKey>> { + pub fn recorded_keys(&self) -> HashMap, RecordedForKey>> { self.inner.lock().recorded_keys.clone() } @@ -316,14 +381,23 @@ impl<'a, H: Hasher> trie_db::TrieRecorder for TrieRecorder<'a, H> { match access { TrieAccess::NodeOwned { hash, node_owned } => { + let inner = self.inner.deref_mut(); + + if inner.ignored_nodes.is_ignored(&hash) { + tracing::trace!( + target: LOG_TARGET, + ?hash, + "Ignoring node", + ); + return + } + tracing::trace!( target: LOG_TARGET, - hash = ?hash, + ?hash, "Recording node", ); - let inner = self.inner.deref_mut(); - inner.accessed_nodes.entry(hash).or_insert_with(|| { let node = node_owned.to_encoded::>(); @@ -337,14 +411,23 @@ impl<'a, H: Hasher> trie_db::TrieRecorder for TrieRecorder<'a, H> { }); }, TrieAccess::EncodedNode { hash, encoded_node } => { + let inner = self.inner.deref_mut(); + + if inner.ignored_nodes.is_ignored(&hash) { + tracing::trace!( + target: LOG_TARGET, + ?hash, + "Ignoring node", + ); + return + } + tracing::trace!( target: LOG_TARGET, hash = ?hash, "Recording node", ); - let inner = self.inner.deref_mut(); - inner.accessed_nodes.entry(hash).or_insert_with(|| { let node = encoded_node.into_owned(); @@ -358,6 +441,18 @@ impl<'a, H: Hasher> trie_db::TrieRecorder for TrieRecorder<'a, H> { }); }, TrieAccess::Value { hash, value, full_key } => { + let inner = self.inner.deref_mut(); + + // A value is also just a node. + if inner.ignored_nodes.is_ignored(&hash) { + tracing::trace!( + target: LOG_TARGET, + ?hash, + "Ignoring value", + ); + return + } + tracing::trace!( target: LOG_TARGET, hash = ?hash, @@ -365,8 +460,6 @@ impl<'a, H: Hasher> trie_db::TrieRecorder for TrieRecorder<'a, H> { "Recording value", ); - let inner = self.inner.deref_mut(); - inner.accessed_nodes.entry(hash).or_insert_with(|| { let value = value.into_owned(); @@ -730,4 +823,61 @@ mod tests { assert!(matches!(trie_recorder.trie_nodes_recorded_for_key(key), RecordedForKey::None)); } } + + #[test] + fn recorder_ignoring_nodes_works() { + let (db, root) = create_trie::(TEST_DATA); + + let recorder = Recorder::default(); + + { + let mut trie_recorder = recorder.as_trie_recorder(root); + let trie = TrieDBBuilder::::new(&db, &root) + .with_recorder(&mut trie_recorder) + .build(); + + for (key, data) in TEST_DATA.iter().take(3) { + assert_eq!(data.to_vec(), trie.get(&key).unwrap().unwrap()); + } + } + + assert!(recorder.estimate_encoded_size() > 10); + let mut ignored_nodes = IgnoredNodes::from_storage_proof::( + &recorder.drain_storage_proof(), + ); + + let recorder = Recorder::with_ignored_nodes(ignored_nodes.clone()); + + { + let mut trie_recorder = recorder.as_trie_recorder(root); + let trie = TrieDBBuilder::::new(&db, &root) + .with_recorder(&mut trie_recorder) + .build(); + + for (key, data) in TEST_DATA { + assert_eq!(data.to_vec(), trie.get(&key).unwrap().unwrap()); + } + } + + assert!(recorder.estimate_encoded_size() > TEST_DATA[3].1.len()); + let ignored_nodes2 = IgnoredNodes::from_storage_proof::( + &recorder.drain_storage_proof(), + ); + + ignored_nodes.extend(ignored_nodes2); + + let recorder = Recorder::with_ignored_nodes(ignored_nodes); + + { + let mut trie_recorder = recorder.as_trie_recorder(root); + let trie = TrieDBBuilder::::new(&db, &root) + .with_recorder(&mut trie_recorder) + .build(); + + for (key, data) in TEST_DATA { + assert_eq!(data.to_vec(), trie.get(&key).unwrap().unwrap()); + } + } + assert_eq!(0, recorder.estimate_encoded_size()); + } } diff --git a/substrate/primitives/trie/src/trie_codec.rs b/substrate/primitives/trie/src/trie_codec.rs index 65b4f50535990..521f0edce70d0 100644 --- a/substrate/primitives/trie/src/trie_codec.rs +++ b/substrate/primitives/trie/src/trie_codec.rs @@ -69,10 +69,8 @@ where let (top_root, _nb_used) = trie_db::decode_compact_from_iter::(db, &mut nodes_iter)?; // Only check root if expected root is passed as argument. - if let Some(expected_root) = expected_root { - if expected_root != &top_root { - return Err(Error::RootMismatch(top_root, *expected_root)) - } + if let Some(expected_root) = expected_root.filter(|expected| *expected != &top_root) { + return Err(Error::RootMismatch(top_root, *expected_root)) } let mut child_tries = Vec::new(); @@ -205,3 +203,237 @@ where Ok(CompactProof { encoded_nodes: compact_proof }) } + +#[cfg(test)] +mod tests { + use super::*; + use crate::{delta_trie_root, recorder::IgnoredNodes, HashDB, StorageProof}; + use codec::Encode; + use hash_db::AsHashDB; + use sp_core::{Blake2Hasher, H256}; + use std::collections::HashSet; + use trie_db::{DBValue, Trie, TrieDBBuilder, TrieDBMutBuilder, TrieHash, TrieMut}; + + type MemoryDB = crate::MemoryDB; + type Layout = crate::LayoutV1; + type Recorder = crate::recorder::Recorder; + + fn create_trie(num_keys: u32) -> (MemoryDB, TrieHash) { + let mut db = MemoryDB::default(); + let mut root = Default::default(); + + { + let mut trie = TrieDBMutBuilder::::new(&mut db, &mut root).build(); + for i in 0..num_keys { + trie.insert( + &i.encode(), + &vec![1u8; 64].into_iter().chain(i.encode()).collect::>(), + ) + .expect("Inserts data"); + } + } + + (db, root) + } + + struct Overlay<'a> { + db: &'a MemoryDB, + write: MemoryDB, + } + + impl hash_db::HashDB for Overlay<'_> { + fn get( + &self, + key: &::Out, + prefix: hash_db::Prefix, + ) -> Option { + HashDB::get(self.db, key, prefix) + } + + fn contains( + &self, + key: &::Out, + prefix: hash_db::Prefix, + ) -> bool { + HashDB::contains(self.db, key, prefix) + } + + fn insert( + &mut self, + prefix: hash_db::Prefix, + value: &[u8], + ) -> ::Out { + self.write.insert(prefix, value) + } + + fn emplace( + &mut self, + key: ::Out, + prefix: hash_db::Prefix, + value: DBValue, + ) { + self.write.emplace(key, prefix, value); + } + + fn remove( + &mut self, + key: &::Out, + prefix: hash_db::Prefix, + ) { + self.write.remove(key, prefix); + } + } + + impl AsHashDB for Overlay<'_> { + fn as_hash_db(&self) -> &dyn HashDBT { + self + } + + fn as_hash_db_mut<'a>(&'a mut self) -> &'a mut (dyn HashDBT + 'a) { + self + } + } + + fn emulate_block_building( + state: &MemoryDB, + root: H256, + read_keys: &[u32], + write_keys: &[u32], + nodes_to_ignore: IgnoredNodes, + ) -> (Recorder, MemoryDB, H256) { + let recorder = Recorder::with_ignored_nodes(nodes_to_ignore); + + { + let mut trie_recorder = recorder.as_trie_recorder(root); + let trie = TrieDBBuilder::::new(state, &root) + .with_recorder(&mut trie_recorder) + .build(); + + for key in read_keys { + trie.get(&key.encode()).unwrap().unwrap(); + } + } + + let mut overlay = Overlay { db: state, write: Default::default() }; + + let new_root = { + let mut trie_recorder = recorder.as_trie_recorder(root); + delta_trie_root::( + &mut overlay, + root, + write_keys.iter().map(|k| { + ( + k.encode(), + Some(vec![2u8; 64].into_iter().chain(k.encode()).collect::>()), + ) + }), + Some(&mut trie_recorder), + None, + ) + .unwrap() + }; + + (recorder, overlay.write, new_root) + } + + fn build_known_nodes_list(recorder: &Recorder, transaction: &MemoryDB) -> IgnoredNodes { + let mut ignored_nodes = + IgnoredNodes::from_storage_proof::(&recorder.to_storage_proof()); + + ignored_nodes.extend(IgnoredNodes::from_memory_db::(transaction.clone())); + + ignored_nodes + } + + #[test] + fn ensure_multiple_tries_encode_compact_works() { + let (mut db, root) = create_trie(100); + + let mut nodes_to_ignore = IgnoredNodes::default(); + let (recorder, transaction, root1) = emulate_block_building( + &db, + root, + &[2, 4, 5, 6, 7, 8], + &[9, 10, 11, 12, 13, 14], + nodes_to_ignore.clone(), + ); + + db.consolidate(transaction.clone()); + nodes_to_ignore.extend(build_known_nodes_list(&recorder, &transaction)); + + let (recorder2, transaction, root2) = emulate_block_building( + &db, + root1, + &[9, 10, 11, 12, 13, 14], + &[15, 16, 17, 18, 19, 20], + nodes_to_ignore.clone(), + ); + + db.consolidate(transaction.clone()); + nodes_to_ignore.extend(build_known_nodes_list(&recorder2, &transaction)); + + let (recorder3, _, root3) = emulate_block_building( + &db, + root2, + &[20, 30, 40, 41, 42], + &[80, 90, 91, 92, 93], + nodes_to_ignore, + ); + + let proof = recorder.to_storage_proof(); + let proof2 = recorder2.to_storage_proof(); + let proof3 = recorder3.to_storage_proof(); + + let mut combined = HashSet::>::from_iter(proof.into_iter_nodes()); + proof2.iter_nodes().for_each(|n| assert!(combined.insert(n.clone()))); + proof3.iter_nodes().for_each(|n| assert!(combined.insert(n.clone()))); + + let proof = StorageProof::new(combined.into_iter()); + + let compact_proof = encode_compact::(&proof.to_memory_db(), &root).unwrap(); + + assert!(proof.encoded_size() > compact_proof.encoded_size()); + + let mut res_db = crate::MemoryDB::::new(&[]); + decode_compact::( + &mut res_db, + compact_proof.iter_compact_encoded_nodes(), + Some(&root), + ) + .unwrap(); + + let (_, transaction, root1_proof) = emulate_block_building( + &res_db, + root, + &[2, 4, 5, 6, 7, 8], + &[9, 10, 11, 12, 13, 14], + Default::default(), + ); + + assert_eq!(root1, root1_proof); + + res_db.consolidate(transaction); + + let (_, transaction2, root2_proof) = emulate_block_building( + &res_db, + root1, + &[9, 10, 11, 12, 13, 14], + &[15, 16, 17, 18, 19, 20], + Default::default(), + ); + + assert_eq!(root2, root2_proof); + + res_db.consolidate(transaction2); + + let (_, _, root3_proof) = emulate_block_building( + &res_db, + root2, + &[20, 30, 40, 41, 42], + &[80, 90, 91, 92, 93], + Default::default(), + ); + + assert_eq!(root3, root3_proof); + } +} diff --git a/substrate/primitives/wasm-interface/src/lib.rs b/substrate/primitives/wasm-interface/src/lib.rs index f6948d8cb88e9..5e2bd10c16853 100644 --- a/substrate/primitives/wasm-interface/src/lib.rs +++ b/substrate/primitives/wasm-interface/src/lib.rs @@ -342,7 +342,7 @@ if_wasmtime_is_enabled! { /// host functions' definitions generated through the runtime interface macro, /// and is not meant to be used directly. pub trait HostFunctionRegistry { - type State; + type State: 'static; type Error; type FunctionContext: FunctionContext; diff --git a/substrate/utils/frame/benchmarking-cli/Cargo.toml b/substrate/utils/frame/benchmarking-cli/Cargo.toml index b903175a38149..e58b403a03340 100644 --- a/substrate/utils/frame/benchmarking-cli/Cargo.toml +++ b/substrate/utils/frame/benchmarking-cli/Cargo.toml @@ -24,6 +24,7 @@ codec = { workspace = true, default-features = true } comfy-table = { workspace = true } cumulus-client-parachain-inherent = { workspace = true, default-features = true } cumulus-primitives-proof-size-hostfunction = { workspace = true, default-features = true } +env_filter = { workspace = true } frame-benchmarking = { workspace = true, default-features = true } frame-storage-access-test-runtime = { workspace = true, default-features = true } frame-support = { workspace = true, default-features = true } @@ -61,6 +62,7 @@ sp-inherents = { workspace = true, default-features = true } sp-io = { workspace = true, default-features = true } sp-keystore = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } +sp-runtime-interface = { workspace = true, default-features = true } sp-state-machine = { workspace = true, default-features = true } sp-storage = { workspace = true, default-features = true } sp-timestamp = { workspace = true, default-features = true } diff --git a/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs b/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs index 1f3d5436748cc..578dabf48fda8 100644 --- a/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs +++ b/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs @@ -17,7 +17,7 @@ use super::{ types::{ComponentRange, ComponentRangeMap}, - writer, ListOutput, PalletCmd, + writer, ListOutput, PalletCmd, LOG_TARGET, }; use crate::{ pallet::{types::FetchedCode, GenesisBuilderPolicy}, @@ -50,7 +50,7 @@ use sp_keystore::{testing::MemoryKeystore, KeystoreExt}; use sp_runtime::traits::Hash; use sp_state_machine::StateMachine; use sp_trie::{proof_size_extension::ProofSizeExt, recorder::Recorder}; -use sp_wasm_interface::HostFunctions; +use sp_wasm_interface::{ExtendedHostFunctions, HostFunctions}; use std::{ borrow::Cow, collections::{BTreeMap, BTreeSet, HashMap}, @@ -60,11 +60,13 @@ use std::{ time, }; -/// Logging target -const LOG_TARGET: &'static str = "polkadot_sdk_frame::benchmark::pallet"; - -type SubstrateAndExtraHF = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions, T); +type SubstrateAndExtraHF = ( + ExtendedHostFunctions< + (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions), + super::logging::logging::HostFunctions, + >, + T, +); /// How the PoV size of a storage item should be estimated. #[derive(clap::ValueEnum, Debug, Eq, PartialEq, Clone, Copy)] pub enum PovEstimationMode { @@ -252,6 +254,7 @@ impl PalletCmd { }; return self.output_from_results(&batches) } + super::logging::init(self.runtime_log.clone()); let state_handler = self.state_handler_from_cli::>(chain_spec)?; @@ -716,7 +719,7 @@ impl PalletCmd { state: &'a BenchmarkingState, ) -> Result, H>> { if let Some(runtime) = self.runtime.as_ref() { - log::info!(target: LOG_TARGET, "Loading WASM from file"); + log::debug!(target: LOG_TARGET, "Loading WASM from file {}", runtime.display()); let code = fs::read(runtime).map_err(|e| { format!( "Could not load runtime file from path: {}, error: {}", diff --git a/substrate/utils/frame/benchmarking-cli/src/pallet/logging.rs b/substrate/utils/frame/benchmarking-cli/src/pallet/logging.rs new file mode 100644 index 0000000000000..f6a3c82d49dbb --- /dev/null +++ b/substrate/utils/frame/benchmarking-cli/src/pallet/logging.rs @@ -0,0 +1,89 @@ +// This file is part of Substrate. + +// 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 super::LOG_TARGET; +use sp_core::{LogLevelFilter, RuntimeInterfaceLogLevel}; +use sp_runtime_interface::{ + pass_by::{PassAs, PassFatPointerAndRead, ReturnAs}, + runtime_interface, +}; +use std::cell::OnceCell; + +thread_local! { + /// Log level filter that the runtime will use. + /// + /// Must be initialized by the host before invoking the runtime executor. You may use `init` for + /// this or set it manually. The that can be set are either levels directly or filter like + // `warn,runtime=info`. + pub static RUNTIME_LOG: OnceCell = OnceCell::new(); +} + +/// Init runtime logger with the following priority (high to low): +/// - CLI argument +/// - Environment variable +/// - Default logger settings +pub fn init(arg: Option) { + let filter_str = arg.unwrap_or_else(|| { + if let Ok(env) = std::env::var("RUNTIME_LOG") { + env + } else { + log::max_level().to_string() + } + }); + + let filter = env_filter::Builder::new() + .try_parse(&filter_str) + .expect("Invalid runtime log filter") + .build(); + + RUNTIME_LOG.with(|cell| { + cell.set(filter).expect("Can be set by host"); + log::info!(target: LOG_TARGET, "Initialized runtime log filter to '{}'", filter_str); + }); +} + +/// Alternative implementation to `sp_runtime_interface::logging::HostFunctions` for benchmarking. +#[runtime_interface] +pub trait Logging { + #[allow(dead_code)] + fn log( + level: PassAs, + target: PassFatPointerAndRead<&str>, + message: PassFatPointerAndRead<&[u8]>, + ) { + let Ok(message) = core::str::from_utf8(message) else { + log::error!(target: LOG_TARGET, "Runtime tried to log invalid UTF-8 data"); + return; + }; + + let level = log::Level::from(level); + let metadata = log::MetadataBuilder::new().level(level).target(target).build(); + + if RUNTIME_LOG.with(|filter| filter.get().expect("Must be set by host").enabled(&metadata)) + { + log::log!(target: target, level, "{}", message); + } + } + + #[allow(dead_code)] + fn max_level() -> ReturnAs { + RUNTIME_LOG + // .filter() gives us the max level of this filter + .with(|filter| filter.get().expect("Must be set by host").filter()) + .into() + } +} diff --git a/substrate/utils/frame/benchmarking-cli/src/pallet/mod.rs b/substrate/utils/frame/benchmarking-cli/src/pallet/mod.rs index 5cb353059988c..7ac5c4436837a 100644 --- a/substrate/utils/frame/benchmarking-cli/src/pallet/mod.rs +++ b/substrate/utils/frame/benchmarking-cli/src/pallet/mod.rs @@ -16,6 +16,7 @@ // limitations under the License. mod command; +mod logging; mod types; mod writer; @@ -28,6 +29,9 @@ use sc_cli::{ }; use std::{fmt::Debug, path::PathBuf}; +/// Logging target +const LOG_TARGET: &'static str = "frame::benchmark::pallet"; + // Add a more relaxed parsing for pallet names by allowing pallet directory names with `-` to be // used like crate names with `_` fn parse_pallet_name(pallet: &str) -> std::result::Result { @@ -187,6 +191,13 @@ pub struct PalletCmd { #[arg(long, conflicts_with = "chain", required_if_eq("genesis_builder", "runtime"))] pub runtime: Option, + /// Set the runtime log level. + /// + /// This will overwrite the `RUNTIME_LOG` environment variable. If neither is set, the CLI + /// default set by `RUST_LOG` setting is used. + #[arg(long)] + pub runtime_log: Option, + /// Do not fail if there are unknown but also unused host functions in the runtime. #[arg(long)] pub allow_missing_host_functions: bool, diff --git a/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs b/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs index 28918dd4e6a39..e9312023611b9 100644 --- a/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs +++ b/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs @@ -467,7 +467,10 @@ pub(crate) fn write_results( file_name = format!("{}_{}", file_name, instance.to_snake_case()); } // "mod::pallet_name.rs" becomes "mod_pallet_name.rs". - file_path.push(file_name.replace("::", "_")); + file_name = file_name.replace("::", "_"); + // Some old runtimes have a bug with the pallet and instance name containing a space + file_name = file_name.replace(" ", ""); + file_path.push(file_name); file_path.set_extension("rs"); } diff --git a/substrate/utils/prometheus/Cargo.toml b/substrate/utils/prometheus/Cargo.toml index b8dfd6fb2beee..3a755e2da85b3 100644 --- a/substrate/utils/prometheus/Cargo.toml +++ b/substrate/utils/prometheus/Cargo.toml @@ -22,7 +22,7 @@ hyper-util = { features = ["server-auto", "server-graceful", "tokio"], workspace log = { workspace = true, default-features = true } prometheus = { workspace = true } thiserror = { workspace = true } -tokio = { features = ["parking_lot"], workspace = true, default-features = true } +tokio = { features = ["net", "parking_lot"], workspace = true, default-features = true } [dev-dependencies] hyper-util = { features = ["client-legacy", "tokio"], workspace = true, default-features = true } diff --git a/substrate/utils/wasm-builder/src/wasm_project.rs b/substrate/utils/wasm-builder/src/wasm_project.rs index b907a250c6009..b6709682ef491 100644 --- a/substrate/utils/wasm-builder/src/wasm_project.rs +++ b/substrate/utils/wasm-builder/src/wasm_project.rs @@ -258,6 +258,7 @@ fn maybe_compact_and_compress_wasm( // We at least want to lower the `sign-ext` code to `mvp`. wasm_opt::OptimizationOptions::new_opt_level_0() .add_pass(wasm_opt::Pass::SignextLowering) + .debug_info(true) .run(bloaty_blob_binary.bloaty_path(), bloaty_blob_binary.bloaty_path()) .expect("Failed to lower sign-ext in WASM binary."); diff --git a/templates/minimal/node/src/command.rs b/templates/minimal/node/src/command.rs index 8672c35abbc50..14bca1abc5fa6 100644 --- a/templates/minimal/node/src/command.rs +++ b/templates/minimal/node/src/command.rs @@ -125,12 +125,10 @@ pub fn run() -> sc_cli::Result<()> { match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => service::new_full::>(config, cli.consensus) - .await .map_err(sc_cli::Error::Service), sc_network::config::NetworkBackendType::Litep2p => service::new_full::< sc_network::Litep2pNetworkBackend, >(config, cli.consensus) - .await .map_err(sc_cli::Error::Service), } }) diff --git a/templates/minimal/node/src/service.rs b/templates/minimal/node/src/service.rs index e105cad5b55b2..5988dbf3ce6ed 100644 --- a/templates/minimal/node/src/service.rs +++ b/templates/minimal/node/src/service.rs @@ -20,7 +20,6 @@ use futures::FutureExt; use minimal_template_runtime::{interface::OpaqueBlock as Block, RuntimeApi}; use polkadot_sdk::{ sc_client_api::backend::Backend, - sc_consensus_manual_seal::{seal_block, SealBlockParams}, sc_executor::WasmExecutor, sc_service::{error::Error as ServiceError, Configuration, TaskManager}, sc_telemetry::{Telemetry, TelemetryWorker}, @@ -108,7 +107,7 @@ pub fn new_partial(config: &Configuration) -> Result { } /// Builds a new service for a full client. -pub async fn new_full::Hash>>( +pub fn new_full::Hash>>( config: Configuration, consensus: Consensus, ) -> Result { @@ -197,7 +196,7 @@ pub async fn new_full { - // Seal a first block to trigger fork-aware txpool `maintain`, and create a first - // view. This is necessary so that sending txs will not keep them in mempool for - // an undeterminated amount of time. - // - // If single state txpool is used there's no issue if we're sealing a first block in - // advance. - let create_inherent_data_providers = - |_, ()| async move { Ok(sp_timestamp::InherentDataProvider::from_system_time()) }; - let mut client_mut = client.clone(); - let consensus_data_provider = None; - let seal_params = SealBlockParams { - sender: None, - parent_hash: None, - finalize: true, - create_empty: true, - env: &mut proposer, - select_chain: &select_chain, - block_import: &mut client_mut, - consensus_data_provider, - pool: transaction_pool.clone(), - client: client.clone(), - create_inherent_data_providers: &create_inherent_data_providers, - }; - seal_block(seal_params).await; - let params = sc_consensus_manual_seal::InstantSealParams { block_import: client.clone(), env: proposer, @@ -239,7 +213,9 @@ pub async fn new_full>) + Send + Sync>, ) -> Result<(), sc_service::Error> { - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( + let proposer = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), transaction_pool, @@ -194,8 +193,6 @@ fn start_consensus( telemetry.clone(), ); - let proposer = Proposer::new(proposer_factory); - let collator_service = CollatorService::new( client.clone(), Arc::new(task_manager.spawn_handle()),