From 431c1e9a64096e34f27a440697f59789208c5177 Mon Sep 17 00:00:00 2001 From: William Freudenberger Date: Tue, 6 Dec 2022 16:39:17 +0100 Subject: [PATCH] feat: upgrade to Polkadot v0.9.32 (#434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## fixes KILTProtocol/ticket#2289 and KILTProtocol/ticket#2296 * Upgrades from Polkadot v0.9.29 to v0.9.32 * Adds missing feature implementations for all tomls (checked via `subalfred check features` in all crates) * Actually necessary for application of https://github.com/paritytech/substrate/pull/10592 (see runtime changes in [dd81eac](https://github.com/KILTprotocol/kilt-node/pull/434/commits/dd81eac1c44c9309ba49265908435412eb1c0999)) * Migrates Democracy, Preimage and Scheduler pallets to use bounded Calls, see below ## Summary of changes (Polkadot v0.9.30-0.9.32) * Weights v2 are not fully there yet, but the struct now includes the [second field for storage size](https://github.com/paritytech/substrate/pull/12277) (tracking issue: https://github.com/paritytech/substrate/issues/12176) ### Breaking Changes * Breaking: Outer enums (https://github.com/paritytech/substrate/pull/11981) * `Origin` --> `RuntimeOrigin` * `Call` --> `RuntimeCall` * `Event` --> `RuntimeEvent` * ~Convention seems to be to keep `Event`, `Call`, `Origin` for inner pallet usage, e.g. `Did::Origin`~ Update: We use `Runtime` prefix internally as well ### Noteworthy PRs * https://github.com/paritytech/substrate/pull/12109 * https://github.com/paritytech/substrate/pull/12328 * https://github.com/paritytech/cumulus/pull/1585 * Following the effort of decoupling collators and full relay nodes, this PR adds the possibility of pointing the collator to an “external” (non in-process) relay node. This is still considered experimental, and the **relay node is suggested to run on the same machine than the collator for the moment**. * To specify the relay full node rpc: `polkadot-parachain --alice --collator --relay-chain-rpc-url ` * https://github.com/paritytech/substrate/pull/12486 * Before this change only the interpreted WASM executor was included in per default compilations. Making the compiled executor opt-in, now, compiled WASM executor is set by default and an opt-out instead. This could lead to **big performance difference** between using these two, as more recent versions of the interpreter see a regression in performance. ### Scheduler, Preimage, Democracy Migration * https://github.com/paritytech/substrate/pull/11649 * Referenda, Democracy, Scheduler and Preimage pallets are all now bounded in storage access footprint * Removed the concept of a "hard deadline" or weight-override priority and no longer guarantees that at least one scheduled item will be executed per block (since these are both dangerous to parachains which have a strict need of weight limits). This means you must ensure that scheduled items are below the MaximumWeight or they will not be executed. * Interesting comment: https://github.com/paritytech/substrate/pull/11649#discussion_r903159314 > There is migration code which moves existing proposals and referenda over to the new format. However IT DOES NOT MIGRATE EVERYTHING: > > * Preimages are **NOT** migrated. Any registered preimages in Democracy at the time of migration are dropped. Their balance is **NOT UNRESERVED**. > * The re-dispatcher used in the old Democracy implementation is removed. Any proposals scheduled for dispatch by Democracy **WILL NOT EXECUTE**. > > This means you SHOULD ensure that: > > * **the preimage for the runtime upgrade is placed as an imminent preimage, not with a deposit;** > * **no other preimages are in place at the time of upgrade;** > * **there are no other proposals scheduled for dispatch by Democracy at the time of upgrade.** > > The Democracy pallet will be marked as deprecated immediately once Referenda is considered production-ready. **ALL TEAMS ARE RECOMMENDED TO SWITCH SWAY FROM DEMOCRACY PALLET TO REFERENDA/CONVICTION-VOTING PALLETS ASAP** #### Result of `try-runtime` against Spiritnet on Friday Nov 18, 2022: ``` 2022-11-18 09:27:23.917 INFO main runtime::preimage::migration::v1: Migrating 0 images 2022-11-18 09:27:23.917 INFO main runtime::scheduler::migration: Trying to migrate 0 agendas... 2022-11-18 09:27:23.917 INFO main runtime::scheduler::migration: Migrated 0 agendas. 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: 0 public proposals will be migrated. 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: 25 referenda will be migrated. 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #7 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #20 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #13 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #5 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #8 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #1 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #19 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #9 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #16 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #14 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #21 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #15 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #24 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #22 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #2 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #10 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #0 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #6 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #11 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #3 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #17 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #18 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #23 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #4 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #25 2022-11-18 09:27:23.918 INFO main runtime::democracy::migration::v1: 0 public proposals migrated, 25 referenda migrated ``` ## Checklist: - [x] I have verified that the code works - [x] No panics! (checked arithmetic ops, no indexing `array[3]` use `get(3)`, ...) - [x] I have verified that the code is easy to understand - [ ] If not, I have left a well-balanced amount of inline comments - [x] I have [left the code in a better state](https://deviq.com/principles/boy-scout-rule) - [x] I have documented the changes (where applicable) --- Cargo.lock | 2134 +++++++++-------- Cargo.toml | 209 +- nodes/parachain/Cargo.toml | 14 + nodes/parachain/src/cli.rs | 20 +- nodes/parachain/src/command.rs | 22 +- nodes/parachain/src/service.rs | 53 +- nodes/standalone/Cargo.toml | 8 + nodes/standalone/src/benchmarking.rs | 2 +- nodes/standalone/src/cli.rs | 8 +- nodes/standalone/src/command.rs | 8 +- nodes/standalone/src/service.rs | 34 +- pallets/attestation/Cargo.toml | 3 + pallets/attestation/src/benchmarking.rs | 10 +- pallets/attestation/src/lib.rs | 4 +- pallets/attestation/src/mock.rs | 14 +- pallets/attestation/src/tests.rs | 21 +- pallets/ctype/Cargo.toml | 4 +- pallets/ctype/src/benchmarking.rs | 4 +- pallets/ctype/src/lib.rs | 4 +- pallets/ctype/src/mock.rs | 12 +- pallets/delegation/Cargo.toml | 5 + pallets/delegation/src/benchmarking.rs | 20 +- pallets/delegation/src/lib.rs | 4 +- pallets/delegation/src/mock.rs | 16 +- pallets/delegation/src/tests.rs | 15 +- pallets/did/Cargo.toml | 2 + pallets/did/src/benchmarking.rs | 4 +- pallets/did/src/lib.rs | 14 +- pallets/did/src/mock.rs | 36 +- pallets/did/src/origin.rs | 2 +- pallets/did/src/tests.rs | 210 +- pallets/pallet-did-lookup/Cargo.toml | 6 +- pallets/pallet-did-lookup/src/benchmarking.rs | 16 +- pallets/pallet-did-lookup/src/lib.rs | 4 +- pallets/pallet-did-lookup/src/migrations.rs | 23 +- pallets/pallet-did-lookup/src/mock.rs | 12 +- pallets/pallet-did-lookup/src/tests.rs | 19 +- pallets/pallet-inflation/Cargo.toml | 5 +- pallets/pallet-inflation/src/mock.rs | 8 +- pallets/pallet-web3-names/Cargo.toml | 5 +- pallets/pallet-web3-names/src/benchmarking.rs | 10 +- pallets/pallet-web3-names/src/lib.rs | 6 +- pallets/pallet-web3-names/src/mock.rs | 12 +- pallets/pallet-web3-names/src/tests.rs | 4 +- pallets/parachain-staking/Cargo.toml | 8 + pallets/parachain-staking/src/benchmarking.rs | 6 +- pallets/parachain-staking/src/lib.rs | 8 +- pallets/parachain-staking/src/migration.rs | 170 -- pallets/parachain-staking/src/mock.rs | 28 +- pallets/parachain-staking/src/set.rs | 4 +- pallets/parachain-staking/src/tests.rs | 729 +++--- pallets/public-credentials/Cargo.toml | 8 +- .../public-credentials/src/benchmarking.rs | 12 +- pallets/public-credentials/src/lib.rs | 4 +- pallets/public-credentials/src/mock.rs | 14 +- pallets/public-credentials/src/tests.rs | 16 +- runtimes/clone/Cargo.toml | 19 +- runtimes/clone/src/lib.rs | 151 +- runtimes/clone/src/xcm_config.rs | 40 +- runtimes/common/Cargo.toml | 19 + runtimes/common/src/constants.rs | 8 +- runtimes/common/src/fees.rs | 46 +- runtimes/common/src/lib.rs | 10 +- runtimes/common/src/migrations.rs | 65 - runtimes/peregrine/Cargo.toml | 15 +- runtimes/peregrine/src/lib.rs | 398 +-- runtimes/peregrine/src/tests.rs | 62 +- .../peregrine/src/weights/pallet_democracy.rs | 192 +- .../peregrine/src/weights/pallet_proxy.rs | 104 +- .../peregrine/src/weights/pallet_scheduler.rs | 155 +- runtimes/peregrine/src/xcm_config.rs | 38 +- runtimes/spiritnet/Cargo.toml | 17 +- runtimes/spiritnet/src/lib.rs | 394 +-- runtimes/spiritnet/src/tests.rs | 60 +- .../spiritnet/src/weights/pallet_democracy.rs | 192 +- .../spiritnet/src/weights/pallet_proxy.rs | 104 +- .../spiritnet/src/weights/pallet_scheduler.rs | 155 +- runtimes/spiritnet/src/xcm_config.rs | 40 +- runtimes/standalone/Cargo.toml | 14 +- runtimes/standalone/src/lib.rs | 230 +- support/src/mock.rs | 2 +- 81 files changed, 3298 insertions(+), 3285 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f73dd9439..6fb72fe5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,6 +121,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "array-bytes" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a913633b0c922e6b745072795f50d90ebea78ba31a57e2ac8c2fc7b50950949" + [[package]] name = "arrayref" version = "0.3.6" @@ -288,9 +294,9 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" +checksum = "6ba50e24d9ee0a8950d3d03fc6d0dd10aa14b5de3b101949b4e160f7fee7c723" dependencies = [ "async-std", "async-trait", @@ -401,7 +407,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.29.0", + "object", "rustc-demangle", ] @@ -429,6 +435,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "beef" version = "0.5.2" @@ -441,14 +453,14 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", "beefy-primitives", "fnv", "futures", "futures-timer", - "hex", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -458,6 +470,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-network-gossip", "sc-utils", "sp-api", @@ -477,7 +490,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -497,32 +510,30 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "beefy-primitives", "sp-api", + "sp-runtime", ] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", + "serde", "sp-api", "sp-application-crypto", "sp-core", + "sp-io", + "sp-mmr-primitives", "sp-runtime", "sp-std", ] -[[package]] -name = "bimap" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" - [[package]] name = "bincode" version = "1.3.3" @@ -534,9 +545,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" dependencies = [ "bitflags", "cexpr", @@ -630,7 +641,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -642,7 +653,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding 0.2.1", "generic-array 0.14.6", ] @@ -664,12 +674,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" version = "1.2.0" @@ -919,31 +923,29 @@ checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" dependencies = [ "glob", "libc", - "libloading 0.7.3", + "libloading", ] [[package]] name = "clap" -version = "3.2.22" +version = "4.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "0eb41c13df48950b20eb4cd0eefa618819469df1bffc49d11e8487c4ba0037e5" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck", "proc-macro-error", @@ -954,9 +956,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] @@ -1020,15 +1022,6 @@ dependencies = [ "xcm-executor", ] -[[package]] -name = "cmake" -version = "0.1.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" -dependencies = [ - "cc", -] - [[package]] name = "coarsetime" version = "0.1.22" @@ -1124,19 +1117,21 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" +checksum = "52056f6d0584484b57fa6c1a65c1fcb15f3780d8b6a758426d9e3084169b2ddd" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" +checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" dependencies = [ + "arrayvec 0.7.2", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", @@ -1151,33 +1146,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" +checksum = "1c451b81faf237d11c7e4f3165eeb6bac61112762c5cfe7b4c0fb7241474358f" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" +checksum = "e7c940133198426d26128f08be2b40b0bd117b84771fd36798969c4d712d81fc" [[package]] name = "cranelift-entity" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" +checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" +checksum = "34897538b36b216cc8dd324e73263596d51b8cf610da6498322838b2546baf8a" dependencies = [ "cranelift-codegen", "log", @@ -1187,15 +1182,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" +checksum = "1b2629a569fae540f16a76b70afcc87ad7decb38dc28fa6c648ac73b51e78470" [[package]] name = "cranelift-native" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" +checksum = "20937dab4e14d3e225c5adfc9c7106bafd4ac669bdb43027b911ff794c6fb318" dependencies = [ "cranelift-codegen", "libc", @@ -1204,9 +1199,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" +checksum = "80fc2288957a94fd342a015811479de1837850924166d1f1856d8406e6f3609b" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1369,21 +1364,10 @@ dependencies = [ "substrate-wasm-builder", ] -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", -] - [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "clap", "parity-scale-codec", @@ -1398,12 +1382,11 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", - "cumulus-relay-chain-interface", "futures", "parity-scale-codec", "parking_lot 0.12.1", @@ -1422,7 +1405,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1451,7 +1434,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1461,7 +1444,6 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", - "sp-api", "sp-blockchain", "sp-consensus", "sp-runtime", @@ -1472,11 +1454,10 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-relay-chain-interface", - "derive_more", "futures", "futures-timer", "parity-scale-codec", @@ -1485,7 +1466,6 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "sc-client-api", - "sp-api", "sp-blockchain", "sp-consensus", "sp-core", @@ -1497,7 +1477,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", @@ -1511,7 +1491,6 @@ dependencies = [ "rand 0.8.5", "sc-client-api", "sc-consensus", - "sp-api", "sp-consensus", "sp-maybe-compressed-blob", "sp-runtime", @@ -1521,7 +1500,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1530,34 +1509,27 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "parking_lot 0.12.1", - "polkadot-overseer", "polkadot-primitives", "sc-client-api", "sc-consensus", - "sc-consensus-babe", "sc-service", - "sc-telemetry", - "sc-tracing", "sp-api", "sp-blockchain", "sp-consensus", "sp-core", "sp-runtime", - "tracing", ] [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ - "frame-executive", "frame-support", "frame-system", "pallet-aura", "parity-scale-codec", "scale-info", - "serde", "sp-application-crypto", "sp-consensus-aura", "sp-runtime", @@ -1567,7 +1539,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1579,13 +1551,12 @@ dependencies = [ "sp-runtime", "sp-std", "xcm", - "xcm-executor", ] [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1596,11 +1567,9 @@ dependencies = [ "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances", "parity-scale-codec", "polkadot-parachain", "scale-info", - "serde", "sp-core", "sp-externalities", "sp-inherents", @@ -1610,13 +1579,12 @@ dependencies = [ "sp-std", "sp-trie", "sp-version", - "xcm", ] [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1627,7 +1595,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "frame-benchmarking", "frame-support", @@ -1641,10 +1609,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-solo-to-para" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-pallet-parachain-system", - "cumulus-primitives-core", "frame-support", "frame-system", "pallet-sudo", @@ -1658,14 +1625,13 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde", "sp-io", "sp-runtime", "sp-std", @@ -1675,9 +1641,10 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", + "frame-benchmarking", "frame-support", "frame-system", "log", @@ -1693,9 +1660,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ - "frame-support", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain", @@ -1709,7 +1675,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1732,7 +1698,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "futures", @@ -1745,18 +1711,14 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", "log", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-primitives", "sp-runtime", "sp-std", - "sp-trie", "xcm", "xcm-builder", "xcm-executor", @@ -1765,7 +1727,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1777,47 +1739,83 @@ dependencies = [ "polkadot-service", "sc-cli", "sc-client-api", - "sc-consensus-babe", - "sc-network", "sc-sysinfo", "sc-telemetry", "sc-tracing", "sp-api", - "sp-blockchain", "sp-consensus", "sp-core", "sp-runtime", "sp-state-machine", - "tracing", ] [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-primitives-core", - "derive_more", "futures", "jsonrpsee-core", "parity-scale-codec", - "parking_lot 0.12.1", "polkadot-overseer", "polkadot-service", "sc-client-api", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", "sp-state-machine", "thiserror", ] +[[package]] +name = "cumulus-relay-chain-minimal-node" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" +dependencies = [ + "array-bytes", + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-rpc-interface", + "futures", + "lru 0.8.1", + "polkadot-availability-distribution", + "polkadot-core-primitives", + "polkadot-network-bridge", + "polkadot-node-core-av-store", + "polkadot-node-network-protocol", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "polkadot-service", + "sc-authority-discovery", + "sc-client-api", + "sc-consensus", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-light", + "sc-network-sync", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-runtime", + "tokio", + "tracing", + "url", +] + [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "backoff", @@ -1827,11 +1825,12 @@ dependencies = [ "futures-timer", "jsonrpsee", "parity-scale-codec", - "parking_lot 0.12.1", "polkadot-service", "sc-client-api", "sc-rpc-api", "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", "sp-core", "sp-runtime", "sp-state-machine", @@ -1844,7 +1843,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1998,6 +1997,12 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + [[package]] name = "digest" version = "0.8.1" @@ -2078,6 +2083,12 @@ dependencies = [ "quick-error", ] +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + [[package]] name = "downcast-rs" version = "1.2.0" @@ -2192,9 +2203,9 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck", "proc-macro2", @@ -2397,7 +2408,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -2418,9 +2429,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", "rand 0.8.5", @@ -2445,6 +2456,15 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2454,25 +2474,30 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -2495,9 +2520,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "Inflector", + "array-bytes", "chrono", "clap", "comfy-table", @@ -2507,7 +2533,6 @@ dependencies = [ "gethostname", "handlebars", "hash-db", - "hex", "itertools", "kvdb", "lazy_static", @@ -2546,7 +2571,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2557,7 +2582,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2573,7 +2598,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -2602,7 +2627,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "bitflags", "frame-metadata", @@ -2627,13 +2652,14 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-tracing", + "sp-weights", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "Inflector", "cfg-expr", @@ -2647,7 +2673,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2659,7 +2685,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro2", "quote", @@ -2669,7 +2695,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "log", @@ -2681,12 +2707,13 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", + "sp-weights", ] [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -2701,7 +2728,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-api", @@ -2710,7 +2737,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "parity-scale-codec", @@ -2725,18 +2752,6 @@ version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi", -] - [[package]] name = "fs2" version = "0.4.3" @@ -3054,15 +3069,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -3099,12 +3105,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "hex_fmt" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" - [[package]] name = "hmac" version = "0.8.1" @@ -3250,6 +3250,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if-addrs" version = "0.7.0" @@ -3262,9 +3272,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "1.1.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" +checksum = "065c008e570a43c00de6aed9714035e5ea6a498c255323db9091722af6ee67dd" dependencies = [ "async-io", "core-foundation", @@ -3289,9 +3299,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ "serde", ] @@ -3314,7 +3324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.3", + "hashbrown", "serde", ] @@ -3344,15 +3354,19 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" +checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" [[package]] name = "io-lifetimes" -version = "0.7.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" +checksum = "a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] [[package]] name = "ip_network" @@ -3609,6 +3623,7 @@ dependencies = [ "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", + "cumulus-relay-chain-minimal-node", "cumulus-relay-chain-rpc-interface", "frame-benchmarking", "frame-benchmarking-cli", @@ -3705,8 +3720,8 @@ dependencies = [ [[package]] name = "kusama-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -3729,10 +3744,12 @@ dependencies = [ "pallet-bounties", "pallet-child-bounties", "pallet-collective", + "pallet-conviction-voting", "pallet-democracy", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-gilt", "pallet-grandpa", "pallet-identity", @@ -3747,7 +3764,9 @@ dependencies = [ "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", + "pallet-ranked-collective", "pallet-recovery", + "pallet-referenda", "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", @@ -3761,6 +3780,7 @@ dependencies = [ "pallet-treasury", "pallet-utility", "pallet-vesting", + "pallet-whitelist", "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", @@ -3798,14 +3818,16 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] @@ -3819,9 +3841,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" +checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" dependencies = [ "parity-util-mem", "smallvec", @@ -3829,9 +3851,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" +checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" dependencies = [ "kvdb", "parity-util-mem", @@ -3840,15 +3862,13 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" +checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" dependencies = [ - "fs-swap", "kvdb", "log", "num_cpus", - "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3870,19 +3890,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" - -[[package]] -name = "libloading" -version = "0.5.2" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libloading" @@ -3902,9 +3912,9 @@ checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" [[package]] name = "libp2p" -version = "0.46.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" +checksum = "ec878fda12ebec479186b3914ebc48ff180fa4c51847e11a1a68bf65249e02c1" dependencies = [ "bytes", "futures", @@ -3912,12 +3922,8 @@ dependencies = [ "getrandom 0.2.7", "instant", "lazy_static", - "libp2p-autonat", "libp2p-core", - "libp2p-deflate", "libp2p-dns", - "libp2p-floodsub", - "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-mdns", @@ -3925,49 +3931,24 @@ dependencies = [ "libp2p-mplex", "libp2p-noise", "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", - "libp2p-relay", - "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", "libp2p-swarm-derive", "libp2p-tcp", - "libp2p-uds", "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr", "parking_lot 0.12.1", "pin-project", - "rand 0.7.3", "smallvec", ] -[[package]] -name = "libp2p-autonat" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-request-response", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.8.5", -] - [[package]] name = "libp2p-core" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" +checksum = "799676bb0807c788065e57551c6527d461ad572162b0519d1958946ff9e0539d" dependencies = [ "asn1_der", "bs58", @@ -3978,7 +3959,6 @@ dependencies = [ "futures-timer", "instant", "lazy_static", - "libsecp256k1", "log", "multiaddr", "multihash", @@ -3988,7 +3968,6 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "ring", "rw-stream-sink", "sha2 0.10.2", "smallvec", @@ -3998,22 +3977,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-deflate" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" -dependencies = [ - "flate2", - "futures", - "libp2p-core", -] - [[package]] name = "libp2p-dns" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" +checksum = "2322c9fb40d99101def6a01612ee30500c89abbbecb6297b3cd252903a4c1720" dependencies = [ "async-std-resolver", "futures", @@ -4025,92 +3993,46 @@ dependencies = [ ] [[package]] -name = "libp2p-floodsub" -version = "0.37.0" +name = "libp2p-identify" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" +checksum = "dcf9a121f699e8719bda2e6e9e9b6ddafc6cff4602471d6481c1067930ccb29b" dependencies = [ - "cuckoofilter", - "fnv", + "asynchronous-codec", "futures", + "futures-timer", "libp2p-core", "libp2p-swarm", "log", + "lru 0.8.1", "prost", "prost-build", - "rand 0.7.3", + "prost-codec", "smallvec", + "thiserror", + "void", ] [[package]] -name = "libp2p-gossipsub" -version = "0.39.0" +name = "libp2p-kad" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" +checksum = "6721c200e2021f6c3fab8b6cf0272ead8912d871610ee194ebd628cecf428f22" dependencies = [ + "arrayvec 0.7.2", "asynchronous-codec", - "base64", - "byteorder", "bytes", + "either", "fnv", "futures", - "hex_fmt", + "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", - "prometheus-client", "prost", "prost-build", - "rand 0.7.3", - "regex", - "sha2 0.10.2", - "smallvec", - "unsigned-varint", - "wasm-timer", -] - -[[package]] -name = "libp2p-identify" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" -dependencies = [ - "asynchronous-codec", - "futures", - "futures-timer", - "libp2p-core", - "libp2p-swarm", - "log", - "lru 0.7.8", - "prost", - "prost-build", - "prost-codec", - "smallvec", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-kad" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" -dependencies = [ - "arrayvec 0.7.2", - "asynchronous-codec", - "bytes", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", + "rand 0.8.5", "sha2 0.10.2", "smallvec", "thiserror", @@ -4121,16 +4043,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.38.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" +checksum = "761704e727f7d68d58d7bc2231eafae5fc1b9814de24290f126df09d4bd37a15" dependencies = [ "async-io", "data-encoding", "dns-parser", "futures", "if-watch", - "lazy_static", "libp2p-core", "libp2p-swarm", "log", @@ -4142,25 +4063,23 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" +checksum = "9ee31b08e78b7b8bfd1c4204a9dd8a87b4fcdf6dafc57eb51701c1c264a81cb9" dependencies = [ "libp2p-core", - "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-ping", - "libp2p-relay", "libp2p-swarm", "prometheus-client", ] [[package]] name = "libp2p-mplex" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" +checksum = "692664acfd98652de739a8acbb0a0d670f1d67190a49be6b4395e22c37337d89" dependencies = [ "asynchronous-codec", "bytes", @@ -4169,16 +4088,16 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "unsigned-varint", ] [[package]] name = "libp2p-noise" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" +checksum = "048155686bd81fe6cb5efdef0c6290f25ad32a0a42e8f4f72625cf6a505a206f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -4198,105 +4117,25 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" -dependencies = [ - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.7.3", - "void", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "log", - "prost", - "prost-build", - "unsigned-varint", - "void", -] - -[[package]] -name = "libp2p-pnet" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" -dependencies = [ - "futures", - "log", - "pin-project", - "rand 0.7.3", - "salsa20", - "sha3 0.9.1", -] - -[[package]] -name = "libp2p-relay" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" -dependencies = [ - "asynchronous-codec", - "bytes", - "either", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "pin-project", - "prost", - "prost-build", - "prost-codec", - "rand 0.8.5", - "smallvec", - "static_assertions", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-rendezvous" -version = "0.7.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" +checksum = "7228b9318d34689521349a86eb39a3c3a802c9efc99a0568062ffb80913e3f91" dependencies = [ - "asynchronous-codec", - "bimap", "futures", "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", "rand 0.8.5", - "sha2 0.10.2", - "thiserror", - "unsigned-varint", "void", ] [[package]] name = "libp2p-request-response" -version = "0.19.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" +checksum = "8827af16a017b65311a410bb626205a9ad92ec0473967618425039fa5231adc1" dependencies = [ "async-trait", "bytes", @@ -4305,16 +4144,16 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.37.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" +checksum = "46d13df7c37807965d82930c0e4b04a659efcb6cca237373b206043db5398ecf" dependencies = [ "either", "fnv", @@ -4324,7 +4163,7 @@ dependencies = [ "libp2p-core", "log", "pin-project", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "thiserror", "void", @@ -4332,48 +4171,36 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.28.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" +checksum = "a0eddc4497a8b5a506013c40e8189864f9c3a00db2b25671f428ae9007f3ba32" dependencies = [ + "heck", "quote", "syn", ] [[package]] name = "libp2p-tcp" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" +checksum = "9839d96761491c6d3e238e70554b856956fca0ab60feb9de2cd08eed4473fa92" dependencies = [ "async-io", "futures", "futures-timer", "if-watch", - "ipnet", "libc", "libp2p-core", "log", "socket2", ] -[[package]] -name = "libp2p-uds" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" -dependencies = [ - "async-std", - "futures", - "libp2p-core", - "log", -] - [[package]] name = "libp2p-wasm-ext" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" +checksum = "a17b5b8e7a73e379e47b1b77f8a82c4721e97eca01abcd18e9cd91a23ca6ce97" dependencies = [ "futures", "js-sys", @@ -4385,9 +4212,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.36.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" +checksum = "3758ae6f89b2531a24b6d9f5776bda6a626b60a57600d7185d43dfa75ca5ecc4" dependencies = [ "either", "futures", @@ -4404,12 +4231,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.38.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" +checksum = "30f079097a21ad017fc8139460630286f02488c8c13b26affb46623aa20d8845" dependencies = [ "futures", "libp2p-core", + "log", "parking_lot 0.12.1", "thiserror", "yamux", @@ -4417,9 +4245,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.6.1+6.28.2" +version = "0.8.0+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" dependencies = [ "bindgen", "bzip2-sys", @@ -4516,15 +4344,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.0.42" +version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.0.46" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +checksum = "bb68f22743a3fb35785f1e7f844ca5a3de2dde5bd0c0ef5b372065814699b121" [[package]] name = "lock_api" @@ -4548,20 +4376,20 @@ dependencies = [ [[package]] name = "lru" -version = "0.6.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.11.2", + "hashbrown", ] [[package]] name = "lru" -version = "0.7.8" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -4736,11 +4564,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.4.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "libc", + "rustix 0.36.1", ] [[package]] @@ -4772,29 +4600,29 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "parity-util-mem", ] [[package]] name = "memory-lru" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" +checksum = "ce95ae042940bad7e312857b929ee3d11b8f799a80cb7b9c7ec5125516906395" dependencies = [ - "lru 0.6.6", + "lru 0.8.1", ] [[package]] name = "memory_units" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "merlin" @@ -4843,14 +4671,35 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] -name = "more-asserts" -version = "0.2.2" +name = "mockall" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" +dependencies = [ + "cfg-if 1.0.0", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" +checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" +dependencies = [ + "cfg-if 1.0.0", + "proc-macro2", + "quote", + "syn", +] [[package]] name = "multiaddr" @@ -4894,7 +4743,7 @@ dependencies = [ "digest 0.10.3", "multihash-derive", "sha2 0.10.2", - "sha3 0.10.2", + "sha3", "unsigned-varint", ] @@ -4920,9 +4769,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" +checksum = "9bc41247ec209813e2fd414d6e16b9d94297dacf3cd613fa6ef09cd4d9755c10" dependencies = [ "bytes", "futures", @@ -5075,6 +4924,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "num-bigint" version = "0.2.6" @@ -5086,6 +4941,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.2" @@ -5122,7 +4988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ "autocfg", - "num-bigint", + "num-bigint 0.2.6", "num-integer", "num-traits", ] @@ -5134,6 +5000,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", + "num-bigint 0.4.3", "num-integer", "num-traits", ] @@ -5158,24 +5025,15 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - [[package]] name = "object" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ + "crc32fast", + "hashbrown", + "indexmap", "memchr", ] @@ -5205,8 +5063,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" -version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aab54694ddaa8a9b703724c6ef04272b2d27bc32d2c855aae5cdd1857216b43" dependencies = [ "async-trait", "dyn-clonable", @@ -5221,8 +5080,9 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a702b2f6bf592b3eb06c00d80d05afaf7a8eff6b41bb361e397d799acc21b45a" dependencies = [ "expander 0.0.6", "itertools", @@ -5248,19 +5108,10 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -[[package]] -name = "owning_ref" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5276,7 +5127,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5292,7 +5143,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5307,7 +5158,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5331,7 +5182,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5351,7 +5202,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5366,7 +5217,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "beefy-primitives", "frame-support", @@ -5382,13 +5233,13 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "beefy-merkle-tree", "beefy-primitives", "frame-support", "frame-system", - "hex", "log", "pallet-beefy", "pallet-mmr", @@ -5405,7 +5256,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5423,7 +5274,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5442,7 +5293,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "3.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5453,7 +5304,6 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "serde", "sp-runtime", "sp-staking", "sp-std", @@ -5462,7 +5312,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5476,17 +5326,36 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-conviction-voting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5507,7 +5376,7 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "sha3 0.10.2", + "sha3", "sp-core", "sp-io", "sp-keystore", @@ -5518,13 +5387,14 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "log", + "pallet-election-provider-support-benchmarking", "parity-scale-codec", "rand 0.7.3", "scale-info", @@ -5541,7 +5411,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5554,7 +5424,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5569,10 +5439,31 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-staking", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5587,7 +5478,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5610,7 +5501,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5626,7 +5517,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5646,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5679,7 +5570,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5696,7 +5587,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5714,7 +5605,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5729,11 +5620,12 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5744,7 +5636,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5761,7 +5653,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5773,6 +5665,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", + "sp-runtime-interface", "sp-staking", "sp-std", ] @@ -5780,7 +5673,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-api", @@ -5790,7 +5683,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5807,7 +5700,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5830,11 +5723,12 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5846,7 +5740,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5861,7 +5755,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5872,10 +5766,28 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-ranked-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5887,10 +5799,28 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-referenda" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5906,7 +5836,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5927,7 +5857,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5943,7 +5873,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5957,7 +5887,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5980,7 +5910,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5991,7 +5921,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "sp-arithmetic", @@ -6000,7 +5930,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6014,7 +5944,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6032,7 +5962,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6051,7 +5981,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6067,7 +5997,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6077,23 +6007,25 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", + "sp-weights", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", "sp-runtime", + "sp-weights", ] [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6110,7 +6042,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6126,7 +6058,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6156,10 +6088,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-whitelist" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-xcm" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "frame-system", @@ -6176,8 +6123,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-benchmarking", "frame-support", @@ -6194,14 +6141,13 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde", ] [[package]] @@ -6250,9 +6196,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.1.5" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -6283,12 +6229,12 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.12.3", + "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot 0.12.1", @@ -6319,9 +6265,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" @@ -6374,7 +6320,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -6409,9 +6355,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "peregrine-runtime" @@ -6582,6 +6528,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "pkg-config" version = "0.3.25" @@ -6596,8 +6553,8 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -6611,8 +6568,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -6625,13 +6582,13 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derive_more", "fatality", "futures", - "lru 0.7.8", + "lru 0.8.1", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6648,12 +6605,12 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "fatality", "futures", - "lru 0.7.8", + "lru 0.8.1", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6669,8 +6626,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "clap", "frame-benchmarking-cli", @@ -6695,8 +6652,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -6735,10 +6692,11 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "always-assert", + "bitvec", "fatality", "futures", "futures-timer", @@ -6756,8 +6714,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -6769,13 +6727,15 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derive_more", "fatality", "futures", - "lru 0.7.8", + "futures-timer", + "indexmap", + "lru 0.8.1", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6792,8 +6752,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -6806,8 +6766,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "futures-timer", @@ -6826,8 +6786,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "always-assert", "async-trait", @@ -6850,8 +6810,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "parity-scale-codec", @@ -6868,15 +6828,15 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "derive_more", "futures", "futures-timer", "kvdb", - "lru 0.7.8", + "lru 0.8.1", "merlin", "parity-scale-codec", "polkadot-node-jaeger", @@ -6897,8 +6857,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "futures", @@ -6917,8 +6877,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "fatality", @@ -6936,8 +6896,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "polkadot-node-subsystem", @@ -6951,8 +6911,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "futures", @@ -6969,8 +6929,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "polkadot-node-subsystem", @@ -6984,8 +6944,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "futures-timer", @@ -7001,13 +6961,13 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "fatality", "futures", "kvdb", - "lru 0.7.8", + "lru 0.8.1", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7020,8 +6980,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "futures", @@ -7037,8 +6997,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "fatality", @@ -7055,8 +7015,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "always-assert", "assert_matches", @@ -7067,7 +7027,7 @@ dependencies = [ "parity-scale-codec", "pin-project", "polkadot-core-primitives", - "polkadot-node-subsystem-util", + "polkadot-node-metrics", "polkadot-parachain", "rand 0.8.5", "rayon", @@ -7087,8 +7047,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "polkadot-node-primitives", @@ -7103,8 +7063,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures", "memory-lru", @@ -7119,8 +7079,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-std", "lazy_static", @@ -7137,8 +7097,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bs58", "futures", @@ -7156,8 +7116,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "derive_more", @@ -7171,6 +7131,7 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", + "sc-network-common", "strum", "thiserror", "tracing-gum", @@ -7178,8 +7139,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bounded-vec", "futures", @@ -7200,8 +7161,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7210,8 +7171,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "derive_more", @@ -7233,8 +7194,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "derive_more", @@ -7242,7 +7203,7 @@ dependencies = [ "futures", "itertools", "kvdb", - "lru 0.7.8", + "lru 0.8.1", "parity-db", "parity-scale-codec", "parity-util-mem", @@ -7266,13 +7227,13 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "futures", "futures-timer", - "lru 0.7.8", + "lru 0.8.1", "orchestra", "parity-util-mem", "parking_lot 0.12.1", @@ -7289,8 +7250,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derive_more", "frame-support", @@ -7306,8 +7267,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "env_logger", "kusama-runtime", @@ -7321,8 +7282,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "frame-system", @@ -7351,8 +7312,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7383,8 +7344,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -7410,6 +7371,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -7471,8 +7433,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -7518,20 +7480,22 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] name = "polkadot-runtime-metrics" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bs58", "parity-scale-codec", @@ -7542,8 +7506,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitflags", "bitvec", @@ -7585,8 +7549,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "beefy-gadget", @@ -7598,7 +7562,7 @@ dependencies = [ "kusama-runtime", "kvdb", "kvdb-rocksdb", - "lru 0.7.8", + "lru 0.8.1", "pallet-babe", "pallet-im-online", "pallet-staking", @@ -7689,8 +7653,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -7710,8 +7674,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -7761,11 +7725,51 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +[[package]] +name = "predicates" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed6bd09a7f7e68f3f0bf710fb7ab9c4615a488b58b5f653382a687701e458c92" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" + +[[package]] +name = "predicates-tree" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "primitive-types" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", @@ -7777,7 +7781,8 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382698e48a268c832d0b181ed438374a6bb708a82a8ca273bb0f61c74cf209c4" dependencies = [ "coarsetime", "crossbeam-queue", @@ -7826,9 +7831,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -7849,21 +7854,21 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.16.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" +checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" dependencies = [ "dtoa", "itoa 1.0.3", - "owning_ref", + "parking_lot 0.12.1", "prometheus-client-derive-text-encode", ] [[package]] name = "prometheus-client-derive-text-encode" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" +checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", @@ -7872,9 +7877,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" dependencies = [ "bytes", "prost-derive", @@ -7882,31 +7887,31 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +checksum = "1d8b442418ea0822409d9e7d047cbf1e7e9e1760b172bf9982cf29d517c93511" dependencies = [ "bytes", - "cfg-if 1.0.0", - "cmake", "heck", "itertools", "lazy_static", "log", "multimap", "petgraph", + "prettyplease", "prost", "prost-types", "regex", + "syn", "tempfile", "which", ] [[package]] name = "prost-codec" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" +checksum = "011ae9ff8359df7915f97302d591cdd9e0e27fbd5a4ddc5bd13b71079bb20987" dependencies = [ "asynchronous-codec", "bytes", @@ -7917,9 +7922,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" dependencies = [ "anyhow", "itertools", @@ -7930,9 +7935,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" dependencies = [ "bytes", "prost", @@ -8157,7 +8162,7 @@ dependencies = [ "derive_more", "fs-err", "itertools", - "static_init", + "static_init 0.5.2", "thiserror", ] @@ -8183,9 +8188,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" dependencies = [ "fxhash", "log", @@ -8219,25 +8224,12 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "env_logger", - "jsonrpsee", "log", "parity-scale-codec", "serde", @@ -8246,6 +8238,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-version", + "substrate-rpc-client", ] [[package]] @@ -8295,9 +8288,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys", @@ -8305,8 +8298,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -8324,23 +8317,37 @@ dependencies = [ "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-gilt", "pallet-grandpa", + "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-offences", + "pallet-preimage", "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", "pallet-session", + "pallet-society", "pallet-staking", "pallet-sudo", "pallet-timestamp", + "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", "pallet-utility", + "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -8366,6 +8373,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "static_assertions", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -8374,14 +8382,16 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] @@ -8414,6 +8424,7 @@ name = "runtime-common" version = "1.9.0" dependencies = [ "attestation", + "cumulus-primitives-core", "frame-support", "frame-system", "kilt-asset-dids", @@ -8477,30 +8488,30 @@ dependencies = [ [[package]] name = "rustix" -version = "0.33.7" +version = "0.35.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" +checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.5.3", + "io-lifetimes 0.7.3", "libc", - "linux-raw-sys 0.0.42", - "winapi", + "linux-raw-sys 0.0.46", + "windows-sys 0.36.1", ] [[package]] name = "rustix" -version = "0.35.9" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" +checksum = "812a2ec2043c4d6bc6482f5be2ab8244613cac2493d128d36c0759e52a626ab3" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.7.3", + "io-lifetimes 1.0.1", "libc", - "linux-raw-sys 0.0.46", - "windows-sys", + "linux-raw-sys 0.1.2", + "windows-sys 0.42.0", ] [[package]] @@ -8568,15 +8579,6 @@ dependencies = [ "rustc_version 0.2.3", ] -[[package]] -name = "salsa20" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" -dependencies = [ - "cipher", -] - [[package]] name = "same-file" version = "1.0.6" @@ -8589,7 +8591,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "sp-core", @@ -8600,7 +8602,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures", @@ -8627,7 +8629,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "futures-timer", @@ -8650,7 +8652,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8666,7 +8668,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.7", @@ -8683,7 +8685,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8694,13 +8696,13 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "chrono", "clap", "fdlimit", "futures", - "hex", "libp2p", "log", "names", @@ -8712,6 +8714,7 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", + "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -8733,7 +8736,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "fnv", "futures", @@ -8761,7 +8764,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "hash-db", "kvdb", @@ -8786,7 +8789,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures", @@ -8810,7 +8813,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures", @@ -8839,14 +8842,14 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "fork-tree", "futures", "log", "merlin", - "num-bigint", + "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", "parity-scale-codec", @@ -8881,7 +8884,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "jsonrpsee", @@ -8903,7 +8906,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8916,7 +8919,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures", @@ -8934,14 +8937,13 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-timestamp", "thiserror", ] [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8968,7 +8970,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "environmental", "parity-scale-codec", @@ -8984,7 +8986,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", @@ -8999,15 +9001,14 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "cfg-if 1.0.0", "libc", "log", "once_cell", "parity-scale-codec", - "parity-wasm 0.42.2", - "rustix 0.33.7", + "parity-wasm 0.45.0", "rustix 0.35.9", "sc-allocator", "sc-executor-common", @@ -9020,16 +9021,16 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", "futures", "futures-timer", - "hex", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9061,7 +9062,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "finality-grandpa", "futures", @@ -9082,7 +9083,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ansi_term", "futures", @@ -9099,10 +9100,10 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", - "hex", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -9114,8 +9115,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", "asynchronous-codec", "bitflags", @@ -9126,7 +9128,6 @@ dependencies = [ "fork-tree", "futures", "futures-timer", - "hex", "ip_network", "libp2p", "linked-hash-map", @@ -9137,7 +9138,6 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "prost", - "prost-build", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9156,20 +9156,41 @@ dependencies = [ "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", - "void", "zeroize", ] +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "cid", + "futures", + "libp2p", + "log", + "prost", + "prost-build", + "sc-client-api", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", + "void", +] + [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "bitflags", "bytes", "futures", + "futures-timer", "libp2p", + "linked_hash_set", "parity-scale-codec", "prost-build", "sc-consensus", @@ -9180,13 +9201,14 @@ dependencies = [ "sp-consensus", "sp-finality-grandpa", "sp-runtime", + "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ahash", "futures", @@ -9204,10 +9226,10 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "futures", - "hex", "libp2p", "log", "parity-scale-codec", @@ -9225,14 +9247,15 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "fork-tree", "futures", - "hex", "libp2p", "log", "lru 0.7.8", + "mockall", "parity-scale-codec", "prost", "prost-build", @@ -9240,6 +9263,7 @@ dependencies = [ "sc-consensus", "sc-network-common", "sc-peerset", + "sc-utils", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -9250,16 +9274,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "array-bytes", + "futures", + "hex", + "libp2p", + "log", + "parity-scale-codec", + "pin-project", + "sc-network-common", + "sc-peerset", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "bytes", "fnv", "futures", "futures-timer", - "hex", "hyper", "hyper-rustls", "libp2p", @@ -9283,7 +9326,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "libp2p", @@ -9296,7 +9339,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9305,7 +9348,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "hash-db", @@ -9335,7 +9378,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "jsonrpsee", @@ -9358,7 +9401,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "jsonrpsee", @@ -9368,10 +9411,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "sc-rpc-spec-v2" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "directories", @@ -9395,12 +9457,15 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", + "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", + "sc-network-transactions", "sc-offchain", "sc-rpc", "sc-rpc-server", + "sc-rpc-spec-v2", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -9427,6 +9492,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", + "static_init 1.0.3", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -9438,7 +9504,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", @@ -9452,7 +9518,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9471,7 +9537,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "libc", @@ -9490,7 +9556,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "chrono", "futures", @@ -9508,7 +9574,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ansi_term", "atty", @@ -9539,7 +9605,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9550,8 +9616,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "async-trait", "futures", "futures-timer", "linked-hash-map", @@ -9576,8 +9643,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "async-trait", "futures", "log", "serde", @@ -9589,7 +9657,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "futures-timer", @@ -9601,9 +9669,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.1.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +checksum = "88d8a765117b237ef233705cc2cc4c6a27fccd46eea6ef0c8c6dae5f3ef407f8" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -9615,9 +9683,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.1.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +checksum = "cdcd47b380d8c4541044e341dcd9475f55ba37ddc50c908d945fc036a8642496" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9632,7 +9700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -9677,6 +9745,7 @@ checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der", "generic-array 0.14.6", + "pkcs8", "subtle", "zeroize", ] @@ -9864,18 +9933,6 @@ dependencies = [ "digest 0.10.3", ] -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - [[package]] name = "sha3" version = "0.10.2" @@ -9959,8 +10016,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "enumn", "parity-scale-codec", @@ -10036,7 +10093,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "hash-db", "log", @@ -10054,7 +10111,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "blake2", "proc-macro-crate", @@ -10066,7 +10123,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10079,7 +10136,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "integer-sqrt", "num-traits", @@ -10094,7 +10151,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10107,7 +10164,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "parity-scale-codec", @@ -10119,7 +10176,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-api", @@ -10131,7 +10188,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures", "log", @@ -10149,7 +10206,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures", @@ -10168,7 +10225,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "parity-scale-codec", @@ -10186,7 +10243,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "merlin", @@ -10209,7 +10266,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10223,7 +10280,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10236,18 +10293,18 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "base58", "bitflags", - "blake2-rfc", + "blake2", "byteorder", "dyn-clonable", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "hex", "impl-serde", "lazy_static", "libsecp256k1", @@ -10282,13 +10339,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "blake2", "byteorder", "digest 0.10.3", "sha2 0.10.2", - "sha3 0.10.2", + "sha3", "sp-std", "twox-hash", ] @@ -10296,7 +10353,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro2", "quote", @@ -10307,7 +10364,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10316,7 +10373,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro2", "quote", @@ -10326,7 +10383,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "environmental", "parity-scale-codec", @@ -10337,7 +10394,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "finality-grandpa", "log", @@ -10355,7 +10412,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10369,7 +10426,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "bytes", "futures", @@ -10395,7 +10452,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "lazy_static", "sp-core", @@ -10406,7 +10463,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures", @@ -10423,7 +10480,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "thiserror", "zstd", @@ -10432,10 +10489,11 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", + "scale-info", "serde", "sp-api", "sp-core", @@ -10447,7 +10505,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10461,7 +10519,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "sp-api", "sp-core", @@ -10471,7 +10529,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "backtrace", "lazy_static", @@ -10481,7 +10539,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "rustc-hash", "serde", @@ -10491,7 +10549,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "either", "hash256-std-hasher", @@ -10508,12 +10566,13 @@ dependencies = [ "sp-core", "sp-io", "sp-std", + "sp-weights", ] [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10531,7 +10590,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "Inflector", "proc-macro-crate", @@ -10543,7 +10602,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", @@ -10557,7 +10616,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10571,7 +10630,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10582,7 +10641,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "hash-db", "log", @@ -10604,12 +10663,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10622,7 +10681,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "sp-core", @@ -10635,7 +10694,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures-timer", @@ -10651,7 +10710,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-std", @@ -10663,7 +10722,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "sp-api", "sp-runtime", @@ -10672,7 +10731,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "log", @@ -10688,11 +10747,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ahash", "hash-db", - "hashbrown 0.12.3", + "hashbrown", "lazy_static", "lru 0.7.8", "memory-db", @@ -10711,11 +10770,11 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-serde", "parity-scale-codec", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "scale-info", "serde", "sp-core-hashing-proc-macro", @@ -10728,7 +10787,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10739,7 +10798,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-trait-for-tuples", "log", @@ -10749,6 +10808,22 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "spin" version = "0.5.2" @@ -10831,11 +10906,21 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "ss58-registry" -version = "1.28.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c8a1e645fa0bd3e81a90e592a677f7ada3182ac338c4a71cd9ec0ba911f6abb" +checksum = "1de151faef619cb7b5c26b32d42bc7ddccac0d202beb7a84344b44e9232b92f7" dependencies = [ "Inflector", "num-format", @@ -10867,7 +10952,22 @@ dependencies = [ "cfg_aliases", "libc", "parking_lot 0.11.2", - "static_init_macro", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.5", + "static_init_macro 1.0.2", + "winapi", ] [[package]] @@ -10883,6 +10983,19 @@ dependencies = [ "syn", ] +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "statrs" version = "0.15.0" @@ -10940,7 +11053,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "platforms", ] @@ -10948,7 +11061,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10969,7 +11082,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures-util", "hyper", @@ -10979,10 +11092,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "substrate-rpc-client" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "async-trait", + "jsonrpsee", + "log", + "sc-rpc-api", + "serde", + "sp-runtime", +] + [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "log", @@ -11003,7 +11129,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ansi_term", "build-helper", @@ -11025,9 +11151,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.99" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -11103,10 +11229,10 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.15.1" +name = "termtree" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" +checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" [[package]] name = "thiserror" @@ -11167,9 +11293,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.4.3+5.2.1-patched.2" +version = "0.5.2+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" dependencies = [ "cc", "fs_extra", @@ -11306,9 +11432,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "pin-project-lite 0.2.9", @@ -11318,9 +11444,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", @@ -11329,9 +11455,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -11349,8 +11475,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -11360,8 +11486,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -11421,7 +11547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "log", "rustc-hex", "smallvec", @@ -11438,9 +11564,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -11449,33 +11575,33 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.2.3", "ipnet", "lazy_static", - "log", "rand 0.8.5", "smallvec", "thiserror", "tinyvec", + "tracing", "url", ] [[package]] name = "trust-dns-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ "cfg-if 1.0.0", "futures-util", "ipconfig", "lazy_static", - "log", "lru-cache", "parking_lot 0.12.1", "resolv-conf", "smallvec", "thiserror", + "tracing", "trust-dns-proto", ] @@ -11488,11 +11614,10 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "clap", "frame-try-runtime", - "jsonrpsee", "log", "parity-scale-codec", "remote-externalities", @@ -11508,6 +11633,8 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-version", + "sp-weights", + "substrate-rpc-client", "zstd", ] @@ -11523,7 +11650,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.3", "rand 0.8.5", "static_assertions", @@ -11625,13 +11752,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna", - "matches", + "idna 0.3.0", "percent-encoding", ] @@ -11793,11 +11919,11 @@ dependencies = [ [[package]] name = "wasm-instrument" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", ] [[package]] @@ -11817,58 +11943,63 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.9.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ - "downcast-rs", - "libc", - "libm", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "wasmi-validation", + "wasmi_core", ] [[package]] name = "wasmi-validation" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +dependencies = [ + "parity-wasm 0.45.0", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" dependencies = [ - "parity-wasm 0.42.2", + "downcast-rs", + "libm", + "memory_units", + "num-rational 0.4.1", + "num-traits", ] [[package]] name = "wasmparser" -version = "0.85.0" +version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ "indexmap", ] [[package]] name = "wasmtime" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" +checksum = "4ad5af6ba38311282f2a21670d96e78266e8c8e2f38cbcd52c254df6ccbc7731" dependencies = [ "anyhow", - "backtrace", "bincode", "cfg-if 1.0.0", "indexmap", - "lazy_static", "libc", "log", - "object 0.28.4", + "object", "once_cell", "paste", "psm", "rayon", - "region", "serde", "target-lexicon", "wasmparser", @@ -11877,14 +12008,23 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45de63ddfc8b9223d1adc8f7b2ee5f35d1f6d112833934ad7ea66e4f4339e597" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] name = "wasmtime-cache" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" +checksum = "bcd849399d17d2270141cfe47fa0d91ee52d5f8ea9b98cf7ddde0d53e5f79882" dependencies = [ "anyhow", "base64", @@ -11892,19 +12032,19 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.33.7", + "rustix 0.35.9", "serde", "sha2 0.9.9", "toml", - "winapi", + "windows-sys 0.36.1", "zstd", ] [[package]] name = "wasmtime-cranelift" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" +checksum = "4bd91339b742ff20bfed4532a27b73c86b5bcbfedd6bea2dcdf2d64471e1b5c6" dependencies = [ "anyhow", "cranelift-codegen", @@ -11914,8 +12054,7 @@ dependencies = [ "cranelift-wasm", "gimli", "log", - "more-asserts", - "object 0.28.4", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -11924,17 +12063,16 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" +checksum = "ebb881c61f4f627b5d45c54e629724974f8a8890d455bcbe634330cc27309644" dependencies = [ "anyhow", "cranelift-entity", "gimli", "indexmap", "log", - "more-asserts", - "object 0.28.4", + "object", "serde", "target-lexicon", "thiserror", @@ -11944,9 +12082,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" +checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681" dependencies = [ "addr2line", "anyhow", @@ -11955,38 +12093,36 @@ dependencies = [ "cpp_demangle", "gimli", "log", - "object 0.28.4", - "region", + "object", "rustc-demangle", - "rustix 0.33.7", + "rustix 0.35.9", "serde", "target-lexicon", "thiserror", "wasmtime-environ", "wasmtime-jit-debug", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-jit-debug" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" +checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" dependencies = [ - "lazy_static", - "object 0.28.4", - "rustix 0.33.7", + "object", + "once_cell", + "rustix 0.35.9", ] [[package]] name = "wasmtime-runtime" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" +checksum = "ee8f92ad4b61736339c29361da85769ebc200f184361959d1792832e592a1afd" dependencies = [ "anyhow", - "backtrace", "cc", "cfg-if 1.0.0", "indexmap", @@ -11995,21 +12131,21 @@ dependencies = [ "mach", "memfd", "memoffset", - "more-asserts", + "paste", "rand 0.8.5", - "region", - "rustix 0.33.7", + "rustix 0.35.9", "thiserror", + "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-types" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" +checksum = "d23d61cb4c46e837b431196dd06abb11731541021916d03476a178b54dc07aeb" dependencies = [ "cranelift-entity", "serde", @@ -12057,8 +12193,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -12082,6 +12218,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -12146,14 +12283,16 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] @@ -12230,6 +12369,27 @@ dependencies = [ "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.34.0" @@ -12242,6 +12402,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.34.0" @@ -12254,6 +12420,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.34.0" @@ -12266,6 +12438,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.34.0" @@ -12278,6 +12456,18 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.34.0" @@ -12290,6 +12480,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.7.0" @@ -12321,8 +12517,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -12335,8 +12531,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "frame-system", @@ -12355,8 +12551,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-benchmarking", "frame-support", @@ -12373,8 +12569,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "Inflector", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index c8c09c7d2..8fc9dbbfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,23 +23,23 @@ version = "1.9.0" [workspace.dependencies] # Build deps -substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} +substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} # External (without extra features and with default disabled if necessary) base58 = {version = "0.2.0", default-features = false} bitflags = {version = "1.3.2", default-features = false} -clap = "3.2.20" +clap = "4.0.9" codec = {package = "parity-scale-codec", version = "3.1.5", default-features = false} env_logger = "0.9.0" hex-literal = "0.3.4" -hex = {version = "0.4", default-features = false} +hex = {version = "0.4.0", default-features = false} jsonrpsee = "0.15.1" libsecp256k1 = {version = "0.7", default-features = false} log = "0.4.17" scale-info = {version = "2.1.1", default-features = false} serde = "1.0.144" -serde_json = "1.0.83" -sha3 = {version = "0.10", default-features = false} +serde_json = "1.0.85" +sha3 = {version = "0.10.0", default-features = false} smallvec = "1.8.0" # Internal pallets (with default disabled) @@ -70,110 +70,111 @@ peregrine-runtime = {path = "runtimes/peregrine", default-features = false} spiritnet-runtime = {path = "runtimes/spiritnet", default-features = false} # Benchmarking (with default disabled) -cumulus-pallet-session-benchmarking = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -frame-system-benchmarking = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} +cumulus-pallet-session-benchmarking = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +frame-system-benchmarking = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} # Cumulus (with default disabled) -cumulus-pallet-aura-ext = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-pallet-dmp-queue = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-pallet-solo-to-para = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-pallet-parachain-system = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-pallet-xcm = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-pallet-xcmp-queue = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-primitives-timestamp = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -cumulus-primitives-utility = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -pallet-collator-selection = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} -parachain-info = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29"} +cumulus-pallet-aura-ext = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-pallet-dmp-queue = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-pallet-solo-to-para = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-pallet-parachain-system = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-pallet-xcm = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-pallet-xcmp-queue = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-primitives-timestamp = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +cumulus-primitives-utility = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +pallet-collator-selection = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} +parachain-info = {git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32"} # Substrate (with default disabled) -frame-benchmarking = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -frame-executive = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -frame-support = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -frame-system = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -frame-system-rpc-runtime-api = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -frame-try-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-aura = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-authorship = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-balances = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-collective = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-democracy = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-grandpa = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-indices = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-membership = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-preimage = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-proxy = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-randomness-collective-flip = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-scheduler = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-session = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-sudo = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-timestamp = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-tips = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-transaction-payment = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-transaction-payment-rpc-runtime-api = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-treasury = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-utility = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -pallet-vesting = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-api = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-block-builder = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-consensus-aura = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-core = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-inherents = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-io = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-offchain = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-session = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-staking = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-std = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-transaction-pool = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -sp-version = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} -try-runtime-cli = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29"} +frame-benchmarking = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +frame-executive = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +frame-support = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +frame-system = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +frame-system-rpc-runtime-api = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +frame-try-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-aura = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-authorship = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-balances = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-collective = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-democracy = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-grandpa = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-indices = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-membership = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-preimage = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-proxy = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-randomness-collective-flip = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-scheduler = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-session = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-sudo = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-timestamp = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-tips = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-transaction-payment = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-transaction-payment-rpc-runtime-api = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-treasury = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-utility = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +pallet-vesting = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-api = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-block-builder = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-consensus-aura = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-core = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-inherents = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-io = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-offchain = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-session = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-staking = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-std = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-transaction-pool = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +sp-version = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} +try-runtime-cli = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32"} # Polkadot (with default disabled) -pallet-xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29"} -polkadot-parachain = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29"} -xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29"} -xcm-builder = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29"} -xcm-executor = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29"} +pallet-xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.32"} +polkadot-parachain = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.32"} +xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.32"} +xcm-builder = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.32"} +xcm-executor = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.32"} # Client-only (with default enabled) -cumulus-client-cli = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-client-network = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-client-service = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-relay-chain-inprocess-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -cumulus-relay-chain-rpc-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29"} -pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -polkadot-cli = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29"} -polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29"} -polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29"} -sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-finality-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-rpc-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sp-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sp-finality-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sp-keyring = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -substrate-frame-rpc-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} -substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29"} +cumulus-client-cli = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-client-network = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-client-service = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-relay-chain-inprocess-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-relay-chain-minimal-node = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +cumulus-relay-chain-rpc-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32"} +pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +polkadot-cli = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.32"} +polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.32"} +polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.32"} +sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-finality-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-rpc-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sp-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sp-finality-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sp-keyring = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +substrate-frame-rpc-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} +substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32"} diff --git a/nodes/parachain/Cargo.toml b/nodes/parachain/Cargo.toml index 06cfc79be..e3d47c870 100644 --- a/nodes/parachain/Cargo.toml +++ b/nodes/parachain/Cargo.toml @@ -77,6 +77,7 @@ cumulus-primitives-core = {workspace = true, features = ["std"]} cumulus-primitives-parachain-inherent = {workspace = true, features = ["std"]} cumulus-relay-chain-inprocess-interface.workspace = true cumulus-relay-chain-interface.workspace = true +cumulus-relay-chain-minimal-node.workspace = true cumulus-relay-chain-rpc-interface.workspace = true # Polkadot dependencies @@ -99,12 +100,25 @@ fast-gov = [ "runtime-common/fast-gov", ] runtime-benchmarks = [ + "clone-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", + "polkadot-cli/runtime-benchmarks", + "polkadot-primitives/runtime-benchmarks", "polkadot-service/runtime-benchmarks", + "runtime-common/runtime-benchmarks", "peregrine-runtime/runtime-benchmarks", + "sc-service/runtime-benchmarks", "spiritnet-runtime/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm/runtime-benchmarks", ] try-runtime = [ + "clone-runtime/try-runtime", "peregrine-runtime/try-runtime", + "polkadot-cli/try-runtime", + "polkadot-service/try-runtime", + "runtime-common/try-runtime", "spiritnet-runtime/try-runtime", "try-runtime-cli", ] diff --git a/nodes/parachain/src/cli.rs b/nodes/parachain/src/cli.rs index fe3b69d98..71afb4b0c 100644 --- a/nodes/parachain/src/cli.rs +++ b/nodes/parachain/src/cli.rs @@ -53,7 +53,7 @@ pub(crate) enum Subcommand { /// Sub-commands concerned with benchmarking. /// The pallet benchmarking moved to the `pallet` sub-command. - #[clap(subcommand)] + #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), /// Try some command against runtime state. @@ -69,11 +69,11 @@ pub(crate) enum Subcommand { /// Command for building the genesis state of the parachain #[derive(Debug, Parser)] pub(crate) struct BuildSpecCmd { - #[clap(flatten)] + #[command(flatten)] pub(crate) inner_args: sc_cli::BuildSpecCmd, /// The name of the runtime which should get executed. - #[clap(long, default_value = DEFAULT_RUNTIME)] + #[arg(long, default_value = DEFAULT_RUNTIME)] pub(crate) runtime: String, } @@ -86,16 +86,16 @@ impl Deref for BuildSpecCmd { } #[derive(Debug, clap::Parser)] -#[clap( +#[command( propagate_version = true, args_conflicts_with_subcommands = true, subcommand_negates_reqs = true )] pub(crate) struct Cli { - #[clap(subcommand)] + #[command(subcommand)] pub(crate) subcommand: Option, - #[clap(flatten)] + #[command(flatten)] pub(crate) run: cumulus_client_cli::RunCmd, // Disable automatic hardware benchmarks. @@ -105,16 +105,16 @@ pub(crate) struct Cli { /// /// The results are then printed out in the logs, and also sent as part of /// telemetry, if telemetry is enabled. - #[clap(long)] + #[arg(long)] pub no_hardware_benchmarks: bool, /// The name of the runtime which should get executed. - #[clap(long, default_value = DEFAULT_RUNTIME)] + #[arg(long, default_value = DEFAULT_RUNTIME)] pub(crate) runtime: String, /// Relaychain arguments - #[clap(raw = true)] - pub(crate) relaychain_args: Vec, + #[arg(raw = true)] + pub(crate) relay_chain_args: Vec, } #[derive(Debug)] diff --git a/nodes/parachain/src/command.rs b/nodes/parachain/src/command.rs index d012ed6d7..b36d28854 100644 --- a/nodes/parachain/src/command.rs +++ b/nodes/parachain/src/command.rs @@ -25,7 +25,7 @@ use codec::Encode; use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; -use log::info; +use log::{info, warn}; #[cfg(feature = "try-runtime")] use polkadot_service::TaskManager; use runtime_common::Block; @@ -35,7 +35,7 @@ use sc_cli::{ }; use sc_service::config::{BasePath, PrometheusConfig}; use sp_core::hexdisplay::HexDisplay; -use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; +use sp_runtime::traits::{AccountIdConversion, Block as BlockT, Zero}; use std::net::SocketAddr; trait IdentifyChain { @@ -271,7 +271,7 @@ pub fn run() -> Result<()> { &config, [RelayChainCli::executable_name()] .iter() - .chain(cli.relaychain_args.iter()), + .chain(cli.relay_chain_args.iter()), ); let polkadot_config = @@ -336,6 +336,14 @@ pub fn run() -> Result<()> { )?; cmd.run(partials.client) }), + #[cfg(not(feature = "runtime-benchmarks"))] + (BenchmarkCmd::Storage(_), _) => Err(sc_cli::Error::Input( + "Compile with --features=runtime-benchmarks \ + to enable storage benchmarks." + .into(), + ) + .into()), + #[cfg(feature = "runtime-benchmarks")] (BenchmarkCmd::Storage(cmd), "spiritnet") => runner.sync_run(|config| { let partials = new_partial::( &config, @@ -347,6 +355,7 @@ pub fn run() -> Result<()> { cmd.run(config, partials.client.clone(), db, storage) }), + #[cfg(feature = "runtime-benchmarks")] (BenchmarkCmd::Storage(cmd), "peregrine") => runner.sync_run(|config| { let partials = new_partial::( &config, @@ -358,6 +367,7 @@ pub fn run() -> Result<()> { cmd.run(config, partials.client.clone(), db, storage) }), + #[cfg(feature = "runtime-benchmarks")] (BenchmarkCmd::Storage(cmd), "clone") => runner.sync_run(|config| { let partials = new_partial::( &config, @@ -421,7 +431,7 @@ pub fn run() -> Result<()> { &config, [RelayChainCli::executable_name()] .iter() - .chain(cli.relaychain_args.iter()), + .chain(cli.relay_chain_args.iter()), ); let id = ParaId::from(para_id); @@ -446,6 +456,10 @@ pub fn run() -> Result<()> { if config.role.is_authority() { "yes" } else { "no" } ); + if collator_options.relay_chain_rpc_url.is_some() && !cli.relay_chain_args.len().is_zero() { + warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options."); + } + if config.chain_spec.is_peregrine() { crate::service::start_node::( config, diff --git a/nodes/parachain/src/service.rs b/nodes/parachain/src/service.rs index 81f1e8f49..06dd73cad 100644 --- a/nodes/parachain/src/service.rs +++ b/nodes/parachain/src/service.rs @@ -29,9 +29,8 @@ use cumulus_client_service::{ use cumulus_primitives_core::ParaId; use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; -use cumulus_relay_chain_rpc_interface::{create_client_and_start_worker, RelayChainRpcInterface}; +use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node; use polkadot_service::{CollatorPair, NativeExecutionDispatch}; -use sc_client_api::ExecutorProvider; use sc_executor::NativeElseWasmExecutor; use sc_network::{NetworkBlock, NetworkService}; use sc_service::{Configuration, TFullBackend, TFullClient, TaskManager}; @@ -181,7 +180,7 @@ where &task_manager, )?; - let params = PartialComponents { + Ok(PartialComponents { backend, client, import_queue, @@ -190,9 +189,7 @@ where transaction_pool, select_chain: (), other: (telemetry, telemetry_worker_handle), - }; - - Ok(params) + }) } async fn build_relay_chain_interface( @@ -204,10 +201,7 @@ async fn build_relay_chain_interface( hwbench: Option, ) -> RelayChainResult<(Arc<(dyn RelayChainInterface + 'static)>, Option)> { match collator_options.relay_chain_rpc_url { - Some(relay_chain_url) => { - let client = create_client_and_start_worker(relay_chain_url, task_manager).await?; - Ok((Arc::new(RelayChainRpcInterface::new(client)) as Arc<_>, None)) - } + Some(relay_chain_url) => build_minimal_relay_chain_node(polkadot_config, task_manager, relay_chain_url).await, None => build_inprocess_relay_chain( polkadot_config, parachain_config, @@ -310,15 +304,16 @@ where let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue); - let (network, system_rpc_tx, start_network) = sc_service::build_network(sc_service::BuildNetworkParams { - config: ¶chain_config, - client: client.clone(), - transaction_pool: transaction_pool.clone(), - spawn_handle: task_manager.spawn_handle(), - import_queue: import_queue.clone(), - block_announce_validator_builder: Some(Box::new(|_| Box::new(block_announce_validator))), - warp_sync: None, - })?; + let (network, system_rpc_tx, tx_handler_controller, start_network) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: ¶chain_config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue: import_queue.clone(), + block_announce_validator_builder: Some(Box::new(|_| Box::new(block_announce_validator))), + warp_sync: None, + })?; let rpc_builder = { let client = client.clone(); @@ -345,6 +340,7 @@ where backend: backend.clone(), network: network.clone(), system_rpc_tx, + tx_handler_controller, telemetry: telemetry.as_mut(), })?; @@ -382,7 +378,6 @@ where )?; let spawner = task_manager.spawn_handle(); - let params = StartCollatorParams { para_id: id, block_status: client.clone(), @@ -407,7 +402,6 @@ where relay_chain_interface, relay_chain_slot_duration, import_queue, - collator_options, }; start_full_node(params)?; @@ -446,22 +440,21 @@ where { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; - cumulus_client_consensus_aura::import_queue::( + cumulus_client_consensus_aura::import_queue::( cumulus_client_consensus_aura::ImportQueueParams { block_import: client.clone(), - client: client.clone(), + client, create_inherent_data_providers: move |_, _| async move { - let time = sp_timestamp::InherentDataProvider::from_system_time(); + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *time, + *timestamp, slot_duration, ); - Ok((time, slot)) + Ok((slot, timestamp)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), spawner: &task_manager.spawn_essential_handle(), telemetry, }, @@ -539,17 +532,17 @@ where id, ) .await; - let time = sp_timestamp::InherentDataProvider::from_system_time(); + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *time, + *timestamp, slot_duration, ); let parachain_inherent = parachain_inherent.ok_or_else(|| { Box::::from("Failed to create parachain inherent") })?; - Ok((time, slot, parachain_inherent)) + Ok((slot, timestamp, parachain_inherent)) } }, block_import: client.clone(), diff --git a/nodes/standalone/Cargo.toml b/nodes/standalone/Cargo.toml index 6efa52a15..7eeabca20 100644 --- a/nodes/standalone/Cargo.toml +++ b/nodes/standalone/Cargo.toml @@ -70,10 +70,18 @@ try-runtime-cli = {workspace = true, optional = true} [features] default = [] runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", + "frame-system/runtime-benchmarks", "mashnet-node-runtime/runtime-benchmarks", "runtime-common/runtime-benchmarks", + "sc-service/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] try-runtime = [ + "frame-system/try-runtime", "mashnet-node-runtime/try-runtime", + "pallet-transaction-payment/try-runtime", + "runtime-common/try-runtime", "try-runtime-cli", ] diff --git a/nodes/standalone/src/benchmarking.rs b/nodes/standalone/src/benchmarking.rs index 0206c3d58..361f70fdc 100644 --- a/nodes/standalone/src/benchmarking.rs +++ b/nodes/standalone/src/benchmarking.rs @@ -120,7 +120,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { pub fn create_benchmark_extrinsic( client: &FullClient, sender: sp_core::sr25519::Pair, - call: runtime::Call, + call: runtime::RuntimeCall, nonce: u32, ) -> runtime::UncheckedExtrinsic { let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); diff --git a/nodes/standalone/src/cli.rs b/nodes/standalone/src/cli.rs index d05376123..aad8b23d6 100644 --- a/nodes/standalone/src/cli.rs +++ b/nodes/standalone/src/cli.rs @@ -21,17 +21,17 @@ use sc_cli::RunCmd; #[derive(Debug, Parser)] pub struct Cli { - #[clap(subcommand)] + #[command(subcommand)] pub subcommand: Option, - #[clap(flatten)] + #[command(flatten)] pub run: RunCmd, } #[derive(Debug, Parser)] pub enum Subcommand { /// Key management cli utilities - #[clap(subcommand)] + #[command(subcommand)] Key(sc_cli::KeySubcommand), /// Build a chain specification. @@ -56,7 +56,7 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Sub-commands concerned with benchmarking. - #[clap(subcommand)] + #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), /// Try some command against runtime state. diff --git a/nodes/standalone/src/command.rs b/nodes/standalone/src/command.rs index df62f4b27..a7f426d49 100644 --- a/nodes/standalone/src/command.rs +++ b/nodes/standalone/src/command.rs @@ -143,7 +143,7 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| { - let PartialComponents { client, backend, .. } = service::new_partial(&config)?; + let PartialComponents { client, .. } = service::new_partial(&config)?; // This switch needs to be in the client, since the client decides // which sub-commands it wants to support. match cmd { @@ -157,7 +157,13 @@ pub fn run() -> sc_cli::Result<()> { cmd.run::(config) } BenchmarkCmd::Block(cmd) => cmd.run(client), + #[cfg(not(feature = "runtime-benchmarks"))] + BenchmarkCmd::Storage(_) => { + Err("Storage benchmarking can be enabled with `--features runtime-benchmarks`.".into()) + } + #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Storage(cmd) => { + let PartialComponents { client, backend, .. } = service::new_partial(&config)?; let db = backend.expose_db(); let storage = backend.expose_storage(); diff --git a/nodes/standalone/src/service.rs b/nodes/standalone/src/service.rs index 82e93e733..78e2eda96 100644 --- a/nodes/standalone/src/service.rs +++ b/nodes/standalone/src/service.rs @@ -19,7 +19,7 @@ //! Service and ServiceFactory implementation. Specialized wrapper over //! substrate service. -use sc_client_api::{BlockBackend, ExecutorProvider}; +use sc_client_api::BlockBackend; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; pub use sc_executor::NativeElseWasmExecutor; use sc_finality_grandpa::SharedVoterState; @@ -117,7 +117,7 @@ pub fn new_partial(config: &Configuration) -> Result(ImportQueueParams { + let import_queue = sc_consensus_aura::import_queue::(ImportQueueParams { block_import: grandpa_block_import.clone(), justification_import: Some(Box::new(grandpa_block_import.clone())), client: client.clone(), @@ -129,10 +129,9 @@ pub fn new_partial(config: &Configuration) -> Result Result Vec::default(), )); - let (network, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { - config: &config, - client: client.clone(), - transaction_pool: transaction_pool.clone(), - spawn_handle: task_manager.spawn_handle(), - import_queue, - block_announce_validator_builder: None, - warp_sync: Some(warp_sync), - })?; + let (network, system_rpc_tx, tx_handler_controller, network_starter) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: &config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue, + block_announce_validator_builder: None, + warp_sync: Some(warp_sync), + })?; if config.offchain_worker.enabled { sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone()); @@ -242,6 +242,7 @@ pub fn new_full(mut config: Configuration) -> Result rpc_builder: rpc_extensions_builder, backend, system_rpc_tx, + tx_handler_controller, config, telemetry: telemetry.as_mut(), })?; @@ -255,11 +256,9 @@ pub fn new_full(mut config: Configuration) -> Result telemetry.as_ref().map(|x| x.handle()), ); - let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let aura = sc_consensus_aura::start_aura::(StartAuraParams { + let aura = sc_consensus_aura::start_aura::(StartAuraParams { slot_duration, client, select_chain, @@ -273,12 +272,11 @@ pub fn new_full(mut config: Configuration) -> Result slot_duration, ); - Ok((timestamp, slot)) + Ok((slot, timestamp)) }, force_authoring, backoff_authoring_blocks, keystore: keystore_container.sync_keystore(), - can_author_with, sync_oracle: network.clone(), justification_sync_link: network.clone(), block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), diff --git a/pallets/attestation/Cargo.toml b/pallets/attestation/Cargo.toml index 6c66c902c..9cc6b7a98 100644 --- a/pallets/attestation/Cargo.toml +++ b/pallets/attestation/Cargo.toml @@ -61,10 +61,12 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "kilt-support/runtime-benchmarks", "sp-core", + "sp-runtime/runtime-benchmarks" ] std = [ "codec/std", "ctype/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "kilt-support/std", @@ -78,4 +80,5 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", ] diff --git a/pallets/attestation/src/benchmarking.rs b/pallets/attestation/src/benchmarking.rs index 479e0a65d..b5d09c4d2 100644 --- a/pallets/attestation/src/benchmarking.rs +++ b/pallets/attestation/src/benchmarking.rs @@ -31,7 +31,7 @@ benchmarks! { where_clause { where T: core::fmt::Debug, - ::EnsureOrigin: GenerateBenchmarkOrigin, + ::EnsureOrigin: GenerateBenchmarkOrigin, T: ctype::Config, } @@ -45,7 +45,7 @@ benchmarks! { ::Currency::make_free_balance_be(&sender, ::Deposit::get() + ::Deposit::get()); let origin = ::EnsureOrigin::generate_origin(sender.clone(), attester.clone()); - }: _(origin, claim_hash, ctype_hash, None) + }: _(origin, claim_hash, ctype_hash, None) verify { assert!(Attestations::::contains_key(claim_hash)); assert_eq!(Pallet::::attestations(claim_hash), Some(AttestationDetails { @@ -71,7 +71,7 @@ benchmarks! { let origin = ::EnsureOrigin::generate_origin(sender.clone(), attester.clone()); Pallet::::add(origin.clone(), claim_hash, ctype_hash, None)?; - }: _(origin, claim_hash, None) + }: _(origin, claim_hash, None) verify { assert!(Attestations::::contains_key(claim_hash)); assert_eq!(Attestations::::get(claim_hash), Some(AttestationDetails { @@ -98,7 +98,7 @@ benchmarks! { let origin = ::EnsureOrigin::generate_origin(sender.clone(), attester.clone()); Pallet::::add(origin, claim_hash, ctype_hash, None)?; let origin = ::EnsureOrigin::generate_origin(sender, attester); - }: _(origin, claim_hash, None) + }: _(origin, claim_hash, None) verify { assert!(!Attestations::::contains_key(claim_hash)); } @@ -134,7 +134,7 @@ benchmarks! { let origin = ::EnsureOrigin::generate_origin(deposit_owner_old, attester.clone()); Pallet::::add(origin, claim_hash, ctype_hash, None)?; let origin = ::EnsureOrigin::generate_origin(deposit_owner_new.clone(), attester.clone()); - }: _(origin, claim_hash) + }: _(origin, claim_hash) verify { assert_eq!(Attestations::::get(claim_hash), Some(AttestationDetails { ctype_hash, diff --git a/pallets/attestation/src/lib.rs b/pallets/attestation/src/lib.rs index e01e25f86..e4fd04995 100644 --- a/pallets/attestation/src/lib.rs +++ b/pallets/attestation/src/lib.rs @@ -115,11 +115,11 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + ctype::Config { type EnsureOrigin: EnsureOrigin< + ::RuntimeOrigin, Success = ::OriginSuccess, - ::Origin, >; type OriginSuccess: CallSources, AttesterOf>; - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type WeightInfo: WeightInfo; /// The currency that is used to reserve funds for each attestation. diff --git a/pallets/attestation/src/mock.rs b/pallets/attestation/src/mock.rs index 489d7b08a..3417c805b 100644 --- a/pallets/attestation/src/mock.rs +++ b/pallets/attestation/src/mock.rs @@ -214,8 +214,8 @@ pub(crate) mod runtime { } impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = Hash; @@ -223,7 +223,7 @@ pub(crate) mod runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type RuntimeEvent = (); type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = (); @@ -250,7 +250,7 @@ pub(crate) mod runtime { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); @@ -267,7 +267,7 @@ pub(crate) mod runtime { type CtypeCreatorId = SubjectId; type EnsureOrigin = mock_origin::EnsureDoubleOrigin; type OriginSuccess = mock_origin::DoubleOrigin; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; @@ -276,7 +276,7 @@ pub(crate) mod runtime { } impl mock_origin::Config for Test { - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type AccountId = AccountId; type SubjectId = SubjectId; } @@ -289,7 +289,7 @@ pub(crate) mod runtime { impl Config for Test { type EnsureOrigin = mock_origin::EnsureDoubleOrigin>; type OriginSuccess = mock_origin::DoubleOrigin>; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; diff --git a/pallets/attestation/src/tests.rs b/pallets/attestation/src/tests.rs index 25d81e8b0..edcdd10db 100644 --- a/pallets/attestation/src/tests.rs +++ b/pallets/attestation/src/tests.rs @@ -416,7 +416,10 @@ fn test_reclaim_deposit() { .build() .execute_with(|| { assert_eq!(Balances::reserved_balance(ACCOUNT_00), ::Deposit::get()); - assert_ok!(Attestation::reclaim_deposit(Origin::signed(ACCOUNT_00), claim_hash)); + assert_ok!(Attestation::reclaim_deposit( + RuntimeOrigin::signed(ACCOUNT_00), + claim_hash + )); assert!(!Attestation::external_attestations( other_authorized.clone(), claim_hash @@ -439,7 +442,10 @@ fn test_reclaim_deposit_authorization() { .build() .execute_with(|| { assert_eq!(Balances::reserved_balance(ACCOUNT_00), ::Deposit::get()); - assert_ok!(Attestation::reclaim_deposit(Origin::signed(ACCOUNT_00), claim_hash)); + assert_ok!(Attestation::reclaim_deposit( + RuntimeOrigin::signed(ACCOUNT_00), + claim_hash + )); assert!(Attestation::attestations(claim_hash).is_none()); assert!(Balances::reserved_balance(ACCOUNT_00).is_zero()); }); @@ -458,7 +464,7 @@ fn test_reclaim_unauthorized() { .build() .execute_with(|| { assert_noop!( - Attestation::reclaim_deposit(Origin::signed(ACCOUNT_01), claim_hash), + Attestation::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_01), claim_hash), attestation::Error::::Unauthorized, ); }); @@ -476,7 +482,7 @@ fn test_reclaim_deposit_not_found() { .build() .execute_with(|| { assert_noop!( - Attestation::reclaim_deposit(Origin::signed(ACCOUNT_01), claim_hash), + Attestation::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_01), claim_hash), attestation::Error::::AttestationNotFound, ); }); @@ -602,7 +608,10 @@ fn test_update_deposit() { Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() * 2 ); - assert_ok!(Attestation::update_deposit(Origin::signed(ACCOUNT_00), claim_hash)); + assert_ok!(Attestation::update_deposit( + RuntimeOrigin::signed(ACCOUNT_00), + claim_hash + )); assert_eq!( Attestation::attestations(claim_hash) .expect("Attestation must be retained") @@ -640,7 +649,7 @@ fn test_update_deposit_unauthorized() { ::Deposit::get() * 2 ); assert_noop!( - Attestation::update_deposit(Origin::signed(ACCOUNT_01), claim_hash), + Attestation::update_deposit(RuntimeOrigin::signed(ACCOUNT_01), claim_hash), Error::::Unauthorized ); }); diff --git a/pallets/ctype/Cargo.toml b/pallets/ctype/Cargo.toml index 86086fa2f..6614ffe95 100644 --- a/pallets/ctype/Cargo.toml +++ b/pallets/ctype/Cargo.toml @@ -55,10 +55,11 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", "kilt-support/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ "codec/std", - "frame-benchmarking/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "kilt-support/std", @@ -73,4 +74,5 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", ] diff --git a/pallets/ctype/src/benchmarking.rs b/pallets/ctype/src/benchmarking.rs index 95726055c..a28689582 100644 --- a/pallets/ctype/src/benchmarking.rs +++ b/pallets/ctype/src/benchmarking.rs @@ -39,7 +39,7 @@ benchmarks! { where <::Currency as Currency>>::Balance: TryFrom, <<::Currency as Currency<::AccountId>>::Balance as TryFrom>::Error: Debug, - T::EnsureOrigin: GenerateBenchmarkOrigin, + T::EnsureOrigin: GenerateBenchmarkOrigin, } add { @@ -55,7 +55,7 @@ benchmarks! { ::Currency::make_free_balance_be(&caller, initial_balance); let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); - }: _(origin, ctype) + }: _(origin, ctype) verify { let stored_ctype_creator: T::CtypeCreatorId = Ctypes::::get(ctype_hash).expect("CType hash should be present on chain."); diff --git a/pallets/ctype/src/lib.rs b/pallets/ctype/src/lib.rs index 73f84d530..05c898563 100644 --- a/pallets/ctype/src/lib.rs +++ b/pallets/ctype/src/lib.rs @@ -85,9 +85,9 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type EnsureOrigin: EnsureOrigin::Origin>; + type EnsureOrigin: EnsureOrigin<::RuntimeOrigin, Success = Self::OriginSuccess>; type OriginSuccess: CallSources, CtypeCreatorOf>; - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type Currency: Currency>; type WeightInfo: WeightInfo; type CtypeCreatorId: Parameter + MaxEncodedLen; diff --git a/pallets/ctype/src/mock.rs b/pallets/ctype/src/mock.rs index 03919dacb..1e5bbfb51 100644 --- a/pallets/ctype/src/mock.rs +++ b/pallets/ctype/src/mock.rs @@ -78,8 +78,8 @@ pub mod runtime { } impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = Hash; @@ -87,7 +87,7 @@ pub mod runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type RuntimeEvent = (); type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = (); @@ -114,7 +114,7 @@ pub mod runtime { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); @@ -124,7 +124,7 @@ pub mod runtime { } impl mock_origin::Config for Test { - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type AccountId = AccountId; type SubjectId = SubjectId; } @@ -137,7 +137,7 @@ pub mod runtime { type CtypeCreatorId = SubjectId; type EnsureOrigin = mock_origin::EnsureDoubleOrigin; type OriginSuccess = mock_origin::DoubleOrigin; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; diff --git a/pallets/delegation/Cargo.toml b/pallets/delegation/Cargo.toml index 691e6138d..5229c1463 100644 --- a/pallets/delegation/Cargo.toml +++ b/pallets/delegation/Cargo.toml @@ -64,13 +64,16 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "kilt-support/runtime-benchmarks", + "public-credentials/runtime-benchmarks", "sp-core", "sp-io", + "sp-runtime/runtime-benchmarks", ] std = [ "attestation/std", "codec/std", "ctype/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "kilt-support/std", @@ -85,5 +88,7 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", "kilt-support/try-runtime", + "public-credentials/try-runtime", ] diff --git a/pallets/delegation/src/benchmarking.rs b/pallets/delegation/src/benchmarking.rs index 73dd553b7..2c0580e05 100644 --- a/pallets/delegation/src/benchmarking.rs +++ b/pallets/delegation/src/benchmarking.rs @@ -60,7 +60,7 @@ where T::DelegationEntityId: From, T::DelegationNodeId: From, T::CtypeCreatorId: From, - ::EnsureOrigin: GenerateBenchmarkOrigin, + ::EnsureOrigin: GenerateBenchmarkOrigin, { log::info!("create delegation root"); let root_public = sr25519_generate(KeyTypeId(*b"aura"), None); @@ -111,7 +111,7 @@ where T::DelegationEntityId, <::DelegationSignatureVerification as VerifySignature>::Payload, )>, - ::EnsureOrigin: GenerateBenchmarkOrigin, + ::EnsureOrigin: GenerateBenchmarkOrigin, { if level == 0 { return Ok((parent_acc_public, parent_acc_id, parent_id)); @@ -191,7 +191,7 @@ where T::DelegationEntityId, <::DelegationSignatureVerification as VerifySignature>::Payload, )>, - ::EnsureOrigin: GenerateBenchmarkOrigin, + ::EnsureOrigin: GenerateBenchmarkOrigin, { let ( DelegationTriplet:: { @@ -226,7 +226,7 @@ benchmarks! { T::DelegationEntityId, <::DelegationSignatureVerification as VerifySignature>::Payload, )>, - ::EnsureOrigin: GenerateBenchmarkOrigin, + ::EnsureOrigin: GenerateBenchmarkOrigin, } create_hierarchy { @@ -241,7 +241,7 @@ benchmarks! { ); let origin = ::EnsureOrigin::generate_origin(sender, creator); - }: _(origin, delegation, ctype) + }: _(origin, delegation, ctype) verify { assert!(DelegationHierarchies::::contains_key(delegation)); } @@ -281,7 +281,7 @@ benchmarks! { ::Currency::minimum_balance() + ::Deposit::get(), ); let origin = ::EnsureOrigin::generate_origin(sender, leaf_acc_id); - }: _(origin, delegation_id, hierarchy_id, delegate_acc_id, perm, sig) + }: _(origin, delegation_id, hierarchy_id, delegate_acc_id, perm, sig) verify { assert!(DelegationNodes::::contains_key(delegation_id)); } @@ -305,7 +305,7 @@ benchmarks! { ::Currency::minimum_balance() + ::Deposit::get(), ); let origin = ::EnsureOrigin::generate_origin(sender, child_delegation.details.owner); - }: revoke_delegation(origin, child_id, c, r) + }: revoke_delegation(origin, child_id, c, r) verify { assert!(DelegationNodes::::contains_key(child_id)); let DelegationNode:: { details, .. } = DelegationNodes::::get(leaf_id).ok_or("Child of root should have delegation id")?; @@ -329,7 +329,7 @@ benchmarks! { let sender: T::AccountId = account("sender", 0, SEED); let (root_acc, _, _, leaf_id) = setup_delegations::(c, ONE_CHILD_PER_LEVEL.expect(">0"), Permissions::DELEGATE)?; let origin = ::EnsureOrigin::generate_origin(sender, root_acc.into()); - }: revoke_delegation(origin, leaf_id, c, r) + }: revoke_delegation(origin, leaf_id, c, r) verify { assert!(DelegationNodes::::contains_key(leaf_id)); let DelegationNode:: { details, .. } = DelegationNodes::::get(leaf_id).ok_or("Child of root should have delegation id")?; @@ -350,7 +350,7 @@ benchmarks! { let child_delegation = DelegationNodes::::get(child_id).ok_or("Child of root should have delegation id")?; assert!(!::Currency::reserved_balance(&sender).is_zero()); let origin = ::EnsureOrigin::generate_origin(sender.clone(), root_acc.into()); - }: _(origin, hierarchy_id, r) + }: _(origin, hierarchy_id, r) verify { assert!(!DelegationNodes::::contains_key(hierarchy_id)); assert!(!DelegationNodes::::contains_key(child_id)); @@ -453,7 +453,7 @@ benchmarks! { assert!(!::Currency::reserved_balance(&deposit_owner_old).is_zero()); let origin = ::EnsureOrigin::generate_origin(deposit_owner_new.clone(), root_acc.into()); - }: _(origin, hierarchy_id) + }: _(origin, hierarchy_id) verify { assert_eq!(::Currency::reserved_balance(&deposit_owner_new), ::Deposit::get()); } diff --git a/pallets/delegation/src/lib.rs b/pallets/delegation/src/lib.rs index c6975ed07..5a6f91234 100644 --- a/pallets/delegation/src/lib.rs +++ b/pallets/delegation/src/lib.rs @@ -141,11 +141,11 @@ pub mod pallet { type DelegationEntityId: Parameter + TypeInfo + MaxEncodedLen; type DelegationNodeId: Parameter + Copy + AsRef<[u8]> + Eq + PartialEq + Ord + PartialOrd + MaxEncodedLen; type EnsureOrigin: EnsureOrigin< + ::RuntimeOrigin, Success = ::OriginSuccess, - ::Origin, >; type OriginSuccess: CallSources, DelegatorIdOf>; - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type WeightInfo: WeightInfo; /// The currency that is used to reserve funds for each delegation. diff --git a/pallets/delegation/src/mock.rs b/pallets/delegation/src/mock.rs index ef30b34af..720039fde 100644 --- a/pallets/delegation/src/mock.rs +++ b/pallets/delegation/src/mock.rs @@ -223,8 +223,8 @@ pub(crate) mod runtime { } impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = Hash; @@ -232,7 +232,7 @@ pub(crate) mod runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type RuntimeEvent = (); type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = (); @@ -259,7 +259,7 @@ pub(crate) mod runtime { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); @@ -269,7 +269,7 @@ pub(crate) mod runtime { } impl mock_origin::Config for Test { - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type AccountId = AccountId; type SubjectId = SubjectId; } @@ -282,7 +282,7 @@ pub(crate) mod runtime { type CtypeCreatorId = SubjectId; type EnsureOrigin = mock_origin::EnsureDoubleOrigin; type OriginSuccess = mock_origin::DoubleOrigin; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; @@ -298,7 +298,7 @@ pub(crate) mod runtime { impl attestation::Config for Test { type EnsureOrigin = mock_origin::EnsureDoubleOrigin>; type OriginSuccess = mock_origin::DoubleOrigin>; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; @@ -326,7 +326,7 @@ pub(crate) mod runtime { type DelegationNodeId = Hash; type EnsureOrigin = mock_origin::EnsureDoubleOrigin; type OriginSuccess = mock_origin::DoubleOrigin; - type Event = (); + type RuntimeEvent = (); type MaxSignatureByteLength = MaxSignatureByteLength; type MaxParentChecks = MaxParentChecks; type MaxRevocations = MaxRevocations; diff --git a/pallets/delegation/src/tests.rs b/pallets/delegation/src/tests.rs index 458098dc2..e25560743 100644 --- a/pallets/delegation/src/tests.rs +++ b/pallets/delegation/src/tests.rs @@ -1564,7 +1564,7 @@ fn direct_owner_reclaim_deposit_delegation_successful() { .execute_with(|| { // Revoke direct child of hierarchy root assert_ok!(Delegation::reclaim_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), operation.delegation_id, operation.max_removals )); @@ -1616,7 +1616,7 @@ fn parent_owner_reclaim_deposit_error() { assert_eq!(Balances::reserved_balance(ACCOUNT_01), ::Deposit::get()); assert_noop!( Delegation::reclaim_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), operation.delegation_id, operation.max_removals ), @@ -1643,7 +1643,7 @@ fn delegation_not_found_reclaim_deposit_error() { .execute_with(|| { assert_noop!( Delegation::reclaim_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), operation.delegation_id, operation.max_removals ), @@ -1670,7 +1670,7 @@ fn max_removals_too_large_reclaim_deposit_error() { .execute_with(|| { assert_noop!( Delegation::reclaim_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), operation.delegation_id, operation.max_removals ), @@ -2359,7 +2359,10 @@ fn test_update_deposit() { Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() * 3 ); - assert_ok!(Delegation::update_deposit(Origin::signed(ACCOUNT_00), delegation_id)); + assert_ok!(Delegation::update_deposit( + RuntimeOrigin::signed(ACCOUNT_00), + delegation_id + )); // ACCOUNT_00 has still one deposit (there are two nodes) assert_eq!( @@ -2399,7 +2402,7 @@ fn test_update_deposit_unauthorized() { ::Deposit::get() * 3 ); assert_noop!( - Delegation::update_deposit(Origin::signed(ACCOUNT_01), delegation_id), + Delegation::update_deposit(RuntimeOrigin::signed(ACCOUNT_01), delegation_id), Error::::AccessDenied ); }); diff --git a/pallets/did/Cargo.toml b/pallets/did/Cargo.toml index 5aaaef86e..d2c05abb8 100644 --- a/pallets/did/Cargo.toml +++ b/pallets/did/Cargo.toml @@ -63,6 +63,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "kilt-support/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ "codec/std", @@ -81,5 +82,6 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", "kilt-support/try-runtime", ] diff --git a/pallets/did/src/benchmarking.rs b/pallets/did/src/benchmarking.rs index 8992a5625..13fb0a63e 100644 --- a/pallets/did/src/benchmarking.rs +++ b/pallets/did/src/benchmarking.rs @@ -102,7 +102,7 @@ fn generate_base_did_call_operation( did: DidIdentifierOf, submitter: AccountIdOf, ) -> DidAuthorizedCallOperation { - let test_call = ::Call::get_call_for_did_call_benchmark(); + let test_call = ::RuntimeCall::get_call_for_did_call_benchmark(); DidAuthorizedCallOperation { did, @@ -124,7 +124,7 @@ benchmarks! { where_clause { where T::DidIdentifier: From, - ::Origin: From>, + ::RuntimeOrigin: From>, ::AccountId: From, } diff --git a/pallets/did/src/lib.rs b/pallets/did/src/lib.rs index ba27ddcc4..fd210d64a 100644 --- a/pallets/did/src/lib.rs +++ b/pallets/did/src/lib.rs @@ -173,7 +173,7 @@ pub mod pallet { pub type BlockNumberOf = ::BlockNumber; /// Type for a runtime extrinsic callable under DID-based authorisation. - pub type DidCallableOf = ::Call; + pub type DidCallableOf = ::RuntimeCall; /// Type for origin that supports a DID sender. #[pallet::origin] @@ -187,8 +187,8 @@ pub mod pallet { pub trait Config: frame_system::Config + Debug { /// Type for a dispatchable call that can be proxied through the DID /// pallet to support DID-based authorisation. - type Call: Parameter - + Dispatchable::Origin, PostInfo = PostDispatchInfo> + type RuntimeCall: Parameter + + Dispatchable::RuntimeOrigin> + GetDispatchInfo + DeriveDidCallAuthorizationVerificationKeyRelationship; @@ -197,21 +197,21 @@ pub mod pallet { /// Origin type expected by the proxied dispatchable calls. #[cfg(not(feature = "runtime-benchmarks"))] - type Origin: From, AccountIdOf>>; + type RuntimeOrigin: From, AccountIdOf>>; #[cfg(feature = "runtime-benchmarks")] - type Origin: From>>; + type RuntimeOrigin: From>>; /// The origin check for all DID calls inside this pallet. type EnsureOrigin: EnsureOrigin< + ::RuntimeOrigin, Success = ::OriginSuccess, - ::Origin, >; /// The return type when the DID origin check was successful. type OriginSuccess: CallSources, DidIdentifierOf>; /// Overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The currency that is used to reserve funds for each did. type Currency: ReservableCurrency>; diff --git a/pallets/did/src/mock.rs b/pallets/did/src/mock.rs index e9f906f68..969b5c5ee 100644 --- a/pallets/did/src/mock.rs +++ b/pallets/did/src/mock.rs @@ -79,8 +79,8 @@ parameter_types! { } impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; @@ -88,7 +88,7 @@ impl frame_system::Config for Test { type AccountId = <::Signer as IdentifyAccount>::AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type RuntimeEvent = (); type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; type Version = (); @@ -140,11 +140,11 @@ where impl Config for Test { type DidIdentifier = DidIdentifier; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type EnsureOrigin = EnsureSigned; type OriginSuccess = AccountId; - type Event = (); + type RuntimeEvent = (); type Currency = Balances; type Deposit = Deposit; type Fee = DidFee; @@ -171,7 +171,7 @@ parameter_types! { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); @@ -196,7 +196,7 @@ impl ctype::Config for Test { type OriginSuccess = DidRawOrigin; type CtypeCreatorId = DidIdentifier; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; type Fee = Fee; @@ -334,37 +334,37 @@ pub fn generate_key_id(key: &DidPublicKey) -> KeyIdOf { pub(crate) fn get_attestation_key_test_input() -> Vec { [0u8; 32].to_vec() } -pub(crate) fn get_attestation_key_call() -> Call { - Call::Ctype(ctype::Call::add { +pub(crate) fn get_attestation_key_call() -> RuntimeCall { + RuntimeCall::Ctype(ctype::Call::add { ctype: get_attestation_key_test_input(), }) } pub(crate) fn get_authentication_key_test_input() -> Vec { [1u8; 32].to_vec() } -pub(crate) fn get_authentication_key_call() -> Call { - Call::Ctype(ctype::Call::add { +pub(crate) fn get_authentication_key_call() -> RuntimeCall { + RuntimeCall::Ctype(ctype::Call::add { ctype: get_authentication_key_test_input(), }) } pub(crate) fn get_delegation_key_test_input() -> Vec { [2u8; 32].to_vec() } -pub(crate) fn get_delegation_key_call() -> Call { - Call::Ctype(ctype::Call::add { +pub(crate) fn get_delegation_key_call() -> RuntimeCall { + RuntimeCall::Ctype(ctype::Call::add { ctype: get_delegation_key_test_input(), }) } pub(crate) fn get_none_key_test_input() -> Vec { [3u8; 32].to_vec() } -pub(crate) fn get_none_key_call() -> Call { - Call::Ctype(ctype::Call::add { +pub(crate) fn get_none_key_call() -> RuntimeCall { + RuntimeCall::Ctype(ctype::Call::add { ctype: get_none_key_test_input(), }) } -impl DeriveDidCallAuthorizationVerificationKeyRelationship for Call { +impl DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall { fn derive_verification_key_relationship(&self) -> DeriveDidCallKeyRelationshipResult { if *self == get_attestation_key_call() { Ok(DidVerificationKeyRelationship::AssertionMethod) @@ -385,7 +385,7 @@ impl DeriveDidCallAuthorizationVerificationKeyRelationship for Call { // Always return a System::remark() extrinsic call #[cfg(feature = "runtime-benchmarks")] fn get_call_for_did_call_benchmark() -> Self { - Call::System(frame_system::Call::remark { remark: sp_std::vec![] }) + RuntimeCall::System(frame_system::Call::remark { remark: sp_std::vec![] }) } } diff --git a/pallets/did/src/origin.rs b/pallets/did/src/origin.rs index 5b33c1613..2dbc75d6d 100644 --- a/pallets/did/src/origin.rs +++ b/pallets/did/src/origin.rs @@ -97,7 +97,7 @@ mod tests { use crate::mock::Test; use frame_support::{assert_ok, traits::EnsureOrigin}; - let origin: ::Origin = EnsureDidOrigin::successful_origin(); + let origin: ::RuntimeOrigin = EnsureDidOrigin::successful_origin(); assert_ok!(EnsureDidOrigin::try_origin(origin)); } } diff --git a/pallets/did/src/tests.rs b/pallets/did/src/tests.rs index f928cc517..33066c0e4 100644 --- a/pallets/did/src/tests.rs +++ b/pallets/did/src/tests.rs @@ -57,7 +57,7 @@ fn check_successful_simple_ed25519_creation() { .build(None) .execute_with(|| { assert_ok!(Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature), )); @@ -99,7 +99,7 @@ fn check_successful_simple_sr25519_creation() { .build(None) .execute_with(|| { assert_ok!(Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature), )); @@ -141,7 +141,7 @@ fn check_successful_simple_ecdsa_creation() { .build(None) .execute_with(|| { assert_ok!(Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature), )); @@ -202,7 +202,7 @@ fn check_successful_complete_creation() { .build(None) .execute_with(|| { assert_ok!(Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details.clone()), did::DidSignature::from(signature), )); @@ -292,7 +292,7 @@ fn check_duplicate_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -323,7 +323,7 @@ fn check_unauthorised_submitter_did_creation_error() { assert_noop!( // Use ACCOUNT_00 to submit the transaction Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -343,7 +343,7 @@ fn create_fail_insufficient_balance() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -370,7 +370,7 @@ fn check_did_already_deleted_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -399,7 +399,7 @@ fn check_invalid_signature_format_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -426,7 +426,7 @@ fn check_invalid_signature_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -453,7 +453,7 @@ fn check_swapped_did_subject_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -483,7 +483,7 @@ fn check_max_limit_key_agreement_keys_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -517,7 +517,7 @@ fn check_max_limit_service_endpoints_count_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -546,7 +546,7 @@ fn check_max_limit_service_id_length_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -581,7 +581,7 @@ fn check_max_limit_service_type_count_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -610,7 +610,7 @@ fn check_max_limit_service_type_length_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -645,7 +645,7 @@ fn check_max_limit_service_url_count_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -674,7 +674,7 @@ fn check_max_limit_service_url_length_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -702,7 +702,7 @@ fn check_invalid_service_id_character_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -730,7 +730,7 @@ fn check_invalid_service_type_character_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -758,7 +758,7 @@ fn check_invalid_service_url_character_did_creation() { .execute_with(|| { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), Box::new(details), did::DidSignature::from(signature) ), @@ -786,7 +786,7 @@ fn check_successful_authentication_key_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_authentication_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_auth_key.public()) )); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); @@ -827,7 +827,7 @@ fn check_successful_authentication_key_max_public_keys_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_authentication_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_auth_key.public()) )); @@ -865,7 +865,7 @@ fn check_reused_key_authentication_key_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_authentication_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_auth_key.public()) )); @@ -917,7 +917,7 @@ fn check_max_keys_authentication_key_update_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_authentication_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_auth_key.public()) ), did::Error::::MaxPublicKeysPerDidExceeded @@ -938,7 +938,7 @@ fn check_did_not_present_authentication_key_update_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_authentication_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_auth_key.public()) ), did::Error::::DidNotPresent @@ -965,7 +965,7 @@ fn check_successful_delegation_key_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_del_key.public()) )); @@ -1008,7 +1008,7 @@ fn check_successful_delegation_key_max_public_keys_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_del_key.public()) )); @@ -1044,7 +1044,7 @@ fn check_reused_key_delegation_key_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_del_key.public()) )); @@ -1088,7 +1088,7 @@ fn check_max_public_keys_delegation_key_addition_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_del_key.public()) ), did::Error::::MaxPublicKeysPerDidExceeded @@ -1124,7 +1124,7 @@ fn check_max_public_keys_reused_key_delegation_key_update_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_del_key.public()) ), did::Error::::MaxPublicKeysPerDidExceeded @@ -1145,7 +1145,7 @@ fn check_did_not_present_delegation_key_update_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_del_key.public()) ), did::Error::::DidNotPresent @@ -1166,7 +1166,7 @@ fn check_successful_delegation_key_deletion() { .with_dids(vec![(alice_did.clone(), old_did_details)]) .build(None) .execute_with(|| { - assert_ok!(Did::remove_delegation_key(Origin::signed(alice_did.clone()))); + assert_ok!(Did::remove_delegation_key(RuntimeOrigin::signed(alice_did.clone()))); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); assert!(new_did_details.delegation_key.is_none()); @@ -1191,7 +1191,7 @@ fn check_successful_reused_delegation_key_deletion() { .with_dids(vec![(alice_did.clone(), old_did_details.clone())]) .build(None) .execute_with(|| { - assert_ok!(Did::remove_delegation_key(Origin::signed(alice_did.clone()))); + assert_ok!(Did::remove_delegation_key(RuntimeOrigin::signed(alice_did.clone()))); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); assert!(new_did_details.delegation_key.is_none()); @@ -1211,7 +1211,7 @@ fn check_did_not_present_delegation_key_deletion_error() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( - Did::remove_delegation_key(Origin::signed(alice_did.clone())), + Did::remove_delegation_key(RuntimeOrigin::signed(alice_did.clone())), did::Error::::DidNotPresent ); }); @@ -1229,7 +1229,7 @@ fn check_key_not_present_delegation_key_deletion_error() { .build(None) .execute_with(|| { assert_noop!( - Did::remove_delegation_key(Origin::signed(alice_did.clone())), + Did::remove_delegation_key(RuntimeOrigin::signed(alice_did.clone())), did::Error::::VerificationKeyNotPresent ); }); @@ -1254,7 +1254,7 @@ fn check_successful_attestation_key_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_attestation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_att_key.public()) )); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); @@ -1296,7 +1296,7 @@ fn check_successful_attestation_key_max_public_keys_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_attestation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_att_key.public()) )); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); @@ -1331,7 +1331,7 @@ fn check_reused_key_attestation_key_update() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::set_attestation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_att_key.public()) )); @@ -1375,7 +1375,7 @@ fn check_max_public_keys_attestation_key_addition_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_attestation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_att_key.public()) ), did::Error::::MaxPublicKeysPerDidExceeded @@ -1411,7 +1411,7 @@ fn check_max_public_keys_reused_key_attestation_key_update_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_attestation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_att_key.public()) ), did::Error::::MaxPublicKeysPerDidExceeded @@ -1432,7 +1432,7 @@ fn check_did_not_present_attestation_key_update_error() { System::set_block_number(new_block_number); assert_noop!( Did::set_delegation_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), DidVerificationKey::from(new_att_key.public()) ), did::Error::::DidNotPresent @@ -1453,7 +1453,7 @@ fn check_successful_attestation_key_deletion() { .with_dids(vec![(alice_did.clone(), old_did_details)]) .build(None) .execute_with(|| { - assert_ok!(Did::remove_attestation_key(Origin::signed(alice_did.clone()))); + assert_ok!(Did::remove_attestation_key(RuntimeOrigin::signed(alice_did.clone()))); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); assert!(new_did_details.attestation_key.is_none()); @@ -1478,7 +1478,7 @@ fn check_successful_reused_attestation_key_deletion() { .with_dids(vec![(alice_did.clone(), old_did_details.clone())]) .build(None) .execute_with(|| { - assert_ok!(Did::remove_attestation_key(Origin::signed(alice_did.clone()))); + assert_ok!(Did::remove_attestation_key(RuntimeOrigin::signed(alice_did.clone()))); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); assert!(new_did_details.attestation_key.is_none()); let public_keys = new_did_details.public_keys; @@ -1497,7 +1497,7 @@ fn check_did_not_present_attestation_key_deletion_error() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( - Did::remove_attestation_key(Origin::signed(alice_did.clone())), + Did::remove_attestation_key(RuntimeOrigin::signed(alice_did.clone())), did::Error::::DidNotPresent ); }); @@ -1515,7 +1515,7 @@ fn check_key_not_present_attestation_key_deletion_error() { .build(None) .execute_with(|| { assert_noop!( - Did::remove_attestation_key(Origin::signed(alice_did.clone())), + Did::remove_attestation_key(RuntimeOrigin::signed(alice_did.clone())), did::Error::::VerificationKeyNotPresent ); }); @@ -1537,7 +1537,7 @@ fn check_successful_key_agreement_key_addition() { .execute_with(|| { System::set_block_number(new_block_number); assert_ok!(Did::add_key_agreement_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), new_key_agreement_key, )); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); @@ -1577,7 +1577,7 @@ fn check_max_public_keys_key_agreement_key_addition_error() { .execute_with(|| { System::set_block_number(new_block_number); assert_noop!( - Did::add_key_agreement_key(Origin::signed(alice_did.clone()), new_key_agreement_key,), + Did::add_key_agreement_key(RuntimeOrigin::signed(alice_did.clone()), new_key_agreement_key,), did::Error::::MaxPublicKeysPerDidExceeded ); }); @@ -1595,7 +1595,7 @@ fn check_did_not_present_key_agreement_key_addition_error() { ExtBuilder::default().build(None).execute_with(|| { System::set_block_number(new_block_number); assert_noop!( - Did::add_key_agreement_key(Origin::signed(alice_did.clone()), new_enc_key), + Did::add_key_agreement_key(RuntimeOrigin::signed(alice_did.clone()), new_enc_key), did::Error::::DidNotPresent ); }); @@ -1615,7 +1615,7 @@ fn check_successful_key_agreement_key_deletion() { .build(None) .execute_with(|| { assert_ok!(Did::remove_key_agreement_key( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), generate_key_id(&old_enc_key.into()), )); let new_did_details = Did::get_did(&alice_did).expect("ALICE_DID should be present on chain."); @@ -1636,7 +1636,10 @@ fn check_did_not_found_key_agreement_key_deletion_error() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( - Did::remove_key_agreement_key(Origin::signed(alice_did.clone()), generate_key_id(&test_enc_key.into())), + Did::remove_key_agreement_key( + RuntimeOrigin::signed(alice_did.clone()), + generate_key_id(&test_enc_key.into()) + ), did::Error::::DidNotPresent ); }); @@ -1656,7 +1659,10 @@ fn check_key_not_found_key_agreement_key_deletion_error() { .build(None) .execute_with(|| { assert_noop!( - Did::remove_key_agreement_key(Origin::signed(alice_did.clone()), generate_key_id(&test_enc_key.into())), + Did::remove_key_agreement_key( + RuntimeOrigin::signed(alice_did.clone()), + generate_key_id(&test_enc_key.into()) + ), did::Error::::VerificationKeyNotPresent ); }); @@ -1677,7 +1683,7 @@ fn check_service_addition_no_prior_service_successful() { .build(None) .execute_with(|| { assert_ok!(Did::add_service_endpoint( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint.clone() )); let stored_endpoint = did::pallet::ServiceEndpoints::::get(&alice_did, &new_service_endpoint.id) @@ -1714,7 +1720,7 @@ fn check_service_addition_one_from_full_successful() { .build(None) .execute_with(|| { assert_ok!(Did::add_service_endpoint( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint.clone() )); assert_eq!( @@ -1739,7 +1745,7 @@ fn check_did_not_present_services_addition_error() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::DidNotPresent ); }); @@ -1759,7 +1765,7 @@ fn check_service_already_present_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), service_endpoint), did::Error::::ServiceAlreadyPresent ); }); @@ -1787,7 +1793,7 @@ fn check_max_services_count_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::MaxNumberOfServicesPerDidExceeded ); }); @@ -1815,7 +1821,7 @@ fn check_max_service_id_length_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::MaxServiceIdLengthExceeded ); }); @@ -1843,7 +1849,7 @@ fn check_max_service_type_length_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::MaxServiceTypeLengthExceeded ); }); @@ -1871,7 +1877,7 @@ fn check_max_service_type_count_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::MaxNumberOfTypesPerServiceExceeded ); }); @@ -1899,7 +1905,7 @@ fn check_max_service_url_length_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::MaxServiceUrlLengthExceeded ); }); @@ -1927,7 +1933,7 @@ fn check_max_service_url_count_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_endpoint), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_endpoint), did::Error::::MaxNumberOfUrlsPerServiceExceeded ); }); @@ -1946,7 +1952,7 @@ fn check_invalid_service_id_character_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_details), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_details), did::Error::::InvalidServiceEncoding ); }); @@ -1965,7 +1971,7 @@ fn check_invalid_service_type_character_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_details), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_details), did::Error::::InvalidServiceEncoding ); }); @@ -1984,7 +1990,7 @@ fn check_invalid_service_url_character_addition_error() { .build(None) .execute_with(|| { assert_noop!( - Did::add_service_endpoint(Origin::signed(alice_did.clone()), new_service_details), + Did::add_service_endpoint(RuntimeOrigin::signed(alice_did.clone()), new_service_details), did::Error::::InvalidServiceEncoding ); }); @@ -2007,7 +2013,7 @@ fn check_service_deletion_successful() { .build(None) .execute_with(|| { assert_ok!(Did::remove_service_endpoint( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), old_service_endpoint.id )); // Counter should be deleted from the storage. @@ -2033,7 +2039,7 @@ fn check_service_not_present_deletion_error() { .execute_with(|| { assert_noop!( Did::remove_service_endpoint( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), service_id.try_into().expect("Service ID to delete too long") ), did::Error::::ServiceNotPresent @@ -2066,7 +2072,7 @@ fn check_successful_deletion_no_endpoints() { Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() ); - assert_ok!(Did::delete(Origin::signed(alice_did.clone()), 0)); + assert_ok!(Did::delete(RuntimeOrigin::signed(alice_did.clone()), 0)); assert!(Did::get_did(alice_did.clone()).is_none()); assert!(Did::get_deleted_did(alice_did.clone()).is_some()); assert!(Balances::reserved_balance(ACCOUNT_00).is_zero()); @@ -2080,7 +2086,7 @@ fn check_successful_deletion_no_endpoints() { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00.clone()), + RuntimeOrigin::signed(ACCOUNT_00.clone()), Box::new(details), did::DidSignature::from(signature), ), @@ -2114,7 +2120,7 @@ fn check_successful_deletion_with_endpoints() { Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() ); - assert_ok!(Did::delete(Origin::signed(alice_did.clone()), 1)); + assert_ok!(Did::delete(RuntimeOrigin::signed(alice_did.clone()), 1)); assert!(Did::get_did(alice_did.clone()).is_none()); assert!(Did::get_deleted_did(alice_did.clone()).is_some()); assert!(Balances::reserved_balance(ACCOUNT_00).is_zero()); @@ -2128,7 +2134,7 @@ fn check_successful_deletion_with_endpoints() { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00.clone()), + RuntimeOrigin::signed(ACCOUNT_00.clone()), Box::new(details), did::DidSignature::from(signature), ), @@ -2150,7 +2156,7 @@ fn check_did_not_present_deletion() { .build(None) .execute_with(|| { assert_noop!( - Did::delete(Origin::signed(alice_did), 0), + Did::delete(RuntimeOrigin::signed(alice_did), 0), did::Error::::DidNotPresent ); }); @@ -2177,7 +2183,7 @@ fn check_service_count_too_small_deletion_error() { .build(None) .execute_with(|| { assert_noop!( - Did::delete(Origin::signed(alice_did.clone()), 0), + Did::delete(RuntimeOrigin::signed(alice_did.clone()), 0), did::Error::::StoredEndpointsCountTooLarge ); }); @@ -2210,7 +2216,7 @@ fn check_successful_reclaiming() { ::Deposit::get() ); assert_ok!(Did::reclaim_deposit( - Origin::signed(ACCOUNT_00.clone()), + RuntimeOrigin::signed(ACCOUNT_00.clone()), alice_did.clone(), 1 )); @@ -2226,7 +2232,7 @@ fn check_successful_reclaiming() { assert_noop!( Did::create( - Origin::signed(ACCOUNT_00.clone()), + RuntimeOrigin::signed(ACCOUNT_00.clone()), Box::new(details), did::DidSignature::from(signature), ), @@ -2257,7 +2263,7 @@ fn unauthorized_reclaiming() { ::Deposit::get() ); assert_noop!( - Did::reclaim_deposit(Origin::signed(ACCOUNT_01.clone()), alice_did.clone(), 0), + Did::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_01.clone()), alice_did.clone(), 0), did::Error::::NotOwnerOfDeposit ); }); @@ -2284,7 +2290,7 @@ fn check_service_count_too_small_reclaim_error() { .build(None) .execute_with(|| { assert_noop!( - Did::reclaim_deposit(Origin::signed(ACCOUNT_00.clone()), alice_did.clone(), 0), + Did::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_00.clone()), alice_did.clone(), 0), did::Error::::StoredEndpointsCountTooLarge ); }); @@ -2305,7 +2311,7 @@ fn check_did_not_found_call_error() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2337,7 +2343,7 @@ fn check_too_small_tx_counter_after_wrap_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2368,7 +2374,7 @@ fn check_too_small_tx_counter_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2398,7 +2404,7 @@ fn check_equal_tx_counter_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2428,7 +2434,7 @@ fn check_too_large_tx_counter_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2460,7 +2466,7 @@ fn check_tx_block_number_too_low_error() { System::set_block_number(call_operation.operation.block_number + MaxBlocksTxValidity::get() + 1); assert_noop!( Did::submit_did_call( - Origin::signed(caller.clone()), + RuntimeOrigin::signed(caller.clone()), Box::new(call_operation.operation.clone()), did::DidSignature::from(signature.clone()) ), @@ -2470,7 +2476,7 @@ fn check_tx_block_number_too_low_error() { // But it would work if the system would be one block earlier. System::set_block_number(call_operation.operation.block_number + MaxBlocksTxValidity::get()); assert_ok!(Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) )); @@ -2503,7 +2509,7 @@ fn check_tx_block_number_too_high_error() { System::set_block_number(call_operation.operation.block_number - MaxBlocksTxValidity::get() - 1); assert_noop!( Did::submit_did_call( - Origin::signed(caller.clone()), + RuntimeOrigin::signed(caller.clone()), Box::new(call_operation.operation.clone()), did::DidSignature::from(signature.clone()) ), @@ -2534,7 +2540,7 @@ fn check_verification_key_not_present_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2564,7 +2570,7 @@ fn check_invalid_signature_format_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2592,7 +2598,7 @@ fn check_bad_submitter_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2622,7 +2628,7 @@ fn check_invalid_signature_call_error() { .execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2653,7 +2659,7 @@ fn check_call_attestation_key_successful() { .build(None) .execute_with(|| { assert_ok!(Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) )); @@ -2687,7 +2693,7 @@ fn check_call_attestation_key_error() { .execute_with(|| { assert_err!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2718,7 +2724,7 @@ fn check_call_delegation_key_successful() { .build(None) .execute_with(|| { assert_ok!(Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) )); @@ -2752,7 +2758,7 @@ fn check_call_delegation_key_error() { .execute_with(|| { assert_err!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2781,7 +2787,7 @@ fn check_call_authentication_key_successful() { .build(None) .execute_with(|| { assert_ok!(Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) )); @@ -2813,7 +2819,7 @@ fn check_call_authentication_key_error() { .execute_with(|| { assert_err!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -2840,7 +2846,7 @@ fn check_null_key_error() { ExtBuilder::default().build(None).execute_with(|| { assert_noop!( Did::submit_did_call( - Origin::signed(caller), + RuntimeOrigin::signed(caller), Box::new(call_operation.operation), did::DidSignature::from(signature) ), @@ -3173,7 +3179,7 @@ fn test_change_deposit_owner() { Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() ); - assert_ok!(Did::change_deposit_owner(Origin::signed(alice_did.clone()))); + assert_ok!(Did::change_deposit_owner(RuntimeOrigin::signed(alice_did.clone()))); assert!(Balances::reserved_balance(ACCOUNT_00).is_zero()); assert_eq!( Balances::reserved_balance(alice_did), @@ -3200,7 +3206,7 @@ fn test_change_deposit_owner_insufficient_balance() { .build(None) .execute_with(|| { assert_noop!( - Did::change_deposit_owner(Origin::signed(alice_did.clone())), + Did::change_deposit_owner(RuntimeOrigin::signed(alice_did.clone())), pallet_balances::Error::::InsufficientBalance ); }); @@ -3220,7 +3226,7 @@ fn test_change_deposit_owner_not_found() { .build(None) .execute_with(|| { assert_noop!( - Did::change_deposit_owner(Origin::signed(alice_did.clone())), + Did::change_deposit_owner(RuntimeOrigin::signed(alice_did.clone())), crate::Error::::DidNotPresent ); }); @@ -3242,7 +3248,7 @@ fn test_change_deposit_owner_not_authorized() { .build(None) .execute_with(|| { assert_noop!( - Did::change_deposit_owner(Origin::signed(bob_did.clone())), + Did::change_deposit_owner(RuntimeOrigin::signed(bob_did.clone())), crate::Error::::DidNotPresent ); }); @@ -3271,7 +3277,7 @@ fn test_update_deposit() { ::Deposit::get() * 2 ); assert_ok!(Did::update_deposit( - Origin::signed(alice_did.clone()), + RuntimeOrigin::signed(alice_did.clone()), alice_did.clone() )); assert_eq!( @@ -3316,7 +3322,7 @@ fn test_update_deposit_unauthorized() { ::Deposit::get() * 2 ); assert_noop!( - Did::update_deposit(Origin::signed(bob_did.clone()), alice_did.clone()), + Did::update_deposit(RuntimeOrigin::signed(bob_did.clone()), alice_did.clone()), Error::::BadDidOrigin ); }); diff --git a/pallets/pallet-did-lookup/Cargo.toml b/pallets/pallet-did-lookup/Cargo.toml index a44b2cc92..45bb612aa 100644 --- a/pallets/pallet-did-lookup/Cargo.toml +++ b/pallets/pallet-did-lookup/Cargo.toml @@ -52,13 +52,16 @@ runtime-benchmarks = [ "kilt-support/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ "codec/std", - "frame-benchmarking/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", + "hex/std", "log/std", + "libsecp256k1/std", "scale-info/std", "sha3/std", "sp-core/std", @@ -68,5 +71,6 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", "kilt-support/try-runtime", ] diff --git a/pallets/pallet-did-lookup/src/benchmarking.rs b/pallets/pallet-did-lookup/src/benchmarking.rs index e3d85c963..c70379560 100644 --- a/pallets/pallet-did-lookup/src/benchmarking.rs +++ b/pallets/pallet-did-lookup/src/benchmarking.rs @@ -57,7 +57,7 @@ benchmarks! { where T::AccountId: From + From + Into + Into, T::DidIdentifier: From, - T::EnsureOrigin: GenerateBenchmarkOrigin, + T::EnsureOrigin: GenerateBenchmarkOrigin, } associate_account_multisig_sr25519 { @@ -86,7 +86,7 @@ benchmarks! { let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); let id_arg = linkable_id.clone(); let req = AssociateAccountRequest::Dotsama(connected_acc_id.into(), sig.into()); - }: associate_account(origin, req, bn) + }: associate_account(origin, req, bn) verify { assert!(ConnectedDids::::get(linkable_id.clone()).is_some()); assert!(ConnectedAccounts::::get(&previous_did, linkable_id.clone()).is_none()); @@ -119,7 +119,7 @@ benchmarks! { let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); let id_arg = linkable_id.clone(); let req = AssociateAccountRequest::Dotsama(connected_acc_id.into(), sig.into()); - }: associate_account(origin, req, bn) + }: associate_account(origin, req, bn) verify { assert!(ConnectedDids::::get(linkable_id.clone()).is_some()); assert!(ConnectedAccounts::::get(&previous_did, linkable_id.clone()).is_none()); @@ -152,7 +152,7 @@ benchmarks! { let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); let id_arg = linkable_id.clone(); let req = AssociateAccountRequest::Dotsama(connected_acc_id, sig.into()); - }: associate_account(origin, req, bn) + }: associate_account(origin, req, bn) verify { assert!(ConnectedDids::::get(linkable_id.clone()).is_some()); assert!(ConnectedAccounts::::get(&previous_did, linkable_id.clone()).is_none()); @@ -186,7 +186,7 @@ benchmarks! { assert!(ConnectedAccounts::::get(&previous_did, LinkableAccountId::from(eth_account)).is_some()); let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); let req = AssociateAccountRequest::Ethereum(eth_account, sig.into()); - }: associate_account(origin, req, expire_at) + }: associate_account(origin, req, expire_at) verify { assert!(ConnectedDids::::get(LinkableAccountId::from(eth_account)).is_some()); assert!(ConnectedAccounts::::get(&previous_did, LinkableAccountId::from(eth_account)).is_none()); @@ -205,7 +205,7 @@ benchmarks! { Pallet::::add_association(caller.clone(), previous_did.clone(), caller.clone().into()).expect("should create previous association"); assert!(ConnectedAccounts::::get(&previous_did, &linkable_id).is_some()); let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); - }: _(origin) + }: _(origin) verify { assert!(ConnectedDids::::get(&linkable_id).is_some()); assert!(ConnectedAccounts::::get(previous_did, &linkable_id).is_none()); @@ -237,7 +237,7 @@ benchmarks! { let origin = T::EnsureOrigin::generate_origin(caller, did.clone()); let id_arg = linkable_id.clone(); - }: _(origin, id_arg) + }: _(origin, id_arg) verify { assert!(ConnectedDids::::get(&linkable_id).is_none()); assert!(ConnectedAccounts::::get(did, linkable_id).is_none()); @@ -255,7 +255,7 @@ benchmarks! { let origin = T::EnsureOrigin::generate_origin(deposit_owner_new.clone(), did); let id_arg = linkable_id.clone(); - }: _(origin, id_arg) + }: _(origin, id_arg) verify { assert_eq!( ConnectedDids::::get(&linkable_id).expect("should retain link").deposit, diff --git a/pallets/pallet-did-lookup/src/lib.rs b/pallets/pallet-did-lookup/src/lib.rs index a660322a4..aedbf57ad 100644 --- a/pallets/pallet-did-lookup/src/lib.rs +++ b/pallets/pallet-did-lookup/src/lib.rs @@ -83,10 +83,10 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The origin that can associate accounts to itself. - type EnsureOrigin: EnsureOrigin::Origin>; + type EnsureOrigin: EnsureOrigin<::RuntimeOrigin, Success = Self::OriginSuccess>; /// The information that is returned by the origin check. type OriginSuccess: CallSources, DidIdentifierOf>; diff --git a/pallets/pallet-did-lookup/src/migrations.rs b/pallets/pallet-did-lookup/src/migrations.rs index f604c9db1..9297997ef 100644 --- a/pallets/pallet-did-lookup/src/migrations.rs +++ b/pallets/pallet-did-lookup/src/migrations.rs @@ -28,9 +28,13 @@ use frame_support::{ use sp_std::{marker::PhantomData, vec}; #[cfg(feature = "try-runtime")] -use frame_support::traits::OnRuntimeUpgradeHelpersExt; -#[cfg(feature = "try-runtime")] -use sp_runtime::SaturatedConversion; +use { + frame_support::{ + codec::{Decode, Encode}, + inherent::Vec, + }, + sp_runtime::SaturatedConversion, +}; #[storage_alias] type ConnectedDids = StorageMap, Blake2_128Concat, AccountIdOf, ConnectionRecordOf>; @@ -98,12 +102,11 @@ where } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { + fn pre_upgrade() -> Result, &'static str> { assert!(Pallet::::on_chain_storage_version() < Pallet::::current_storage_version()); // Store number of connected DIDs in temp storage let connected_did_count: u64 = ConnectedDids::::iter_keys().count().saturated_into(); - Self::set_temp_storage(connected_did_count, "pre_connected_did_count"); log::info!( "🔎 DidLookup pre migration: Number of connected DIDs {:?}", connected_did_count @@ -111,24 +114,24 @@ where // Store number of connected accounts in temp storage let connected_account_count: u64 = ConnectedAccounts::::iter_keys().count().saturated_into(); - Self::set_temp_storage(connected_account_count, "pre_connected_account_count"); log::info!( "🔎 DidLookup pre migration: Number of connected accounts {:?}", connected_account_count ); - Ok(()) + Ok((connected_did_count, connected_account_count).encode()) } #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { + fn post_upgrade(pre_state: Vec) -> Result<(), &'static str> { assert_eq!( Pallet::::on_chain_storage_version(), Pallet::::current_storage_version() ); // Check number of connected DIDs and accounts against pre-check result - let pre_connected_did_count = Self::get_temp_storage("pre_connected_did_count").unwrap_or(0u64); - let pre_connected_account_count = Self::get_temp_storage("pre_connected_account_count").unwrap_or(0u64); + let (pre_connected_did_count, pre_connected_account_count): (u64, u64) = + Decode::decode(&mut pre_state.as_slice()) + .expect("the state parameter should be something that was generated by pre_upgrade"); assert_eq!( ConnectedDidsV2::::iter().count().saturated_into::(), pre_connected_did_count, diff --git a/pallets/pallet-did-lookup/src/mock.rs b/pallets/pallet-did-lookup/src/mock.rs index ca5f0e49f..43b408cca 100644 --- a/pallets/pallet-did-lookup/src/mock.rs +++ b/pallets/pallet-did-lookup/src/mock.rs @@ -65,8 +65,8 @@ impl frame_system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; @@ -74,7 +74,7 @@ impl frame_system::Config for Test { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -96,7 +96,7 @@ parameter_types! { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type MaxLocks = MaxLocks; @@ -110,7 +110,7 @@ parameter_types! { } impl pallet_did_lookup::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Deposit = DidLookupDeposit; @@ -123,7 +123,7 @@ impl pallet_did_lookup::Config for Test { } impl mock_origin::Config for Test { - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type AccountId = AccountId; type SubjectId = SubjectId; } diff --git a/pallets/pallet-did-lookup/src/tests.rs b/pallets/pallet-did-lookup/src/tests.rs index 9b2b77073..1dd7f3f50 100644 --- a/pallets/pallet-did-lookup/src/tests.rs +++ b/pallets/pallet-did-lookup/src/tests.rs @@ -296,9 +296,9 @@ fn test_remove_association_sender() { .build() .execute_with(|| { // remove association - assert!(DidLookup::remove_sender_association(Origin::signed(ACCOUNT_00)).is_ok()); - assert_eq!(ConnectedDids::::get(LinkableAccountId::from(ACCOUNT_00)), None); - assert!(ConnectedAccounts::::get(DID_01, LinkableAccountId::from(ACCOUNT_00)).is_none()); + assert!(DidLookup::remove_sender_association(RuntimeOrigin::signed(ACCOUNT_00)).is_ok()); + assert_eq!(ConnectedDids::::get(&LinkableAccountId::from(ACCOUNT_00)), None); + assert!(ConnectedAccounts::::get(DID_01, &LinkableAccountId::from(ACCOUNT_00)).is_none()); assert_eq!(Balances::reserved_balance(ACCOUNT_00), 0); }); } @@ -313,7 +313,7 @@ fn test_remove_association_sender_not_found() { .build() .execute_with(|| { assert_noop!( - DidLookup::remove_sender_association(Origin::signed(ACCOUNT_00)), + DidLookup::remove_sender_association(RuntimeOrigin::signed(ACCOUNT_00)), Error::::AssociationNotFound ); }); @@ -396,7 +396,7 @@ fn test_reclaim_deposit() { .build() .execute_with(|| { assert_ok!(DidLookup::reclaim_deposit( - Origin::signed(ACCOUNT_01), + RuntimeOrigin::signed(ACCOUNT_01), ACCOUNT_00.into() )); assert_eq!(Balances::reserved_balance(ACCOUNT_01), 0); @@ -414,7 +414,7 @@ fn test_reclaim_deposit_not_authorized() { .build() .execute_with(|| { assert_noop!( - DidLookup::reclaim_deposit(Origin::signed(ACCOUNT_00), ACCOUNT_00.into()), + DidLookup::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_00), ACCOUNT_00.into()), Error::::NotAuthorized ); assert_eq!( @@ -518,7 +518,10 @@ fn test_update_deposit() { Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() * 2 ); - assert_ok!(DidLookup::update_deposit(Origin::signed(ACCOUNT_00), ACCOUNT_00.into())); + assert_ok!(DidLookup::update_deposit( + RuntimeOrigin::signed(ACCOUNT_00), + ACCOUNT_00.into() + )); assert_eq!( Balances::reserved_balance(ACCOUNT_00), ::Deposit::get() @@ -546,7 +549,7 @@ fn test_update_deposit_unauthorized() { ::Deposit::get() * 2 ); assert_noop!( - DidLookup::update_deposit(Origin::signed(ACCOUNT_01), ACCOUNT_00.into()), + DidLookup::update_deposit(RuntimeOrigin::signed(ACCOUNT_01), ACCOUNT_00.into()), Error::::NotAuthorized ); }) diff --git a/pallets/pallet-inflation/Cargo.toml b/pallets/pallet-inflation/Cargo.toml index dc4f5de4b..303312b53 100644 --- a/pallets/pallet-inflation/Cargo.toml +++ b/pallets/pallet-inflation/Cargo.toml @@ -38,9 +38,11 @@ runtime-benchmarks = [ "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - "frame-benchmarking/std", + "codec/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "scale-info/std", @@ -49,4 +51,5 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", ] diff --git a/pallets/pallet-inflation/src/mock.rs b/pallets/pallet-inflation/src/mock.rs index 432f39a3f..c1998e048 100644 --- a/pallets/pallet-inflation/src/mock.rs +++ b/pallets/pallet-inflation/src/mock.rs @@ -69,8 +69,8 @@ impl frame_system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; @@ -78,7 +78,7 @@ impl frame_system::Config for Test { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -102,7 +102,7 @@ impl pallet_balances::Config for Test { type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; diff --git a/pallets/pallet-web3-names/Cargo.toml b/pallets/pallet-web3-names/Cargo.toml index 6cd3f5da4..60bac0a75 100644 --- a/pallets/pallet-web3-names/Cargo.toml +++ b/pallets/pallet-web3-names/Cargo.toml @@ -43,14 +43,15 @@ sp-io = {workspace = true, optional = true} default = ["std"] runtime-benchmarks = [ "frame-benchmarking", - "sp-io", "kilt-support/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "sp-io", + "sp-runtime/runtime-benchmarks", ] std = [ "codec/std", - "frame-benchmarking/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "scale-info/std", diff --git a/pallets/pallet-web3-names/src/benchmarking.rs b/pallets/pallet-web3-names/src/benchmarking.rs index f5b86a483..4ccf6128d 100644 --- a/pallets/pallet-web3-names/src/benchmarking.rs +++ b/pallets/pallet-web3-names/src/benchmarking.rs @@ -53,8 +53,8 @@ benchmarks! { where T::AccountId: From, T::Web3NameOwner: From, - T::OwnerOrigin: GenerateBenchmarkOrigin, - T::BanOrigin: EnsureOrigin, + T::OwnerOrigin: GenerateBenchmarkOrigin, + T::BanOrigin: EnsureOrigin, } claim { @@ -66,7 +66,7 @@ benchmarks! { let origin = T::OwnerOrigin::generate_origin(caller.clone(), owner.clone()); make_free_for_did::(&caller); - }: _(origin, web3_name_input_clone) + }: _(origin, web3_name_input_clone) verify { let web3_name = Web3NameOf::::try_from(web3_name_input.to_vec()).unwrap(); assert!(Names::::get(&owner).is_some()); @@ -81,7 +81,7 @@ benchmarks! { make_free_for_did::(&caller); Pallet::::claim(origin.clone(), web3_name_input.clone()).expect("Should register the claimed web3 name."); - }: _(origin) + }: _(origin) verify { let web3_name = Web3NameOf::::try_from(web3_name_input.to_vec()).unwrap(); assert!(Names::::get(&owner).is_none()); @@ -158,7 +158,7 @@ benchmarks! { Pallet::::claim(origin_create, web3_name_input.clone()).expect("Should register the claimed web3 name."); let origin = T::OwnerOrigin::generate_origin(deposit_owner_new.clone(), owner); - }: _(origin) + }: _(origin) verify { let web3_name = Web3NameOf::::try_from(web3_name_input.to_vec()).unwrap(); assert_eq!(Owner::::get(&web3_name).expect("w3n should exists").deposit, Deposit { diff --git a/pallets/pallet-web3-names/src/lib.rs b/pallets/pallet-web3-names/src/lib.rs index f2b36ebb0..447d7205c 100644 --- a/pallets/pallet-web3-names/src/lib.rs +++ b/pallets/pallet-web3-names/src/lib.rs @@ -94,9 +94,9 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The origin allowed to ban names. - type BanOrigin: EnsureOrigin; + type BanOrigin: EnsureOrigin; /// The origin allowed to perform regular operations. - type OwnerOrigin: EnsureOrigin::Origin>; + type OwnerOrigin: EnsureOrigin<::RuntimeOrigin, Success = Self::OriginSuccess>; /// The type of origin after a successful origin check. type OriginSuccess: CallSources, Web3NameOwnerOf>; /// The currency type to reserve and release deposits. @@ -105,7 +105,7 @@ pub mod pallet { #[pallet::constant] type Deposit: Get>; /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The min encoded length of a name. #[pallet::constant] type MinNameLength: Get; diff --git a/pallets/pallet-web3-names/src/mock.rs b/pallets/pallet-web3-names/src/mock.rs index 9ce3a6929..07fdcc0a3 100644 --- a/pallets/pallet-web3-names/src/mock.rs +++ b/pallets/pallet-web3-names/src/mock.rs @@ -99,8 +99,8 @@ pub(crate) mod runtime { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; @@ -108,7 +108,7 @@ pub(crate) mod runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -130,7 +130,7 @@ pub(crate) mod runtime { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type MaxLocks = MaxLocks; @@ -159,7 +159,7 @@ pub(crate) mod runtime { type OriginSuccess = TestOriginSuccess; type Currency = Balances; type Deposit = Web3NameDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxNameLength = MaxNameLength; type MinNameLength = MinNameLength; type Web3Name = TestWeb3Name; @@ -168,7 +168,7 @@ pub(crate) mod runtime { } impl mock_origin::Config for Test { - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type AccountId = AccountId; type SubjectId = SubjectId; } diff --git a/pallets/pallet-web3-names/src/tests.rs b/pallets/pallet-web3-names/src/tests.rs index 2865c5f2f..ef6f555bc 100644 --- a/pallets/pallet-web3-names/src/tests.rs +++ b/pallets/pallet-web3-names/src/tests.rs @@ -455,7 +455,7 @@ fn test_update_deposit() { ::Deposit::get() * 2 ); assert_ok!(Pallet::::update_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), WEB3_NAME_00_INPUT.to_vec().try_into().unwrap() )); assert_eq!( @@ -492,7 +492,7 @@ fn test_update_deposit_unauthorized() { ); assert_noop!( Pallet::::update_deposit( - Origin::signed(ACCOUNT_01), + RuntimeOrigin::signed(ACCOUNT_01), WEB3_NAME_00_INPUT.to_vec().try_into().unwrap() ), Error::::Unauthorized diff --git a/pallets/parachain-staking/Cargo.toml b/pallets/parachain-staking/Cargo.toml index 85933c673..1eda33e37 100644 --- a/pallets/parachain-staking/Cargo.toml +++ b/pallets/parachain-staking/Cargo.toml @@ -46,9 +46,13 @@ runtime-benchmarks = [ "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] std = [ "codec/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "kilt-runtime-api-staking/std", @@ -63,5 +67,9 @@ std = [ "sp-std/std", ] try-runtime = [ + "frame-system/try-runtime", "frame-support/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-session/try-runtime", ] diff --git a/pallets/parachain-staking/src/benchmarking.rs b/pallets/parachain-staking/src/benchmarking.rs index d271363b7..96e000b2a 100644 --- a/pallets/parachain-staking/src/benchmarking.rs +++ b/pallets/parachain-staking/src/benchmarking.rs @@ -49,7 +49,7 @@ fn setup_collator_candidates( for acc in collators.iter() { T::Currency::make_free_balance_be(acc, amount); assert_ok!(Pallet::::join_candidates( - T::Origin::from(Some(acc.clone()).into()), + T::RuntimeOrigin::from(Some(acc.clone()).into()), amount, )); assert_eq!(CandidatePool::::get(acc).unwrap().stake, amount); @@ -80,7 +80,7 @@ fn fill_delegators(num_delegators: u32, collator: T::AccountId, colla for acc in delegators.iter() { T::Currency::make_free_balance_be(acc, T::MinDelegatorStake::get()); assert_ok!(Pallet::::join_delegators( - T::Origin::from(Some(acc.clone()).into()), + T::RuntimeOrigin::from(Some(acc.clone()).into()), T::Lookup::unlookup(collator.clone()), T::MinDelegatorStake::get(), )); @@ -526,7 +526,7 @@ benchmarks! { let stake = T::MinCollatorCandidateStake::get(); T::Currency::make_free_balance_be(&candidate, free_balance); assert_ok!(Pallet::::join_candidates( - T::Origin::from(Some(candidate.clone()).into()), + T::RuntimeOrigin::from(Some(candidate.clone()).into()), stake, )); assert_eq!(pallet_balances::Pallet::::usable_balance(&candidate), (free_balance - T::MinCollatorCandidateStake::get()).into()); diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index 163540ea8..64e401af3 100644 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -185,7 +185,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_balances::Config + pallet_session::Config { /// Overarching event type - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; // FIXME: Remove Currency and CurrencyBalance types. Problem: Need to restrict // pallet_balances::Config::Balance with From for usage with Perquintill // multiplication @@ -685,13 +685,13 @@ pub mod pallet { ); if let Some(delegated_val) = opt_val { assert_ok!(Pallet::::join_delegators( - T::Origin::from(Some(actor.clone()).into()), + T::RuntimeOrigin::from(Some(actor.clone()).into()), T::Lookup::unlookup(delegated_val.clone()), balance, )); } else { assert_ok!(Pallet::::join_candidates( - T::Origin::from(Some(actor.clone()).into()), + T::RuntimeOrigin::from(Some(actor.clone()).into()), balance )); } @@ -2272,7 +2272,7 @@ pub mod pallet { // Kill storage BlocksAuthored::::remove(collator); BlocksRewarded::::remove(collator); - CandidatePool::::remove(&collator); + CandidatePool::::remove(collator); Ok(()) } diff --git a/pallets/parachain-staking/src/migration.rs b/pallets/parachain-staking/src/migration.rs index 93662db5d..93d54fefd 100644 --- a/pallets/parachain-staking/src/migration.rs +++ b/pallets/parachain-staking/src/migration.rs @@ -15,173 +15,3 @@ // along with this program. If not, see . // If you feel like getting in touch with us, you can do so at info@botlabs.org - -#![cfg_attr(not(feature = "std"), no_std)] - -use crate::{ - set::OrderedSet, - types::{BalanceOf, Delegator, Stake}, -}; - -use super::*; -use codec::{Decode, Encode, MaxEncodedLen}; -use core::marker::PhantomData; -use frame_support::{ - dispatch::GetStorageVersion, - pallet_prelude::{StorageVersion, ValueQuery}, - parameter_types, storage_alias, - traits::{Get, OnRuntimeUpgrade}, - weights::Weight, - Blake2_128Concat, RuntimeDebug, -}; -use scale_info::TypeInfo; -use sp_runtime::traits::Zero; - -#[cfg(feature = "try-runtime")] -use sp_runtime::SaturatedConversion; - -// Old delegator type needed for translating storage map -#[derive(Encode, Decode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] -#[scale_info(skip_type_params(MaxCollatorsPerDelegator))] -#[codec(mel_bound(AccountId: MaxEncodedLen, Balance: MaxEncodedLen))] -pub struct DelegatorOld> { - pub delegations: OrderedSet, MaxCollatorsPerDelegator>, - pub total: Balance, -} -parameter_types! { - const MaxCollatorsPerDelegator: u32 = 1; -} -// Old delegator state map required for pre checks -#[storage_alias] -type DelegatorStateOld = StorageMap< - Pallet, - Blake2_128Concat, - ::AccountId, - DelegatorOld<::AccountId, BalanceOf, MaxCollatorsPerDelegator>, ->; - -/// Number of delegators post migration -#[storage_alias] -type CounterForDelegators = StorageValue, u32, ValueQuery>; - -pub struct StakingPayoutRefactor(PhantomData); -impl OnRuntimeUpgrade for StakingPayoutRefactor { - fn on_runtime_upgrade() -> Weight { - let current = Pallet::::current_storage_version(); - let onchain = Pallet::::on_chain_storage_version(); - - log::info!( - "💰 Running migration with current storage version {:?} / onchain {:?}", - current, - onchain - ); - - if current == 8 && onchain == 7 { - let num_delegators = migrate_delegators::(); - log::info!("💰 Migrated {:?} delegator states", num_delegators); - StorageVersion::new(8).put::>(); - T::DbWeight::get().reads_writes(num_delegators, num_delegators) - } else { - log::info!("💰 StakingPayoutRefactor did not execute. This probably should be removed"); - T::DbWeight::get().reads(1) - } - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - let current = Pallet::::on_chain_storage_version(); - - assert_eq!( - current, 7, - "ParachainStaking on-chain StorageVersion is {:?} instead of 7", - current - ); - - // sanity check each old entry - for delegator in DelegatorStateOld::::iter_values() { - assert!( - delegator.delegations.is_empty(), - "There exists a delegator without a collator in pre migration!" - ); - assert!( - !delegator.total.is_zero(), - "There exists a delegator without any self stake in pre migration!", - ) - } - log::info!( - "💰 Staking migration pre check: {:?} delegators", - DelegatorStateOld::::iter().count() - ); - - assert!( - CounterForDelegators::::get().is_zero(), - "CounterForDelegators already set." - ); - // store number of delegators before migration to check against in post - // migration - CounterForDelegators::::put(DelegatorState::::iter_keys().count().saturated_into::()); - - Ok(()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - // new version must be set. - let onchain = Pallet::::on_chain_storage_version(); - - assert_eq!( - onchain, 8, - "ParachainStaking StorageVersion post-migration is not 8, but {:?} instead.", - onchain - ); - - let old_num_delegators: u32 = CounterForDelegators::::get(); - let new_num_delegators: u32 = DelegatorState::::iter_keys().count().saturated_into::(); - assert_eq!( - old_num_delegators, new_num_delegators, - "Number of delegators changed during migration! Before {:?} vs. now {:?}", - old_num_delegators, new_num_delegators - ); - log::info!( - "💰 Number of delegators: Before {:?} vs. after {:?}", - old_num_delegators, - new_num_delegators - ); - - // sanity check each new entry - for delegator in DelegatorState::::iter_values() { - assert!( - !delegator.amount.is_zero(), - "There exists a delegator without any self stake in post migration!", - ) - } - - log::info!("💰 Post staking payout refactor upgrade checks match up."); - Ok(()) - } -} - -/// Translate all values from the DelegatorState StorageMap from old to new -fn migrate_delegators() -> u64 { - let mut num_translations = 0; - DelegatorState::::translate_values( - |old: DelegatorOld, MaxCollatorsPerDelegator>| { - num_translations += 1; - - // Should never occur because of pre checks but let's be save - if old.total.is_zero() { - log::debug!("Translating delegator with 0 stake amount") - } - if old.delegations.get(0).is_none() { - log::debug!("Translating delegator without collator") - } - - old.delegations.get(0).map(|stake| Delegator { - amount: old.total, - owner: stake.owner.clone(), - }) - }, - ); - - num_translations -} diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index 1a5281dbd..92acfa6e4 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -74,16 +74,16 @@ parameter_types! { impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type DbWeight = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type Index = u64; type BlockNumber = BlockNumber; - type Call = Call; + type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -106,7 +106,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -153,7 +153,7 @@ impl OnUnbalanced> for ToBeneficiary { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type CurrencyBalance = ::Balance; type MinBlocksPerRound = MinBlocksPerRound; @@ -187,7 +187,7 @@ parameter_types! { } impl pallet_session::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type ValidatorIdOf = ConvertInto; type ShouldEndSession = StakePallet; @@ -337,7 +337,7 @@ impl ExtBuilder { if self.blocks_per_round != BLOCKS_PER_ROUND { ext.execute_with(|| { - StakePallet::set_blocks_per_round(Origin::root(), self.blocks_per_round) + StakePallet::set_blocks_per_round(RuntimeOrigin::root(), self.blocks_per_round) .expect("Ran into issues when setting blocks_per_round"); }); } @@ -387,18 +387,18 @@ pub(crate) fn roll_to_claim_rewards(n: BlockNumber, authors: Vec>::on_finalize(System::block_number()); @@ -407,8 +407,8 @@ pub(crate) fn roll_to_claim_rewards(n: BlockNumber, authors: Vec Event { - System::events().pop().expect("Event expected").event +pub(crate) fn last_event() -> pallet::Event { + events().pop().expect("Event expected") } pub(crate) fn events() -> Vec> { @@ -416,7 +416,7 @@ pub(crate) fn events() -> Vec> { .into_iter() .map(|r| r.event) .filter_map(|e| { - if let Event::StakePallet(inner) = e { + if let RuntimeEvent::StakePallet(inner) = e { Some(inner) } else { None diff --git a/pallets/parachain-staking/src/set.rs b/pallets/parachain-staking/src/set.rs index 9995504c1..9ac86d737 100644 --- a/pallets/parachain-staking/src/set.rs +++ b/pallets/parachain-staking/src/set.rs @@ -49,7 +49,7 @@ impl> OrderedSet { let mut v = bv.into_inner(); v.sort_by(|a, b| b.cmp(a)); v.dedup(); - Self::from_sorted_set(v.try_into().expect("No values were added")) + Self::from_sorted_set(v.try_into().map_err(|_| ()).expect("No values were added")) } /// Create a set from a `BoundedVec`. @@ -146,7 +146,7 @@ impl> OrderedSet { } Err(i) => { // Delegator - self.0.try_insert(i, value)?; + self.0.try_insert(i, value).map_err(|_| ())?; Ok(None) } } diff --git a/pallets/parachain-staking/src/tests.rs b/pallets/parachain-staking/src/tests.rs index bae172222..8959cb9ce 100644 --- a/pallets/parachain-staking/src/tests.rs +++ b/pallets/parachain-staking/src/tests.rs @@ -33,14 +33,13 @@ use sp_runtime::{traits::Zero, Perbill, Permill, Perquintill, SaturatedConversio use crate::{ mock::{ almost_equal, events, last_event, roll_to, roll_to_claim_rewards, AccountId, Balance, Balances, BlockNumber, - Event as MetaEvent, ExtBuilder, Origin, Session, StakePallet, System, Test, BLOCKS_PER_ROUND, DECIMALS, - TREASURY_ACC, + ExtBuilder, RuntimeOrigin, Session, StakePallet, System, Test, BLOCKS_PER_ROUND, DECIMALS, TREASURY_ACC, }, set::OrderedSet, types::{ BalanceOf, Candidate, CandidateStatus, DelegationCounter, Delegator, RoundInfo, Stake, StakeOf, TotalStake, }, - CandidatePool, Config, Error, Event, InflationInfo, RewardRate, StakingInfo, STAKING_ID, + CandidatePool, Config, Error, Event, Event as StakeEvent, InflationInfo, RewardRate, StakingInfo, STAKING_ID, }; #[test] @@ -289,50 +288,47 @@ fn join_collator_candidates() { } ); assert_noop!( - StakePallet::join_candidates(Origin::signed(1), 11u128,), + StakePallet::join_candidates(RuntimeOrigin::signed(1), 11u128,), Error::::CandidateExists ); assert_noop!( - StakePallet::join_delegators(Origin::signed(1), 1, 11u128,), + StakePallet::join_delegators(RuntimeOrigin::signed(1), 1, 11u128,), Error::::CandidateExists ); assert_noop!( - StakePallet::join_candidates(Origin::signed(3), 11u128,), + StakePallet::join_candidates(RuntimeOrigin::signed(3), 11u128,), Error::::DelegatorExists ); assert_noop!( - StakePallet::join_candidates(Origin::signed(7), 9u128,), + StakePallet::join_candidates(RuntimeOrigin::signed(7), 9u128,), Error::::ValStakeBelowMin ); assert_noop!( - StakePallet::join_candidates(Origin::signed(8), 10u128,), + StakePallet::join_candidates(RuntimeOrigin::signed(8), 10u128,), BalancesError::::InsufficientBalance ); assert_eq!(CandidatePool::::count(), 2); assert!(System::events().is_empty()); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); - assert_ok!(StakePallet::join_candidates(Origin::signed(7), 10u128,)); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::JoinedCollatorCandidates(7, 10u128)) - ); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(7), 10u128,)); + assert_eq!(last_event(), StakeEvent::JoinedCollatorCandidates(7, 10u128)); // MaxCollatorCandidateStake assert_noop!( - StakePallet::join_candidates(Origin::signed(10), 161_000_000 * DECIMALS), + StakePallet::join_candidates(RuntimeOrigin::signed(10), 161_000_000 * DECIMALS), Error::::ValStakeAboveMax ); assert_ok!(StakePallet::join_candidates( - Origin::signed(10), + RuntimeOrigin::signed(10), StakePallet::max_candidate_stake() )); assert_eq!(CandidatePool::::count(), 4); assert_eq!( last_event(), - MetaEvent::StakePallet(Event::JoinedCollatorCandidates(10, StakePallet::max_candidate_stake(),)) + StakeEvent::JoinedCollatorCandidates(10, StakePallet::max_candidate_stake(),) ); }); } @@ -364,7 +360,7 @@ fn collator_exit_executes_after_delay() { delegators: 400 } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -375,28 +371,25 @@ fn collator_exit_executes_after_delay() { assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 7]); roll_to(4, vec![]); assert_noop!( - StakePallet::init_leave_candidates(Origin::signed(3)), + StakePallet::init_leave_candidates(RuntimeOrigin::signed(3)), Error::::CandidateNotFound ); roll_to(11, vec![]); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(2))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(2))); // Still three, candidate didn't leave yet assert_eq!(CandidatePool::::count(), 3); assert_noop!( - StakePallet::join_delegators(Origin::signed(10), 2, 10), + StakePallet::join_delegators(RuntimeOrigin::signed(10), 2, 10), Error::::CannotDelegateIfLeaving ); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 7]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::CollatorScheduledExit(2, 2, 4)) - ); + assert_eq!(last_event(), StakeEvent::CollatorScheduledExit(2, 2, 4)); let info = StakePallet::candidate_pool(&2).unwrap(); assert_eq!(info.status, CandidateStatus::Leaving(4)); roll_to(21, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(2), 2)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(2), 2)); assert_eq!(CandidatePool::::count(), 2); // we must exclude leaving collators from rewards while @@ -443,7 +436,7 @@ fn collator_selection_chooses_top_candidates() { delegators: 0 } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -456,24 +449,18 @@ fn collator_selection_chooses_top_candidates() { assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 5]); let expected = vec![Event::MaxSelectedCandidatesSet(2, 5), Event::NewRound(5, 1)]; assert_eq!(events(), expected); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(6))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(6))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 5],); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::CollatorScheduledExit(1, 6, 3)) - ); + assert_eq!(last_event(), StakeEvent::CollatorScheduledExit(1, 6, 3)); roll_to(15, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(6), 6)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(6), 6)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 5]); roll_to(21, vec![]); - assert_ok!(StakePallet::join_candidates(Origin::signed(6), 69u128)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(6), 69u128)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 6]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::JoinedCollatorCandidates(6, 69u128)) - ); + assert_eq!(last_event(), StakeEvent::JoinedCollatorCandidates(6, 69u128)); roll_to(27, vec![]); // should choose top MaxSelectedCandidates (5), in order @@ -516,7 +503,7 @@ fn exit_queue_with_events() { .execute_with(|| { assert_eq!(CandidatePool::::count(), 6); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2]); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 5]); roll_to(8, vec![]); @@ -524,43 +511,34 @@ fn exit_queue_with_events() { assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 5]); let mut expected = vec![Event::MaxSelectedCandidatesSet(2, 5), Event::NewRound(5, 1)]; assert_eq!(events(), expected); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(6))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(6))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4, 5]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::CollatorScheduledExit(1, 6, 3)) - ); + assert_eq!(last_event(), StakeEvent::CollatorScheduledExit(1, 6, 3)); roll_to(11, vec![]); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(5))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(5))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3, 4]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::CollatorScheduledExit(2, 5, 4)) - ); + assert_eq!(last_event(), StakeEvent::CollatorScheduledExit(2, 5, 4)); assert_eq!(CandidatePool::::count(), 6, "No collators have left yet."); roll_to(16, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(6), 6)); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(4))); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(6), 6)); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(4))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::CollatorScheduledExit(3, 4, 5)) - ); + assert_eq!(last_event(), StakeEvent::CollatorScheduledExit(3, 4, 5)); assert_noop!( - StakePallet::init_leave_candidates(Origin::signed(4)), + StakePallet::init_leave_candidates(RuntimeOrigin::signed(4)), Error::::AlreadyLeaving ); assert_eq!(CandidatePool::::count(), 5, "Collator #5 left."); roll_to(20, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(5), 5)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(5), 5)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 3]); assert_eq!(CandidatePool::::count(), 4, "Two out of six collators left."); roll_to(26, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(4), 4)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(4), 4)); assert_eq!(CandidatePool::::count(), 3, "Three out of six collators left."); roll_to(30, vec![]); @@ -628,7 +606,7 @@ fn execute_leave_candidates_with_delay() { delegators: 500, } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -640,14 +618,14 @@ fn execute_leave_candidates_with_delay() { roll_to(5, vec![]); // should choose top MaxSelectedCandidates (5), in order assert_eq!(StakePallet::selected_candidates().into_inner(), vec![2, 1, 10, 9, 8]); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(10))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(9))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(7))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(6))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(5))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(8))); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(2))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(10))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(9))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(7))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(6))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(5))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(8))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(2))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![4, 3]); for owner in vec![1, 2, 5, 6, 7, 8, 9, 10].iter() { assert!(StakePallet::candidate_pool(owner) @@ -743,7 +721,7 @@ fn execute_leave_candidates_with_delay() { .unwrap() .can_exit(1 + ::ExitQueueDelay::get())); assert_noop!( - StakePallet::execute_leave_candidates(Origin::signed(*owner), *owner), + StakePallet::execute_leave_candidates(RuntimeOrigin::signed(*owner), *owner), Error::::CannotLeaveYet ); } @@ -829,7 +807,7 @@ fn execute_leave_candidates_with_delay() { assert_eq!(StakePallet::selected_candidates().into_inner(), vec![4, 3]); for collator in vec![1u64, 2u64, 5u64, 6u64, 7u64].iter() { assert_ok!(StakePallet::execute_leave_candidates( - Origin::signed(*collator), + RuntimeOrigin::signed(*collator), *collator )); assert!(StakePallet::candidate_pool(&collator).is_none()); @@ -848,7 +826,7 @@ fn execute_leave_candidates_with_delay() { roll_to(20, vec![]); for collator in 8u64..=10u64 { assert_ok!(StakePallet::execute_leave_candidates( - Origin::signed(collator), + RuntimeOrigin::signed(collator), collator )); assert!(StakePallet::candidate_pool(&collator).is_none()); @@ -890,7 +868,7 @@ fn multiple_delegations() { .set_blocks_per_round(5) .build() .execute_with(|| { - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); roll_to( 8, vec![Some(1), Some(2), Some(3), Some(4), Some(5), Some(1), Some(2), Some(3)], @@ -900,15 +878,15 @@ fn multiple_delegations() { let mut expected = vec![Event::MaxSelectedCandidatesSet(2, 5), Event::NewRound(5, 1)]; assert_eq!(events(), expected); assert_noop!( - StakePallet::join_delegators(Origin::signed(13), 2, 2), + StakePallet::join_delegators(RuntimeOrigin::signed(13), 2, 2), Error::::DelegationBelowMin, ); - assert_ok!(StakePallet::join_delegators(Origin::signed(13), 2, 10)); - assert_ok!(StakePallet::join_delegators(Origin::signed(14), 4, 10)); - assert_ok!(StakePallet::join_delegators(Origin::signed(15), 3, 10)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(13), 2, 10)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(14), 4, 10)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(15), 3, 10)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2, 4, 3, 5]); assert_noop!( - StakePallet::join_delegators(Origin::signed(6), 5, 10), + StakePallet::join_delegators(RuntimeOrigin::signed(6), 5, 10), Error::::AlreadyDelegating, ); @@ -928,24 +906,24 @@ fn multiple_delegations() { assert_eq!(events(), expected); roll_to(21, vec![Some(1), Some(2), Some(3), Some(4), Some(5)]); - assert_ok!(StakePallet::join_delegators(Origin::signed(16), 2, 80)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(16), 2, 80)); assert_noop!( - StakePallet::join_delegators(Origin::signed(99), 3, 11), + StakePallet::join_delegators(RuntimeOrigin::signed(99), 3, 11), BalancesError::::InsufficientBalance ); assert_noop!( - StakePallet::join_delegators(Origin::signed(17), 2, 10), + StakePallet::join_delegators(RuntimeOrigin::signed(17), 2, 10), Error::::TooManyDelegators ); // kick 13 by staking 1 more (11 > 10) assert!(StakePallet::unstaking(13).is_empty()); - assert_ok!(StakePallet::join_delegators(Origin::signed(17), 2, 11)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(17), 2, 11)); assert!(StakePallet::delegator_state(13).is_none()); assert_eq!(StakePallet::unstaking(13).get(&23), Some(&10u128)); // kick 9 by staking 1 more (11 > 10) assert!(StakePallet::unstaking(9).is_empty()); assert!(StakePallet::rewards(9).is_zero()); - assert_ok!(StakePallet::join_delegators(Origin::signed(11), 2, 11)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(11), 2, 11)); // 11 should be initiated with the same rewarded counter as the authored counter // by their collator 2 assert_eq!(StakePallet::blocks_rewarded(2), StakePallet::blocks_authored(11)); @@ -970,12 +948,9 @@ fn multiple_delegations() { ]; expected.append(&mut new2); assert_eq!(events(), expected); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(2))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(2))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 4, 3, 5]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::CollatorScheduledExit(5, 2, 7)) - ); + assert_eq!(last_event(), StakeEvent::CollatorScheduledExit(5, 2, 7)); roll_to(31, vec![Some(1), Some(2), Some(3), Some(4), Some(5)]); let mut new3 = vec![ @@ -987,12 +962,12 @@ fn multiple_delegations() { assert_eq!(events(), expected); // test join_delegator errors - assert_ok!(StakePallet::join_delegators(Origin::signed(18), 1, 10)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(18), 1, 10)); assert_noop!( - StakePallet::join_delegators(Origin::signed(12), 1, 10), + StakePallet::join_delegators(RuntimeOrigin::signed(12), 1, 10), Error::::TooManyDelegators ); - assert_ok!(StakePallet::join_delegators(Origin::signed(12), 1, 11)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(12), 1, 11)); // verify that delegations are removed after collator leaves, not before assert!(StakePallet::candidate_pool(2) @@ -1011,7 +986,7 @@ fn multiple_delegations() { assert_eq!(Balances::free_balance(&17), 100); roll_to(35, vec![Some(1), Some(2), Some(3), Some(4)]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(2), 2)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(2), 2)); let mut unbonding_8: BoundedBTreeMap, ::MaxUnstakeRequests> = BoundedBTreeMap::new(); assert_ok!(unbonding_8.try_insert(35u64 + ::StakeDuration::get() as u64, 10)); @@ -1024,10 +999,10 @@ fn multiple_delegations() { roll_to(37, vec![Some(1), Some(2)]); assert!(StakePallet::delegator_state(8).is_none()); assert!(StakePallet::delegator_state(17).is_none()); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(8), 8)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(17), 17)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(8), 8)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(17), 17)); assert_noop!( - StakePallet::unlock_unstaked(Origin::signed(12), 12), + StakePallet::unlock_unstaked(RuntimeOrigin::signed(12), 12), Error::::UnstakingIsEmpty ); assert_eq!(Balances::usable_balance(&17), 100); @@ -1066,7 +1041,7 @@ fn should_update_total_stake() { delegators: 30, } ); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 50)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 50)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -1076,7 +1051,7 @@ fn should_update_total_stake() { ); old_stake = StakePallet::total_collator_stake(); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 50)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 50)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -1086,13 +1061,13 @@ fn should_update_total_stake() { ); old_stake = StakePallet::total_collator_stake(); - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(7), 50)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(7), 50)); assert_noop!( - StakePallet::delegator_stake_more(Origin::signed(7), 0), + StakePallet::delegator_stake_more(RuntimeOrigin::signed(7), 0), Error::::ValStakeZero ); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(7), 0), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(7), 0), Error::::ValStakeZero ); assert_eq!( @@ -1104,7 +1079,7 @@ fn should_update_total_stake() { ); old_stake = StakePallet::total_collator_stake(); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(7), 50)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(7), 50)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -1114,7 +1089,7 @@ fn should_update_total_stake() { ); old_stake = StakePallet::total_collator_stake(); - assert_ok!(StakePallet::join_delegators(Origin::signed(11), 1, 200)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(11), 1, 200)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -1125,7 +1100,7 @@ fn should_update_total_stake() { old_stake = StakePallet::total_collator_stake(); assert_eq!(StakePallet::delegator_state(11).unwrap().amount, 200); - assert_ok!(StakePallet::leave_delegators(Origin::signed(11))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(11))); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -1136,7 +1111,7 @@ fn should_update_total_stake() { let old_stake = StakePallet::total_collator_stake(); assert_eq!(StakePallet::delegator_state(8).unwrap().amount, 10); - assert_ok!(StakePallet::leave_delegators(Origin::signed(8))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(8))); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -1155,7 +1130,7 @@ fn should_update_total_stake() { StakePallet::candidate_pool(2).unwrap().stake, StakePallet::candidate_pool(3).unwrap().stake ); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(2))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(2))); let old_stake = TotalStake { delegators: old_stake.delegators - 10, // total active collator stake is unchanged because number of selected candidates is 2 and 2's @@ -1168,7 +1143,7 @@ fn should_update_total_stake() { // shouldn't change total stake when 2 leaves roll_to(10, vec![]); assert_eq!(StakePallet::total_collator_stake(), old_stake); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(2), 2)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::total_collator_stake(), old_stake); }) } @@ -1196,66 +1171,66 @@ fn collators_bond() { .execute_with(|| { roll_to(4, vec![]); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(6), 50), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(6), 50), Error::::CandidateNotFound ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(6), 50), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(6), 50), Error::::CandidateNotFound ); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 50)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 50)); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 40), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 40), BalancesError::::InsufficientBalance ); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); assert!(StakePallet::candidate_pool(1) .unwrap() .can_exit(::ExitQueueDelay::get())); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 30), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 30), Error::::CannotStakeIfLeaving ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(1), 10), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10), Error::::CannotStakeIfLeaving ); roll_to(30, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 40), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 40), Error::::CandidateNotFound ); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(2), 80)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(2), 90)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(3), 10)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(2), 80)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(2), 90)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(3), 10)); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(2), 11), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(2), 11), Error::::Underflow ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(2), 1), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(2), 1), Error::::ValStakeBelowMin ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(3), 1), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(3), 1), Error::::ValStakeBelowMin ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(4), 11), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(4), 11), Error::::ValStakeBelowMin ); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(4), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(4), 10)); // MaxCollatorCandidateStake assert_ok!(StakePallet::join_candidates( - Origin::signed(11), + RuntimeOrigin::signed(11), StakePallet::max_candidate_stake() )); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(11), 1u128), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(11), 1u128), Error::::ValStakeAboveMax, ); }); @@ -1283,45 +1258,45 @@ fn delegators_bond() { .execute_with(|| { roll_to(4, vec![]); assert_noop!( - StakePallet::join_delegators(Origin::signed(6), 2, 50), + StakePallet::join_delegators(RuntimeOrigin::signed(6), 2, 50), Error::::AlreadyDelegating ); assert_noop!( - StakePallet::delegator_stake_more(Origin::signed(1), 50), + StakePallet::delegator_stake_more(RuntimeOrigin::signed(1), 50), Error::::DelegatorNotFound ); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(1), 50), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(1), 50), Error::::DelegatorNotFound ); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(6), 11), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(6), 11), Error::::Underflow ); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(6), 8), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(6), 8), Error::::DelegationBelowMin ); - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(6), 10)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(6), 10)); assert_noop!( - StakePallet::delegator_stake_more(Origin::signed(6), 81), + StakePallet::delegator_stake_more(RuntimeOrigin::signed(6), 81), BalancesError::::InsufficientBalance ); assert_noop!( - StakePallet::join_delegators(Origin::signed(10), 1, 4), + StakePallet::join_delegators(RuntimeOrigin::signed(10), 1, 4), Error::::DelegationBelowMin ); roll_to(9, vec![]); assert_eq!(Balances::usable_balance(&6), 80); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); assert!(StakePallet::candidate_pool(1) .unwrap() .can_exit(1 + ::ExitQueueDelay::get())); roll_to(31, vec![]); assert!(StakePallet::is_delegator(&6)); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert!(!StakePallet::is_delegator(&6)); assert_eq!(Balances::usable_balance(&6), 80); assert_eq!(Balances::free_balance(&6), 100); @@ -1336,18 +1311,18 @@ fn should_leave_delegators() { .with_delegators(vec![(2, 1, 100)]) .build() .execute_with(|| { - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); assert!(StakePallet::delegator_state(2).is_none()); assert!(!StakePallet::candidate_pool(1) .unwrap() .delegators .contains(&StakeOf:: { owner: 2, amount: 100 })); assert_noop!( - StakePallet::leave_delegators(Origin::signed(2)), + StakePallet::leave_delegators(RuntimeOrigin::signed(2)), Error::::DelegatorNotFound ); assert_noop!( - StakePallet::leave_delegators(Origin::signed(1)), + StakePallet::leave_delegators(RuntimeOrigin::signed(1)), Error::::DelegatorNotFound ); }); @@ -1380,15 +1355,12 @@ fn round_transitions() { roll_to(5, vec![]); let init = vec![Event::NewRound(5, 1)]; assert_eq!(events(), init); - assert_ok!(StakePallet::set_blocks_per_round(Origin::root(), 3)); + assert_ok!(StakePallet::set_blocks_per_round(RuntimeOrigin::root(), 3)); assert_noop!( - StakePallet::set_blocks_per_round(Origin::root(), 1), + StakePallet::set_blocks_per_round(RuntimeOrigin::root(), 1), Error::::CannotSetBelowMin ); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::BlocksPerRoundSet(1, 5, 5, 3)) - ); + assert_eq!(last_event(), StakeEvent::BlocksPerRoundSet(1, 5, 5, 3)); // inflation config should be untouched after per_block update assert_eq!(inflation, StakePallet::inflation_config()); @@ -1396,7 +1368,7 @@ fn round_transitions() { // last round startet at 5 but we are already at 9, so we expect 9 to be the new // round roll_to(8, vec![]); - assert_eq!(last_event(), MetaEvent::StakePallet(Event::NewRound(8, 2))); + assert_eq!(last_event(), StakeEvent::NewRound(8, 2)) }); // if duration of current round is less than new bpr, round waits until new bpr @@ -1416,24 +1388,18 @@ fn round_transitions() { // chooses top MaxSelectedCandidates (5), in order let init = vec![Event::NewRound(5, 1)]; assert_eq!(events(), init); - assert_ok!(StakePallet::set_blocks_per_round(Origin::root(), 3)); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::BlocksPerRoundSet(1, 5, 5, 3)) - ); + assert_ok!(StakePallet::set_blocks_per_round(RuntimeOrigin::root(), 3)); + assert_eq!(last_event(), StakeEvent::BlocksPerRoundSet(1, 5, 5, 3)); // inflation config should be untouched after per_block update assert_eq!(inflation, StakePallet::inflation_config()); // there should not be a new event roll_to(7, vec![]); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::BlocksPerRoundSet(1, 5, 5, 3)) - ); + assert_eq!(last_event(), StakeEvent::BlocksPerRoundSet(1, 5, 5, 3)); roll_to(8, vec![]); - assert_eq!(last_event(), MetaEvent::StakePallet(Event::NewRound(8, 2))); + assert_eq!(last_event(), StakeEvent::NewRound(8, 2)) }); // round_immediately_jumps_if_current_duration_exceeds_new_blocks_per_round @@ -1452,7 +1418,7 @@ fn round_transitions() { // chooses top MaxSelectedCandidates (5), in order let init = vec![Event::NewRound(5, 1)]; assert_eq!(events(), init); - assert_ok!(StakePallet::set_blocks_per_round(Origin::root(), 3)); + assert_ok!(StakePallet::set_blocks_per_round(RuntimeOrigin::root(), 3)); // inflation config should be untouched after per_block update assert_eq!(inflation, StakePallet::inflation_config()); @@ -1467,14 +1433,11 @@ fn round_transitions() { Perquintill::from_percent(d_rewards) ) ); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::BlocksPerRoundSet(1, 5, 5, 3)) - ); + assert_eq!(last_event(), StakeEvent::BlocksPerRoundSet(1, 5, 5, 3)); roll_to(8, vec![]); // last round startet at 5, so we expect 8 to be the new round - assert_eq!(last_event(), MetaEvent::StakePallet(Event::NewRound(8, 2))); + assert_eq!(last_event(), StakeEvent::NewRound(8, 2)) }); } @@ -1560,7 +1523,7 @@ fn coinbase_rewards_few_blocks_detailed_check() { assert_eq!(Balances::usable_balance(&3), user_3 + d_rewards / 2 * 3); assert_eq!(Balances::usable_balance(&4), user_4 + d_rewards / 4 * 3); assert_eq!(Balances::usable_balance(&5), user_5 + d_rewards / 4); - assert_ok!(StakePallet::leave_delegators(Origin::signed(5))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(5))); // 2 is block author for 5th block roll_to_claim_rewards(6, authors); @@ -1583,13 +1546,13 @@ fn delegator_should_not_receive_rewards_after_revoking() { .with_inflation(10, 15, 40, 15, 5) .build() .execute_with(|| { - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); let authors: Vec> = (1u64..100u64).map(|_| Some(1u64)).collect(); assert_eq!(Balances::usable_balance(&1), Balance::zero()); assert_eq!(Balances::usable_balance(&2), Balance::zero()); roll_to_claim_rewards(100, authors); assert!(Balances::usable_balance(&1) > Balance::zero()); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(Balances::usable_balance(&2), 10_000_000 * DECIMALS); }); @@ -1604,7 +1567,7 @@ fn delegator_should_not_receive_rewards_after_revoking() { .with_inflation(10, 15, 40, 15, 5) .build() .execute_with(|| { - assert_ok!(StakePallet::leave_delegators(Origin::signed(3))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(3))); let authors: Vec> = (1u64..100u64).map(|_| Some(1u64)).collect(); assert_eq!(Balances::usable_balance(&1), Balance::zero()); assert_eq!(Balances::usable_balance(&2), Balance::zero()); @@ -1612,7 +1575,7 @@ fn delegator_should_not_receive_rewards_after_revoking() { roll_to_claim_rewards(100, authors); assert!(Balances::usable_balance(&1) > Balance::zero()); assert!(Balances::usable_balance(&2) > Balance::zero()); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(3), 3)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(3), 3)); assert_eq!(Balances::usable_balance(&3), 10_000_000 * DECIMALS); }); } @@ -1740,7 +1703,7 @@ fn should_not_reward_delegators_below_min_stake() { amount: delegator_stake_below_min, }; assert_eq!(state.delegators.try_insert(impossible_bond), Ok(true)); - >::insert(&1u64, state); + >::insert(1u64, state); let authors: Vec> = vec![Some(1u64), Some(1u64), Some(1u64), Some(1u64)]; assert_eq!(Balances::usable_balance(&1), Balance::zero()); @@ -1825,7 +1788,7 @@ fn reach_max_top_candidates() { ::MaxTopCandidates::get() ); // should not be possible to join candidate pool, even with more stake - assert_ok!(StakePallet::join_candidates(Origin::signed(11), 11)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(11), 11)); assert_eq!( StakePallet::top_candidates() .into_iter() @@ -1834,7 +1797,7 @@ fn reach_max_top_candidates() { vec![2, 11, 1, 3, 4, 5, 6, 7, 8, 9] ); // last come, last one in the list - assert_ok!(StakePallet::join_candidates(Origin::signed(12), 11)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(12), 11)); assert_eq!( StakePallet::top_candidates() .into_iter() @@ -1842,13 +1805,13 @@ fn reach_max_top_candidates() { .collect::>(), vec![2, 11, 12, 1, 3, 4, 5, 6, 7, 8] ); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 1)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(3), 1)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(4), 1)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(5), 1)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(6), 1)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(7), 1)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(8), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(3), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(4), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(5), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(6), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(7), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(8), 1)); assert_eq!( StakePallet::top_candidates() .into_iter() @@ -1999,15 +1962,21 @@ fn set_max_selected_candidates_safe_guards() { .build() .execute_with(|| { assert_noop!( - StakePallet::set_max_selected_candidates(Origin::root(), ::MinCollators::get() - 1), + StakePallet::set_max_selected_candidates( + RuntimeOrigin::root(), + ::MinCollators::get() - 1 + ), Error::::CannotSetBelowMin ); assert_noop!( - StakePallet::set_max_selected_candidates(Origin::root(), ::MaxTopCandidates::get() + 1), + StakePallet::set_max_selected_candidates( + RuntimeOrigin::root(), + ::MaxTopCandidates::get() + 1 + ), Error::::CannotSetAboveMax ); assert_ok!(StakePallet::set_max_selected_candidates( - Origin::root(), + RuntimeOrigin::root(), ::MinCollators::get() + 1 )); }); @@ -2048,7 +2017,7 @@ fn set_max_selected_candidates_total_stake() { } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 3)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 3)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -2057,7 +2026,7 @@ fn set_max_selected_candidates_total_stake() { } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 5)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 5)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -2066,7 +2035,7 @@ fn set_max_selected_candidates_total_stake() { } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 10)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -2075,7 +2044,7 @@ fn set_max_selected_candidates_total_stake() { } ); - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 2)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 2)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -2114,28 +2083,28 @@ fn update_inflation() { assert!(!invalid_inflation.is_valid(::BLOCKS_PER_YEAR)); assert_ok!(StakePallet::set_inflation( - Origin::root(), + RuntimeOrigin::root(), Perquintill::from_percent(0), Perquintill::from_percent(100), Perquintill::from_percent(100), Perquintill::from_percent(100), )); assert_ok!(StakePallet::set_inflation( - Origin::root(), + RuntimeOrigin::root(), Perquintill::from_percent(100), Perquintill::from_percent(0), Perquintill::from_percent(100), Perquintill::from_percent(100), )); assert_ok!(StakePallet::set_inflation( - Origin::root(), + RuntimeOrigin::root(), Perquintill::from_percent(100), Perquintill::from_percent(100), Perquintill::from_percent(0), Perquintill::from_percent(100), )); assert_ok!(StakePallet::set_inflation( - Origin::root(), + RuntimeOrigin::root(), Perquintill::from_percent(100), Perquintill::from_percent(100), Perquintill::from_percent(100), @@ -2157,7 +2126,7 @@ fn unlock_unstaked() { .with_delegators(vec![(2, 1, 100)]) .build() .execute_with(|| { - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); let mut unstaking: BoundedBTreeMap, ::MaxUnstakeRequests> = BoundedBTreeMap::new(); assert_ok!(unstaking.try_insert(3, 100)); @@ -2169,20 +2138,20 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // join delegators and revoke again --> consume unstaking at block 3 roll_to(2, vec![]); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 100)); - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100)); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); unstaking.remove(&3); assert_ok!(unstaking.try_insert(4, 100)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); @@ -2191,7 +2160,7 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); @@ -2199,7 +2168,7 @@ fn unlock_unstaked() { unstaking.remove(&4); assert_eq!(Balances::locks(2), vec![lock]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![]); }); @@ -2215,7 +2184,7 @@ fn unlock_unstaked() { .with_delegators(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); let mut unstaking: BoundedBTreeMap, ::MaxUnstakeRequests> = BoundedBTreeMap::new(); assert_ok!(unstaking.try_insert(3, 10)); @@ -2227,21 +2196,21 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // join delegators and revoke again roll_to(2, vec![]); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 100)); - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100)); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); unstaking.remove(&3); assert_ok!(unstaking.try_insert(4, 100)); lock.amount = 100; assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); @@ -2249,7 +2218,7 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); @@ -2257,7 +2226,7 @@ fn unlock_unstaked() { roll_to(4, vec![]); unstaking.remove(&4); assert_eq!(Balances::locks(2), vec![lock]); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![]); }); @@ -2275,7 +2244,7 @@ fn unlock_unstaked() { .with_delegators(vec![(2, 1, 100)]) .build() .execute_with(|| { - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); let mut unstaking: BoundedBTreeMap, ::MaxUnstakeRequests> = BoundedBTreeMap::new(); assert_ok!(unstaking.try_insert(3, 100)); @@ -2287,20 +2256,20 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // join delegators and revoke again roll_to(2, vec![]); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 10)); - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 10)); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); assert_ok!(unstaking.try_insert(3, 90)); assert_ok!(unstaking.try_insert(4, 10)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); @@ -2309,7 +2278,7 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![lock.clone()]); // should be able to unlock 90 of 100 from unstaking - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); unstaking.remove(&3); lock.amount = 10; assert_eq!(StakePallet::unstaking(2), unstaking); @@ -2318,7 +2287,7 @@ fn unlock_unstaked() { roll_to(4, vec![]); assert_eq!(Balances::locks(2), vec![lock]); // should be able to unlock 10 of remaining 10 - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); unstaking.remove(&4); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(2), vec![]); @@ -2340,18 +2309,18 @@ fn unlock_unstaked() { // should be able to decrease more often than MaxUnstakeRequests because it's // the same block and thus unstaking is increased at block 3 instead of having // multiple entries for the same block - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10),); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10),); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10),); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10),); let mut unstaking: BoundedBTreeMap, ::MaxUnstakeRequests> = BoundedBTreeMap::new(); assert_ok!(unstaking.try_insert(3, 60)); @@ -2365,32 +2334,32 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(2), unstaking); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(1), 1)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(1), 1)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(1), vec![lock.clone()]); assert_eq!(Balances::locks(2), vec![lock.clone()]); roll_to(2, vec![]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10),); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10),); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10),); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10),); assert_ok!(unstaking.try_insert(4, 10)); assert_eq!(Balances::locks(1), vec![lock.clone()]); assert_eq!(Balances::locks(2), vec![lock.clone()]); assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(2), unstaking); // shouldn't be able to unlock anything - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(1), 1)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(1), 1)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(1), vec![lock.clone()]); assert_eq!(Balances::locks(2), vec![lock.clone()]); roll_to(3, vec![]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10),); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10),); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10),); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10),); assert_ok!(unstaking.try_insert(5, 10)); assert_ok!(unstaking.try_insert(5, 10)); assert_eq!(Balances::locks(1), vec![lock.clone()]); @@ -2398,8 +2367,8 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(2), unstaking); // should unlock 60 - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(1), 1)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(1), 1)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); lock.amount = 140; unstaking.remove(&3); assert_eq!(StakePallet::unstaking(1), unstaking); @@ -2409,14 +2378,14 @@ fn unlock_unstaked() { // reach MaxUnstakeRequests roll_to(4, vec![]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); roll_to(5, vec![]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); roll_to(6, vec![]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 10)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10)); assert_ok!(unstaking.try_insert(6, 10)); assert_ok!(unstaking.try_insert(7, 10)); assert_ok!(unstaking.try_insert(8, 10)); @@ -2427,15 +2396,15 @@ fn unlock_unstaked() { roll_to(7, vec![]); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(1), 10), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 10), Error::::NoMoreUnstaking ); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(2), 10), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 10), Error::::NoMoreUnstaking ); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(1), 1)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(2), 2)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(1), 1)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(2), 2)); unstaking.remove(&4); unstaking.remove(&5); unstaking.remove(&6); @@ -2445,11 +2414,11 @@ fn unlock_unstaked() { assert_eq!(StakePallet::unstaking(2), unstaking); assert_eq!(Balances::locks(1), vec![lock.clone()]); assert_eq!(Balances::locks(2), vec![lock.clone()]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 40)); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(2), 40)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 40)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(2), 40)); assert_ok!(unstaking.try_insert(9, 40)); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 30)); - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(2), 30)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 30)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(2), 30)); unstaking.remove(&8); assert_ok!(unstaking.try_insert(9, 20)); assert_eq!(StakePallet::unstaking(1), unstaking); @@ -2472,28 +2441,28 @@ fn kick_candidate_with_full_unstaking() { // Fill unstake requests for block in 1u64..1u64.saturating_add(max_unstake_reqs as u64) { System::set_block_number(block); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(3), 1)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(3), 1)); } assert_eq!(StakePallet::unstaking(3).into_inner().len(), max_unstake_reqs); // Additional unstake should fail System::set_block_number(100); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(3), 1), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(3), 1), Error::::NoMoreUnstaking ); // Fill last unstake request by removing candidate and unstaking all stake - assert_ok!(StakePallet::force_remove_candidate(Origin::root(), 3)); + assert_ok!(StakePallet::force_remove_candidate(RuntimeOrigin::root(), 3)); // Cannot join with full unstaking assert_eq!(StakePallet::unstaking(3).into_inner().len(), max_unstake_reqs + 1); assert_noop!( - StakePallet::join_candidates(Origin::signed(3), 100), + StakePallet::join_candidates(RuntimeOrigin::signed(3), 100), Error::::CannotJoinBeforeUnlocking ); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(3), 3)); - assert_ok!(StakePallet::join_candidates(Origin::signed(3), 100)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(3), 3)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(3), 100)); }); } #[test] @@ -2510,29 +2479,29 @@ fn kick_delegator_with_full_unstaking() { // Fill unstake requests for block in 1u64..1u64.saturating_add(max_unstake_reqs as u64) { System::set_block_number(block); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(5), 1)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(5), 1)); } assert_eq!(StakePallet::unstaking(5).into_inner().len(), max_unstake_reqs); // Additional unstake should fail System::set_block_number(100); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(5), 1), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(5), 1), Error::::NoMoreUnstaking ); // Fill last unstake request by replacing delegator - assert_ok!(StakePallet::join_delegators(Origin::signed(6), 1, 200)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(6), 1, 200)); assert_eq!(StakePallet::unstaking(5).into_inner().len(), max_unstake_reqs + 1); assert!(!StakePallet::is_delegator(&5)); // Cannot join with full unstaking assert_noop!( - StakePallet::join_delegators(Origin::signed(5), 1, 100), + StakePallet::join_delegators(RuntimeOrigin::signed(5), 1, 100), Error::::CannotJoinBeforeUnlocking ); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(5), 5)); - assert_ok!(StakePallet::join_delegators(Origin::signed(5), 1, 220)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(5), 5)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(5), 1, 220)); }); } @@ -2553,16 +2522,16 @@ fn candidate_leaves() { vec![1, 2] ); assert_noop!( - StakePallet::init_leave_candidates(Origin::signed(11)), + StakePallet::init_leave_candidates(RuntimeOrigin::signed(11)), Error::::CandidateNotFound ); assert_noop!( - StakePallet::init_leave_candidates(Origin::signed(1)), + StakePallet::init_leave_candidates(RuntimeOrigin::signed(1)), Error::::TooFewCollatorCandidates ); // add five more collator to max fill TopCandidates for candidate in 3u64..11u64 { - assert_ok!(StakePallet::join_candidates(Origin::signed(candidate), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(candidate), 100)); } assert_eq!( StakePallet::top_candidates() @@ -2572,7 +2541,7 @@ fn candidate_leaves() { (1u64..11u64).collect::>() ); assert_eq!(CandidatePool::::count(), 10); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); assert_eq!( StakePallet::top_candidates() .into_iter() @@ -2581,27 +2550,27 @@ fn candidate_leaves() { (2u64..11u64).collect::>() ); assert_noop!( - StakePallet::join_delegators(Origin::signed(15), 1, 10), + StakePallet::join_delegators(RuntimeOrigin::signed(15), 1, 10), Error::::CannotDelegateIfLeaving ); assert_noop!( - StakePallet::delegator_stake_more(Origin::signed(12), 1), + StakePallet::delegator_stake_more(RuntimeOrigin::signed(12), 1), Error::::CannotDelegateIfLeaving ); assert_noop!( - StakePallet::delegator_stake_less(Origin::signed(12), 1), + StakePallet::delegator_stake_less(RuntimeOrigin::signed(12), 1), Error::::CannotDelegateIfLeaving ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(1), 1), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 1), Error::::CannotStakeIfLeaving ); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 1), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 1), Error::::CannotStakeIfLeaving ); assert_noop!( - StakePallet::init_leave_candidates(Origin::signed(1)), + StakePallet::init_leave_candidates(RuntimeOrigin::signed(1)), Error::::AlreadyLeaving ); assert_eq!( @@ -2615,16 +2584,16 @@ fn candidate_leaves() { // next rounds starts, cannot leave yet roll_to(5, vec![]); assert_noop!( - StakePallet::execute_leave_candidates(Origin::signed(2), 2), + StakePallet::execute_leave_candidates(RuntimeOrigin::signed(2), 2), Error::::NotLeaving ); assert_noop!( - StakePallet::execute_leave_candidates(Origin::signed(2), 1), + StakePallet::execute_leave_candidates(RuntimeOrigin::signed(2), 1), Error::::CannotLeaveYet ); // add 11 as candidate to reach max size for TopCandidates and then try leave // again as 1 which should not be possible - assert_ok!(StakePallet::join_candidates(Origin::signed(11), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(11), 100)); assert_eq!( StakePallet::top_candidates() .into_iter() @@ -2632,9 +2601,9 @@ fn candidate_leaves() { .collect::>(), (2u64..12u64).collect::>() ); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(11))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(11))); // join back - assert_ok!(StakePallet::cancel_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::cancel_leave_candidates(RuntimeOrigin::signed(1))); assert_eq!( StakePallet::top_candidates() .into_iter() @@ -2666,10 +2635,10 @@ fn candidate_leaves() { ); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2]); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); roll_to(15, vec![]); - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(13), 1)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(13), 1)); let mut unstaking: BoundedBTreeMap, ::MaxUnstakeRequests> = BoundedBTreeMap::new(); assert_ok!(unstaking.try_insert(17, 100)); @@ -2678,16 +2647,16 @@ fn candidate_leaves() { // cannot unlock yet roll_to(16, vec![]); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(4), 1)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(4), 12)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(4), 1)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(4), 12)); assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(12), unstaking); // can unlock now roll_to(17, vec![]); unstaking.remove(&17); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(4), 1)); - assert_ok!(StakePallet::unlock_unstaked(Origin::signed(4), 12)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(4), 1)); + assert_ok!(StakePallet::unlock_unstaked(RuntimeOrigin::signed(4), 12)); assert_eq!(StakePallet::unstaking(1), unstaking); assert_eq!(StakePallet::unstaking(12), unstaking); }); @@ -2719,7 +2688,7 @@ fn adjust_reward_rates() { roll_to_claim_rewards(::BLOCKS_PER_YEAR + 1, vec![]); // reward reduction should not happen automatically anymore assert_eq!(StakePallet::last_reward_reduction(), 0u64); - assert_ok!(StakePallet::execute_scheduled_reward_change(Origin::signed(1))); + assert_ok!(StakePallet::execute_scheduled_reward_change(RuntimeOrigin::signed(1))); assert_eq!(StakePallet::last_reward_reduction(), 1u64); let inflation_1 = InflationInfo::new( ::BLOCKS_PER_YEAR, @@ -2750,7 +2719,7 @@ fn adjust_reward_rates() { roll_to_claim_rewards(2 * ::BLOCKS_PER_YEAR + 1, vec![]); // reward reduction should not happen automatically anymore assert_eq!(StakePallet::last_reward_reduction(), 1u64); - assert_ok!(StakePallet::execute_scheduled_reward_change(Origin::signed(1))); + assert_ok!(StakePallet::execute_scheduled_reward_change(RuntimeOrigin::signed(1))); assert_eq!(StakePallet::last_reward_reduction(), 2u64); let inflation_2 = InflationInfo::new( ::BLOCKS_PER_YEAR, @@ -2786,19 +2755,19 @@ fn increase_max_candidate_stake() { .execute_with(|| { assert_eq!(StakePallet::max_candidate_stake(), max_stake); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 1), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 1), Error::::ValStakeAboveMax ); - assert_ok!(StakePallet::set_max_candidate_stake(Origin::root(), max_stake + 1)); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::MaxCandidateStakeChanged(max_stake + 1)) - ); + assert_ok!(StakePallet::set_max_candidate_stake( + RuntimeOrigin::root(), + max_stake + 1 + )); + assert_eq!(last_event(), StakeEvent::MaxCandidateStakeChanged(max_stake + 1)); assert_eq!(StakePallet::max_candidate_stake(), max_stake + 1); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 1)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 1)); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 1), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 1), Error::::ValStakeAboveMax ); }); @@ -2826,12 +2795,9 @@ fn decrease_max_candidate_stake() { ) ); - assert_ok!(StakePallet::set_max_candidate_stake(Origin::root(), 50)); + assert_ok!(StakePallet::set_max_candidate_stake(RuntimeOrigin::root(), 50)); assert_eq!(StakePallet::max_candidate_stake(), 50); - assert_eq!( - last_event(), - MetaEvent::StakePallet(Event::MaxCandidateStakeChanged(50)) - ); + assert_eq!(last_event(), StakeEvent::MaxCandidateStakeChanged(50)); // check collator states, nothing changed assert_eq!( @@ -2848,20 +2814,20 @@ fn decrease_max_candidate_stake() { ); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 0), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 0), Error::::ValStakeZero ); assert_noop!( - StakePallet::candidate_stake_less(Origin::signed(1), 0), + StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 0), Error::::ValStakeZero ); assert_noop!( - StakePallet::candidate_stake_more(Origin::signed(1), 1), + StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 1), Error::::ValStakeAboveMax ); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 50)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 50)); assert_noop!( - StakePallet::set_max_candidate_stake(Origin::root(), 9), + StakePallet::set_max_candidate_stake(RuntimeOrigin::root(), 9), Error::::CannotSetBelowMin ); }); @@ -2876,12 +2842,12 @@ fn exceed_delegations_per_round() { .build() .execute_with(|| { // leave and re-join to set counter to 2 (= MaxDelegationsPerRound) - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 100)); - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100)); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); // reached max delegations in this round assert_noop!( - StakePallet::join_delegators(Origin::signed(2), 1, 100), + StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100), Error::::DelegationsPerRoundExceeded ); @@ -2891,22 +2857,22 @@ fn exceed_delegations_per_round() { StakePallet::last_delegation(2), DelegationCounter { round: 0, counter: 2 } ); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 100)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100)); // counter should be reset because the round changed assert_eq!( StakePallet::last_delegation(2), DelegationCounter { round: 1, counter: 1 } ); // leave and re-join to set counter to 2 (= MaxDelegationsPerRound)) - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 100)); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100)); assert_noop!( - StakePallet::join_delegators(Origin::signed(2), 1, 100), + StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100), Error::::AlreadyDelegating ); - assert_ok!(StakePallet::leave_delegators(Origin::signed(2))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(2))); assert_noop!( - StakePallet::join_delegators(Origin::signed(2), 1, 100), + StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100), Error::::DelegationsPerRoundExceeded ); assert_eq!( @@ -2925,7 +2891,7 @@ fn force_remove_candidate() { .build() .execute_with(|| { assert_eq!(CandidatePool::::count(), 3); - assert_ok!(StakePallet::join_delegators(Origin::signed(6), 2, 50)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(6), 2, 50)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 2]); assert!(StakePallet::unstaking(1).get(&3).is_none()); assert!(StakePallet::unstaking(2).get(&3).is_none()); @@ -2940,7 +2906,7 @@ fn force_remove_candidate() { delegators: 150, } ); - assert_ok!(StakePallet::force_remove_candidate(Origin::root(), 1)); + assert_ok!(StakePallet::force_remove_candidate(RuntimeOrigin::root(), 1)); // collator stake does not change since 3, who took 1's place, has staked the // same amount assert_eq!( @@ -2951,7 +2917,7 @@ fn force_remove_candidate() { } ); assert_eq!(Session::disabled_validators(), vec![0]); - assert_eq!(last_event(), MetaEvent::StakePallet(Event::CollatorRemoved(1, 200))); + assert_eq!(last_event(), StakeEvent::CollatorRemoved(1, 200)); assert!(!StakePallet::top_candidates().contains(&StakeOf:: { owner: 1, amount: 100 })); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![2, 3]); assert_eq!(CandidatePool::::count(), 2); @@ -2963,11 +2929,11 @@ fn force_remove_candidate() { assert_eq!(StakePallet::unstaking(5).get(&3), Some(&50)); assert_noop!( - StakePallet::force_remove_candidate(Origin::root(), 2), + StakePallet::force_remove_candidate(RuntimeOrigin::root(), 2), Error::::TooFewCollatorCandidates ); assert_noop!( - StakePallet::force_remove_candidate(Origin::root(), 4), + StakePallet::force_remove_candidate(RuntimeOrigin::root(), 4), Error::::CandidateNotFound ); @@ -3011,7 +2977,7 @@ fn prioritize_collators() { ) ); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![2, 3]); - assert_ok!(StakePallet::join_candidates(Origin::signed(1), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(1), 100)); assert_eq!( StakePallet::top_candidates(), OrderedSet::from_sorted_set( @@ -3024,14 +2990,14 @@ fn prioritize_collators() { ) ); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![2, 3]); - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(2))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(2))); assert_eq!(StakePallet::top_candidates().len(), 2); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![3, 1]); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(3), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(3), 10)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 3]); // add 6 - assert_ok!(StakePallet::join_candidates(Origin::signed(6), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(6), 100)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 6]); assert_eq!( StakePallet::top_candidates(), @@ -3047,7 +3013,7 @@ fn prioritize_collators() { ); // add 4 - assert_ok!(StakePallet::join_candidates(Origin::signed(4), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(4), 100)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 6]); assert_eq!( StakePallet::top_candidates(), @@ -3063,7 +3029,7 @@ fn prioritize_collators() { ); // add 5 - assert_ok!(StakePallet::join_candidates(Origin::signed(5), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(5), 100)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![1, 6]); assert_eq!( StakePallet::top_candidates(), @@ -3079,7 +3045,7 @@ fn prioritize_collators() { ); // 3 stake_more - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(3), 20)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(3), 20)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![3, 1]); assert_eq!( StakePallet::top_candidates(), @@ -3097,7 +3063,7 @@ fn prioritize_collators() { ); // 1 stake_less - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), 1)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), 1)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![3, 6]); assert_eq!( StakePallet::top_candidates(), @@ -3115,7 +3081,7 @@ fn prioritize_collators() { ); // 7 delegates to 4 - assert_ok!(StakePallet::join_delegators(Origin::signed(7), 5, 20)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(7), 5, 20)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![5, 3]); assert_eq!( StakePallet::top_candidates(), @@ -3133,7 +3099,7 @@ fn prioritize_collators() { ); // 7 decreases delegation - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(7), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(7), 10)); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![5, 3]); assert_eq!( StakePallet::top_candidates(), @@ -3149,7 +3115,7 @@ fn prioritize_collators() { .unwrap() ) ); - assert_ok!(StakePallet::leave_delegators(Origin::signed(7))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(7))); assert_eq!(StakePallet::selected_candidates().into_inner(), vec![3, 5]); assert_eq!( StakePallet::top_candidates(), @@ -3199,7 +3165,7 @@ fn prioritize_delegators() { .unwrap() ) ); - assert_ok!(StakePallet::join_delegators(Origin::signed(5), 2, 110)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(5), 2, 110)); assert_eq!( StakePallet::candidate_pool(2).unwrap().delegators, OrderedSet::from_sorted_set( @@ -3215,7 +3181,7 @@ fn prioritize_delegators() { ); // delegate_less - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(5), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(5), 10)); assert_eq!( StakePallet::candidate_pool(2).unwrap().delegators, OrderedSet::from_sorted_set( @@ -3231,7 +3197,7 @@ fn prioritize_delegators() { ); // delegate_more - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(6), 10)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(6), 10)); assert_eq!( StakePallet::candidate_pool(2).unwrap().delegators, OrderedSet::from_sorted_set( @@ -3245,7 +3211,7 @@ fn prioritize_delegators() { .unwrap() ) ); - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(7), 10)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(7), 10)); assert_eq!( StakePallet::candidate_pool(2).unwrap().delegators, OrderedSet::from_sorted_set( @@ -3294,7 +3260,7 @@ fn authorities_per_round() { let reward_0 = inflation.collator.reward_rate.per_block * stake * 2; assert_eq!(Balances::free_balance(1), stake + reward_0); // increase max selected candidates which will become effective in round 2 - assert_ok!(StakePallet::set_max_selected_candidates(Origin::root(), 10)); + assert_ok!(StakePallet::set_max_selected_candidates(RuntimeOrigin::root(), 10)); // roll to last block of round 1 // should still multiply with 2 because the Authority set was chosen at start of @@ -3336,10 +3302,10 @@ fn force_new_round() { assert_eq!(Session::validators(), vec![1, 2]); assert_eq!(Session::current_index(), 0); // 3 should be validator in round 2 - assert_ok!(StakePallet::join_delegators(Origin::signed(5), 3, 100)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(5), 3, 100)); // init force new round from 0 to 1, updating the authorities - assert_ok!(StakePallet::force_new_round(Origin::root())); + assert_ok!(StakePallet::force_new_round(RuntimeOrigin::root())); assert_eq!(StakePallet::round(), round); assert_eq!(Session::current_index(), 0); assert!(StakePallet::new_round_forced()); @@ -3362,7 +3328,7 @@ fn force_new_round() { // assert_eq!(Session::validators(), vec![3, 1]); assert!(!StakePallet::new_round_forced()); // 4 should become validator in session 3 if we do not force a new round - assert_ok!(StakePallet::join_delegators(Origin::signed(6), 4, 100)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(6), 4, 100)); // end session 2 naturally roll_to(7, vec![]); @@ -3377,7 +3343,7 @@ fn force_new_round() { assert_eq!(Session::validators(), vec![3, 1]); // force new round 3 - assert_ok!(StakePallet::force_new_round(Origin::root())); + assert_ok!(StakePallet::force_new_round(RuntimeOrigin::root())); assert_eq!(StakePallet::round(), round); assert_eq!(Session::current_index(), 2); // validator set should not change until next round @@ -3412,7 +3378,7 @@ fn replace_lowest_delegator() { ); // 6 replaces 5 - assert_ok!(StakePallet::join_delegators(Origin::signed(6), 1, 51)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(6), 1, 51)); assert!(StakePallet::delegator_state(5).is_none()); assert_eq!( StakePallet::candidate_pool(1) @@ -3430,7 +3396,7 @@ fn replace_lowest_delegator() { // 5 attempts to replace 6 with more balance than available frame_support::assert_noop!( - StakePallet::join_delegators(Origin::signed(5), 1, 101), + StakePallet::join_delegators(RuntimeOrigin::signed(5), 1, 101), BalancesError::::InsufficientBalance ); assert!(StakePallet::delegator_state(6).is_some()); @@ -3500,7 +3466,7 @@ fn network_reward_multiple_blocks() { // should mint the same amount even if a collator exits because reward is only // based on MaxCollatorCandidateStake and MaxSelectedCandidates - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); roll_to(network_reward_start + 101, vec![None]); assert_eq!(101 * network_reward, Balances::free_balance(&TREASURY_ACC)); assert_eq!( @@ -3538,7 +3504,10 @@ fn network_reward_increase_max_candidate_stake() { // double max stake let max_stake_doubled = 320_000_000 * DECIMALS; let reward_after = 2 * reward_before; - assert_ok!(StakePallet::set_max_candidate_stake(Origin::root(), max_stake_doubled)); + assert_ok!(StakePallet::set_max_candidate_stake( + RuntimeOrigin::root(), + max_stake_doubled + )); roll_to(network_reward_start + 2, vec![None]); assert_eq!(reward_before + reward_after, Balances::free_balance(&TREASURY_ACC)); assert_eq!( @@ -3576,7 +3545,7 @@ fn network_reward_increase_max_collator_count() { // tripple number of max collators let reward_after = 3 * reward_before; assert_ok!(StakePallet::set_max_selected_candidates( - Origin::root(), + RuntimeOrigin::root(), ::MinCollators::get() * 3 )); roll_to(network_reward_start + 2, vec![None]); @@ -3603,7 +3572,7 @@ fn update_total_stake_collators_stay() { delegators: 150 } ); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3611,7 +3580,7 @@ fn update_total_stake_collators_stay() { delegators: 150 } ); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(2), 5)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(2), 5)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3619,7 +3588,7 @@ fn update_total_stake_collators_stay() { delegators: 150 } ); - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(3), 10)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(3), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3627,7 +3596,7 @@ fn update_total_stake_collators_stay() { delegators: 160 } ); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(4), 5)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(4), 5)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3665,7 +3634,7 @@ fn update_total_stake_displace_collators() { ); // 4 is pushed out by staking less - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(4), 30)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(4), 30)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3673,10 +3642,10 @@ fn update_total_stake_displace_collators() { delegators: 105 } ); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(8), 45)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(8), 45)); // 3 is pushed out by delegator staking less - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(7), 45)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(7), 45)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3686,7 +3655,7 @@ fn update_total_stake_displace_collators() { ); // 1 is pushed out by new candidate - assert_ok!(StakePallet::join_candidates(Origin::signed(1337), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(1337), 100)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3712,7 +3681,7 @@ fn update_total_stake_new_collators() { delegators: 100 } ); - assert_ok!(StakePallet::join_candidates(Origin::signed(2), 100)); + assert_ok!(StakePallet::join_candidates(RuntimeOrigin::signed(2), 100)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3720,7 +3689,7 @@ fn update_total_stake_new_collators() { delegators: 100 } ); - assert_ok!(StakePallet::join_delegators(Origin::signed(3), 2, 50)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(3), 2, 50)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3728,7 +3697,7 @@ fn update_total_stake_new_collators() { delegators: 150 } ); - assert_ok!(StakePallet::leave_delegators(Origin::signed(4))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(4))); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3764,7 +3733,7 @@ fn update_total_stake_no_collator_changes() { delegators: 110 } ); - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), 10)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3772,7 +3741,7 @@ fn update_total_stake_no_collator_changes() { delegators: 110 } ); - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(5), 10)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(5), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3780,7 +3749,7 @@ fn update_total_stake_no_collator_changes() { delegators: 110 } ); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(2), 10)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(2), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3788,7 +3757,7 @@ fn update_total_stake_no_collator_changes() { delegators: 110 } ); - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(6), 10)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(6), 10)); assert_eq!( StakePallet::total_collator_stake(), TotalStake { @@ -3818,7 +3787,7 @@ fn rewards_candidate_stake_more() { }); // stake less to trigger reward incrementing for collator - assert_ok!(StakePallet::candidate_stake_more(Origin::signed(1), DECIMALS)); + assert_ok!(StakePallet::candidate_stake_more(RuntimeOrigin::signed(1), DECIMALS)); assert!(!StakePallet::rewards(1).is_zero()); assert!(!StakePallet::blocks_rewarded(1).is_zero()); // delegator reward storage should be untouched @@ -3856,7 +3825,7 @@ fn rewards_candidate_stake_less() { }); // stake less to trigger reward incrementing for collator - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), DECIMALS)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), DECIMALS)); assert!(!StakePallet::rewards(1).is_zero()); assert!(!StakePallet::blocks_rewarded(1).is_zero()); // delegator reward storage should be untouched @@ -3890,7 +3859,7 @@ fn rewards_candidate_leave_network() { .build() .execute_with(|| { // init does not increment rewards - assert_ok!(StakePallet::init_leave_candidates(Origin::signed(1))); + assert_ok!(StakePallet::init_leave_candidates(RuntimeOrigin::signed(1))); // advance two rounds to enable leaving roll_to( @@ -3923,7 +3892,7 @@ fn rewards_candidate_leave_network() { // execute leave intent to trigger reward incrementing for collator and // delegators - assert_ok!(StakePallet::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(StakePallet::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); // reward counting storages should be killed for collator assert!(StakePallet::blocks_authored(1).is_zero()); @@ -3962,7 +3931,7 @@ fn rewards_force_remove_candidate() { StakePallet::note_author(2); // removing triggers reward increment for collator 1 and delegators 4, 5 - assert_ok!(StakePallet::force_remove_candidate(Origin::root(), 1)); + assert_ok!(StakePallet::force_remove_candidate(RuntimeOrigin::root(), 1)); // rewarded counter storage should be killed for collator assert!(StakePallet::blocks_authored(1).is_zero()); assert!(StakePallet::blocks_rewarded(1).is_zero()); @@ -3995,7 +3964,7 @@ fn blocks_rewarded_join_delegators() { StakePallet::note_author(1); assert_eq!(StakePallet::blocks_authored(1), 1); assert!(StakePallet::blocks_rewarded(1).is_zero()); - assert_ok!(StakePallet::join_delegators(Origin::signed(2), 1, 100)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(2), 1, 100)); // delegator's rewarded counter should equal of collator's authored counter upon // joining assert_eq!(StakePallet::blocks_rewarded(2), StakePallet::blocks_authored(1)); @@ -4020,7 +3989,7 @@ fn rewards_delegator_stake_more() { }); // stake less to trigger reward incrementing just for 3 - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(3), DECIMALS)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(3), DECIMALS)); // 1 should still have counter 1 but no rewards assert_eq!(StakePallet::blocks_authored(1), 1); assert!(StakePallet::blocks_rewarded(1).is_zero()); @@ -4052,7 +4021,7 @@ fn rewards_delegator_stake_less() { }); // stake less to trigger reward incrementing just for 3 - assert_ok!(StakePallet::delegator_stake_less(Origin::signed(3), DECIMALS)); + assert_ok!(StakePallet::delegator_stake_less(RuntimeOrigin::signed(3), DECIMALS)); // 1 should still have counter 1 but no rewards assert_eq!(StakePallet::blocks_authored(1), 1); assert!(StakePallet::blocks_rewarded(1).is_zero()); @@ -4091,7 +4060,7 @@ fn rewards_delegator_replaced() { assert_eq!(StakePallet::blocks_authored(1), 1); // 6 kicks 5 - assert_ok!(StakePallet::join_delegators(Origin::signed(6), 1, 2 * DECIMALS)); + assert_ok!(StakePallet::join_delegators(RuntimeOrigin::signed(6), 1, 2 * DECIMALS)); // 5 should have rewards and counter updated assert!(!StakePallet::rewards(5).is_zero()); assert_eq!(StakePallet::blocks_rewarded(5), 1); @@ -4119,7 +4088,7 @@ fn rewards_delegator_leaves() { }); // only 3 should have non-zero rewards - assert_ok!(StakePallet::leave_delegators(Origin::signed(3))); + assert_ok!(StakePallet::leave_delegators(RuntimeOrigin::signed(3))); assert!(StakePallet::blocks_rewarded(1).is_zero()); assert!(StakePallet::rewards(1).is_zero()); assert!(StakePallet::blocks_rewarded(2).is_zero()); @@ -4152,7 +4121,7 @@ fn rewards_set_inflation() { // set inflation to trigger reward setting assert_ok!(StakePallet::set_inflation( - Origin::root(), + RuntimeOrigin::root(), hundred, hundred, hundred, @@ -4194,7 +4163,7 @@ fn rewards_yearly_inflation_adjustment() { }); // execute to trigger reward increment - assert_ok!(StakePallet::execute_scheduled_reward_change(Origin::signed(1))); + assert_ok!(StakePallet::execute_scheduled_reward_change(RuntimeOrigin::signed(1))); (1..=5).for_each(|id| { assert!( !StakePallet::blocks_rewarded(id).is_zero(), @@ -4217,7 +4186,7 @@ fn rewards_incrementing_and_claiming() { // claiming should not be possible with zero counters (1..=3).for_each(|id| { assert_noop!( - StakePallet::claim_rewards(Origin::signed(id)), + StakePallet::claim_rewards(RuntimeOrigin::signed(id)), Error::::RewardsNotFound, ); }); @@ -4230,13 +4199,13 @@ fn rewards_incrementing_and_claiming() { // claiming should not be possible before incrementing rewards (1..=3).for_each(|id| { assert_noop!( - StakePallet::claim_rewards(Origin::signed(id)), + StakePallet::claim_rewards(RuntimeOrigin::signed(id)), Error::::RewardsNotFound ); }); // increment rewards for 2 and match counter to collator - assert_ok!(StakePallet::increment_delegator_rewards(Origin::signed(2))); + assert_ok!(StakePallet::increment_delegator_rewards(RuntimeOrigin::signed(2))); assert_eq!(StakePallet::blocks_rewarded(2), 1); let rewards_2 = StakePallet::rewards(2); assert!(!rewards_2.is_zero()); @@ -4244,7 +4213,7 @@ fn rewards_incrementing_and_claiming() { assert!(StakePallet::rewards(3).is_zero()); // should only update rewards for collator as well - assert_ok!(StakePallet::increment_collator_rewards(Origin::signed(1))); + assert_ok!(StakePallet::increment_collator_rewards(RuntimeOrigin::signed(1))); assert_eq!(StakePallet::blocks_rewarded(1), StakePallet::blocks_authored(1)); assert!(!StakePallet::rewards(1).is_zero()); // rewards of 2 should not be changed @@ -4253,7 +4222,7 @@ fn rewards_incrementing_and_claiming() { assert!(StakePallet::blocks_rewarded(3).is_zero()); // claim for 1 to move rewards into balance - assert_ok!(StakePallet::claim_rewards(Origin::signed(1))); + assert_ok!(StakePallet::claim_rewards(RuntimeOrigin::signed(1))); assert!(StakePallet::rewards(1).is_zero()); // delegator situation should be unchanged assert!(Balances::free_balance(&1) > DECIMALS); @@ -4262,21 +4231,21 @@ fn rewards_incrementing_and_claiming() { // incrementing again should not change anything because collator has not // authored blocks since last inc - assert_ok!(StakePallet::increment_delegator_rewards(Origin::signed(2))); + assert_ok!(StakePallet::increment_delegator_rewards(RuntimeOrigin::signed(2))); assert_eq!(StakePallet::blocks_rewarded(2), 1); // claim for 2 to move rewards into balance - assert_ok!(StakePallet::claim_rewards(Origin::signed(2))); + assert_ok!(StakePallet::claim_rewards(RuntimeOrigin::signed(2))); assert!(Balances::free_balance(&2) > DECIMALS); assert!(StakePallet::rewards(2).is_zero()); assert_eq!(Balances::free_balance(&3), DECIMALS); // should not be able to claim for incorrect role assert_noop!( - StakePallet::increment_collator_rewards(Origin::signed(2)), + StakePallet::increment_collator_rewards(RuntimeOrigin::signed(2)), Error::::CandidateNotFound ); assert_noop!( - StakePallet::increment_delegator_rewards(Origin::signed(1)), + StakePallet::increment_delegator_rewards(RuntimeOrigin::signed(1)), Error::::DelegatorNotFound ); }); @@ -4315,18 +4284,18 @@ fn api_get_unclaimed_staking_rewards() { assert_eq!(rewards_2, inflation_config.delegator.reward_rate.per_block * stake * 2); // API and actual claiming should match - assert_ok!(StakePallet::increment_collator_rewards(Origin::signed(1))); - assert_ok!(StakePallet::claim_rewards(Origin::signed(1))); + assert_ok!(StakePallet::increment_collator_rewards(RuntimeOrigin::signed(1))); + assert_ok!(StakePallet::claim_rewards(RuntimeOrigin::signed(1))); assert_eq!(rewards_1, Balances::usable_balance(&1)); assert!(StakePallet::get_unclaimed_staking_rewards(&1).is_zero()); - assert_ok!(StakePallet::increment_delegator_rewards(Origin::signed(2))); - assert_ok!(StakePallet::claim_rewards(Origin::signed(2))); + assert_ok!(StakePallet::increment_delegator_rewards(RuntimeOrigin::signed(2))); + assert_ok!(StakePallet::claim_rewards(RuntimeOrigin::signed(2))); assert_eq!(rewards_2, Balances::usable_balance(&2)); assert!(StakePallet::get_unclaimed_staking_rewards(&2).is_zero()); - assert_ok!(StakePallet::increment_collator_rewards(Origin::signed(3))); - assert_ok!(StakePallet::claim_rewards(Origin::signed(3))); + assert_ok!(StakePallet::increment_collator_rewards(RuntimeOrigin::signed(3))); + assert_ok!(StakePallet::claim_rewards(RuntimeOrigin::signed(3))); assert_eq!(rewards_3 + 98 * stake, Balances::usable_balance(&3)); assert!(StakePallet::get_unclaimed_staking_rewards(&3).is_zero()); }); @@ -4352,10 +4321,10 @@ fn api_get_staking_rates() { assert_eq!(rates, StakePallet::get_staking_rates()); // candidates stake less to not exceed max staking rate - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(1), stake / 2)); - assert_ok!(StakePallet::candidate_stake_less(Origin::signed(2), stake / 2)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(1), stake / 2)); + assert_ok!(StakePallet::candidate_stake_less(RuntimeOrigin::signed(2), stake / 2)); // delegator stakes more to exceed - assert_ok!(StakePallet::delegator_stake_more(Origin::signed(3), stake)); + assert_ok!(StakePallet::delegator_stake_more(RuntimeOrigin::signed(3), stake)); rates.collator_staking_rate = Perquintill::from_percent(25); rates.collator_reward_rate = Perquintill::from_percent(10); rates.delegator_staking_rate = Perquintill::from_percent(50); diff --git a/pallets/public-credentials/Cargo.toml b/pallets/public-credentials/Cargo.toml index 8fc5f7dc7..7a8feb829 100644 --- a/pallets/public-credentials/Cargo.toml +++ b/pallets/public-credentials/Cargo.toml @@ -40,19 +40,18 @@ sp-std.workspace = true [features] default = ["std"] runtime-benchmarks = [ - "kilt-support/runtime-benchmarks", - "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "kilt-support/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ "codec/std", "scale-info/std", - "ctype/std", "kilt-support/std", - + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "sp-core/std", @@ -62,4 +61,5 @@ std = [ ] try-runtime = [ "frame-support/try-runtime", + "frame-system/try-runtime", ] diff --git a/pallets/public-credentials/src/benchmarking.rs b/pallets/public-credentials/src/benchmarking.rs index 0434da3f8..0525cd3dd 100644 --- a/pallets/public-credentials/src/benchmarking.rs +++ b/pallets/public-credentials/src/benchmarking.rs @@ -50,7 +50,7 @@ benchmarks! { T: core::fmt::Debug, T: Config, T: ctype::Config, - ::EnsureOrigin: GenerateBenchmarkOrigin, + ::EnsureOrigin: GenerateBenchmarkOrigin, ::SubjectId: GetWorstCase + Into> + sp_std::fmt::Debug, ::CredentialId: Default, } @@ -73,7 +73,7 @@ benchmarks! { ctype::Ctypes::::insert(ctype_hash, attester.clone()); reserve_balance::(&sender); let origin = ::EnsureOrigin::generate_origin(sender, attester); - }: _(origin, creation_op) + }: _(origin, creation_op) verify { assert!(Credentials::::contains_key(subject_id, &credential_id)); assert!(CredentialSubjects::::contains_key(&credential_id)); @@ -100,7 +100,7 @@ benchmarks! { ctype::Ctypes::::insert(ctype_hash, attester); Pallet::::add(origin.clone(), creation_op).expect("Pallet::add should not fail"); let credential_id_clone = credential_id.clone(); - }: _(origin, credential_id_clone, None) + }: _(origin, credential_id_clone, None) verify { assert!(Credentials::::get(subject_id, &credential_id).expect("Credential should be present in storage").revoked); } @@ -127,7 +127,7 @@ benchmarks! { Pallet::::add(origin.clone(), creation_op).expect("Pallet::add should not fail"); Pallet::::revoke(origin.clone(), credential_id.clone(), None).expect("Pallet::revoke should not fail"); let credential_id_clone = credential_id.clone(); - }: _(origin, credential_id_clone, None) + }: _(origin, credential_id_clone, None) verify { assert!(!Credentials::::get(subject_id, &credential_id).expect("Credential should be present in storage").revoked); } @@ -152,7 +152,7 @@ benchmarks! { ctype::Ctypes::::insert(ctype_hash, attester); Pallet::::add(origin.clone(), creation_op).expect("Pallet::add should not fail"); let credential_id_clone = credential_id.clone(); - }: _(origin, credential_id_clone, None) + }: _(origin, credential_id_clone, None) verify { assert!(!Credentials::::contains_key(subject_id, &credential_id)); assert!(!CredentialSubjects::::contains_key(credential_id)); @@ -208,7 +208,7 @@ benchmarks! { Pallet::::add(origin, creation_op).expect("Pallet::add should not fail"); let credential_id_clone = credential_id.clone(); let origin = ::EnsureOrigin::generate_origin(deposit_owner_new.clone(), attester); - }: _(origin, credential_id_clone) + }: _(origin, credential_id_clone) verify { assert_eq!( Credentials::::get(subject_id, &credential_id) diff --git a/pallets/public-credentials/src/lib.rs b/pallets/public-credentials/src/lib.rs index 78d5d0505..33796119b 100644 --- a/pallets/public-credentials/src/lib.rs +++ b/pallets/public-credentials/src/lib.rs @@ -119,9 +119,9 @@ pub mod pallet { /// for the different operations. type AuthorizationId: Parameter + MaxEncodedLen; /// The origin allowed to issue/revoke/remove public credentials. - type EnsureOrigin: EnsureOrigin::OriginSuccess, Self::Origin>; + type EnsureOrigin: EnsureOrigin::OriginSuccess>; /// The ubiquitous event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The hashing algorithm to derive a credential identifier from the /// credential content. type CredentialHash: Hash; diff --git a/pallets/public-credentials/src/mock.rs b/pallets/public-credentials/src/mock.rs index 48f50baff..75d8579ce 100644 --- a/pallets/public-credentials/src/mock.rs +++ b/pallets/public-credentials/src/mock.rs @@ -284,14 +284,14 @@ pub(crate) mod runtime { ); impl mock_origin::Config for Test { - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type AccountId = AccountId; type SubjectId = SubjectId; } impl frame_system::Config for Test { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = BlockNumber; type Hash = Hash; @@ -299,7 +299,7 @@ pub(crate) mod runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type RuntimeEvent = (); type BlockHashCount = ConstU64<250>; type DbWeight = RocksDbWeight; type Version = (); @@ -320,7 +320,7 @@ pub(crate) mod runtime { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ConstU128; type AccountStore = System; type WeightInfo = (); @@ -333,7 +333,7 @@ pub(crate) mod runtime { type CtypeCreatorId = SubjectId; type EnsureOrigin = mock_origin::EnsureDoubleOrigin; type OriginSuccess = mock_origin::DoubleOrigin; - type Event = (); + type RuntimeEvent = (); type WeightInfo = (); type Currency = Balances; @@ -350,7 +350,7 @@ pub(crate) mod runtime { type Currency = Balances; type Deposit = ConstU128<{ 10 * MILLI_UNIT }>; type EnsureOrigin = mock_origin::EnsureDoubleOrigin; - type Event = (); + type RuntimeEvent = (); type MaxEncodedClaimsLength = ConstU32<500>; type MaxSubjectIdLength = ConstU32<100>; type OriginSuccess = mock_origin::DoubleOrigin; diff --git a/pallets/public-credentials/src/tests.rs b/pallets/public-credentials/src/tests.rs index c84029d57..d1ca84e47 100644 --- a/pallets/public-credentials/src/tests.rs +++ b/pallets/public-credentials/src/tests.rs @@ -684,7 +684,7 @@ fn reclaim_deposit_successful() { .build() .execute_with(|| { assert_ok!(PublicCredentials::reclaim_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), credential_id )); @@ -697,12 +697,12 @@ fn reclaim_deposit_successful() { // Reclaiming the deposit for the same credential again will fail assert_noop!( - PublicCredentials::reclaim_deposit(Origin::signed(ACCOUNT_00), credential_id), + PublicCredentials::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_00), credential_id), Error::::CredentialNotFound ); assert_noop!( - PublicCredentials::reclaim_deposit(Origin::signed(ACCOUNT_00), credential_id), + PublicCredentials::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_00), credential_id), Error::::CredentialNotFound ); }); @@ -718,7 +718,7 @@ fn reclaim_deposit_credential_not_found() { .build() .execute_with(|| { assert_noop!( - PublicCredentials::reclaim_deposit(Origin::signed(ACCOUNT_00), credential_id), + PublicCredentials::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_00), credential_id), Error::::CredentialNotFound ); }); @@ -738,7 +738,7 @@ fn reclaim_deposit_unauthorized() { .build() .execute_with(|| { assert_noop!( - PublicCredentials::reclaim_deposit(Origin::signed(ACCOUNT_01), credential_id), + PublicCredentials::reclaim_deposit(RuntimeOrigin::signed(ACCOUNT_01), credential_id), Error::::Unauthorized ); }); @@ -861,7 +861,7 @@ fn test_update_deposit() { .build() .execute_with(|| { assert_ok!(PublicCredentials::update_deposit( - Origin::signed(ACCOUNT_00), + RuntimeOrigin::signed(ACCOUNT_00), credential_id )); @@ -887,7 +887,7 @@ fn test_update_deposit_not_found() { .build() .execute_with(|| { assert_noop!( - PublicCredentials::update_deposit(Origin::signed(ACCOUNT_01), credential_id), + PublicCredentials::update_deposit(RuntimeOrigin::signed(ACCOUNT_01), credential_id), Error::::CredentialNotFound ); }); @@ -907,7 +907,7 @@ fn test_update_deposit_unauthorized() { .build() .execute_with(|| { assert_noop!( - PublicCredentials::update_deposit(Origin::signed(ACCOUNT_01), credential_id), + PublicCredentials::update_deposit(RuntimeOrigin::signed(ACCOUNT_01), credential_id), Error::::Unauthorized ); }); diff --git a/runtimes/clone/Cargo.toml b/runtimes/clone/Cargo.toml index 08d04490e..0e3876fd3 100644 --- a/runtimes/clone/Cargo.toml +++ b/runtimes/clone/Cargo.toml @@ -45,7 +45,6 @@ sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true -frame-benchmarking.workspace = true frame-executive.workspace = true frame-support.workspace = true frame-system.workspace = true @@ -79,6 +78,7 @@ xcm-executor.workspace = true # Benchmarking dependencies cumulus-pallet-session-benchmarking = {workspace = true, optional = true} +frame-benchmarking = {workspace = true, optional = true} frame-system-benchmarking = {workspace = true, optional = true} # Runtime tests @@ -88,37 +88,45 @@ frame-try-runtime = {workspace = true, optional = true} default = ["std"] fast-gov = ["runtime-common/fast-gov"] runtime-benchmarks = [ - "cumulus-pallet-session-benchmarking", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-benchmarking/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", "pallet-balances/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", "pallet-did-lookup/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", "public-credentials/runtime-benchmarks", "runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", ] std = [ "codec/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-dmp-queue/std", "cumulus-pallet-parachain-system/std", + "cumulus-pallet-session-benchmarking?/std", "cumulus-pallet-solo-to-para/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-core/std", "cumulus-primitives-timestamp/std", "cumulus-primitives-utility/std", + "frame-benchmarking?/std", "frame-executive/std", "frame-support/std", - "frame-system-rpc-runtime-api/std", "frame-system/std", - "frame-try-runtime/std", + "frame-system-benchmarking?/std", + "frame-system-rpc-runtime-api/std", + "frame-try-runtime?/std", "kilt-runtime-api-did/std", "kilt-runtime-api-public-credentials/std", "log/std", @@ -176,5 +184,6 @@ try-runtime = [ "pallet-utility/try-runtime", "pallet-xcm/try-runtime", "parachain-info/try-runtime", + "public-credentials/try-runtime", "runtime-common/try-runtime", ] diff --git a/runtimes/clone/src/lib.rs b/runtimes/clone/src/lib.rs index 0b472c31c..24bf6b465 100644 --- a/runtimes/clone/src/lib.rs +++ b/runtimes/clone/src/lib.rs @@ -102,9 +102,12 @@ parameter_types! { } pub struct CloneCallFilter; -impl Contains for CloneCallFilter { - fn contains(call: &Call) -> bool { - matches!(call, Call::ParachainSystem(..) | Call::Sudo(..) | Call::Timestamp(..)) +impl Contains for CloneCallFilter { + fn contains(call: &RuntimeCall) -> bool { + matches!( + call, + RuntimeCall::ParachainSystem(..) | RuntimeCall::Sudo(..) | RuntimeCall::Timestamp(..) + ) } } @@ -112,7 +115,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in /// dispatchers. type Lookup = AccountIdLookup; @@ -127,9 +130,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = runtime_common::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest /// pruned first). type BlockHashCount = BlockHashCount; @@ -173,7 +176,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -184,7 +187,7 @@ impl pallet_balances::Config for Runtime { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>>; type OperationalFeeMultiplier = constants::fee::OperationalFeeMultiplier; @@ -199,7 +202,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = cumulus_pallet_solo_to_para::Pallet; type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -215,11 +218,11 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_solo_to_para::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -230,7 +233,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -263,7 +266,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type ValidatorIdOf = pallet_collator_selection::IdentityCollator; type ShouldEndSession = pallet_session::PeriodicSessions; @@ -275,8 +278,8 @@ impl pallet_session::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -291,7 +294,7 @@ parameter_types! { } impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = EnsureRoot; type PotId = PotId; @@ -307,8 +310,8 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; } construct_runtime! { @@ -412,9 +415,9 @@ pub type SignedExtra = ( cumulus_pallet_solo_to_para::CheckSudo, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -426,6 +429,24 @@ pub type Executive = frame_executive::Executive< (), >; +// follows Substrate's non destructive way of eliminating otherwise required +// repetion: https://github.com/paritytech/substrate/pull/10592 +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_benchmarking, Baseline::] + [frame_system, SystemBench::] + [pallet_session, SessionBench::] + [pallet_balances, Balances] + [pallet_timestamp, Timestamp] + [pallet_utility, Utility] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -466,6 +487,23 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic( extrinsic: ::Extrinsic, @@ -595,58 +633,31 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList}; + use frame_benchmarking::{Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; let mut list = Vec::::new(); - - // Substrate - list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); - list_benchmark!(list, extra, frame_system, SystemBench::); - list_benchmark!(list, extra, pallet_session, SessionBench::); - list_benchmark!(list, extra, pallet_balances, Balances); - // list_benchmark!(list, extra, pallet_collective, Council); - // list_benchmark!(list, extra, pallet_democracy, Democracy); - // list_benchmark!(list, extra, pallet_indices, Indices); - // list_benchmark!(list, extra, pallet_membership, TechnicalMembership); - // list_benchmark!(list, extra, pallet_preimage, Preimage); - // list_benchmark!(list, extra, pallet_scheduler, Scheduler); - list_benchmark!(list, extra, pallet_timestamp, Timestamp); - // list_benchmark!(list, extra, pallet_tips, Tips); - // list_benchmark!(list, extra, pallet_treasury, Treasury); - list_benchmark!(list, extra, pallet_utility, Utility); - // list_benchmark!(list, extra, pallet_vesting, Vesting); - // list_benchmark!(list, extra, pallet_proxy, Proxy); - - // KILT - // list_benchmark!(list, extra, attestation, Attestation); - // list_benchmark!(list, extra, ctype, Ctype); - // list_benchmark!(list, extra, delegation, Delegation); - // list_benchmark!(list, extra, did, Did); - // list_benchmark!(list, extra, pallet_did_lookup, DidLookup); - // list_benchmark!(list, extra, pallet_inflation, Inflation); - // list_benchmark!(list, extra, parachain_staking, ParachainStaking); - // list_benchmark!(list, extra, pallet_web3_names, Web3Names); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); - (list, storage_info) } fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; impl frame_system_benchmarking::Config for Runtime {} impl cumulus_pallet_session_benchmarking::Config for Runtime {} - impl baseline::Config for Runtime {} + impl frame_benchmarking::baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -669,37 +680,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - // Substrate - add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - // add_benchmark!(params, batches, pallet_collective, Council); - // add_benchmark!(params, batches, pallet_democracy, Democracy); - // add_benchmark!(params, batches, pallet_indices, Indices); - // add_benchmark!(params, batches, pallet_membership, TechnicalMembership); - // add_benchmark!(params, batches, pallet_preimage, Preimage); - // add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, pallet_session, SessionBench::); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - // add_benchmark!(params, batches, pallet_tips, Tips); - // add_benchmark!(params, batches, pallet_treasury, Treasury); - add_benchmark!(params, batches, pallet_utility, Utility); - // add_benchmark!(params, batches, pallet_vesting, Vesting); - // add_benchmark!(params, batches, pallet_proxy, Proxy); - - // KILT - // add_benchmark!(params, batches, attestation, Attestation); - // add_benchmark!(params, batches, ctype, Ctype); - // add_benchmark!(params, batches, delegation, Delegation); - // add_benchmark!(params, batches, did, Did); - // add_benchmark!(params, batches, pallet_did_lookup, DidLookup); - // add_benchmark!(params, batches, pallet_inflation, Inflation); - // add_benchmark!(params, batches, parachain_staking, ParachainStaking); - // add_benchmark!(params, batches, pallet_web3_names, Web3Names); - - // No benchmarks for these pallets - // add_benchmark!(params, batches, cumulus_pallet_parachain_system, ParachainSystem); - // add_benchmark!(params, batches, parachain_info, ParachainInfo); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtimes/clone/src/xcm_config.rs b/runtimes/clone/src/xcm_config.rs index 14ecc9731..e955ca13e 100644 --- a/runtimes/clone/src/xcm_config.rs +++ b/runtimes/clone/src/xcm_config.rs @@ -17,8 +17,8 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, WeightToFee, - XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, + RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ @@ -36,7 +36,7 @@ use xcm_executor::XcmExecutor; use runtime_common::xcm_config::{LocalAssetTransactor, MaxInstructions, RelayLocation, UnitWeightCost, XcmBarrier}; parameter_types! { - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayNetworkId: NetworkId = NetworkId::Polkadot; } @@ -46,25 +46,25 @@ parameter_types! { /// `Transact`. There is an `OriginKind` which can bias the kind of local /// `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( - // We don't include `SovereignSignedViaLocation` since we don't want to allow other - // chains to manage accounts on our network. + // We don't include `SovereignSignedViaLocation` since we don't want to allow + // other chains to manage accounts on our network. // Native converter for Relay-chain (Parent) location which converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains which converts to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter which just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; // How we send Xcm messages. type XcmSender = XcmRouter; // How to withdraw and deposit an asset. @@ -83,7 +83,7 @@ impl xcm_executor::Config for XcmConfig { type Barrier = XcmBarrier; // How XCM messages are weighted. Each transaction has a weight of // `UnitWeightCost`. - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; // How weight is transformed into fees. The fees are not taken out of the // Balances pallet here. Balances is only used if fees are dropped without being // used. In that case they are put into the treasury. @@ -98,7 +98,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into /// the right message queues. @@ -110,20 +110,20 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // Disable dispatchable execution on the XCM pallet. // NOTE: For local testing this needs to be `Everything`. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // Our latest supported XCM version. @@ -131,6 +131,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/runtimes/common/Cargo.toml b/runtimes/common/Cargo.toml index 9c3aec069..fb3251f77 100644 --- a/runtimes/common/Cargo.toml +++ b/runtimes/common/Cargo.toml @@ -40,6 +40,9 @@ sp-io.workspace = true sp-runtime.workspace = true sp-std.workspace = true +# Cumulus dependencies +cumulus-primitives-core.workspace = true + # Polkadot dependencies polkadot-parachain.workspace = true xcm.workspace = true @@ -52,19 +55,26 @@ fast-gov = [] runtime-benchmarks = [ "attestation/runtime-benchmarks", "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", "kilt-support/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", "parachain-staking/runtime-benchmarks", "polkadot-parachain/runtime-benchmarks", + "public-credentials/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", ] std = [ "attestation/std", "codec/std", + "cumulus-primitives-core/std", "frame-support/std", "frame-system/std", "kilt-asset-dids/std", "kilt-support/std", + "log/std", "pallet-authorship/std", "pallet-balances/std", "pallet-membership/std", @@ -83,5 +93,14 @@ std = [ "xcm/std", ] try-runtime = [ + "attestation/try-runtime", "frame-support/try-runtime", + "frame-system/try-runtime", + "kilt-support/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-membership/try-runtime", + "pallet-transaction-payment/try-runtime", + "parachain-staking/try-runtime", + "public-credentials/try-runtime", ] diff --git a/runtimes/common/src/constants.rs b/runtimes/common/src/constants.rs index eabca7a17..0721500f9 100644 --- a/runtimes/common/src/constants.rs +++ b/runtimes/common/src/constants.rs @@ -18,6 +18,7 @@ use frame_support::{ parameter_types, + traits::WithdrawReasons, weights::{constants::WEIGHT_PER_SECOND, Weight}, }; use sp_runtime::{Perbill, Percent, Perquintill}; @@ -67,7 +68,9 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// used by Operational extrinsics. pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 0.5 seconds of compute with a 12 second average block time. -pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); +pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND + .saturating_div(2) + .set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64); pub const INFLATION_CONFIG: (Perquintill, Perquintill, Perquintill, Perquintill) = ( // max collator staking rate @@ -111,6 +114,8 @@ pub const MAX_VESTING_SCHEDULES: u32 = 28; parameter_types! { /// Vesting Pallet. Copied from Kusama & Polkadot runtime pub const MinVestedTransfer: Balance = 100 * MILLI_KILT; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); /// Deposits per byte pub const ByteDeposit: Balance = deposit(0, 1); /// Index Pallet. Deposit taken for an account index @@ -402,7 +407,6 @@ pub mod web3_names { pub mod preimage { use super::*; parameter_types! { - pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); } } diff --git a/runtimes/common/src/fees.rs b/runtimes/common/src/fees.rs index 7541ca3da..e1c137da4 100644 --- a/runtimes/common/src/fees.rs +++ b/runtimes/common/src/fees.rs @@ -17,10 +17,10 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use frame_support::{ + dispatch::DispatchClass, traits::{Currency, Get, Imbalance, OnUnbalanced}, weights::{ - DispatchClass, Weight, WeightToFee as WeightToFeeT, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, + Weight, WeightToFee as WeightToFeeT, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }, }; use pallet_balances::WeightInfo; @@ -133,7 +133,11 @@ where #[cfg(test)] mod tests { use super::*; - use frame_support::{parameter_types, traits::FindAuthor, weights::DispatchClass}; + use crate::{ + AccountId, BlockExecutionWeight, ExtrinsicBaseWeight, AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, + }; + use frame_support::{dispatch::DispatchClass, parameter_types, traits::FindAuthor}; use frame_system::limits; use sp_core::H256; use sp_runtime::{ @@ -142,8 +146,6 @@ mod tests { Perbill, }; - use crate::AccountId; - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -161,31 +163,41 @@ mod tests { parameter_types! { pub const BlockHashCount: u64 = 250; + // One to one clone of our runtimes' blockweight pub BlockWeights: limits::BlockWeights = limits::BlockWeights::builder() - .base_block(Weight::from_ref_time(10u64)) - .for_class(DispatchClass::all(), |weight| { - weight.base_extrinsic = Weight::from_ref_time(100u64); - }) - .for_class(DispatchClass::non_mandatory(), |weight| { - weight.max_total = Some(Weight::from_ref_time(1024u64)); - }) - .build_or_panic(); + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024); pub const AvailableBlockRatio: Perbill = Perbill::one(); } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type Index = u64; type BlockNumber = u64; - type Call = Call; + type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = BlockLength; type BlockWeights = BlockWeights; @@ -203,7 +215,7 @@ mod tests { impl pallet_balances::Config for Test { type Balance = u64; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = (); type AccountStore = System; diff --git a/runtimes/common/src/lib.rs b/runtimes/common/src/lib.rs index 4d597e858..9119921f4 100644 --- a/runtimes/common/src/lib.rs +++ b/runtimes/common/src/lib.rs @@ -27,15 +27,15 @@ pub use opaque::*; pub use frame_support::weights::constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use frame_support::{ + dispatch::DispatchClass, parameter_types, traits::{Contains, ContainsLengthBound, Currency, Get, SortedMembers}, - weights::DispatchClass, }; use frame_system::limits; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_runtime::{ generic, - traits::{IdentifyAccount, Verify}, + traits::{Bounded, IdentifyAccount, Verify}, FixedPointNumber, MultiSignature, Perquintill, SaturatedConversion, }; use sp_std::marker::PhantomData; @@ -125,6 +125,8 @@ parameter_types! { /// that combined with `AdjustmentVariable`, we can recover from the minimum. /// See `multiplier_can_grow_from_zero`. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000u128); + /// The maximum amount of the multiplier. + pub MaximumMultiplier: Multiplier = Bounded::max_value(); /// Maximum length of block. Up to 5MB. pub BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -139,7 +141,7 @@ parameter_types! { }) .for_class(DispatchClass::Operational, |weights| { weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have an extra reserved space, so that they + // Operational transactions have some extra reserved space, so that they // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. weights.reserved = Some( MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT, @@ -159,7 +161,7 @@ pub type FeeSplit = SplitFeesByRatio; /// Parameterized slow adjusting fee updated based on /// https://w3f-research.readthedocs.io/en/latest/polkadot/Token%20Economics.html#-2.-slow-adjusting-mechanism pub type SlowAdjustingFeeUpdate = - TargetedFeeAdjustment; + TargetedFeeAdjustment; pub struct Tippers(PhantomData, PhantomData); impl ContainsLengthBound for Tippers diff --git a/runtimes/common/src/migrations.rs b/runtimes/common/src/migrations.rs index 1fce9a577..93d54fefd 100644 --- a/runtimes/common/src/migrations.rs +++ b/runtimes/common/src/migrations.rs @@ -15,68 +15,3 @@ // along with this program. If not, see . // If you feel like getting in touch with us, you can do so at info@botlabs.org - -use sp_std::marker::PhantomData; - -use frame_support::{ - traits::{Get, OnRuntimeUpgrade}, - StorageHasher, Twox128, -}; - -pub struct RemoveRelocationPallets(PhantomData); - -impl OnRuntimeUpgrade for RemoveRelocationPallets { - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - log::info!("Pre check RemoveRelocationPallets."); - let has_migration_storage = frame_support::storage::migration::have_storage_value( - b"RelayMigration", - b"RelayNumberStrictlyIncreases", - b"", - ); - let has_filter_storage = frame_support::storage::migration::have_storage_value(b"DynFilter", b"Filter", b""); - - match (has_migration_storage, has_filter_storage) { - (false, false) => Err("Pallets not present"), - (true, false) => Err("DynFilter not present"), - (false, true) => Err("RelayMigration not present"), - _ => Ok(()), - } - } - - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let entries: u32 = 2; - if frame_support::storage::unhashed::clear_prefix(&Twox128::hash(b"RelayMigration"), Some(entries), None) - .maybe_cursor - .is_some() - { - log::warn!("Pallet RelayMigration not removed entirely") - } - if frame_support::storage::unhashed::clear_prefix(&Twox128::hash(b"DynFilter"), Some(entries), None) - .maybe_cursor - .is_some() - { - log::warn!("Pallet DynFilter not removed entirely") - } - - ::DbWeight::get().writes((entries * 2).into()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - log::info!("Post check RemoveRelocationPallets."); - let has_migration_storage = frame_support::storage::migration::have_storage_value( - b"RelayMigration", - b"RelayNumberStrictlyIncreases", - b"", - ); - let has_filter_storage = frame_support::storage::migration::have_storage_value(b"DynFilter", b"Filter", b""); - - match (has_migration_storage, has_filter_storage) { - (false, false) => Ok(()), - (true, false) => Err("RelayMigration still present"), - (false, true) => Err("DynFilter still present"), - (true, true) => Err("Pallets still present"), - } - } -} diff --git a/runtimes/peregrine/Cargo.toml b/runtimes/peregrine/Cargo.toml index 30302fdb9..1983a7974 100644 --- a/runtimes/peregrine/Cargo.toml +++ b/runtimes/peregrine/Cargo.toml @@ -54,7 +54,6 @@ sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true -frame-benchmarking.workspace = true frame-executive.workspace = true frame-support.workspace = true frame-system.workspace = true @@ -97,6 +96,7 @@ xcm-executor.workspace = true # Benchmarking dependencies cumulus-pallet-session-benchmarking = {workspace = true, optional = true} +frame-benchmarking = {workspace = true, optional = true} frame-system-benchmarking = {workspace = true, optional = true} # Runtime tests @@ -108,13 +108,14 @@ fast-gov = ["runtime-common/fast-gov"] runtime-benchmarks = [ "attestation/runtime-benchmarks", "ctype/runtime-benchmarks", - "cumulus-pallet-session-benchmarking", + "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", "delegation/runtime-benchmarks", "did/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", "kilt-support/runtime-benchmarks", @@ -134,11 +135,13 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", "pallet-web3-names/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", "parachain-staking/runtime-benchmarks", "public-credentials/runtime-benchmarks", "runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", ] std = [ "attestation/std", @@ -152,14 +155,16 @@ std = [ "cumulus-primitives-core/std", "cumulus-primitives-timestamp/std", "cumulus-primitives-utility/std", + "cumulus-pallet-session-benchmarking/std", "delegation/std", "did/std", - "frame-benchmarking/std", + "frame-benchmarking?/std", "frame-executive/std", "frame-support/std", + "frame-system-benchmarking?/std", "frame-system-rpc-runtime-api/std", "frame-system/std", - "frame-try-runtime/std", + "frame-try-runtime?/std", "kilt-runtime-api-did/std", "kilt-runtime-api-public-credentials/std", "kilt-runtime-api-staking/std", diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index 94a4b7eeb..fcd293115 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -29,7 +29,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use frame_support::{ construct_runtime, parameter_types, - traits::{EitherOfDiverse, Everything, InstanceFilter, PrivilegeCmp}, + traits::{ConstU32, EitherOfDiverse, Everything, InstanceFilter, PrivilegeCmp}, weights::{constants::RocksDbWeight, ConstantMultiplier, Weight}, }; use frame_system::EnsureRoot; @@ -47,14 +47,14 @@ use xcm_executor::XcmExecutor; use delegation::DelegationAc; use kilt_support::traits::ItemFilter; -use pallet_did_lookup::linkable_account::LinkableAccountId; +use pallet_did_lookup::{linkable_account::LinkableAccountId, migrations::EthereumMigration}; pub use parachain_staking::InflationInfo; pub use public_credentials; use runtime_common::{ assets::{AssetDid, PublicCredentialsFilter}, authorization::{AuthorizationId, PalletAuthorize}, - constants::{self, EXISTENTIAL_DEPOSIT, KILT}, + constants::{self, UnvestedFundsAllowedWithdrawReasons, EXISTENTIAL_DEPOSIT, KILT}, errors::PublicCredentialsApiError, fees::{ToAuthor, WeightToFee}, pallet_id, AccountId, AuthorityId, Balance, BlockHashCount, BlockLength, BlockNumber, BlockWeights, DidIdentifier, @@ -115,7 +115,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in /// dispatchers. type Lookup = AccountIdLookup; @@ -130,9 +130,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = runtime_common::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest /// pruned first). type BlockHashCount = BlockHashCount; @@ -176,7 +176,7 @@ impl pallet_indices::Config for Runtime { type AccountIndex = Index; type Currency = pallet_balances::Pallet; type Deposit = constants::IndicesDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_indices::WeightInfo; } @@ -184,7 +184,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = Treasury; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -195,7 +195,7 @@ impl pallet_balances::Config for Runtime { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>>; type OperationalFeeMultiplier = constants::fee::OperationalFeeMultiplier; @@ -205,8 +205,8 @@ impl pallet_transaction_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } parameter_types! { @@ -215,7 +215,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -231,7 +231,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -242,7 +242,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -270,7 +270,7 @@ impl pallet_authorship::Config for Runtime { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type ValidatorIdOf = ConvertInto; type ShouldEndSession = ParachainStaking; @@ -282,12 +282,13 @@ impl pallet_session::Config for Runtime { } impl pallet_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BlockNumberToBalance = ConvertInto; // disable vested transfers by setting min amount to max balance type MinVestedTransfer = constants::MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = constants::MAX_VESTING_SCHEDULES; } @@ -299,10 +300,9 @@ parameter_types! { impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = constants::preimage::PreimageMaxSize; type BaseDeposit = constants::preimage::PreimageBaseDeposit; type ByteDeposit = constants::ByteDeposit; } @@ -342,17 +342,16 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = ScheduleOrigin; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { @@ -362,8 +361,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = constants::governance::EnactmentPeriod; type VoteLockingPeriod = constants::governance::VotingPeriod; @@ -402,15 +400,15 @@ impl pallet_democracy::Config for Runtime { // however they can only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = constants::governance::CooloffPeriod; - type PreimageByteDeposit = constants::ByteDeposit; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; - type MaxProposals = MaxProposals; - type WeightInfo = weights::pallet_democracy::WeightInfo; + type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -436,7 +434,7 @@ impl pallet_treasury::Config for Runtime { type Currency = Balances; type ApproveOrigin = ApproveOrigin; type RejectOrigin = MoreThanHalfCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSlash = Treasury; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; @@ -452,9 +450,9 @@ impl pallet_treasury::Config for Runtime { type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = constants::governance::CouncilMotionDuration; type MaxProposals = constants::governance::CouncilMaxProposals; type MaxMembers = constants::governance::CouncilMaxMembers; @@ -464,9 +462,9 @@ impl pallet_collective::Config for Runtime { type TechnicalCollective = pallet_collective::Instance2; impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = constants::governance::TechnicalMotionDuration; type MaxProposals = constants::governance::TechnicalMaxProposals; type MaxMembers = constants::governance::TechnicalMaxMembers; @@ -476,7 +474,7 @@ impl pallet_collective::Config for Runtime { type TechnicalMembershipProvider = pallet_membership::Instance1; impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = MoreThanHalfCouncil; type RemoveOrigin = MoreThanHalfCouncil; type SwapOrigin = MoreThanHalfCouncil; @@ -490,7 +488,7 @@ impl pallet_membership::Config for Runtime { type TipsMembershipProvider = pallet_membership::Instance2; impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = MoreThanHalfCouncil; type RemoveOrigin = MoreThanHalfCouncil; type SwapOrigin = MoreThanHalfCouncil; @@ -509,7 +507,7 @@ impl pallet_tips::Config for Runtime { type TipCountdown = constants::tips::TipCountdown; type TipFindersFee = constants::tips::TipFindersFee; type TipReportDepositBase = constants::tips::TipReportDepositBase; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_tips::WeightInfo; } @@ -517,7 +515,7 @@ impl attestation::Config for Runtime { type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::attestation::WeightInfo; type Currency = Balances; @@ -545,7 +543,7 @@ impl delegation::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type DelegationSignatureVerification = AlwaysVerify, Self::Signature>; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxSignatureByteLength = constants::delegation::MaxSignatureByteLength; type MaxParentChecks = constants::delegation::MaxParentChecks; type MaxRevocations = constants::delegation::MaxRevocations; @@ -565,15 +563,15 @@ impl ctype::Config for Runtime { type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::ctype::WeightInfo; } impl did::Config for Runtime { type DidIdentifier = DidIdentifier; - type Event = Event; - type Call = Call; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type RuntimeOrigin = RuntimeOrigin; type Currency = Balances; type Deposit = constants::did::DidDeposit; type Fee = constants::did::DidFee; @@ -603,7 +601,7 @@ impl did::Config for Runtime { } impl pallet_did_lookup::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DidIdentifier = DidIdentifier; @@ -622,7 +620,7 @@ impl pallet_web3_names::Config for Runtime { type OriginSuccess = did::DidRawOrigin; type Currency = Balances; type Deposit = constants::web3_names::Web3NameDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxNameLength = constants::web3_names::MaxNameLength; type MinNameLength = constants::web3_names::MinNameLength; type Web3Name = pallet_web3_names::web3_name::AsciiWeb3Name; @@ -639,7 +637,7 @@ impl pallet_inflation::Config for Runtime { } impl parachain_staking::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type CurrencyBalance = Balance; @@ -666,8 +664,8 @@ impl parachain_staking::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -686,7 +684,7 @@ impl public_credentials::Config for Runtime { type MaxEncodedClaimsLength = runtime_common::constants::public_credentials::MaxEncodedClaimsLength; type MaxSubjectIdLength = runtime_common::constants::public_credentials::MaxSubjectIdLength; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SubjectId = runtime_common::assets::AssetDid; type WeightInfo = weights::public_credentials::WeightInfo; } @@ -717,51 +715,51 @@ impl Default for ProxyType { } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::NonTransfer => matches!( c, - Call::Attestation(..) - | Call::Authorship(..) + RuntimeCall::Attestation(..) + | RuntimeCall::Authorship(..) // Excludes `Balances` - | Call::Council(..) - | Call::Ctype(..) - | Call::Delegation(..) - | Call::Democracy(..) - | Call::Did(..) - | Call::DidLookup(..) - | Call::Indices( + | RuntimeCall::Council(..) + | RuntimeCall::Ctype(..) + | RuntimeCall::Delegation(..) + | RuntimeCall::Democracy(..) + | RuntimeCall::Did(..) + | RuntimeCall::DidLookup(..) + | RuntimeCall::Indices( // Excludes `force_transfer`, and `transfer` pallet_indices::Call::claim { .. } | pallet_indices::Call::free { .. } | pallet_indices::Call::freeze { .. } ) - | Call::ParachainStaking(..) + | RuntimeCall::ParachainStaking(..) // Excludes `ParachainSystem` - | Call::Preimage(..) - | Call::Proxy(..) - | Call::PublicCredentials(..) - | Call::Scheduler(..) - | Call::Session(..) - | Call::System(..) - | Call::TechnicalCommittee(..) - | Call::TechnicalMembership(..) - | Call::TipsMembership(..) - | Call::Timestamp(..) - | Call::Treasury(..) - | Call::Utility(..) - | Call::Vesting( + | RuntimeCall::Preimage(..) + | RuntimeCall::Proxy(..) + | RuntimeCall::PublicCredentials(..) + | RuntimeCall::Scheduler(..) + | RuntimeCall::Session(..) + | RuntimeCall::System(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalMembership(..) + | RuntimeCall::TipsMembership(..) + | RuntimeCall::Timestamp(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) + | RuntimeCall::Vesting( // Excludes `force_vested_transfer`, `merge_schedules`, and `vested_transfer` pallet_vesting::Call::vest { .. } | pallet_vesting::Call::vest_other { .. } ) - | Call::Web3Names(..), + | RuntimeCall::Web3Names(..), ), ProxyType::NonDepositClaiming => matches!( c, - Call::Attestation( + RuntimeCall::Attestation( // Excludes `reclaim_deposit` attestation::Call::add { .. } | attestation::Call::remove { .. } @@ -769,11 +767,11 @@ impl InstanceFilter for ProxyType { | attestation::Call::change_deposit_owner { .. } | attestation::Call::update_deposit { .. } ) - | Call::Authorship(..) + | RuntimeCall::Authorship(..) // Excludes `Balances` - | Call::Council(..) - | Call::Ctype(..) - | Call::Delegation( + | RuntimeCall::Council(..) + | RuntimeCall::Ctype(..) + | RuntimeCall::Delegation( // Excludes `reclaim_deposit` delegation::Call::add_delegation { .. } | delegation::Call::create_hierarchy { .. } @@ -782,8 +780,8 @@ impl InstanceFilter for ProxyType { | delegation::Call::update_deposit { .. } | delegation::Call::change_deposit_owner { .. } ) - | Call::Democracy(..) - | Call::Did( + | RuntimeCall::Democracy(..) + | RuntimeCall::Did( // Excludes `reclaim_deposit` did::Call::add_key_agreement_key { .. } | did::Call::add_service_endpoint { .. } @@ -800,7 +798,7 @@ impl InstanceFilter for ProxyType { | did::Call::update_deposit { .. } | did::Call::change_deposit_owner { .. } ) - | Call::DidLookup( + | RuntimeCall::DidLookup( // Excludes `reclaim_deposit` pallet_did_lookup::Call::associate_account { .. } | pallet_did_lookup::Call::associate_sender { .. } @@ -809,12 +807,12 @@ impl InstanceFilter for ProxyType { | pallet_did_lookup::Call::update_deposit { .. } | pallet_did_lookup::Call::change_deposit_owner { .. } ) - | Call::Indices(..) - | Call::ParachainStaking(..) + | RuntimeCall::Indices(..) + | RuntimeCall::ParachainStaking(..) // Excludes `ParachainSystem` - | Call::Preimage(..) - | Call::Proxy(..) - | Call::PublicCredentials( + | RuntimeCall::Preimage(..) + | RuntimeCall::Proxy(..) + | RuntimeCall::PublicCredentials( // Excludes `reclaim_deposit` public_credentials::Call::add { .. } | public_credentials::Call::revoke { .. } @@ -823,18 +821,18 @@ impl InstanceFilter for ProxyType { | public_credentials::Call::update_deposit { .. } | public_credentials::Call::change_deposit_owner { .. } ) - | Call::Scheduler(..) - | Call::Session(..) + | RuntimeCall::Scheduler(..) + | RuntimeCall::Session(..) // Excludes `Sudo` - | Call::System(..) - | Call::TechnicalCommittee(..) - | Call::TechnicalMembership(..) - | Call::TipsMembership(..) - | Call::Timestamp(..) - | Call::Treasury(..) - | Call::Utility(..) - | Call::Vesting(..) - | Call::Web3Names( + | RuntimeCall::System(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalMembership(..) + | RuntimeCall::TipsMembership(..) + | RuntimeCall::Timestamp(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) + | RuntimeCall::Vesting(..) + | RuntimeCall::Web3Names( // Excludes `ban`, and `reclaim_deposit` pallet_web3_names::Call::claim { .. } | pallet_web3_names::Call::release_by_owner { .. } @@ -845,17 +843,21 @@ impl InstanceFilter for ProxyType { ), ProxyType::Governance => matches!( c, - Call::Council(..) - | Call::Democracy(..) - | Call::TechnicalCommittee(..) - | Call::TechnicalMembership(..) - | Call::TipsMembership(..) - | Call::Treasury(..) | Call::Utility(..) + RuntimeCall::Council(..) + | RuntimeCall::Democracy(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalMembership(..) + | RuntimeCall::TipsMembership(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) ), ProxyType::ParachainStaking => { - matches!(c, Call::ParachainStaking(..) | Call::Session(..) | Call::Utility(..)) + matches!( + c, + RuntimeCall::ParachainStaking(..) | RuntimeCall::Session(..) | RuntimeCall::Utility(..) + ) } - ProxyType::CancelProxy => matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })), + ProxyType::CancelProxy => matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })), } } @@ -879,8 +881,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = constants::proxy::ProxyDepositBase; @@ -974,10 +976,10 @@ construct_runtime! { } } -impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { +impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall { fn derive_verification_key_relationship(&self) -> did::DeriveDidCallKeyRelationshipResult { /// ensure that all calls have the same VerificationKeyRelationship - fn single_key_relationship(calls: &[Call]) -> did::DeriveDidCallKeyRelationshipResult { + fn single_key_relationship(calls: &[RuntimeCall]) -> did::DeriveDidCallKeyRelationshipResult { let init = calls .get(0) .ok_or(did::RelationshipDeriveError::InvalidCallParameter)? @@ -985,7 +987,7 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { calls .iter() .skip(1) - .map(Call::derive_verification_key_relationship) + .map(RuntimeCall::derive_verification_key_relationship) .try_fold(init, |acc, next| { if next.is_err() { next @@ -997,18 +999,18 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { }) } match self { - Call::Attestation { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Ctype { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Delegation { .. } => Ok(did::DidVerificationKeyRelationship::CapabilityDelegation), + RuntimeCall::Attestation { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Ctype { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Delegation { .. } => Ok(did::DidVerificationKeyRelationship::CapabilityDelegation), // DID creation is not allowed through the DID proxy. - Call::Did(did::Call::create { .. }) => Err(did::RelationshipDeriveError::NotCallableByDid), - Call::Did { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::Web3Names { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::DidLookup { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::PublicCredentials { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Utility(pallet_utility::Call::batch { calls }) => single_key_relationship(&calls[..]), - Call::Utility(pallet_utility::Call::batch_all { calls }) => single_key_relationship(&calls[..]), - Call::Utility(pallet_utility::Call::force_batch { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Did(did::Call::create { .. }) => Err(did::RelationshipDeriveError::NotCallableByDid), + RuntimeCall::Did { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::Web3Names { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::DidLookup { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::PublicCredentials { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Utility(pallet_utility::Call::batch { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Utility(pallet_utility::Call::force_batch { calls }) => single_key_relationship(&calls[..]), #[cfg(not(feature = "runtime-benchmarks"))] _ => Err(did::RelationshipDeriveError::NotCallableByDid), // By default, returns the authentication key @@ -1020,7 +1022,7 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { // Always return a System::remark() extrinsic call #[cfg(feature = "runtime-benchmarks")] fn get_call_for_did_call_benchmark() -> Self { - Call::System(frame_system::Call::remark { remark: vec![] }) + RuntimeCall::System(frame_system::Call::remark { remark: vec![] }) } } @@ -1045,9 +1047,9 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -1056,9 +1058,55 @@ pub type Executive = frame_executive::Executive< Runtime, // Executes pallet hooks in the order of definition in construct_runtime AllPalletsWithSystem, - parachain_staking::migration::StakingPayoutRefactor, + ( + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + EthereumMigration, + ), >; +// follows Substrate's non destructive way of eliminating otherwise required +// repetion: https://github.com/paritytech/substrate/pull/10592 +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + // KILT + [attestation, Attestation] + [ctype, Ctype] + [delegation, Delegation] + [did, Did] + [pallet_did_lookup, DidLookup] + [pallet_inflation, Inflation] + [parachain_staking, ParachainStaking] + [pallet_web3_names, Web3Names] + [public_credentials, PublicCredentials] + // Substrate + [frame_benchmarking::baseline, Baseline::] + [frame_system, SystemBench::] + [pallet_session, SessionBench::] + [pallet_balances, Balances] + [pallet_collective, Council] + [pallet_collective, TechnicalCommittee] + [pallet_democracy, Democracy] + [pallet_indices, Indices] + [pallet_membership, TechnicalMembership] + [pallet_preimage, Preimage] + [pallet_scheduler, Scheduler] + [pallet_timestamp, Timestamp] + [pallet_tips, Tips] + [pallet_treasury, Treasury] + [pallet_utility, Utility] + [pallet_vesting, Vesting] + [pallet_proxy, Proxy] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1099,6 +1147,23 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic( extrinsic: ::Extrinsic, @@ -1289,59 +1354,31 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList}; + use frame_benchmarking::{Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; let mut list = Vec::::new(); - - // Substrate - list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); - list_benchmark!(list, extra, frame_system, SystemBench::); - list_benchmark!(list, extra, pallet_session, SessionBench::); - list_benchmark!(list, extra, pallet_balances, Balances); - list_benchmark!(list, extra, pallet_collective, Council); - list_benchmark!(list, extra, pallet_democracy, Democracy); - list_benchmark!(list, extra, pallet_indices, Indices); - list_benchmark!(list, extra, pallet_membership, TechnicalMembership); - list_benchmark!(list, extra, pallet_preimage, Preimage); - list_benchmark!(list, extra, pallet_scheduler, Scheduler); - list_benchmark!(list, extra, pallet_timestamp, Timestamp); - list_benchmark!(list, extra, pallet_tips, Tips); - list_benchmark!(list, extra, pallet_treasury, Treasury); - list_benchmark!(list, extra, pallet_utility, Utility); - list_benchmark!(list, extra, pallet_vesting, Vesting); - list_benchmark!(list, extra, pallet_proxy, Proxy); - - // KILT - list_benchmark!(list, extra, attestation, Attestation); - list_benchmark!(list, extra, ctype, Ctype); - list_benchmark!(list, extra, delegation, Delegation); - list_benchmark!(list, extra, did, Did); - list_benchmark!(list, extra, pallet_did_lookup, DidLookup); - list_benchmark!(list, extra, pallet_inflation, Inflation); - list_benchmark!(list, extra, parachain_staking, ParachainStaking); - list_benchmark!(list, extra, pallet_web3_names, Web3Names); - list_benchmark!(list, extra, public_credentials, PublicCredentials); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); - (list, storage_info) } fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; impl frame_system_benchmarking::Config for Runtime {} impl cumulus_pallet_session_benchmarking::Config for Runtime {} - impl baseline::Config for Runtime {} + impl frame_benchmarking::baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -1364,38 +1401,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - // Substrate - add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_collective, Council); - add_benchmark!(params, batches, pallet_democracy, Democracy); - add_benchmark!(params, batches, pallet_indices, Indices); - add_benchmark!(params, batches, pallet_membership, TechnicalMembership); - add_benchmark!(params, batches, pallet_preimage, Preimage); - add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, pallet_session, SessionBench::); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_tips, Tips); - add_benchmark!(params, batches, pallet_treasury, Treasury); - add_benchmark!(params, batches, pallet_utility, Utility); - add_benchmark!(params, batches, pallet_vesting, Vesting); - add_benchmark!(params, batches, pallet_proxy, Proxy); - - // KILT - add_benchmark!(params, batches, attestation, Attestation); - add_benchmark!(params, batches, ctype, Ctype); - add_benchmark!(params, batches, delegation, Delegation); - add_benchmark!(params, batches, did, Did); - add_benchmark!(params, batches, pallet_did_lookup, DidLookup); - add_benchmark!(params, batches, pallet_inflation, Inflation); - add_benchmark!(params, batches, parachain_staking, ParachainStaking); - add_benchmark!(params, batches, pallet_web3_names, Web3Names); - add_benchmark!(params, batches, public_credentials, PublicCredentials); - - // No benchmarks for these pallets - // add_benchmark!(params, batches, cumulus_pallet_parachain_system, ParachainSystem); - // add_benchmark!(params, batches, parachain_info, ParachainInfo); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtimes/peregrine/src/tests.rs b/runtimes/peregrine/src/tests.rs index ac491f507..0009a6c1d 100644 --- a/runtimes/peregrine/src/tests.rs +++ b/runtimes/peregrine/src/tests.rs @@ -32,15 +32,15 @@ use runtime_common::{ AccountId, BlockNumber, }; -use super::{Call, Runtime}; +use super::{Runtime, RuntimeCall}; #[test] fn call_size() { assert!( - core::mem::size_of::() <= 272, + core::mem::size_of::() <= 272, "size of Call is {:?} bytes which is more than 240 bytes: some calls have too big arguments, use Box to reduce the size of Call. If the limit is too strong, maybe consider increase the limit to 300.", - core::mem::size_of::(), + core::mem::size_of::(), ); } @@ -118,20 +118,20 @@ fn public_credentials_storage_sizes() { #[test] fn test_derive_did_verification_relation_ctype() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c3 = Call::Ctype(ctype::Call::add { + let c3 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, c3, c4], }); assert_eq!( @@ -143,7 +143,7 @@ fn test_derive_did_verification_relation_ctype() { #[test] fn test_derive_did_key_web3name() { assert_eq!( - Call::Web3Names(pallet_web3_names::Call::claim { + RuntimeCall::Web3Names(pallet_web3_names::Call::claim { name: b"test-name".to_vec().try_into().unwrap() }) .derive_verification_key_relationship(), @@ -151,7 +151,7 @@ fn test_derive_did_key_web3name() { ); assert_eq!( - Call::Web3Names(pallet_web3_names::Call::release_by_owner {}).derive_verification_key_relationship(), + RuntimeCall::Web3Names(pallet_web3_names::Call::release_by_owner {}).derive_verification_key_relationship(), Ok(did::DidVerificationKeyRelationship::Authentication) ); } @@ -159,7 +159,7 @@ fn test_derive_did_key_web3name() { #[test] fn test_derive_did_key_lookup() { assert_eq!( - Call::DidLookup(pallet_did_lookup::Call::associate_account { + RuntimeCall::DidLookup(pallet_did_lookup::Call::associate_account { req: AssociateAccountRequest::Dotsama( AccountId::new([1u8; 32]), sp_runtime::MultiSignature::from(sp_core::ed25519::Signature([0; 64])) @@ -171,7 +171,7 @@ fn test_derive_did_key_lookup() { ); assert_eq!( - Call::DidLookup(pallet_did_lookup::Call::remove_account_association { + RuntimeCall::DidLookup(pallet_did_lookup::Call::remove_account_association { account: AccountId::new([1u8; 32]).into(), }) .derive_verification_key_relationship(), @@ -181,20 +181,20 @@ fn test_derive_did_key_lookup() { #[test] fn test_derive_did_verification_relation_fail() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c3 = Call::System(frame_system::Call::remark { + let c3 = RuntimeCall::System(frame_system::Call::remark { remark: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, c3, c4], }); @@ -212,24 +212,24 @@ fn test_derive_did_verification_relation_fail() { #[test] fn test_derive_did_verification_relation_nested_fail() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let f3 = Call::System(frame_system::Call::remark { + let f3 = RuntimeCall::System(frame_system::Call::remark { remark: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1.clone(), c2.clone(), c4.clone()], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, cb, f3, c4], }); @@ -247,21 +247,21 @@ fn test_derive_did_verification_relation_nested_fail() { #[test] fn test_derive_did_verification_relation_nested() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1.clone(), c2.clone(), c4.clone()], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, cb, c4], }); assert_eq!( @@ -272,11 +272,11 @@ fn test_derive_did_verification_relation_nested() { #[test] fn test_derive_did_verification_relation_single() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let cb = Call::Utility(pallet_utility::Call::batch { calls: vec![c1] }); + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1] }); assert_eq!( cb.derive_verification_key_relationship(), @@ -286,7 +286,7 @@ fn test_derive_did_verification_relation_single() { #[test] fn test_derive_did_verification_relation_empty() { - let cb = Call::Utility(pallet_utility::Call::batch { calls: vec![] }); + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![] }); assert_eq!( cb.derive_verification_key_relationship(), diff --git a/runtimes/peregrine/src/weights/pallet_democracy.rs b/runtimes/peregrine/src/weights/pallet_democracy.rs index 1b86b8b52..a5e8e2ae1 100644 --- a/runtimes/peregrine/src/weights/pallet_democracy.rs +++ b/runtimes/peregrine/src/weights/pallet_democracy.rs @@ -45,7 +45,6 @@ use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -/// Weights for `pallet_democracy`. pub struct WeightInfo(PhantomData); impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy PublicPropCount (r:1 w:1) @@ -53,125 +52,117 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(83_287_000 as u64) + // Minimum execution time: 42_035 nanoseconds. + Weight::from_ref_time(42_673_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(56_941_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(155_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + // Minimum execution time: 37_908 nanoseconds. + Weight::from_ref_time(39_524_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(73_223_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(147_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + // Minimum execution time: 48_027 nanoseconds. + Weight::from_ref_time(48_672_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(72_313_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(174_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + // Minimum execution time: 48_623 nanoseconds. + Weight::from_ref_time(49_248_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(35_782_000 as u64) + // Minimum execution time: 19_752 nanoseconds. + Weight::from_ref_time(20_235_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:2 w:2) - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(92_163_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(388_000 as u64).saturating_mul(p as u64)) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(7 as u64)) + fn blacklist() -> Weight { + // Minimum execution time: 75_593 nanoseconds. + Weight::from_ref_time(76_707_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(25_305_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(22_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + // Minimum execution time: 15_433 nanoseconds. + Weight::from_ref_time(15_751_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(8_506_000 as u64) + // Minimum execution time: 4_187 nanoseconds. + Weight::from_ref_time(4_344_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(8_419_000 as u64) + // Minimum execution time: 4_424 nanoseconds. + Weight::from_ref_time(4_522_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(36_563_000 as u64) + // Minimum execution time: 18_919 nanoseconds. + Weight::from_ref_time(19_574_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(39_075_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + // Minimum execution time: 24_749 nanoseconds. + Weight::from_ref_time(25_443_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:2 w:2) - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(78_045_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(320_000 as u64).saturating_mul(p as u64)) - .saturating_add(T::DbWeight::get().reads(4 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + // Storage: System Account (r:1 w:1) + fn cancel_proposal() -> Weight { + // Minimum execution time: 63_025 nanoseconds. + Weight::from_ref_time(64_438_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(23_842_000 as u64) + // Minimum execution time: 12_754 nanoseconds. + Weight::from_ref_time(13_249_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(41_080_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(1_001_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(19_412_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(3_021_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 6_036 nanoseconds. + Weight::from_ref_time(9_221_096 as u64) + // Standard Error: 3_753 + .saturating_add(Weight::from_ref_time(2_068_013 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -181,33 +172,39 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(22_572_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(3_039_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 8_435 nanoseconds. + Weight::from_ref_time(11_539_062 as u64) + // Standard Error: 3_966 + .saturating_add(Weight::from_ref_time(2_069_630 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(78_745_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(4_781_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 39_949 nanoseconds. + Weight::from_ref_time(46_035_539 as u64) + // Standard Error: 5_044 + .saturating_add(Weight::from_ref_time(2_971_650 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(46_025_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(4_799_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 23_826 nanoseconds. + Weight::from_ref_time(27_032_402 as u64) + // Standard Error: 4_525 + .saturating_add(Weight::from_ref_time(2_958_429 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -215,70 +212,55 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(10_571_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(52_121_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(39_182_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + // Minimum execution time: 4_775 nanoseconds. + Weight::from_ref_time(5_033_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(64_953_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(53_731_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(102_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 23_245 nanoseconds. + Weight::from_ref_time(30_061_940 as u64) + // Standard Error: 1_523 + .saturating_add(Weight::from_ref_time(34_810 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(53_668_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(140_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 28_063 nanoseconds. + Weight::from_ref_time(30_002_043 as u64) + // Standard Error: 636 + .saturating_add(Weight::from_ref_time(67_182 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(31_346_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(186_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 15_306 nanoseconds. + Weight::from_ref_time(17_690_130 as u64) + // Standard Error: 836 + .saturating_add(Weight::from_ref_time(68_122 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(31_787_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(191_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 15_392 nanoseconds. + Weight::from_ref_time(17_610_812 as u64) + // Standard Error: 819 + .saturating_add(Weight::from_ref_time(69_086 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } } + diff --git a/runtimes/peregrine/src/weights/pallet_proxy.rs b/runtimes/peregrine/src/weights/pallet_proxy.rs index 1ef2aa2c3..8c079f076 100644 --- a/runtimes/peregrine/src/weights/pallet_proxy.rs +++ b/runtimes/peregrine/src/weights/pallet_proxy.rs @@ -49,90 +49,120 @@ use sp_std::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) + /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { - Weight::from_ref_time(35_453_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(116_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 19_011 nanoseconds. + Weight::from_ref_time(20_076_741 as u64) + // Standard Error: 1_518 + .saturating_add(Weight::from_ref_time(55_831 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn proxy_announced(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(63_669_000 as u64) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(354_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn proxy_announced(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 37_088 nanoseconds. + Weight::from_ref_time(36_581_632 as u64) + // Standard Error: 1_964 + .saturating_add(Weight::from_ref_time(116_190 as u64).saturating_mul(a as u64)) + // Standard Error: 2_030 + .saturating_add(Weight::from_ref_time(41_547 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn remove_announcement(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(46_106_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(362_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn remove_announcement(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 25_299 nanoseconds. + Weight::from_ref_time(26_801_993 as u64) + // Standard Error: 2_746 + .saturating_add(Weight::from_ref_time(102_732 as u64).saturating_mul(a as u64)) + // Standard Error: 2_837 + .saturating_add(Weight::from_ref_time(318 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn reject_announcement(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(46_507_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(306_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn reject_announcement(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 25_178 nanoseconds. + Weight::from_ref_time(26_248_780 as u64) + // Standard Error: 1_710 + .saturating_add(Weight::from_ref_time(116_285 as u64).saturating_mul(a as u64)) + // Standard Error: 1_767 + .saturating_add(Weight::from_ref_time(1_860 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. fn announce(a: u32, p: u32, ) -> Weight { - Weight::from_ref_time(56_879_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(425_000 as u64).saturating_mul(a as u64)) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(41_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 32_878 nanoseconds. + Weight::from_ref_time(34_386_513 as u64) + // Standard Error: 1_955 + .saturating_add(Weight::from_ref_time(97_872 as u64).saturating_mul(a as u64)) + // Standard Error: 2_020 + .saturating_add(Weight::from_ref_time(25_879 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:1) + /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { - Weight::from_ref_time(50_431_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(153_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 26_410 nanoseconds. + Weight::from_ref_time(27_653_752 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(57_860 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) + /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { - Weight::from_ref_time(50_457_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(223_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 26_506 nanoseconds. + Weight::from_ref_time(27_604_932 as u64) + // Standard Error: 1_863 + .saturating_add(Weight::from_ref_time(78_466 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) + /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { - Weight::from_ref_time(43_320_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(235_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 22_696 nanoseconds. + Weight::from_ref_time(23_736_641 as u64) + // Standard Error: 1_616 + .saturating_add(Weight::from_ref_time(50_577 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - fn anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(56_237_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(78_000 as u64).saturating_mul(p as u64)) + /// The range of component `p` is `[1, 31]`. + fn create_pure(p: u32, ) -> Weight { + // Minimum execution time: 29_461 nanoseconds. + Weight::from_ref_time(30_835_016 as u64) + // Standard Error: 1_587 + .saturating_add(Weight::from_ref_time(23_834 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) - fn kill_anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(45_796_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(143_000 as u64).saturating_mul(p as u64)) + /// The range of component `p` is `[0, 30]`. + fn kill_pure(p: u32, ) -> Weight { + // Minimum execution time: 24_319 nanoseconds. + Weight::from_ref_time(25_652_003 as u64) + // Standard Error: 1_697 + .saturating_add(Weight::from_ref_time(28_118 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtimes/peregrine/src/weights/pallet_scheduler.rs b/runtimes/peregrine/src/weights/pallet_scheduler.rs index 3fe998d89..761a637d9 100644 --- a/runtimes/peregrine/src/weights/pallet_scheduler.rs +++ b/runtimes/peregrine/src/weights/pallet_scheduler.rs @@ -48,149 +48,96 @@ use sp_std::marker::PhantomData; /// Weights for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(39_657_000 as u64) - // Standard Error: 35_000 - .saturating_add(Weight::from_ref_time(30_657_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + // Minimum execution time: 4_236 nanoseconds. + Weight::from_ref_time(4_539_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(36_610_000 as u64) - // Standard Error: 38_000 - .saturating_add(Weight::from_ref_time(24_526_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + // Minimum execution time: 3_651 nanoseconds. + Weight::from_ref_time(6_843_488 as u64) + // Standard Error: 1_965 + .saturating_add(Weight::from_ref_time(579_324 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(33_522_000 as u64) - // Standard Error: 34_000 - .saturating_add(Weight::from_ref_time(25_972_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + // Minimum execution time: 9_244 nanoseconds. + Weight::from_ref_time(9_537_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(32_379_000 as u64) - // Standard Error: 34_000 - .saturating_add(Weight::from_ref_time(22_381_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(19_133_000 as u64) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(8_862_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(17_636_000 as u64) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(4_612_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + // Minimum execution time: 20_377 nanoseconds. + Weight::from_ref_time(20_733_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(1_250 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(33_523_000 as u64) - // Standard Error: 35_000 - .saturating_add(Weight::from_ref_time(15_752_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + // Minimum execution time: 10_526 nanoseconds. + Weight::from_ref_time(10_839_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(26_528_000 as u64) - // Standard Error: 34_000 - .saturating_add(Weight::from_ref_time(11_541_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn service_task_periodic() -> Weight { + // Minimum execution time: 9_130 nanoseconds. + Weight::from_ref_time(9_476_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(27_589_000 as u64) - // Standard Error: 30_000 - .saturating_add(Weight::from_ref_time(10_293_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn execute_dispatch_signed() -> Weight { + // Minimum execution time: 3_644 nanoseconds. + Weight::from_ref_time(3_761_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(24_390_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(8_612_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_unsigned() -> Weight { + // Minimum execution time: 3_604 nanoseconds. + Weight::from_ref_time(3_738_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(33_885_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(127_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 16_561 nanoseconds. + Weight::from_ref_time(20_688_245 as u64) + // Standard Error: 2_610 + .saturating_add(Weight::from_ref_time(602_897 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(33_766_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_062_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 18_830 nanoseconds. + Weight::from_ref_time(20_815_969 as u64) + // Standard Error: 2_132 + .saturating_add(Weight::from_ref_time(598_343 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(40_632_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(194_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 18_755 nanoseconds. + Weight::from_ref_time(23_838_238 as u64) + // Standard Error: 3_430 + .saturating_add(Weight::from_ref_time(628_138 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(37_902_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(1_114_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 19_761 nanoseconds. + Weight::from_ref_time(22_583_852 as u64) + // Standard Error: 2_440 + .saturating_add(Weight::from_ref_time(612_208 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtimes/peregrine/src/xcm_config.rs b/runtimes/peregrine/src/xcm_config.rs index e0293548c..54d4b4576 100644 --- a/runtimes/peregrine/src/xcm_config.rs +++ b/runtimes/peregrine/src/xcm_config.rs @@ -17,8 +17,8 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, Treasury, - WeightToFee, XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, + RuntimeOrigin, Treasury, WeightToFee, XcmpQueue, }; use frame_support::{ @@ -38,7 +38,7 @@ use runtime_common::xcm_config::{ }; parameter_types! { - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayNetworkId: NetworkId = NetworkId::Any; } @@ -52,23 +52,23 @@ pub type XcmOriginToTransactDispatchOrigin = ( // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. // In contrast to Spiritnet, it's fine to include this on peregrine for testing. - SovereignSignedViaLocation, Origin>, + SovereignSignedViaLocation, RuntimeOrigin>, // Native converter for Relay-chain (Parent) location which converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains which converts to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter which just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; // How we send Xcm messages. type XcmSender = XcmRouter; // How to withdraw and deposit an asset. @@ -87,7 +87,7 @@ impl xcm_executor::Config for XcmConfig { type Barrier = XcmBarrier; // How XCM messages are weighted. Each transaction has a weight of // `UnitWeightCost`. - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; // How weight is transformed into fees. The fees are not taken out of the // Balances pallet here. Balances is only used if fees are dropped without being // used. In that case they are put into the treasury. @@ -102,7 +102,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into /// the right message queues. @@ -114,20 +114,20 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // Disable dispatchable execution on the XCM pallet. // NOTE: For local testing this needs to be `Everything`. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // Our latest supported XCM version. @@ -135,6 +135,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/runtimes/spiritnet/Cargo.toml b/runtimes/spiritnet/Cargo.toml index b54269083..dc3e81e9b 100644 --- a/runtimes/spiritnet/Cargo.toml +++ b/runtimes/spiritnet/Cargo.toml @@ -54,7 +54,6 @@ sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true -frame-benchmarking.workspace = true frame-executive.workspace = true frame-support.workspace = true frame-system.workspace = true @@ -96,6 +95,7 @@ xcm-executor.workspace = true # Benchmarking dependencies cumulus-pallet-session-benchmarking = {workspace = true, optional = true} +frame-benchmarking = {workspace = true, optional = true} frame-system-benchmarking = {workspace = true, optional = true} # Runtime tests @@ -107,13 +107,14 @@ fast-gov = ["runtime-common/fast-gov"] runtime-benchmarks = [ "attestation/runtime-benchmarks", "ctype/runtime-benchmarks", - "cumulus-pallet-session-benchmarking", + "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", "delegation/runtime-benchmarks", "did/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", "kilt-support/runtime-benchmarks", @@ -133,11 +134,13 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", "pallet-web3-names/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", "parachain-staking/runtime-benchmarks", "public-credentials/runtime-benchmarks", "runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", ] std = [ "attestation/std", @@ -151,14 +154,16 @@ std = [ "cumulus-primitives-core/std", "cumulus-primitives-timestamp/std", "cumulus-primitives-utility/std", + "cumulus-pallet-session-benchmarking?/std", "delegation/std", "did/std", - "frame-benchmarking/std", + "frame-benchmarking?/std", "frame-executive/std", "frame-support/std", - "frame-system-rpc-runtime-api/std", "frame-system/std", - "frame-try-runtime/std", + "frame-system-benchmarking?/std", + "frame-system-rpc-runtime-api/std", + "frame-try-runtime?/std", "kilt-runtime-api-did/std", "kilt-runtime-api-public-credentials/std", "kilt-runtime-api-staking/std", diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index 95b62454b..3699015aa 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -29,7 +29,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use frame_support::{ construct_runtime, parameter_types, - traits::{EitherOfDiverse, Everything, InstanceFilter, PrivilegeCmp}, + traits::{ConstU32, EitherOfDiverse, Everything, InstanceFilter, PrivilegeCmp}, weights::{constants::RocksDbWeight, ConstantMultiplier, Weight}, }; use frame_system::EnsureRoot; @@ -47,14 +47,14 @@ use xcm_executor::XcmExecutor; use delegation::DelegationAc; use kilt_support::traits::ItemFilter; -use pallet_did_lookup::linkable_account::LinkableAccountId; +use pallet_did_lookup::{linkable_account::LinkableAccountId, migrations::EthereumMigration}; pub use parachain_staking::InflationInfo; pub use public_credentials; use runtime_common::{ assets::{AssetDid, PublicCredentialsFilter}, authorization::{AuthorizationId, PalletAuthorize}, - constants::{self, EXISTENTIAL_DEPOSIT, KILT}, + constants::{self, UnvestedFundsAllowedWithdrawReasons, EXISTENTIAL_DEPOSIT, KILT}, errors::PublicCredentialsApiError, fees::{ToAuthor, WeightToFee}, pallet_id, AccountId, AuthorityId, Balance, BlockHashCount, BlockLength, BlockNumber, BlockWeights, DidIdentifier, @@ -115,7 +115,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in /// dispatchers. type Lookup = AccountIdLookup; @@ -130,9 +130,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = runtime_common::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest /// pruned first). type BlockHashCount = BlockHashCount; @@ -176,7 +176,7 @@ impl pallet_indices::Config for Runtime { type AccountIndex = Index; type Currency = pallet_balances::Pallet; type Deposit = constants::IndicesDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_indices::WeightInfo; } @@ -184,7 +184,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = Treasury; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -195,7 +195,7 @@ impl pallet_balances::Config for Runtime { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>>; type OperationalFeeMultiplier = constants::fee::OperationalFeeMultiplier; @@ -210,7 +210,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -228,7 +228,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -239,7 +239,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -267,7 +267,7 @@ impl pallet_authorship::Config for Runtime { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type ValidatorIdOf = ConvertInto; type ShouldEndSession = ParachainStaking; @@ -279,12 +279,13 @@ impl pallet_session::Config for Runtime { } impl pallet_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BlockNumberToBalance = ConvertInto; // disable vested transfers by setting min amount to max balance type MinVestedTransfer = constants::MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = constants::MAX_VESTING_SCHEDULES; } @@ -296,10 +297,9 @@ parameter_types! { impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = constants::preimage::PreimageMaxSize; type BaseDeposit = constants::preimage::PreimageBaseDeposit; type ByteDeposit = constants::ByteDeposit; } @@ -339,17 +339,16 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = ScheduleOrigin; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { @@ -359,8 +358,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = constants::governance::EnactmentPeriod; type VoteLockingPeriod = constants::governance::VotingPeriod; @@ -399,15 +397,15 @@ impl pallet_democracy::Config for Runtime { // however they can only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = constants::governance::CooloffPeriod; - type PreimageByteDeposit = constants::ByteDeposit; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; - type MaxProposals = MaxProposals; - type WeightInfo = weights::pallet_democracy::WeightInfo; + type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -433,7 +431,7 @@ impl pallet_treasury::Config for Runtime { type Currency = Balances; type ApproveOrigin = ApproveOrigin; type RejectOrigin = MoreThanHalfCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSlash = Treasury; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; @@ -449,9 +447,9 @@ impl pallet_treasury::Config for Runtime { type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = constants::governance::CouncilMotionDuration; type MaxProposals = constants::governance::CouncilMaxProposals; type MaxMembers = constants::governance::CouncilMaxMembers; @@ -461,9 +459,9 @@ impl pallet_collective::Config for Runtime { type TechnicalCollective = pallet_collective::Instance2; impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = constants::governance::TechnicalMotionDuration; type MaxProposals = constants::governance::TechnicalMaxProposals; type MaxMembers = constants::governance::TechnicalMaxMembers; @@ -473,7 +471,7 @@ impl pallet_collective::Config for Runtime { type TechnicalMembershipProvider = pallet_membership::Instance1; impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = MoreThanHalfCouncil; type RemoveOrigin = MoreThanHalfCouncil; type SwapOrigin = MoreThanHalfCouncil; @@ -487,7 +485,7 @@ impl pallet_membership::Config for Runtime { type TipsMembershipProvider = pallet_membership::Instance2; impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = MoreThanHalfCouncil; type RemoveOrigin = MoreThanHalfCouncil; type SwapOrigin = MoreThanHalfCouncil; @@ -506,7 +504,7 @@ impl pallet_tips::Config for Runtime { type TipCountdown = constants::tips::TipCountdown; type TipFindersFee = constants::tips::TipFindersFee; type TipReportDepositBase = constants::tips::TipReportDepositBase; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_tips::WeightInfo; } @@ -514,7 +512,7 @@ impl attestation::Config for Runtime { type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::attestation::WeightInfo; type Currency = Balances; @@ -542,7 +540,7 @@ impl delegation::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type DelegationSignatureVerification = AlwaysVerify, Self::Signature>; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxSignatureByteLength = constants::delegation::MaxSignatureByteLength; type MaxParentChecks = constants::delegation::MaxParentChecks; type MaxRevocations = constants::delegation::MaxRevocations; @@ -562,15 +560,15 @@ impl ctype::Config for Runtime { type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::ctype::WeightInfo; } impl did::Config for Runtime { type DidIdentifier = DidIdentifier; - type Event = Event; - type Call = Call; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type RuntimeOrigin = RuntimeOrigin; type Currency = Balances; type Deposit = constants::did::DidDeposit; type Fee = constants::did::DidFee; @@ -600,7 +598,7 @@ impl did::Config for Runtime { } impl pallet_did_lookup::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DidIdentifier = DidIdentifier; @@ -619,7 +617,7 @@ impl pallet_web3_names::Config for Runtime { type OriginSuccess = did::DidRawOrigin; type Currency = Balances; type Deposit = constants::web3_names::Web3NameDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxNameLength = constants::web3_names::MaxNameLength; type MinNameLength = constants::web3_names::MinNameLength; type Web3Name = pallet_web3_names::web3_name::AsciiWeb3Name; @@ -636,7 +634,7 @@ impl pallet_inflation::Config for Runtime { } impl parachain_staking::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type CurrencyBalance = Balance; @@ -662,8 +660,8 @@ impl parachain_staking::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -682,7 +680,7 @@ impl public_credentials::Config for Runtime { type MaxEncodedClaimsLength = runtime_common::constants::public_credentials::MaxEncodedClaimsLength; type MaxSubjectIdLength = runtime_common::constants::public_credentials::MaxSubjectIdLength; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SubjectId = runtime_common::assets::AssetDid; type WeightInfo = weights::public_credentials::WeightInfo; } @@ -713,51 +711,51 @@ impl Default for ProxyType { } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::NonTransfer => matches!( c, - Call::Attestation(..) - | Call::Authorship(..) + RuntimeCall::Attestation(..) + | RuntimeCall::Authorship(..) // Excludes `Balances` - | Call::Council(..) - | Call::Ctype(..) - | Call::Delegation(..) - | Call::Democracy(..) - | Call::Did(..) - | Call::DidLookup(..) - | Call::Indices( + | RuntimeCall::Council(..) + | RuntimeCall::Ctype(..) + | RuntimeCall::Delegation(..) + | RuntimeCall::Democracy(..) + | RuntimeCall::Did(..) + | RuntimeCall::DidLookup(..) + | RuntimeCall::Indices( // Excludes `force_transfer`, and `transfer` pallet_indices::Call::claim { .. } | pallet_indices::Call::free { .. } | pallet_indices::Call::freeze { .. } ) - | Call::ParachainStaking(..) + | RuntimeCall::ParachainStaking(..) // Excludes `ParachainSystem` - | Call::Preimage(..) - | Call::Proxy(..) - | Call::PublicCredentials(..) - | Call::Scheduler(..) - | Call::Session(..) - | Call::System(..) - | Call::TechnicalCommittee(..) - | Call::TechnicalMembership(..) - | Call::TipsMembership(..) - | Call::Timestamp(..) - | Call::Treasury(..) - | Call::Utility(..) - | Call::Vesting( + | RuntimeCall::Preimage(..) + | RuntimeCall::Proxy(..) + | RuntimeCall::PublicCredentials(..) + | RuntimeCall::Scheduler(..) + | RuntimeCall::Session(..) + | RuntimeCall::System(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalMembership(..) + | RuntimeCall::TipsMembership(..) + | RuntimeCall::Timestamp(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) + | RuntimeCall::Vesting( // Excludes `force_vested_transfer`, `merge_schedules`, and `vested_transfer` pallet_vesting::Call::vest { .. } | pallet_vesting::Call::vest_other { .. } ) - | Call::Web3Names(..), + | RuntimeCall::Web3Names(..), ), ProxyType::NonDepositClaiming => matches!( c, - Call::Attestation( + RuntimeCall::Attestation( // Excludes `reclaim_deposit` attestation::Call::add { .. } | attestation::Call::remove { .. } @@ -765,11 +763,11 @@ impl InstanceFilter for ProxyType { | attestation::Call::change_deposit_owner { .. } | attestation::Call::update_deposit { .. } ) - | Call::Authorship(..) + | RuntimeCall::Authorship(..) // Excludes `Balances` - | Call::Council(..) - | Call::Ctype(..) - | Call::Delegation( + | RuntimeCall::Council(..) + | RuntimeCall::Ctype(..) + | RuntimeCall::Delegation( // Excludes `reclaim_deposit` delegation::Call::add_delegation { .. } | delegation::Call::create_hierarchy { .. } @@ -778,8 +776,8 @@ impl InstanceFilter for ProxyType { | delegation::Call::update_deposit { .. } | delegation::Call::change_deposit_owner { .. } ) - | Call::Democracy(..) - | Call::Did( + | RuntimeCall::Democracy(..) + | RuntimeCall::Did( // Excludes `reclaim_deposit` did::Call::add_key_agreement_key { .. } | did::Call::add_service_endpoint { .. } @@ -796,7 +794,7 @@ impl InstanceFilter for ProxyType { | did::Call::update_deposit { .. } | did::Call::change_deposit_owner { .. } ) - | Call::DidLookup( + | RuntimeCall::DidLookup( // Excludes `reclaim_deposit` pallet_did_lookup::Call::associate_account { .. } | pallet_did_lookup::Call::associate_sender { .. } @@ -805,12 +803,12 @@ impl InstanceFilter for ProxyType { | pallet_did_lookup::Call::update_deposit { .. } | pallet_did_lookup::Call::change_deposit_owner { .. } ) - | Call::Indices(..) - | Call::ParachainStaking(..) + | RuntimeCall::Indices(..) + | RuntimeCall::ParachainStaking(..) // Excludes `ParachainSystem` - | Call::Preimage(..) - | Call::Proxy(..) - | Call::PublicCredentials( + | RuntimeCall::Preimage(..) + | RuntimeCall::Proxy(..) + | RuntimeCall::PublicCredentials( // Excludes `reclaim_deposit` public_credentials::Call::add { .. } | public_credentials::Call::revoke { .. } @@ -819,18 +817,18 @@ impl InstanceFilter for ProxyType { | public_credentials::Call::update_deposit { .. } | public_credentials::Call::change_deposit_owner { .. } ) - | Call::Scheduler(..) - | Call::Session(..) + | RuntimeCall::Scheduler(..) + | RuntimeCall::Session(..) // Excludes `Sudo` - | Call::System(..) - | Call::TechnicalCommittee(..) - | Call::TechnicalMembership(..) - | Call::TipsMembership(..) - | Call::Timestamp(..) - | Call::Treasury(..) - | Call::Utility(..) - | Call::Vesting(..) - | Call::Web3Names( + | RuntimeCall::System(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalMembership(..) + | RuntimeCall::TipsMembership(..) + | RuntimeCall::Timestamp(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) + | RuntimeCall::Vesting(..) + | RuntimeCall::Web3Names( // Excludes `ban`, and `reclaim_deposit` pallet_web3_names::Call::claim { .. } | pallet_web3_names::Call::release_by_owner { .. } @@ -841,17 +839,21 @@ impl InstanceFilter for ProxyType { ), ProxyType::Governance => matches!( c, - Call::Council(..) - | Call::Democracy(..) - | Call::TechnicalCommittee(..) - | Call::TechnicalMembership(..) - | Call::TipsMembership(..) - | Call::Treasury(..) | Call::Utility(..) + RuntimeCall::Council(..) + | RuntimeCall::Democracy(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalMembership(..) + | RuntimeCall::TipsMembership(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) ), ProxyType::ParachainStaking => { - matches!(c, Call::ParachainStaking(..) | Call::Session(..) | Call::Utility(..)) + matches!( + c, + RuntimeCall::ParachainStaking(..) | RuntimeCall::Session(..) | RuntimeCall::Utility(..) + ) } - ProxyType::CancelProxy => matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })), + ProxyType::CancelProxy => matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })), } } @@ -875,8 +877,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = constants::proxy::ProxyDepositBase; @@ -969,10 +971,10 @@ construct_runtime! { } } -impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { +impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall { fn derive_verification_key_relationship(&self) -> did::DeriveDidCallKeyRelationshipResult { /// ensure that all calls have the same VerificationKeyRelationship - fn single_key_relationship(calls: &[Call]) -> did::DeriveDidCallKeyRelationshipResult { + fn single_key_relationship(calls: &[RuntimeCall]) -> did::DeriveDidCallKeyRelationshipResult { let init = calls .get(0) .ok_or(did::RelationshipDeriveError::InvalidCallParameter)? @@ -980,7 +982,7 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { calls .iter() .skip(1) - .map(Call::derive_verification_key_relationship) + .map(RuntimeCall::derive_verification_key_relationship) .try_fold(init, |acc, next| { if next.is_err() { next @@ -992,18 +994,18 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { }) } match self { - Call::Attestation { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Ctype { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Delegation { .. } => Ok(did::DidVerificationKeyRelationship::CapabilityDelegation), + RuntimeCall::Attestation { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Ctype { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Delegation { .. } => Ok(did::DidVerificationKeyRelationship::CapabilityDelegation), // DID creation is not allowed through the DID proxy. - Call::Did(did::Call::create { .. }) => Err(did::RelationshipDeriveError::NotCallableByDid), - Call::Did { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::Web3Names { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::PublicCredentials { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::DidLookup { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::Utility(pallet_utility::Call::batch { calls }) => single_key_relationship(&calls[..]), - Call::Utility(pallet_utility::Call::batch_all { calls }) => single_key_relationship(&calls[..]), - Call::Utility(pallet_utility::Call::force_batch { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Did(did::Call::create { .. }) => Err(did::RelationshipDeriveError::NotCallableByDid), + RuntimeCall::Did { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::Web3Names { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::PublicCredentials { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::DidLookup { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::Utility(pallet_utility::Call::batch { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Utility(pallet_utility::Call::force_batch { calls }) => single_key_relationship(&calls[..]), #[cfg(not(feature = "runtime-benchmarks"))] _ => Err(did::RelationshipDeriveError::NotCallableByDid), // By default, returns the authentication key @@ -1015,7 +1017,7 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { // Always return a System::remark() extrinsic call #[cfg(feature = "runtime-benchmarks")] fn get_call_for_did_call_benchmark() -> Self { - Call::System(frame_system::Call::remark { remark: vec![] }) + RuntimeCall::System(frame_system::Call::remark { remark: vec![] }) } } @@ -1040,9 +1042,9 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -1051,10 +1053,54 @@ pub type Executive = frame_executive::Executive< Runtime, // Executes pallet hooks in the order of definition in construct_runtime AllPalletsWithSystem, - // EthereumMigration, - parachain_staking::migration::StakingPayoutRefactor, + ( + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + EthereumMigration, + ), >; +// follows Substrate's non destructive way of eliminating otherwise required +// repetion: https://github.com/paritytech/substrate/pull/10592 +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + // KILT + [attestation, Attestation] + [ctype, Ctype] + [delegation, Delegation] + [did, Did] + [pallet_did_lookup, DidLookup] + [pallet_inflation, Inflation] + [parachain_staking, ParachainStaking] + [pallet_web3_names, Web3Names] + // Substrate + [frame_benchmarking::baseline, Baseline::] + [frame_system, SystemBench::] + [pallet_session, SessionBench::] + [pallet_balances, Balances] + [pallet_collective, Council] + [pallet_collective, TechnicalCommittee] + [pallet_democracy, Democracy] + [pallet_indices, Indices] + [pallet_membership, TechnicalMembership] + [pallet_preimage, Preimage] + [pallet_scheduler, Scheduler] + [pallet_timestamp, Timestamp] + [pallet_tips, Tips] + [pallet_treasury, Treasury] + [pallet_utility, Utility] + [pallet_vesting, Vesting] + [pallet_proxy, Proxy] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1095,6 +1141,23 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic( extrinsic: ::Extrinsic, @@ -1285,59 +1348,31 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList}; + use frame_benchmarking::{Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; let mut list = Vec::::new(); - - // Substrate - list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); - list_benchmark!(list, extra, frame_system, SystemBench::); - list_benchmark!(list, extra, pallet_session, SessionBench::); - list_benchmark!(list, extra, pallet_balances, Balances); - list_benchmark!(list, extra, pallet_collective, Council); - list_benchmark!(list, extra, pallet_democracy, Democracy); - list_benchmark!(list, extra, pallet_indices, Indices); - list_benchmark!(list, extra, pallet_membership, TechnicalMembership); - list_benchmark!(list, extra, pallet_preimage, Preimage); - list_benchmark!(list, extra, pallet_scheduler, Scheduler); - list_benchmark!(list, extra, pallet_timestamp, Timestamp); - list_benchmark!(list, extra, pallet_tips, Tips); - list_benchmark!(list, extra, pallet_treasury, Treasury); - list_benchmark!(list, extra, pallet_utility, Utility); - list_benchmark!(list, extra, pallet_vesting, Vesting); - list_benchmark!(list, extra, pallet_proxy, Proxy); - - // KILT - list_benchmark!(list, extra, attestation, Attestation); - list_benchmark!(list, extra, ctype, Ctype); - list_benchmark!(list, extra, delegation, Delegation); - list_benchmark!(list, extra, did, Did); - list_benchmark!(list, extra, pallet_did_lookup, DidLookup); - list_benchmark!(list, extra, pallet_inflation, Inflation); - list_benchmark!(list, extra, parachain_staking, ParachainStaking); - list_benchmark!(list, extra, pallet_web3_names, Web3Names); - list_benchmark!(list, extra, public_credentials, PublicCredentials); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); - (list, storage_info) } fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; impl frame_system_benchmarking::Config for Runtime {} impl cumulus_pallet_session_benchmarking::Config for Runtime {} - impl baseline::Config for Runtime {} + impl frame_benchmarking::baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -1360,38 +1395,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - // Substrate - add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_collective, Council); - add_benchmark!(params, batches, pallet_democracy, Democracy); - add_benchmark!(params, batches, pallet_indices, Indices); - add_benchmark!(params, batches, pallet_membership, TechnicalMembership); - add_benchmark!(params, batches, pallet_preimage, Preimage); - add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, pallet_session, SessionBench::); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_tips, Tips); - add_benchmark!(params, batches, pallet_treasury, Treasury); - add_benchmark!(params, batches, pallet_utility, Utility); - add_benchmark!(params, batches, pallet_vesting, Vesting); - add_benchmark!(params, batches, pallet_proxy, Proxy); - - // KILT - add_benchmark!(params, batches, attestation, Attestation); - add_benchmark!(params, batches, ctype, Ctype); - add_benchmark!(params, batches, delegation, Delegation); - add_benchmark!(params, batches, did, Did); - add_benchmark!(params, batches, pallet_did_lookup, DidLookup); - add_benchmark!(params, batches, pallet_inflation, Inflation); - add_benchmark!(params, batches, parachain_staking, ParachainStaking); - add_benchmark!(params, batches, pallet_web3_names, Web3Names); - add_benchmark!(params, batches, public_credentials, PublicCredentials); - - // No benchmarks for these pallets - // add_benchmark!(params, batches, cumulus_pallet_parachain_system, ParachainSystem); - // add_benchmark!(params, batches, parachain_info, ParachainInfo); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtimes/spiritnet/src/tests.rs b/runtimes/spiritnet/src/tests.rs index c720ae2d9..19da2c04f 100644 --- a/runtimes/spiritnet/src/tests.rs +++ b/runtimes/spiritnet/src/tests.rs @@ -32,12 +32,12 @@ use runtime_common::{ AccountId, BlockNumber, }; -use super::{Call, Runtime}; +use super::{Runtime, RuntimeCall}; #[test] fn call_size() { assert!( - core::mem::size_of::() <= 240, + core::mem::size_of::() <= 240, "size of Call is more than 240 bytes: some calls have too big arguments, use Box to reduce \ the size of Call. If the limit is too strong, maybe consider increase the limit to 300.", @@ -118,20 +118,20 @@ fn public_credentials_storage_sizes() { #[test] fn test_derive_did_verification_relation_ctype() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c3 = Call::Ctype(ctype::Call::add { + let c3 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, c3, c4], }); assert_eq!( @@ -143,7 +143,7 @@ fn test_derive_did_verification_relation_ctype() { #[test] fn test_derive_did_key_web3name() { assert_eq!( - Call::Web3Names(pallet_web3_names::Call::claim { + RuntimeCall::Web3Names(pallet_web3_names::Call::claim { name: b"test-name".to_vec().try_into().unwrap() }) .derive_verification_key_relationship(), @@ -151,7 +151,7 @@ fn test_derive_did_key_web3name() { ); assert_eq!( - Call::Web3Names(pallet_web3_names::Call::release_by_owner {}).derive_verification_key_relationship(), + RuntimeCall::Web3Names(pallet_web3_names::Call::release_by_owner {}).derive_verification_key_relationship(), Ok(did::DidVerificationKeyRelationship::Authentication) ); } @@ -159,7 +159,7 @@ fn test_derive_did_key_web3name() { #[test] fn test_derive_did_key_lookup() { assert_eq!( - Call::DidLookup(pallet_did_lookup::Call::associate_account { + RuntimeCall::DidLookup(pallet_did_lookup::Call::associate_account { req: AssociateAccountRequest::Dotsama( AccountId::new([1u8; 32]), sp_runtime::MultiSignature::from(sp_core::ed25519::Signature([0; 64])) @@ -171,7 +171,7 @@ fn test_derive_did_key_lookup() { ); assert_eq!( - Call::DidLookup(pallet_did_lookup::Call::remove_account_association { + RuntimeCall::DidLookup(pallet_did_lookup::Call::remove_account_association { account: AccountId::new([1u8; 32]).into(), }) .derive_verification_key_relationship(), @@ -181,20 +181,20 @@ fn test_derive_did_key_lookup() { #[test] fn test_derive_did_verification_relation_fail() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c3 = Call::System(frame_system::Call::remark { + let c3 = RuntimeCall::System(frame_system::Call::remark { remark: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, c3, c4], }); @@ -212,24 +212,24 @@ fn test_derive_did_verification_relation_fail() { #[test] fn test_derive_did_verification_relation_nested_fail() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let f3 = Call::System(frame_system::Call::remark { + let f3 = RuntimeCall::System(frame_system::Call::remark { remark: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1.clone(), c2.clone(), c4.clone()], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, cb, f3, c4], }); @@ -247,21 +247,21 @@ fn test_derive_did_verification_relation_nested_fail() { #[test] fn test_derive_did_verification_relation_nested() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let c2 = Call::Ctype(ctype::Call::add { + let c2 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3, 3], }); - let c4 = Call::Ctype(ctype::Call::add { + let c4 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 100], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1.clone(), c2.clone(), c4.clone()], }); - let cb = Call::Utility(pallet_utility::Call::batch { + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1, c2, cb, c4], }); assert_eq!( @@ -272,11 +272,11 @@ fn test_derive_did_verification_relation_nested() { #[test] fn test_derive_did_verification_relation_single() { - let c1 = Call::Ctype(ctype::Call::add { + let c1 = RuntimeCall::Ctype(ctype::Call::add { ctype: vec![0, 1, 2, 3], }); - let cb = Call::Utility(pallet_utility::Call::batch { calls: vec![c1] }); + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![c1] }); assert_eq!( cb.derive_verification_key_relationship(), @@ -286,7 +286,7 @@ fn test_derive_did_verification_relation_single() { #[test] fn test_derive_did_verification_relation_empty() { - let cb = Call::Utility(pallet_utility::Call::batch { calls: vec![] }); + let cb = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![] }); assert_eq!( cb.derive_verification_key_relationship(), diff --git a/runtimes/spiritnet/src/weights/pallet_democracy.rs b/runtimes/spiritnet/src/weights/pallet_democracy.rs index d5b0516c3..894687460 100644 --- a/runtimes/spiritnet/src/weights/pallet_democracy.rs +++ b/runtimes/spiritnet/src/weights/pallet_democracy.rs @@ -45,7 +45,6 @@ use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -/// Weights for `pallet_democracy`. pub struct WeightInfo(PhantomData); impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy PublicPropCount (r:1 w:1) @@ -53,125 +52,117 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(81_101_000 as u64) + // Minimum execution time: 42_035 nanoseconds. + Weight::from_ref_time(42_673_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(56_112_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(159_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + // Minimum execution time: 37_908 nanoseconds. + Weight::from_ref_time(39_524_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(72_585_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(134_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + // Minimum execution time: 48_027 nanoseconds. + Weight::from_ref_time(48_672_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(71_360_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(167_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + // Minimum execution time: 48_623 nanoseconds. + Weight::from_ref_time(49_248_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(35_736_000 as u64) + // Minimum execution time: 19_752 nanoseconds. + Weight::from_ref_time(20_235_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:2 w:2) - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(91_862_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(372_000 as u64).saturating_mul(p as u64)) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(7 as u64)) + fn blacklist() -> Weight { + // Minimum execution time: 75_593 nanoseconds. + Weight::from_ref_time(76_707_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(25_282_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(17_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + // Minimum execution time: 15_433 nanoseconds. + Weight::from_ref_time(15_751_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(8_446_000 as u64) + // Minimum execution time: 4_187 nanoseconds. + Weight::from_ref_time(4_344_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(8_709_000 as u64) + // Minimum execution time: 4_424 nanoseconds. + Weight::from_ref_time(4_522_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(36_411_000 as u64) + // Minimum execution time: 18_919 nanoseconds. + Weight::from_ref_time(19_574_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(38_531_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(40_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + // Minimum execution time: 24_749 nanoseconds. + Weight::from_ref_time(25_443_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:2 w:2) - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(77_202_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(317_000 as u64).saturating_mul(p as u64)) - .saturating_add(T::DbWeight::get().reads(4 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) + // Storage: System Account (r:1 w:1) + fn cancel_proposal() -> Weight { + // Minimum execution time: 63_025 nanoseconds. + Weight::from_ref_time(64_438_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(23_827_000 as u64) + // Minimum execution time: 12_754 nanoseconds. + Weight::from_ref_time(13_249_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(41_351_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_051_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(18_186_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(3_047_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 6_036 nanoseconds. + Weight::from_ref_time(9_221_096 as u64) + // Standard Error: 3_753 + .saturating_add(Weight::from_ref_time(2_068_013 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -181,33 +172,39 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(22_113_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_037_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 8_435 nanoseconds. + Weight::from_ref_time(11_539_062 as u64) + // Standard Error: 3_966 + .saturating_add(Weight::from_ref_time(2_069_630 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(75_444_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(4_795_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 39_949 nanoseconds. + Weight::from_ref_time(46_035_539 as u64) + // Standard Error: 5_044 + .saturating_add(Weight::from_ref_time(2_971_650 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(44_608_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(4_777_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 23_826 nanoseconds. + Weight::from_ref_time(27_032_402 as u64) + // Standard Error: 4_525 + .saturating_add(Weight::from_ref_time(2_958_429 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -215,70 +212,55 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(10_267_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(51_412_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(38_863_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + // Minimum execution time: 4_775 nanoseconds. + Weight::from_ref_time(5_033_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(64_486_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(52_858_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(120_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 23_245 nanoseconds. + Weight::from_ref_time(30_061_940 as u64) + // Standard Error: 1_523 + .saturating_add(Weight::from_ref_time(34_810 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(52_631_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(171_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 28_063 nanoseconds. + Weight::from_ref_time(30_002_043 as u64) + // Standard Error: 636 + .saturating_add(Weight::from_ref_time(67_182 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(30_764_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(196_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 15_306 nanoseconds. + Weight::from_ref_time(17_690_130 as u64) + // Standard Error: 836 + .saturating_add(Weight::from_ref_time(68_122 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(31_420_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(192_000 as u64).saturating_mul(r as u64)) + // Minimum execution time: 15_392 nanoseconds. + Weight::from_ref_time(17_610_812 as u64) + // Standard Error: 819 + .saturating_add(Weight::from_ref_time(69_086 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } } + diff --git a/runtimes/spiritnet/src/weights/pallet_proxy.rs b/runtimes/spiritnet/src/weights/pallet_proxy.rs index 7b76c0f87..6aebe9ba5 100644 --- a/runtimes/spiritnet/src/weights/pallet_proxy.rs +++ b/runtimes/spiritnet/src/weights/pallet_proxy.rs @@ -49,88 +49,120 @@ use sp_std::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) + /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { - Weight::from_ref_time(36_241_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(114_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 19_011 nanoseconds. + Weight::from_ref_time(20_076_741 as u64) + // Standard Error: 1_518 + .saturating_add(Weight::from_ref_time(55_831 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn proxy_announced(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(64_923_000 as u64) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(290_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn proxy_announced(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 37_088 nanoseconds. + Weight::from_ref_time(36_581_632 as u64) + // Standard Error: 1_964 + .saturating_add(Weight::from_ref_time(116_190 as u64).saturating_mul(a as u64)) + // Standard Error: 2_030 + .saturating_add(Weight::from_ref_time(41_547 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn remove_announcement(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(46_651_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(318_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn remove_announcement(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 25_299 nanoseconds. + Weight::from_ref_time(26_801_993 as u64) + // Standard Error: 2_746 + .saturating_add(Weight::from_ref_time(102_732 as u64).saturating_mul(a as u64)) + // Standard Error: 2_837 + .saturating_add(Weight::from_ref_time(318 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn reject_announcement(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(46_000_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(373_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn reject_announcement(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 25_178 nanoseconds. + Weight::from_ref_time(26_248_780 as u64) + // Standard Error: 1_710 + .saturating_add(Weight::from_ref_time(116_285 as u64).saturating_mul(a as u64)) + // Standard Error: 1_767 + .saturating_add(Weight::from_ref_time(1_860 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn announce(a: u32, _p: u32, ) -> Weight { - Weight::from_ref_time(58_234_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(372_000 as u64).saturating_mul(a as u64)) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn announce(a: u32, p: u32, ) -> Weight { + // Minimum execution time: 32_878 nanoseconds. + Weight::from_ref_time(34_386_513 as u64) + // Standard Error: 1_955 + .saturating_add(Weight::from_ref_time(97_872 as u64).saturating_mul(a as u64)) + // Standard Error: 2_020 + .saturating_add(Weight::from_ref_time(25_879 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Proxy Proxies (r:1 w:1) + /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { - Weight::from_ref_time(50_975_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(155_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 26_410 nanoseconds. + Weight::from_ref_time(27_653_752 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(57_860 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) + /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { - Weight::from_ref_time(50_461_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(313_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 26_506 nanoseconds. + Weight::from_ref_time(27_604_932 as u64) + // Standard Error: 1_863 + .saturating_add(Weight::from_ref_time(78_466 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) + /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { - Weight::from_ref_time(43_901_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(215_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 22_696 nanoseconds. + Weight::from_ref_time(23_736_641 as u64) + // Standard Error: 1_616 + .saturating_add(Weight::from_ref_time(50_577 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - fn anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(56_715_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(96_000 as u64).saturating_mul(p as u64)) + /// The range of component `p` is `[1, 31]`. + fn create_pure(p: u32, ) -> Weight { + // Minimum execution time: 29_461 nanoseconds. + Weight::from_ref_time(30_835_016 as u64) + // Standard Error: 1_587 + .saturating_add(Weight::from_ref_time(23_834 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) - fn kill_anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(46_162_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(163_000 as u64).saturating_mul(p as u64)) + /// The range of component `p` is `[0, 30]`. + fn kill_pure(p: u32, ) -> Weight { + // Minimum execution time: 24_319 nanoseconds. + Weight::from_ref_time(25_652_003 as u64) + // Standard Error: 1_697 + .saturating_add(Weight::from_ref_time(28_118 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtimes/spiritnet/src/weights/pallet_scheduler.rs b/runtimes/spiritnet/src/weights/pallet_scheduler.rs index fe9c7244a..46501aa93 100644 --- a/runtimes/spiritnet/src/weights/pallet_scheduler.rs +++ b/runtimes/spiritnet/src/weights/pallet_scheduler.rs @@ -48,149 +48,96 @@ use sp_std::marker::PhantomData; /// Weights for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(32_591_000 as u64) - // Standard Error: 30_000 - .saturating_add(Weight::from_ref_time(31_087_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + // Minimum execution time: 4_236 nanoseconds. + Weight::from_ref_time(4_539_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(32_298_000 as u64) - // Standard Error: 40_000 - .saturating_add(Weight::from_ref_time(24_770_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + // Minimum execution time: 3_651 nanoseconds. + Weight::from_ref_time(6_843_488 as u64) + // Standard Error: 1_965 + .saturating_add(Weight::from_ref_time(579_324 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(35_254_000 as u64) - // Standard Error: 39_000 - .saturating_add(Weight::from_ref_time(26_106_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + // Minimum execution time: 9_244 nanoseconds. + Weight::from_ref_time(9_537_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(31_517_000 as u64) - // Standard Error: 36_000 - .saturating_add(Weight::from_ref_time(22_619_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(16_225_000 as u64) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(8_972_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(17_863_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(4_579_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + // Minimum execution time: 20_377 nanoseconds. + Weight::from_ref_time(20_733_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(1_250 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(35_066_000 as u64) - // Standard Error: 42_000 - .saturating_add(Weight::from_ref_time(15_868_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + // Minimum execution time: 10_526 nanoseconds. + Weight::from_ref_time(10_839_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(26_463_000 as u64) - // Standard Error: 34_000 - .saturating_add(Weight::from_ref_time(11_660_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn service_task_periodic() -> Weight { + // Minimum execution time: 9_130 nanoseconds. + Weight::from_ref_time(9_476_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(27_964_000 as u64) - // Standard Error: 26_000 - .saturating_add(Weight::from_ref_time(10_180_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn execute_dispatch_signed() -> Weight { + // Minimum execution time: 3_644 nanoseconds. + Weight::from_ref_time(3_761_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(26_953_000 as u64) - // Standard Error: 30_000 - .saturating_add(Weight::from_ref_time(8_437_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_unsigned() -> Weight { + // Minimum execution time: 3_604 nanoseconds. + Weight::from_ref_time(3_738_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(34_138_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(138_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 16_561 nanoseconds. + Weight::from_ref_time(20_688_245 as u64) + // Standard Error: 2_610 + .saturating_add(Weight::from_ref_time(602_897 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(34_566_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_105_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 18_830 nanoseconds. + Weight::from_ref_time(20_815_969 as u64) + // Standard Error: 2_132 + .saturating_add(Weight::from_ref_time(598_343 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(40_759_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(189_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 18_755 nanoseconds. + Weight::from_ref_time(23_838_238 as u64) + // Standard Error: 3_430 + .saturating_add(Weight::from_ref_time(628_138 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(38_404_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_169_000 as u64).saturating_mul(s as u64)) + // Minimum execution time: 19_761 nanoseconds. + Weight::from_ref_time(22_583_852 as u64) + // Standard Error: 2_440 + .saturating_add(Weight::from_ref_time(612_208 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtimes/spiritnet/src/xcm_config.rs b/runtimes/spiritnet/src/xcm_config.rs index cac6040fb..96b27c102 100644 --- a/runtimes/spiritnet/src/xcm_config.rs +++ b/runtimes/spiritnet/src/xcm_config.rs @@ -17,8 +17,8 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, Treasury, - WeightToFee, XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, + RuntimeOrigin, Treasury, WeightToFee, XcmpQueue, }; use frame_support::{ @@ -36,7 +36,7 @@ use xcm_executor::XcmExecutor; use runtime_common::xcm_config::{LocalAssetTransactor, MaxInstructions, RelayLocation, UnitWeightCost, XcmBarrier}; parameter_types! { - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayNetworkId: NetworkId = NetworkId::Kusama; } @@ -46,25 +46,25 @@ parameter_types! { /// `Transact`. There is an `OriginKind` which can bias the kind of local /// `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( - // We don't include `SovereignSignedViaLocation` since we don't want to allow other - // chains to manage accounts on our network. + // We don't include `SovereignSignedViaLocation` since we don't want to allow + // other chains to manage accounts on our network. // Native converter for Relay-chain (Parent) location which converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains which converts to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter which just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + // `RuntimeOrigin::signed` origin of the same 32-byte value. + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; // How we send Xcm messages. type XcmSender = XcmRouter; // How to withdraw and deposit an asset. @@ -83,7 +83,7 @@ impl xcm_executor::Config for XcmConfig { type Barrier = XcmBarrier; // How XCM messages are weighted. Each transaction has a weight of // `UnitWeightCost`. - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; // How weight is transformed into fees. The fees are not taken out of the // Balances pallet here. Balances is only used if fees are dropped without being // used. In that case they are put into the treasury. @@ -98,7 +98,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into /// the right message queues. @@ -110,20 +110,20 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; // Disable dispatchable execution on the XCM pallet. // NOTE: For local testing this needs to be `Everything`. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // Our latest supported XCM version. @@ -131,6 +131,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/runtimes/standalone/Cargo.toml b/runtimes/standalone/Cargo.toml index 279a5f8f3..ff201f466 100644 --- a/runtimes/standalone/Cargo.toml +++ b/runtimes/standalone/Cargo.toml @@ -39,7 +39,6 @@ kilt-runtime-api-public-credentials.workspace = true pallet-transaction-payment-rpc-runtime-api.workspace = true # Substrate dependencies -frame-benchmarking.workspace = true frame-executive.workspace = true frame-support.workspace = true frame-system.workspace = true @@ -68,6 +67,7 @@ sp-transaction-pool.workspace = true sp-version.workspace = true # Benchmarking dependencies +frame-benchmarking = {workspace = true, optional = true} frame-system-benchmarking = {workspace = true, optional = true} # Runtime tests @@ -83,21 +83,23 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "hex-literal", "runtime-common/runtime-benchmarks", "kilt-support/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-did-lookup/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", "pallet-indices/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-web3-names/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", "public-credentials/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] std = [ - "frame-benchmarking/std", + "frame-benchmarking?/std", "attestation/std", "codec/std", "ctype/std", @@ -106,8 +108,9 @@ std = [ "frame-executive/std", "frame-support/std", "frame-system/std", + "frame-system-benchmarking?/std", "frame-system-rpc-runtime-api/std", - "frame-try-runtime/std", + "frame-try-runtime?/std", "kilt-runtime-api-did/std", "kilt-runtime-api-public-credentials/std", "kilt-support/std", @@ -125,6 +128,7 @@ std = [ "pallet-timestamp/std", "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-utility/std", "pallet-web3-names/std", "public-credentials/std", "runtime-common/std", @@ -150,6 +154,7 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "frame-try-runtime", + "kilt-support/try-runtime", "pallet-aura/try-runtime", "pallet-authorship/try-runtime", "pallet-balances/try-runtime", @@ -165,4 +170,5 @@ try-runtime = [ "pallet-utility/try-runtime", "pallet-transaction-payment/try-runtime", "public-credentials/try-runtime", + "runtime-common/try-runtime", ] diff --git a/runtimes/standalone/src/lib.rs b/runtimes/standalone/src/lib.rs index 8cfc60631..282010299 100644 --- a/runtimes/standalone/src/lib.rs +++ b/runtimes/standalone/src/lib.rs @@ -154,7 +154,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in /// dispatchers. type Lookup = AccountIdLookup; @@ -169,9 +169,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest /// pruned first). type BlockHashCount = BlockHashCount; @@ -210,8 +210,7 @@ impl pallet_aura::Config for Runtime { } impl pallet_grandpa::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; type KeyOwnerProofSystem = (); @@ -243,7 +242,7 @@ impl pallet_indices::Config for Runtime { type AccountIndex = Index; type Currency = Balances; type Deposit = constants::IndicesDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } @@ -260,7 +259,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -274,7 +273,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = CurrencyAdapter>; type OperationalFeeMultiplier = constants::fee::OperationalFeeMultiplier; type WeightToFee = IdentityFee; @@ -283,8 +282,8 @@ impl pallet_transaction_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; } parameter_types! { @@ -295,7 +294,7 @@ parameter_types! { impl attestation::Config for Runtime { type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type Currency = Balances; type Deposit = AttestationDeposit; @@ -330,7 +329,7 @@ impl delegation::Config for Runtime { type DelegationNodeId = Hash; type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxSignatureByteLength = MaxSignatureByteLength; type MaxParentChecks = MaxParentChecks; type MaxRevocations = MaxRevocations; @@ -353,7 +352,7 @@ impl ctype::Config for Runtime { type CtypeCreatorId = DidIdentifier; type EnsureOrigin = did::EnsureDidOrigin; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } @@ -380,9 +379,9 @@ parameter_types! { impl did::Config for Runtime { type DidIdentifier = DidIdentifier; - type Event = Event; - type Call = Call; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type RuntimeOrigin = RuntimeOrigin; type Currency = Balances; type Deposit = DidDeposit; type Fee = DidFee; @@ -412,7 +411,7 @@ impl did::Config for Runtime { } impl pallet_did_lookup::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DidIdentifier = DidIdentifier; @@ -431,7 +430,7 @@ impl pallet_web3_names::Config for Runtime { type OriginSuccess = did::DidRawOrigin; type Currency = Balances; type Deposit = constants::web3_names::Web3NameDeposit; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxNameLength = constants::web3_names::MaxNameLength; type MinNameLength = constants::web3_names::MinNameLength; type Web3Name = pallet_web3_names::web3_name::AsciiWeb3Name; @@ -445,7 +444,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type ValidatorIdOf = (); type ShouldEndSession = pallet_session::PeriodicSessions; @@ -468,8 +467,8 @@ impl pallet_authorship::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = (); } @@ -488,7 +487,7 @@ impl public_credentials::Config for Runtime { type MaxEncodedClaimsLength = runtime_common::constants::public_credentials::MaxEncodedClaimsLength; type MaxSubjectIdLength = runtime_common::constants::public_credentials::MaxSubjectIdLength; type OriginSuccess = did::DidRawOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SubjectId = runtime_common::assets::AssetDid; type WeightInfo = (); } @@ -515,37 +514,37 @@ impl Default for ProxyType { } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::NonTransfer => matches!( c, - Call::Attestation(..) - | Call::Authorship(..) + RuntimeCall::Attestation(..) + | RuntimeCall::Authorship(..) // Excludes `Balances` - | Call::Ctype(..) - | Call::Delegation(..) - | Call::Did(..) - | Call::DidLookup(..) - | Call::Indices( + | RuntimeCall::Ctype(..) + | RuntimeCall::Delegation(..) + | RuntimeCall::Did(..) + | RuntimeCall::DidLookup(..) + | RuntimeCall::Indices( // Excludes `force_transfer`, and `transfer` pallet_indices::Call::claim { .. } | pallet_indices::Call::free { .. } | pallet_indices::Call::freeze { .. } ) - | Call::Proxy(..) - | Call::PublicCredentials(..) - | Call::Session(..) + | RuntimeCall::Proxy(..) + | RuntimeCall::PublicCredentials(..) + | RuntimeCall::Session(..) // Excludes `Sudo` - | Call::System(..) - | Call::Timestamp(..) - | Call::Utility(..) - | Call::Web3Names(..), + | RuntimeCall::System(..) + | RuntimeCall::Timestamp(..) + | RuntimeCall::Utility(..) + | RuntimeCall::Web3Names(..), ), ProxyType::NonDepositClaiming => matches!( c, - Call::Attestation( + RuntimeCall::Attestation( // Excludes `reclaim_deposit` attestation::Call::add { .. } | attestation::Call::remove { .. } @@ -553,10 +552,10 @@ impl InstanceFilter for ProxyType { | attestation::Call::change_deposit_owner { .. } | attestation::Call::update_deposit { .. } ) - | Call::Authorship(..) + | RuntimeCall::Authorship(..) // Excludes `Balances` - | Call::Ctype(..) - | Call::Delegation( + | RuntimeCall::Ctype(..) + | RuntimeCall::Delegation( // Excludes `reclaim_deposit` delegation::Call::add_delegation { .. } | delegation::Call::create_hierarchy { .. } @@ -565,7 +564,7 @@ impl InstanceFilter for ProxyType { | delegation::Call::update_deposit { .. } | delegation::Call::change_deposit_owner { .. } ) - | Call::Did( + | RuntimeCall::Did( // Excludes `reclaim_deposit` did::Call::add_key_agreement_key { .. } | did::Call::add_service_endpoint { .. } @@ -582,7 +581,7 @@ impl InstanceFilter for ProxyType { | did::Call::update_deposit { .. } | did::Call::change_deposit_owner { .. } ) - | Call::DidLookup( + | RuntimeCall::DidLookup( // Excludes `reclaim_deposit` pallet_did_lookup::Call::associate_account { .. } | pallet_did_lookup::Call::associate_sender { .. } @@ -591,9 +590,9 @@ impl InstanceFilter for ProxyType { | pallet_did_lookup::Call::update_deposit { .. } | pallet_did_lookup::Call::change_deposit_owner { .. } ) - | Call::Indices(..) - | Call::Proxy(..) - | Call::PublicCredentials( + | RuntimeCall::Indices(..) + | RuntimeCall::Proxy(..) + | RuntimeCall::PublicCredentials( // Excludes `reclaim_deposit` public_credentials::Call::add { .. } | public_credentials::Call::revoke { .. } @@ -602,12 +601,12 @@ impl InstanceFilter for ProxyType { | public_credentials::Call::update_deposit { .. } | public_credentials::Call::change_deposit_owner { .. } ) - | Call::Session(..) + | RuntimeCall::Session(..) // Excludes `Sudo` - | Call::System(..) - | Call::Timestamp(..) - | Call::Utility(..) - | Call::Web3Names( + | RuntimeCall::System(..) + | RuntimeCall::Timestamp(..) + | RuntimeCall::Utility(..) + | RuntimeCall::Web3Names( // Excludes `ban`, and `reclaim_deposit` pallet_web3_names::Call::claim { .. } | pallet_web3_names::Call::release_by_owner { .. } @@ -616,7 +615,7 @@ impl InstanceFilter for ProxyType { | pallet_web3_names::Call::change_deposit_owner { .. } ), ), - ProxyType::CancelProxy => matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })), + ProxyType::CancelProxy => matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })), } } @@ -640,8 +639,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = constants::proxy::ProxyDepositBase; @@ -702,9 +701,9 @@ construct_runtime!( } ); -impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { +impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall { fn derive_verification_key_relationship(&self) -> did::DeriveDidCallKeyRelationshipResult { - fn single_key_relationship(calls: &[Call]) -> did::DeriveDidCallKeyRelationshipResult { + fn single_key_relationship(calls: &[RuntimeCall]) -> did::DeriveDidCallKeyRelationshipResult { let init = calls .get(0) .ok_or(did::RelationshipDeriveError::InvalidCallParameter)? @@ -712,7 +711,7 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { calls .iter() .skip(1) - .map(Call::derive_verification_key_relationship) + .map(RuntimeCall::derive_verification_key_relationship) .try_fold(init, |acc, next| { if Ok(acc) == next { Ok(acc) @@ -722,18 +721,18 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { }) } match self { - Call::Attestation { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Ctype { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Delegation { .. } => Ok(did::DidVerificationKeyRelationship::CapabilityDelegation), + RuntimeCall::Attestation { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Ctype { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Delegation { .. } => Ok(did::DidVerificationKeyRelationship::CapabilityDelegation), // DID creation is not allowed through the DID proxy. - Call::Did(did::Call::create { .. }) => Err(did::RelationshipDeriveError::NotCallableByDid), - Call::Did { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::Web3Names { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::DidLookup { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), - Call::PublicCredentials { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), - Call::Utility(pallet_utility::Call::batch { calls }) => single_key_relationship(&calls[..]), - Call::Utility(pallet_utility::Call::batch_all { calls }) => single_key_relationship(&calls[..]), - Call::Utility(pallet_utility::Call::force_batch { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Did(did::Call::create { .. }) => Err(did::RelationshipDeriveError::NotCallableByDid), + RuntimeCall::Did { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::Web3Names { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::DidLookup { .. } => Ok(did::DidVerificationKeyRelationship::Authentication), + RuntimeCall::PublicCredentials { .. } => Ok(did::DidVerificationKeyRelationship::AssertionMethod), + RuntimeCall::Utility(pallet_utility::Call::batch { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => single_key_relationship(&calls[..]), + RuntimeCall::Utility(pallet_utility::Call::force_batch { calls }) => single_key_relationship(&calls[..]), #[cfg(not(feature = "runtime-benchmarks"))] _ => Err(did::RelationshipDeriveError::NotCallableByDid), // By default, returns the authentication key @@ -745,7 +744,7 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for Call { // Always return a System::remark() extrinsic call #[cfg(feature = "runtime-benchmarks")] fn get_call_for_did_call_benchmark() -> Self { - Call::System(frame_system::Call::remark { remark: vec![] }) + RuntimeCall::System(frame_system::Call::remark { remark: vec![] }) } } @@ -771,15 +770,43 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various Pallets. pub type Executive = frame_executive::Executive, Runtime, AllPalletsWithSystem, ()>; +// follows Substrate's non destructive way of eliminating otherwise required +// repetion: https://github.com/paritytech/substrate/pull/10592 +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + // KILT + [attestation, Attestation] + [ctype, Ctype] + [delegation, Delegation] + [did, Did] + [pallet_did_lookup, DidLookup] + [pallet_web3_names, Web3Names] + [public_credentials, PublicCredentials] + // Substrate + [frame_benchmarking::baseline, Baseline::] + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_indices, Indices] + [pallet_timestamp, Timestamp] + [pallet_utility, Utility] + [pallet_proxy, Proxy] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -820,6 +847,23 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { Executive::apply_extrinsic(extrinsic) @@ -1018,48 +1062,35 @@ impl_runtime_apis! { } } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList}; + use frame_benchmarking::{Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; - use baseline::Pallet as BaselineBench; + use frame_benchmarking::baseline::Pallet as Baseline; let mut list = Vec::::new(); - - list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); - list_benchmark!(list, extra, frame_system, SystemBench::); - list_benchmark!(list, extra, pallet_balances, Balances); - list_benchmark!(list, extra, pallet_timestamp, Timestamp); - - list_benchmark!(list, extra, frame_system, SystemBench::); - list_benchmark!(list, extra, pallet_balances, Balances); - list_benchmark!(list, extra, pallet_timestamp, Timestamp); - - list_benchmark!(list, extra, did, Did); - list_benchmark!(list, extra, ctype, Ctype); - list_benchmark!(list, extra, delegation, Delegation); - list_benchmark!(list, extra, attestation, Attestation); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); - (list, storage_info) } fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - - use baseline::Pallet as BaselineBench; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use frame_benchmarking::baseline::Pallet as Baseline; impl frame_system_benchmarking::Config for Runtime {} - impl baseline::Config for Runtime {} + impl frame_benchmarking::baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -1082,21 +1113,14 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - - add_benchmark!(params, batches, did, Did); - add_benchmark!(params, batches, ctype, Ctype); - add_benchmark!(params, batches, delegation, Delegation); - add_benchmark!(params, batches, attestation, Attestation); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) } } + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { diff --git a/support/src/mock.rs b/support/src/mock.rs index 14f79b58c..9082728d0 100644 --- a/support/src/mock.rs +++ b/support/src/mock.rs @@ -40,7 +40,7 @@ pub mod mock_origin { #[pallet::config] pub trait Config: frame_system::Config { - type Origin: From>; + type RuntimeOrigin: From>; type AccountId: Parameter; type SubjectId: Parameter; }