From 29a3125ba00ad4e48cdd9142c0248cb30f3914f7 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 15 Feb 2023 09:54:17 +0100 Subject: [PATCH 01/32] Fellowship into Collectives --- Cargo.lock | 636 +++++++++--------- Cargo.toml | 331 +++++++++ .../runtimes/assets/statemint/src/lib.rs | 26 +- .../collectives-polkadot/Cargo.toml | 17 + .../collectives-polkadot/src/constants.rs | 9 +- .../src/fellowship/mod.rs | 150 +++++ .../src/fellowship/origins.rs | 148 ++++ .../src/fellowship/tracks.rs | 299 ++++++++ .../collectives-polkadot/src/impls.rs | 68 +- .../collectives-polkadot/src/lib.rs | 70 +- 10 files changed, 1411 insertions(+), 343 deletions(-) create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs diff --git a/Cargo.lock b/Cargo.lock index 201e21cb3a4..d9fc4a76050 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,6 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -508,7 +507,6 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "beefy-gadget", "futures", @@ -527,7 +525,6 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "hash-db", "log", @@ -693,9 +690,9 @@ dependencies = [ [[package]] name = "bounded-vec" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3372be4090bf9d4da36bd8ba7ce6ca1669503d0cf6e667236c6df7f053153eb6" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" dependencies = [ "thiserror", ] @@ -1291,7 +1288,11 @@ dependencies = [ "pallet-collator-selection", "pallet-collective", "pallet-multisig", + "pallet-preimage", "pallet-proxy", + "pallet-ranked-collective", + "pallet-referenda", + "pallet-scheduler", "pallet-session", "pallet-timestamp", "pallet-transaction-payment", @@ -1308,6 +1309,7 @@ dependencies = [ "scale-info", "smallvec", "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-core", @@ -1487,8 +1489,7 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3d54eab028f5805ae3b26fd60eca3f3a9cfb76b989d9bab173be3f61356cc3" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cranelift-entity", ] @@ -1496,8 +1497,7 @@ dependencies = [ [[package]] name = "cranelift-codegen" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be1d5f2c3cca1efb691844bc1988b89c77291f13f778499a3f3c0cf49c0ed61" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "arrayvec 0.7.2", "bumpalo", @@ -1517,8 +1517,7 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9b1b1089750ce4005893af7ee00bb08a2cf1c9779999c0f7164cbc8ad2e0d2" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cranelift-codegen-shared", ] @@ -1526,14 +1525,12 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5fbaec51de47297fd7304986fd53c8c0030abbe69728a60d72e1c63559318d" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" [[package]] name = "cranelift-entity" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab984c94593f876090fae92e984bdcc74d9b1acf740ab5f79036001c65cba13" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "serde", ] @@ -1541,8 +1538,7 @@ dependencies = [ [[package]] name = "cranelift-frontend" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0cb3102d21a2fe5f3210af608748ddd0cd09825ac12d42dc56ed5ed8725fe0" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cranelift-codegen", "log", @@ -1553,14 +1549,12 @@ dependencies = [ [[package]] name = "cranelift-isle" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72101dd1f441d629735143c41e00b3428f9267738176983ef588ff43382af0a0" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" [[package]] name = "cranelift-native" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22b0d9fcbe3fc5a1af9e7021b44ce42b930bcefac446ce22e02e8f9a0d67120" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cranelift-codegen", "libc", @@ -1570,8 +1564,7 @@ dependencies = [ [[package]] name = "cranelift-wasm" version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddebe32fb14fbfd9efa5f130ffb8f4665795de019928dcd7247b136c46f9249" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -3231,7 +3224,6 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", ] @@ -3247,14 +3239,13 @@ dependencies = [ [[package]] name = "fragile" -version = "1.2.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85dcb89d2b10c5f6133de2efd8c11959ce9dbb46a2f7a4cab208c4eeda6ce1ab" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-support-procedural", @@ -3279,7 +3270,6 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "Inflector", "array-bytes 4.2.0", @@ -3326,7 +3316,6 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3337,7 +3326,6 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3354,7 +3342,6 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -3383,7 +3370,6 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "log", @@ -3399,7 +3385,6 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "bitflags", "frame-metadata", @@ -3431,7 +3416,6 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "Inflector", "cfg-expr", @@ -3446,7 +3430,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -3458,7 +3441,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro2", "quote", @@ -3468,7 +3450,6 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "log", @@ -3486,7 +3467,6 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -3501,7 +3481,6 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "sp-api", @@ -3510,7 +3489,6 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "parity-scale-codec", @@ -4443,7 +4421,6 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kusama-runtime" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "frame-benchmarking", @@ -4540,7 +4517,6 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-support", "polkadot-primitives", @@ -5377,7 +5353,6 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "log", @@ -5396,7 +5371,6 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "anyhow", "jsonrpsee", @@ -5411,9 +5385,9 @@ dependencies = [ [[package]] name = "mockall" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2be9a9090bc1cac2930688fa9478092a64c6a92ddc6ae0692d46b37d9cab709" +checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" dependencies = [ "cfg-if", "downcast", @@ -5426,9 +5400,9 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d702a0530a0141cf4ed147cf5ec7be6f2c187d4e37fcbefc39cf34116bfe8f" +checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" dependencies = [ "cfg-if", "proc-macro2", @@ -5894,7 +5868,6 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "frame-benchmarking", @@ -5915,7 +5888,6 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -5933,7 +5905,6 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -5948,7 +5919,6 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -5964,7 +5934,6 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -5980,7 +5949,6 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -5994,7 +5962,6 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6018,7 +5985,6 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6038,7 +6004,6 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6053,7 +6018,6 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6069,7 +6033,6 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "binary-merkle-tree", @@ -6093,7 +6056,6 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6111,7 +6073,6 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6155,7 +6116,6 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6172,7 +6132,6 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "bitflags", "frame-benchmarking", @@ -6201,7 +6160,6 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "bitflags", "parity-scale-codec", @@ -6214,7 +6172,6 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro2", "quote", @@ -6224,7 +6181,6 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6241,7 +6197,6 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6259,7 +6214,6 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6282,7 +6236,6 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6295,7 +6248,6 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6313,7 +6265,6 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6331,7 +6282,6 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6354,7 +6304,6 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6370,7 +6319,6 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6390,7 +6338,6 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6407,7 +6354,6 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6421,7 +6367,6 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6438,7 +6383,6 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6455,7 +6399,6 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6471,7 +6414,6 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6481,6 +6423,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core", + "sp-io", "sp-runtime", "sp-std", ] @@ -6488,7 +6431,6 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6504,7 +6446,6 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6521,7 +6462,6 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6541,7 +6481,6 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "sp-api", @@ -6551,7 +6490,6 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6568,7 +6506,6 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6592,7 +6529,6 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6609,7 +6545,6 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6624,7 +6559,6 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6642,7 +6576,6 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6657,7 +6590,6 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6676,7 +6608,6 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6693,7 +6624,6 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6714,7 +6644,6 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6730,7 +6659,6 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6744,7 +6672,6 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6767,7 +6694,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6778,7 +6704,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "log", "sp-arithmetic", @@ -6787,7 +6712,6 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6804,7 +6728,6 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6833,7 +6756,6 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6851,7 +6773,6 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6870,7 +6791,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-support", "frame-system", @@ -6886,7 +6806,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6902,7 +6821,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6914,7 +6832,6 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6931,7 +6848,6 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6946,7 +6862,6 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6962,7 +6877,6 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6977,7 +6891,6 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-benchmarking", "frame-support", @@ -6992,8 +6905,8 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ + "bounded-collections", "frame-benchmarking", "frame-support", "frame-system", @@ -7012,7 +6925,6 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-benchmarking", "frame-support", @@ -7548,7 +7460,6 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "polkadot-node-metrics", @@ -7563,7 +7474,6 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -7577,7 +7487,6 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "derive_more", "fatality", @@ -7600,7 +7509,6 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "fatality", "futures", @@ -7621,7 +7529,6 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "clap 4.1.4", "frame-benchmarking-cli", @@ -7649,7 +7556,6 @@ dependencies = [ [[package]] name = "polkadot-client" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "frame-benchmarking", @@ -7692,7 +7598,6 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "always-assert", "bitvec", @@ -7714,7 +7619,6 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -7726,7 +7630,6 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "derive_more", "fatality", @@ -7751,7 +7654,6 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -7765,7 +7667,6 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "futures-timer", @@ -7785,7 +7686,6 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "always-assert", "async-trait", @@ -7809,7 +7709,6 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "parity-scale-codec", @@ -7827,7 +7726,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "derive_more", @@ -7856,7 +7754,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "futures", @@ -7869,6 +7766,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", + "sp-consensus", "thiserror", "tracing-gum", ] @@ -7876,7 +7774,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "fatality", @@ -7895,7 +7792,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "polkadot-node-subsystem", @@ -7910,7 +7806,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "futures", @@ -7929,7 +7824,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "polkadot-node-metrics", @@ -7944,7 +7838,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "futures-timer", @@ -7961,7 +7854,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "fatality", "futures", @@ -7980,7 +7872,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "futures", @@ -7997,7 +7888,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "fatality", @@ -8015,7 +7905,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "always-assert", "assert_matches", @@ -8049,7 +7938,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "polkadot-node-primitives", @@ -8065,7 +7953,6 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "futures", "lru 0.9.0", @@ -8080,7 +7967,6 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "lazy_static", "log", @@ -8098,7 +7984,6 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bs58", "futures", @@ -8117,7 +8002,6 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "derive_more", @@ -8140,7 +8024,6 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bounded-vec", "futures", @@ -8162,7 +8045,6 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -8172,7 +8054,6 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "futures", @@ -8190,7 +8071,6 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "derive_more", @@ -8213,7 +8093,6 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "derive_more", @@ -8246,7 +8125,6 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "futures", @@ -8269,7 +8147,6 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "derive_more", "frame-support", @@ -8367,7 +8244,6 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -8382,7 +8258,6 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "hex-literal", @@ -8408,7 +8283,6 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -8440,7 +8314,6 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "frame-benchmarking", @@ -8461,6 +8334,7 @@ dependencies = [ "pallet-bounties", "pallet-child-bounties", "pallet-collective", + "pallet-conviction-voting", "pallet-democracy", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", @@ -8479,6 +8353,8 @@ dependencies = [ "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", + "pallet-ranked-collective", + "pallet-referenda", "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", @@ -8491,6 +8367,7 @@ dependencies = [ "pallet-treasury", "pallet-utility", "pallet-vesting", + "pallet-whitelist", "pallet-xcm", "parity-scale-codec", "polkadot-primitives", @@ -8503,6 +8380,7 @@ dependencies = [ "serde_derive", "smallvec", "sp-api", + "sp-arithmetic", "sp-authority-discovery", "sp-beefy", "sp-block-builder", @@ -8529,7 +8407,6 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "frame-benchmarking", @@ -8541,7 +8418,6 @@ dependencies = [ "log", "pallet-authorship", "pallet-babe", - "pallet-bags-list", "pallet-balances", "pallet-beefy-mmr", "pallet-election-provider-multi-phase", @@ -8578,7 +8454,6 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-support", "polkadot-primitives", @@ -8592,7 +8467,6 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bs58", "parity-scale-codec", @@ -8604,7 +8478,6 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitflags", "bitvec", @@ -8647,7 +8520,6 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "async-trait", "beefy-gadget", @@ -8756,7 +8628,6 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -8777,7 +8648,6 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -8787,7 +8657,6 @@ dependencies = [ [[package]] name = "polkadot-test-client" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "parity-scale-codec", "polkadot-node-subsystem", @@ -8812,7 +8681,6 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "frame-election-provider-support", @@ -8873,7 +8741,6 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-benchmarking", "frame-system", @@ -9588,7 +9455,6 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -9674,7 +9540,6 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-support", "polkadot-primitives", @@ -9893,7 +9758,6 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "log", "sp-core", @@ -9904,7 +9768,6 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -9931,7 +9794,6 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "futures-timer", @@ -9954,7 +9816,6 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -9970,7 +9831,6 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -9985,7 +9845,6 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9996,7 +9855,6 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "chrono", @@ -10036,7 +9894,6 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "fnv", "futures", @@ -10062,7 +9919,6 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "hash-db", "kvdb", @@ -10088,7 +9944,6 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -10113,7 +9968,6 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -10142,7 +9996,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "fork-tree", @@ -10181,7 +10034,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "jsonrpsee", @@ -10203,7 +10055,6 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "fork-tree", "parity-scale-codec", @@ -10216,7 +10067,6 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -10239,7 +10089,6 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "lru 0.8.1", "parity-scale-codec", @@ -10263,7 +10112,6 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -10276,7 +10124,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "log", "sc-allocator", @@ -10289,7 +10136,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "anyhow", "cfg-if", @@ -10307,7 +10153,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ahash 0.8.2", "array-bytes 4.2.0", @@ -10347,7 +10192,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "finality-grandpa", "futures", @@ -10367,7 +10211,6 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ansi_term", "futures", @@ -10382,7 +10225,6 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10397,7 +10239,6 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10412,6 +10253,7 @@ dependencies = [ "libp2p", "log", "lru 0.8.1", + "mockall", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", @@ -10439,7 +10281,6 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "cid", "futures", @@ -10458,7 +10299,6 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "bitflags", @@ -10484,7 +10324,6 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ahash 0.8.2", "futures", @@ -10502,7 +10341,6 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10523,7 +10361,6 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10555,7 +10392,6 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10574,7 +10410,6 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "bytes", @@ -10604,7 +10439,6 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "libp2p", @@ -10617,7 +10451,6 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10626,7 +10459,6 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "jsonrpsee", @@ -10656,7 +10488,6 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10675,7 +10506,6 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "http", "jsonrpsee", @@ -10690,7 +10520,6 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10716,7 +10545,6 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "directories", @@ -10782,7 +10610,6 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "log", "parity-scale-codec", @@ -10793,7 +10620,6 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "clap 4.1.4", "futures", @@ -10809,7 +10635,6 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10828,7 +10653,6 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "libc", @@ -10847,7 +10671,6 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "chrono", "futures", @@ -10866,7 +10689,6 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ansi_term", "atty", @@ -10897,7 +10719,6 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10908,7 +10729,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -10935,7 +10755,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -10949,7 +10768,6 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "backtrace", "futures", @@ -11399,7 +11217,6 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "enumn", "parity-scale-codec", @@ -11476,7 +11293,6 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "hash-db", "log", @@ -11494,7 +11310,6 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "blake2", "proc-macro-crate", @@ -11506,7 +11321,6 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -11519,7 +11333,6 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "integer-sqrt", "num-traits", @@ -11533,7 +11346,6 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -11546,7 +11358,6 @@ dependencies = [ [[package]] name = "sp-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "lazy_static", "parity-scale-codec", @@ -11565,7 +11376,6 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "sp-api", @@ -11577,7 +11387,6 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "log", @@ -11595,7 +11404,6 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -11613,7 +11421,6 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "parity-scale-codec", @@ -11631,7 +11438,6 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "merlin", @@ -11654,7 +11460,6 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -11666,7 +11471,6 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -11679,7 +11483,6 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "base58", @@ -11722,7 +11525,6 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "blake2", "byteorder", @@ -11736,7 +11538,6 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro2", "quote", @@ -11747,7 +11548,6 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11756,7 +11556,6 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro2", "quote", @@ -11766,7 +11565,6 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "environmental", "parity-scale-codec", @@ -11777,7 +11575,6 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "finality-grandpa", "log", @@ -11795,7 +11592,6 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11810,7 +11606,6 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "bytes", "ed25519", @@ -11835,7 +11630,6 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "lazy_static", "sp-core", @@ -11846,7 +11640,6 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures", @@ -11863,7 +11656,6 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "thiserror", "zstd", @@ -11872,7 +11664,6 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -11890,7 +11681,6 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -11904,7 +11694,6 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "sp-api", "sp-core", @@ -11914,7 +11703,6 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "backtrace", "lazy_static", @@ -11924,7 +11712,6 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "rustc-hash", "serde", @@ -11934,7 +11721,6 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "either", "hash256-std-hasher", @@ -11956,7 +11742,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11974,7 +11759,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "Inflector", "proc-macro-crate", @@ -11986,7 +11770,6 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "serde", "serde_json", @@ -11995,7 +11778,6 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -12009,7 +11791,6 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -12021,7 +11802,6 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "hash-db", "log", @@ -12041,12 +11821,10 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12059,7 +11837,6 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "futures-timer", @@ -12074,7 +11851,6 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "sp-std", @@ -12086,7 +11862,6 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "sp-api", "sp-runtime", @@ -12095,7 +11870,6 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "log", @@ -12111,7 +11885,6 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ahash 0.8.2", "hash-db", @@ -12134,7 +11907,6 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12151,7 +11923,6 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -12162,7 +11933,6 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -12176,7 +11946,6 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "parity-scale-codec", "scale-info", @@ -12484,7 +12253,6 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "platforms", ] @@ -12492,7 +12260,6 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -12511,7 +12278,6 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "hyper", "log", @@ -12523,7 +12289,6 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "async-trait", "jsonrpsee", @@ -12536,7 +12301,6 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "jsonrpsee", "log", @@ -12555,7 +12319,6 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -12581,7 +12344,6 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "futures", "substrate-test-utils-derive", @@ -12591,7 +12353,6 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12602,7 +12363,6 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "ansi_term", "build-helper", @@ -12719,7 +12479,6 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-runtime-constants" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-support", "polkadot-primitives", @@ -13110,7 +12869,6 @@ dependencies = [ [[package]] name = "tracing-gum" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -13121,7 +12879,6 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -13251,7 +13008,6 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3d60070c1373bc0383aa4f003a5b243c4c4f7118" dependencies = [ "clap 4.1.4", "frame-remote-externalities", @@ -13732,8 +13488,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5b183a159484980138cc05231419c536d395a7b25c1802091310ea2f74276a" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "anyhow", "bincode", @@ -13760,8 +13515,7 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb1cb256d76cf07b20264c808351c8b525ece56de1ef4d93f87a0aaf342db" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cfg-if", ] @@ -13769,8 +13523,7 @@ dependencies = [ [[package]] name = "wasmtime-cache" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830570847f905b8f6d2ca635c33cf42ce701dd8e4abd7d1806c631f8f06e9e4b" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "anyhow", "base64", @@ -13789,8 +13542,7 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7695d3814dcb508bf4d1c181a86ea6b97a209f6444478e95d86e2ffab8d1a3" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "anyhow", "cranelift-codegen", @@ -13810,8 +13562,7 @@ dependencies = [ [[package]] name = "wasmtime-environ" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a2a5f0fb93aa837a727a48dd1076e8a9f882cc2fee20b433c04a18740ff63b" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "anyhow", "cranelift-entity", @@ -13829,8 +13580,7 @@ dependencies = [ [[package]] name = "wasmtime-jit" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c78f9fb2922dbb5a95f009539d4badb44866caeeb53d156bf2cf4d683c3afd" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "addr2line 0.17.0", "anyhow", @@ -13853,8 +13603,7 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cacdb52a77b8c8e744e510beeabf0bd698b1c94c59eed33c52b3fbd19639b0" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "object 0.29.0", "once_cell", @@ -13864,8 +13613,7 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08fcba5ebd96da2a9f0747ab6337fe9788adfb3f63fa2c180520d665562d257e" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cfg-if", "libc", @@ -13875,8 +13623,7 @@ dependencies = [ [[package]] name = "wasmtime-runtime" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0793210acf50d4c69182c916abaee1d423dc5d172cdfde6acfea2f9446725940" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "anyhow", "cc", @@ -13899,8 +13646,7 @@ dependencies = [ [[package]] name = "wasmtime-types" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d015ba8b231248a811e323cf7a525cd3f982d4be0b9e62d27685102e5f12b1" +source = "git+https://github.com/paritytech/wasmtime.git?branch=v5.0.0_lto_fix#8a02705ad378108e43abe23c538688adf73f3b71" dependencies = [ "cranelift-entity", "serde", @@ -14171,7 +13917,6 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "bitvec", "frame-benchmarking", @@ -14262,7 +14007,6 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-support", "polkadot-primitives", @@ -14663,15 +14407,14 @@ dependencies = [ [[package]] name = "xcm" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ + "bounded-collections", "derivative", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", "sp-weights", "xcm-procedural", ] @@ -14679,7 +14422,6 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "frame-support", "frame-system", @@ -14700,7 +14442,6 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "environmental", "frame-benchmarking", @@ -14720,7 +14461,6 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?branch=master#81d265034770ffbce42780dc35ce8370bb8036ca" dependencies = [ "Inflector", "proc-macro2", @@ -14800,3 +14540,295 @@ dependencies = [ "cc", "libc", ] + +[[patch.unused]] +name = "polkadot" +version = "0.9.37" + +[[patch.unused]] +name = "polkadot-primitives-test-helpers" +version = "0.9.37" + +[[patch.unused]] +name = "polkadot-test-malus" +version = "0.9.37" + +[[patch.unused]] +name = "polkadot-voter-bags" +version = "0.9.37" + +[[patch.unused]] +name = "remote-ext-tests-bags-list" +version = "0.9.37" + +[[patch.unused]] +name = "staking-miner" +version = "0.9.37" + +[[patch.unused]] +name = "test-parachain-adder" +version = "0.9.37" + +[[patch.unused]] +name = "test-parachain-adder-collator" +version = "0.9.37" + +[[patch.unused]] +name = "test-parachain-halt" +version = "0.9.37" + +[[patch.unused]] +name = "test-parachain-undying" +version = "0.9.37" + +[[patch.unused]] +name = "test-parachain-undying-collator" +version = "0.9.37" + +[[patch.unused]] +name = "test-parachains" +version = "0.9.37" + +[[patch.unused]] +name = "xcm-executor-integration-tests" +version = "0.9.37" + +[[patch.unused]] +name = "xcm-simulator" +version = "0.9.37" + +[[patch.unused]] +name = "xcm-simulator-example" +version = "0.9.37" + +[[patch.unused]] +name = "xcm-simulator-fuzzer" +version = "0.9.37" + +[[patch.unused]] +name = "zombienet-backchannel" +version = "0.9.37" + +[[patch.unused]] +name = "chain-spec-builder" +version = "2.0.0" + +[[patch.unused]] +name = "frame-benchmarking-pallet-pov" +version = "4.0.0-dev" + +[[patch.unused]] +name = "frame-election-solution-type-fuzzer" +version = "2.0.0-alpha.5" + +[[patch.unused]] +name = "frame-support-test" +version = "3.0.0" + +[[patch.unused]] +name = "frame-support-test-compile-pass" +version = "4.0.0-dev" + +[[patch.unused]] +name = "frame-support-test-pallet" +version = "4.0.0-dev" + +[[patch.unused]] +name = "generate-bags" +version = "4.0.0-dev" + +[[patch.unused]] +name = "kitchensink-runtime" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-bench" +version = "0.9.0-dev" + +[[patch.unused]] +name = "node-cli" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-executor" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-inspect" +version = "0.9.0-dev" + +[[patch.unused]] +name = "node-primitives" +version = "2.0.0" + +[[patch.unused]] +name = "node-rpc" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-runtime-generate-bags" +version = "3.0.0" + +[[patch.unused]] +name = "node-template" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-template-runtime" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-testing" +version = "3.0.0-dev" + +[[patch.unused]] +name = "pallet-atomic-swap" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-bags-list-fuzzer" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-bags-list-remote-tests" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-basic" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-offchain-worker" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-lottery" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-message-queue" +version = "7.0.0-dev" + +[[patch.unused]] +name = "pallet-nicks" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-node-authorization" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-nomination-pools-fuzzer" +version = "2.0.0" + +[[patch.unused]] +name = "pallet-nomination-pools-test-staking" +version = "1.0.0" + +[[patch.unused]] +name = "pallet-remark" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-root-offences" +version = "1.0.0-dev" + +[[patch.unused]] +name = "pallet-root-testing" +version = "1.0.0-dev" + +[[patch.unused]] +name = "pallet-scored-pool" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-template" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-transaction-storage" +version = "4.0.0-dev" + +[[patch.unused]] +name = "sc-consensus-manual-seal" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-consensus-pow" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-network-test" +version = "0.8.0" + +[[patch.unused]] +name = "sc-runtime-test" +version = "2.0.0" + +[[patch.unused]] +name = "sc-service-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-api-test" +version = "2.0.1" + +[[patch.unused]] +name = "sp-application-crypto-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-arithmetic-fuzzer" +version = "2.0.0" + +[[patch.unused]] +name = "sp-consensus-pow" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-npos-elections-fuzzer" +version = "2.0.0-alpha.5" + +[[patch.unused]] +name = "sp-runtime-interface-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-runtime-interface-test-wasm" +version = "2.0.0" + +[[patch.unused]] +name = "sp-runtime-interface-test-wasm-deprecated" +version = "2.0.0" + +[[patch.unused]] +name = "sp-test-primitives" +version = "2.0.0" + +[[patch.unused]] +name = "subkey" +version = "3.0.0" + +[[patch.unused]] +name = "substrate-frame-cli" +version = "4.0.0-dev" + +[[patch.unused]] +name = "substrate-frame-rpc-support" +version = "3.0.0" + +[[patch.unused]] +name = "substrate-test-runtime" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-runtime-client" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-runtime-transaction-pool" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-utils-test-crate" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index a4b817ffe87..e4531fc4815 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,3 +59,334 @@ opt-level = 3 inherits = "release" lto = true codegen-units = 1 + +[patch."https://github.com/paritytech/polkadot"] +polkadot-cli = { path = "/Users/mhau/projects/paritytech/polkadot/cli" } +polkadot-client = { path = "/Users/mhau/projects/paritytech/polkadot/node/client" } +kusama-runtime = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/kusama" } +kusama-runtime-constants = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/kusama/constants" } +polkadot-primitives = { path = "/Users/mhau/projects/paritytech/polkadot/primitives" } +polkadot-core-primitives = { path = "/Users/mhau/projects/paritytech/polkadot/core-primitives" } +polkadot-parachain = { path = "/Users/mhau/projects/paritytech/polkadot/parachain" } +polkadot-runtime-common = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/common" } +polkadot-runtime-parachains = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/parachains" } +polkadot-runtime-metrics = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/metrics" } +xcm = { path = "/Users/mhau/projects/paritytech/polkadot/xcm" } +xcm-procedural = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/procedural" } +xcm-executor = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/xcm-executor" } +polkadot-primitives-test-helpers = { path = "/Users/mhau/projects/paritytech/polkadot/primitives/test-helpers" } +slot-range-helper = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/common/slot_range_helper" } +pallet-xcm = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/pallet-xcm" } +xcm-builder = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/xcm-builder" } +pallet-xcm-benchmarks = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/pallet-xcm-benchmarks" } +polkadot-node-core-parachains-inherent = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/parachains-inherent" } +tracing-gum = { path = "/Users/mhau/projects/paritytech/polkadot/node/gum" } +tracing-gum-proc-macro = { path = "/Users/mhau/projects/paritytech/polkadot/node/gum/proc-macro" } +polkadot-node-jaeger = { path = "/Users/mhau/projects/paritytech/polkadot/node/jaeger" } +polkadot-node-primitives = { path = "/Users/mhau/projects/paritytech/polkadot/node/primitives" } +polkadot-erasure-coding = { path = "/Users/mhau/projects/paritytech/polkadot/erasure-coding" } +polkadot-node-subsystem = { path = "/Users/mhau/projects/paritytech/polkadot/node/subsystem" } +polkadot-node-subsystem-types = { path = "/Users/mhau/projects/paritytech/polkadot/node/subsystem-types" } +polkadot-node-network-protocol = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/protocol" } +polkadot-statement-table = { path = "/Users/mhau/projects/paritytech/polkadot/statement-table" } +polkadot-overseer = { path = "/Users/mhau/projects/paritytech/polkadot/node/overseer" } +polkadot-node-metrics = { path = "/Users/mhau/projects/paritytech/polkadot/node/metrics" } +polkadot-test-service = { path = "/Users/mhau/projects/paritytech/polkadot/node/test/service" } +polkadot-rpc = { path = "/Users/mhau/projects/paritytech/polkadot/rpc" } +polkadot-service = { path = "/Users/mhau/projects/paritytech/polkadot/node/service" } +polkadot-approval-distribution = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/approval-distribution" } +polkadot-node-subsystem-test-helpers = { path = "/Users/mhau/projects/paritytech/polkadot/node/subsystem-test-helpers" } +polkadot-node-subsystem-util = { path = "/Users/mhau/projects/paritytech/polkadot/node/subsystem-util" } +polkadot-availability-bitfield-distribution = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/bitfield-distribution" } +polkadot-availability-distribution = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/availability-distribution" } +polkadot-availability-recovery = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/availability-recovery" } +polkadot-collator-protocol = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/collator-protocol" } +polkadot-dispute-distribution = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/dispute-distribution" } +polkadot-gossip-support = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/gossip-support" } +polkadot-network-bridge = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/bridge" } +polkadot-node-collation-generation = { path = "/Users/mhau/projects/paritytech/polkadot/node/collation-generation" } +polkadot-node-core-approval-voting = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/approval-voting" } +polkadot-node-core-av-store = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/av-store" } +polkadot-node-core-backing = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/backing" } +polkadot-node-core-bitfield-signing = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/bitfield-signing" } +polkadot-node-core-candidate-validation = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/candidate-validation" } +polkadot-node-core-pvf = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/pvf" } +test-parachain-adder = { path = "/Users/mhau/projects/paritytech/polkadot/parachain/test-parachains/adder" } +test-parachain-halt = { path = "/Users/mhau/projects/paritytech/polkadot/parachain/test-parachains/halt" } +polkadot-node-core-chain-api = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/chain-api" } +polkadot-node-core-chain-selection = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/chain-selection" } +polkadot-node-core-dispute-coordinator = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/dispute-coordinator" } +polkadot-node-core-provisioner = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/provisioner" } +polkadot-node-core-pvf-checker = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/pvf-checker" } +polkadot-node-core-runtime-api = { path = "/Users/mhau/projects/paritytech/polkadot/node/core/runtime-api" } +polkadot-runtime = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/polkadot" } +polkadot-runtime-constants = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/polkadot/constants" } +polkadot-statement-distribution = { path = "/Users/mhau/projects/paritytech/polkadot/node/network/statement-distribution" } +rococo-runtime = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/rococo" } +rococo-runtime-constants = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/rococo/constants" } +westend-runtime = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/westend" } +westend-runtime-constants = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/westend/constants" } +polkadot-test-client = { path = "/Users/mhau/projects/paritytech/polkadot/node/test/client" } +polkadot-test-runtime = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/test-runtime" } +test-runtime-constants = { path = "/Users/mhau/projects/paritytech/polkadot/runtime/test-runtime/constants" } +polkadot-performance-test = { path = "/Users/mhau/projects/paritytech/polkadot/node/test/performance-test" } +xcm-executor-integration-tests = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/xcm-executor/integration-tests" } +xcm-simulator = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/xcm-simulator" } +xcm-simulator-example = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/xcm-simulator/example" } +xcm-simulator-fuzzer = { path = "/Users/mhau/projects/paritytech/polkadot/xcm/xcm-simulator/fuzzer" } +polkadot-test-malus = { path = "/Users/mhau/projects/paritytech/polkadot/node/malus" } +zombienet-backchannel = { path = "/Users/mhau/projects/paritytech/polkadot/node/zombienet-backchannel" } +test-parachains = { path = "/Users/mhau/projects/paritytech/polkadot/parachain/test-parachains" } +test-parachain-adder-collator = { path = "/Users/mhau/projects/paritytech/polkadot/parachain/test-parachains/adder/collator" } +test-parachain-undying = { path = "/Users/mhau/projects/paritytech/polkadot/parachain/test-parachains/undying" } +test-parachain-undying-collator = { path = "/Users/mhau/projects/paritytech/polkadot/parachain/test-parachains/undying/collator" } +staking-miner = { path = "/Users/mhau/projects/paritytech/polkadot/utils/staking-miner" } +remote-ext-tests-bags-list = { path = "/Users/mhau/projects/paritytech/polkadot/utils/remote-ext-tests/bags-list" } +polkadot-voter-bags = { path = "/Users/mhau/projects/paritytech/polkadot/utils/generate-bags" } +polkadot = { path = "/Users/mhau/projects/paritytech/polkadot" } + +[patch."https://github.com/paritytech/substrate"] +node-template = { path = "/Users/mhau/projects/paritytech/substrate/bin/node-template/node" } +frame-benchmarking = { path = "/Users/mhau/projects/paritytech/substrate/frame/benchmarking" } +frame-support = { path = "/Users/mhau/projects/paritytech/substrate/frame/support" } +frame-support-procedural = { path = "/Users/mhau/projects/paritytech/substrate/frame/support/procedural" } +frame-support-procedural-tools = { path = "/Users/mhau/projects/paritytech/substrate/frame/support/procedural/tools" } +frame-support-procedural-tools-derive = { path = "/Users/mhau/projects/paritytech/substrate/frame/support/procedural/tools/derive" } +sp-api = { path = "/Users/mhau/projects/paritytech/substrate/primitives/api" } +sp-api-proc-macro = { path = "/Users/mhau/projects/paritytech/substrate/primitives/api/proc-macro" } +sp-core = { path = "/Users/mhau/projects/paritytech/substrate/primitives/core" } +sp-core-hashing = { path = "/Users/mhau/projects/paritytech/substrate/primitives/core/hashing" } +sp-std = { path = "/Users/mhau/projects/paritytech/substrate/primitives/std" } +sp-debug-derive = { path = "/Users/mhau/projects/paritytech/substrate/primitives/debug-derive" } +sp-externalities = { path = "/Users/mhau/projects/paritytech/substrate/primitives/externalities" } +sp-storage = { path = "/Users/mhau/projects/paritytech/substrate/primitives/storage" } +sp-runtime-interface = { path = "/Users/mhau/projects/paritytech/substrate/primitives/runtime-interface" } +sp-runtime-interface-proc-macro = { path = "/Users/mhau/projects/paritytech/substrate/primitives/runtime-interface/proc-macro" } +sp-tracing = { path = "/Users/mhau/projects/paritytech/substrate/primitives/tracing" } +sp-wasm-interface = { path = "/Users/mhau/projects/paritytech/substrate/primitives/wasm-interface" } +sp-io = { path = "/Users/mhau/projects/paritytech/substrate/primitives/io" } +sp-keystore = { path = "/Users/mhau/projects/paritytech/substrate/primitives/keystore" } +sp-state-machine = { path = "/Users/mhau/projects/paritytech/substrate/primitives/state-machine" } +sp-panic-handler = { path = "/Users/mhau/projects/paritytech/substrate/primitives/panic-handler" } +sp-trie = { path = "/Users/mhau/projects/paritytech/substrate/primitives/trie" } +sp-runtime = { path = "/Users/mhau/projects/paritytech/substrate/primitives/runtime" } +sp-application-crypto = { path = "/Users/mhau/projects/paritytech/substrate/primitives/application-crypto" } +sp-arithmetic = { path = "/Users/mhau/projects/paritytech/substrate/primitives/arithmetic" } +sp-weights = { path = "/Users/mhau/projects/paritytech/substrate/primitives/weights" } +substrate-test-runtime-client = { path = "/Users/mhau/projects/paritytech/substrate/test-utils/runtime/client" } +sc-block-builder = { path = "/Users/mhau/projects/paritytech/substrate/client/block-builder" } +sc-client-api = { path = "/Users/mhau/projects/paritytech/substrate/client/api" } +substrate-prometheus-endpoint = { path = "/Users/mhau/projects/paritytech/substrate/utils/prometheus" } +sc-executor = { path = "/Users/mhau/projects/paritytech/substrate/client/executor" } +sc-executor-common = { path = "/Users/mhau/projects/paritytech/substrate/client/executor/common" } +sc-allocator = { path = "/Users/mhau/projects/paritytech/substrate/client/allocator" } +sp-maybe-compressed-blob = { path = "/Users/mhau/projects/paritytech/substrate/primitives/maybe-compressed-blob" } +sc-executor-wasmi = { path = "/Users/mhau/projects/paritytech/substrate/client/executor/wasmi" } +sc-executor-wasmtime = { path = "/Users/mhau/projects/paritytech/substrate/client/executor/wasmtime" } +sc-runtime-test = { path = "/Users/mhau/projects/paritytech/substrate/client/executor/runtime-test" } +substrate-wasm-builder = { path = "/Users/mhau/projects/paritytech/substrate/utils/wasm-builder" } +sp-version = { path = "/Users/mhau/projects/paritytech/substrate/primitives/version" } +sp-core-hashing-proc-macro = { path = "/Users/mhau/projects/paritytech/substrate/primitives/core/hashing/proc-macro" } +sp-version-proc-macro = { path = "/Users/mhau/projects/paritytech/substrate/primitives/version/proc-macro" } +sc-tracing = { path = "/Users/mhau/projects/paritytech/substrate/client/tracing" } +sc-rpc-server = { path = "/Users/mhau/projects/paritytech/substrate/client/rpc-servers" } +sc-tracing-proc-macro = { path = "/Users/mhau/projects/paritytech/substrate/client/tracing/proc-macro" } +sp-blockchain = { path = "/Users/mhau/projects/paritytech/substrate/primitives/blockchain" } +sp-consensus = { path = "/Users/mhau/projects/paritytech/substrate/primitives/consensus/common" } +sp-inherents = { path = "/Users/mhau/projects/paritytech/substrate/primitives/inherents" } +sp-test-primitives = { path = "/Users/mhau/projects/paritytech/substrate/primitives/test-primitives" } +sp-database = { path = "/Users/mhau/projects/paritytech/substrate/primitives/database" } +sp-rpc = { path = "/Users/mhau/projects/paritytech/substrate/primitives/rpc" } +substrate-test-runtime = { path = "/Users/mhau/projects/paritytech/substrate/test-utils/runtime" } +sp-beefy = { path = "/Users/mhau/projects/paritytech/substrate/primitives/beefy" } +sp-mmr-primitives = { path = "/Users/mhau/projects/paritytech/substrate/primitives/merkle-mountain-range" } +frame-system = { path = "/Users/mhau/projects/paritytech/substrate/frame/system" } +frame-system-rpc-runtime-api = { path = "/Users/mhau/projects/paritytech/substrate/frame/system/rpc/runtime-api" } +pallet-babe = { path = "/Users/mhau/projects/paritytech/substrate/frame/babe" } +pallet-authorship = { path = "/Users/mhau/projects/paritytech/substrate/frame/authorship" } +pallet-session = { path = "/Users/mhau/projects/paritytech/substrate/frame/session" } +pallet-timestamp = { path = "/Users/mhau/projects/paritytech/substrate/frame/timestamp" } +sp-timestamp = { path = "/Users/mhau/projects/paritytech/substrate/primitives/timestamp" } +sp-session = { path = "/Users/mhau/projects/paritytech/substrate/primitives/session" } +sp-staking = { path = "/Users/mhau/projects/paritytech/substrate/primitives/staking" } +sp-consensus-babe = { path = "/Users/mhau/projects/paritytech/substrate/primitives/consensus/babe" } +sp-consensus-slots = { path = "/Users/mhau/projects/paritytech/substrate/primitives/consensus/slots" } +sp-consensus-vrf = { path = "/Users/mhau/projects/paritytech/substrate/primitives/consensus/vrf" } +frame-election-provider-support = { path = "/Users/mhau/projects/paritytech/substrate/frame/election-provider-support" } +frame-election-provider-solution-type = { path = "/Users/mhau/projects/paritytech/substrate/frame/election-provider-support/solution-type" } +sp-npos-elections = { path = "/Users/mhau/projects/paritytech/substrate/primitives/npos-elections" } +substrate-test-utils = { path = "/Users/mhau/projects/paritytech/substrate/test-utils" } +substrate-test-utils-derive = { path = "/Users/mhau/projects/paritytech/substrate/test-utils/derive" } +sc-service = { path = "/Users/mhau/projects/paritytech/substrate/client/service" } +sc-chain-spec = { path = "/Users/mhau/projects/paritytech/substrate/client/chain-spec" } +sc-chain-spec-derive = { path = "/Users/mhau/projects/paritytech/substrate/client/chain-spec/derive" } +sc-network-common = { path = "/Users/mhau/projects/paritytech/substrate/client/network/common" } +sc-consensus = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/common" } +sc-utils = { path = "/Users/mhau/projects/paritytech/substrate/client/utils" } +sc-peerset = { path = "/Users/mhau/projects/paritytech/substrate/client/peerset" } +sp-finality-grandpa = { path = "/Users/mhau/projects/paritytech/substrate/primitives/finality-grandpa" } +sc-telemetry = { path = "/Users/mhau/projects/paritytech/substrate/client/telemetry" } +sc-client-db = { path = "/Users/mhau/projects/paritytech/substrate/client/db" } +sc-state-db = { path = "/Users/mhau/projects/paritytech/substrate/client/state-db" } +kitchensink-runtime = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/runtime" } +frame-benchmarking-pallet-pov = { path = "/Users/mhau/projects/paritytech/substrate/frame/benchmarking/pov" } +frame-executive = { path = "/Users/mhau/projects/paritytech/substrate/frame/executive" } +frame-try-runtime = { path = "/Users/mhau/projects/paritytech/substrate/frame/try-runtime" } +pallet-balances = { path = "/Users/mhau/projects/paritytech/substrate/frame/balances" } +pallet-transaction-payment = { path = "/Users/mhau/projects/paritytech/substrate/frame/transaction-payment" } +frame-system-benchmarking = { path = "/Users/mhau/projects/paritytech/substrate/frame/system/benchmarking" } +node-primitives = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/primitives" } +pallet-alliance = { path = "/Users/mhau/projects/paritytech/substrate/frame/alliance" } +pallet-collective = { path = "/Users/mhau/projects/paritytech/substrate/frame/collective" } +pallet-identity = { path = "/Users/mhau/projects/paritytech/substrate/frame/identity" } +pallet-asset-tx-payment = { path = "/Users/mhau/projects/paritytech/substrate/frame/transaction-payment/asset-tx-payment" } +pallet-assets = { path = "/Users/mhau/projects/paritytech/substrate/frame/assets" } +pallet-authority-discovery = { path = "/Users/mhau/projects/paritytech/substrate/frame/authority-discovery" } +sp-authority-discovery = { path = "/Users/mhau/projects/paritytech/substrate/primitives/authority-discovery" } +pallet-bags-list = { path = "/Users/mhau/projects/paritytech/substrate/frame/bags-list" } +pallet-bounties = { path = "/Users/mhau/projects/paritytech/substrate/frame/bounties" } +pallet-treasury = { path = "/Users/mhau/projects/paritytech/substrate/frame/treasury" } +pallet-child-bounties = { path = "/Users/mhau/projects/paritytech/substrate/frame/child-bounties" } +pallet-contracts = { path = "/Users/mhau/projects/paritytech/substrate/frame/contracts" } +pallet-contracts-primitives = { path = "/Users/mhau/projects/paritytech/substrate/frame/contracts/primitives" } +pallet-contracts-proc-macro = { path = "/Users/mhau/projects/paritytech/substrate/frame/contracts/proc-macro" } +pallet-insecure-randomness-collective-flip = { path = "/Users/mhau/projects/paritytech/substrate/frame/insecure-randomness-collective-flip" } +pallet-utility = { path = "/Users/mhau/projects/paritytech/substrate/frame/utility" } +pallet-root-testing = { path = "/Users/mhau/projects/paritytech/substrate/frame/root-testing" } +pallet-conviction-voting = { path = "/Users/mhau/projects/paritytech/substrate/frame/conviction-voting" } +pallet-scheduler = { path = "/Users/mhau/projects/paritytech/substrate/frame/scheduler" } +pallet-preimage = { path = "/Users/mhau/projects/paritytech/substrate/frame/preimage" } +pallet-democracy = { path = "/Users/mhau/projects/paritytech/substrate/frame/democracy" } +pallet-election-provider-multi-phase = { path = "/Users/mhau/projects/paritytech/substrate/frame/election-provider-multi-phase" } +pallet-election-provider-support-benchmarking = { path = "/Users/mhau/projects/paritytech/substrate/frame/election-provider-support/benchmarking" } +pallet-elections-phragmen = { path = "/Users/mhau/projects/paritytech/substrate/frame/elections-phragmen" } +pallet-fast-unstake = { path = "/Users/mhau/projects/paritytech/substrate/frame/fast-unstake" } +pallet-staking = { path = "/Users/mhau/projects/paritytech/substrate/frame/staking" } +pallet-staking-reward-curve = { path = "/Users/mhau/projects/paritytech/substrate/frame/staking/reward-curve" } +pallet-grandpa = { path = "/Users/mhau/projects/paritytech/substrate/frame/grandpa" } +pallet-offences = { path = "/Users/mhau/projects/paritytech/substrate/frame/offences" } +sp-keyring = { path = "/Users/mhau/projects/paritytech/substrate/primitives/keyring" } +pallet-im-online = { path = "/Users/mhau/projects/paritytech/substrate/frame/im-online" } +pallet-indices = { path = "/Users/mhau/projects/paritytech/substrate/frame/indices" } +pallet-lottery = { path = "/Users/mhau/projects/paritytech/substrate/frame/lottery" } +frame-support-test = { path = "/Users/mhau/projects/paritytech/substrate/frame/support/test" } +frame-support-test-pallet = { path = "/Users/mhau/projects/paritytech/substrate/frame/support/test/pallet" } +pallet-membership = { path = "/Users/mhau/projects/paritytech/substrate/frame/membership" } +pallet-message-queue = { path = "/Users/mhau/projects/paritytech/substrate/frame/message-queue" } +pallet-mmr = { path = "/Users/mhau/projects/paritytech/substrate/frame/merkle-mountain-range" } +pallet-multisig = { path = "/Users/mhau/projects/paritytech/substrate/frame/multisig" } +pallet-nfts = { path = "/Users/mhau/projects/paritytech/substrate/frame/nfts" } +pallet-nis = { path = "/Users/mhau/projects/paritytech/substrate/frame/nis" } +pallet-nomination-pools = { path = "/Users/mhau/projects/paritytech/substrate/frame/nomination-pools" } +pallet-nomination-pools-benchmarking = { path = "/Users/mhau/projects/paritytech/substrate/frame/nomination-pools/benchmarking" } +pallet-nomination-pools-runtime-api = { path = "/Users/mhau/projects/paritytech/substrate/frame/nomination-pools/runtime-api" } +pallet-offences-benchmarking = { path = "/Users/mhau/projects/paritytech/substrate/frame/offences/benchmarking" } +pallet-proxy = { path = "/Users/mhau/projects/paritytech/substrate/frame/proxy" } +pallet-ranked-collective = { path = "/Users/mhau/projects/paritytech/substrate/frame/ranked-collective" } +pallet-recovery = { path = "/Users/mhau/projects/paritytech/substrate/frame/recovery" } +pallet-referenda = { path = "/Users/mhau/projects/paritytech/substrate/frame/referenda" } +pallet-remark = { path = "/Users/mhau/projects/paritytech/substrate/frame/remark" } +pallet-session-benchmarking = { path = "/Users/mhau/projects/paritytech/substrate/frame/session/benchmarking" } +pallet-society = { path = "/Users/mhau/projects/paritytech/substrate/frame/society" } +pallet-state-trie-migration = { path = "/Users/mhau/projects/paritytech/substrate/frame/state-trie-migration" } +frame-remote-externalities = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/remote-externalities" } +substrate-rpc-client = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/rpc/client" } +sc-rpc-api = { path = "/Users/mhau/projects/paritytech/substrate/client/rpc-api" } +sc-transaction-pool-api = { path = "/Users/mhau/projects/paritytech/substrate/client/transaction-pool/api" } +substrate-state-trie-migration-rpc = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/rpc/state-trie-migration-rpc" } +pallet-sudo = { path = "/Users/mhau/projects/paritytech/substrate/frame/sudo" } +pallet-tips = { path = "/Users/mhau/projects/paritytech/substrate/frame/tips" } +pallet-transaction-payment-rpc-runtime-api = { path = "/Users/mhau/projects/paritytech/substrate/frame/transaction-payment/rpc/runtime-api" } +pallet-transaction-storage = { path = "/Users/mhau/projects/paritytech/substrate/frame/transaction-storage" } +sp-transaction-storage-proof = { path = "/Users/mhau/projects/paritytech/substrate/primitives/transaction-storage-proof" } +pallet-uniques = { path = "/Users/mhau/projects/paritytech/substrate/frame/uniques" } +pallet-vesting = { path = "/Users/mhau/projects/paritytech/substrate/frame/vesting" } +pallet-whitelist = { path = "/Users/mhau/projects/paritytech/substrate/frame/whitelist" } +sp-block-builder = { path = "/Users/mhau/projects/paritytech/substrate/primitives/block-builder" } +sp-offchain = { path = "/Users/mhau/projects/paritytech/substrate/primitives/offchain" } +sp-transaction-pool = { path = "/Users/mhau/projects/paritytech/substrate/primitives/transaction-pool" } +sc-informant = { path = "/Users/mhau/projects/paritytech/substrate/client/informant" } +sc-keystore = { path = "/Users/mhau/projects/paritytech/substrate/client/keystore" } +sc-network = { path = "/Users/mhau/projects/paritytech/substrate/client/network" } +sc-network-light = { path = "/Users/mhau/projects/paritytech/substrate/client/network/light" } +sc-network-sync = { path = "/Users/mhau/projects/paritytech/substrate/client/network/sync" } +fork-tree = { path = "/Users/mhau/projects/paritytech/substrate/utils/fork-tree" } +sc-network-bitswap = { path = "/Users/mhau/projects/paritytech/substrate/client/network/bitswap" } +sc-network-transactions = { path = "/Users/mhau/projects/paritytech/substrate/client/network/transactions" } +sc-offchain = { path = "/Users/mhau/projects/paritytech/substrate/client/offchain" } +sc-transaction-pool = { path = "/Users/mhau/projects/paritytech/substrate/client/transaction-pool" } +substrate-test-runtime-transaction-pool = { path = "/Users/mhau/projects/paritytech/substrate/test-utils/runtime/transaction-pool" } +sc-rpc = { path = "/Users/mhau/projects/paritytech/substrate/client/rpc" } +sc-rpc-spec-v2 = { path = "/Users/mhau/projects/paritytech/substrate/client/rpc-spec-v2" } +sc-storage-monitor = { path = "/Users/mhau/projects/paritytech/substrate/client/storage-monitor" } +sc-sysinfo = { path = "/Users/mhau/projects/paritytech/substrate/client/sysinfo" } +pallet-beefy-mmr = { path = "/Users/mhau/projects/paritytech/substrate/frame/beefy-mmr" } +binary-merkle-tree = { path = "/Users/mhau/projects/paritytech/substrate/utils/binary-merkle-tree" } +pallet-beefy = { path = "/Users/mhau/projects/paritytech/substrate/frame/beefy" } +sp-consensus-aura = { path = "/Users/mhau/projects/paritytech/substrate/primitives/consensus/aura" } +substrate-test-client = { path = "/Users/mhau/projects/paritytech/substrate/test-utils/client" } +sp-runtime-interface-test-wasm = { path = "/Users/mhau/projects/paritytech/substrate/primitives/runtime-interface/test-wasm" } +sp-serializer = { path = "/Users/mhau/projects/paritytech/substrate/primitives/serializer" } +frame-benchmarking-cli = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/benchmarking-cli" } +sc-cli = { path = "/Users/mhau/projects/paritytech/substrate/client/cli" } +node-template-runtime = { path = "/Users/mhau/projects/paritytech/substrate/bin/node-template/runtime" } +pallet-aura = { path = "/Users/mhau/projects/paritytech/substrate/frame/aura" } +pallet-template = { path = "/Users/mhau/projects/paritytech/substrate/bin/node-template/pallets/template" } +pallet-transaction-payment-rpc = { path = "/Users/mhau/projects/paritytech/substrate/frame/transaction-payment/rpc" } +sc-basic-authorship = { path = "/Users/mhau/projects/paritytech/substrate/client/basic-authorship" } +sc-proposer-metrics = { path = "/Users/mhau/projects/paritytech/substrate/client/proposer-metrics" } +sc-consensus-aura = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/aura" } +sc-consensus-slots = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/slots" } +sc-network-test = { path = "/Users/mhau/projects/paritytech/substrate/client/network/test" } +sc-finality-grandpa = { path = "/Users/mhau/projects/paritytech/substrate/client/finality-grandpa" } +sc-network-gossip = { path = "/Users/mhau/projects/paritytech/substrate/client/network-gossip" } +substrate-frame-rpc-system = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/rpc/system" } +try-runtime-cli = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/try-runtime/cli" } +substrate-build-script-utils = { path = "/Users/mhau/projects/paritytech/substrate/utils/build-script-utils" } +node-bench = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/bench" } +node-testing = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/testing" } +node-executor = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/executor" } +node-cli = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/cli" } +node-inspect = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/inspect" } +node-rpc = { path = "/Users/mhau/projects/paritytech/substrate/bin/node/rpc" } +mmr-rpc = { path = "/Users/mhau/projects/paritytech/substrate/client/merkle-mountain-range/rpc" } +sc-consensus-babe = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/babe" } +sc-consensus-epochs = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/epochs" } +sc-consensus-babe-rpc = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/babe/rpc" } +sc-finality-grandpa-rpc = { path = "/Users/mhau/projects/paritytech/substrate/client/finality-grandpa/rpc" } +sc-sync-state-rpc = { path = "/Users/mhau/projects/paritytech/substrate/client/sync-state-rpc" } +sc-authority-discovery = { path = "/Users/mhau/projects/paritytech/substrate/client/authority-discovery" } +sc-service-test = { path = "/Users/mhau/projects/paritytech/substrate/client/service/test" } +substrate-frame-cli = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/frame-utilities-cli" } +chain-spec-builder = { path = "/Users/mhau/projects/paritytech/substrate/bin/utils/chain-spec-builder" } +subkey = { path = "/Users/mhau/projects/paritytech/substrate/bin/utils/subkey" } +beefy-gadget = { path = "/Users/mhau/projects/paritytech/substrate/client/beefy" } +beefy-gadget-rpc = { path = "/Users/mhau/projects/paritytech/substrate/client/beefy/rpc" } +sc-consensus-manual-seal = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/manual-seal" } +sc-consensus-pow = { path = "/Users/mhau/projects/paritytech/substrate/client/consensus/pow" } +sp-consensus-pow = { path = "/Users/mhau/projects/paritytech/substrate/primitives/consensus/pow" } +mmr-gadget = { path = "/Users/mhau/projects/paritytech/substrate/client/merkle-mountain-range" } +pallet-atomic-swap = { path = "/Users/mhau/projects/paritytech/substrate/frame/atomic-swap" } +pallet-bags-list-fuzzer = { path = "/Users/mhau/projects/paritytech/substrate/frame/bags-list/fuzzer" } +pallet-bags-list-remote-tests = { path = "/Users/mhau/projects/paritytech/substrate/frame/bags-list/remote-tests" } +frame-election-solution-type-fuzzer = { path = "/Users/mhau/projects/paritytech/substrate/frame/election-provider-support/solution-type/fuzzer" } +pallet-example-basic = { path = "/Users/mhau/projects/paritytech/substrate/frame/examples/basic" } +pallet-example-offchain-worker = { path = "/Users/mhau/projects/paritytech/substrate/frame/examples/offchain-worker" } +pallet-nicks = { path = "/Users/mhau/projects/paritytech/substrate/frame/nicks" } +pallet-node-authorization = { path = "/Users/mhau/projects/paritytech/substrate/frame/node-authorization" } +pallet-nomination-pools-fuzzer = { path = "/Users/mhau/projects/paritytech/substrate/frame/nomination-pools/fuzzer" } +pallet-nomination-pools-test-staking = { path = "/Users/mhau/projects/paritytech/substrate/frame/nomination-pools/test-staking" } +pallet-scored-pool = { path = "/Users/mhau/projects/paritytech/substrate/frame/scored-pool" } +pallet-staking-reward-fn = { path = "/Users/mhau/projects/paritytech/substrate/frame/staking/reward-fn" } +pallet-root-offences = { path = "/Users/mhau/projects/paritytech/substrate/frame/root-offences" } +frame-support-test-compile-pass = { path = "/Users/mhau/projects/paritytech/substrate/frame/support/test/compile_pass" } +sp-api-test = { path = "/Users/mhau/projects/paritytech/substrate/primitives/api/test" } +sp-application-crypto-test = { path = "/Users/mhau/projects/paritytech/substrate/primitives/application-crypto/test" } +sp-arithmetic-fuzzer = { path = "/Users/mhau/projects/paritytech/substrate/primitives/arithmetic/fuzzer" } +sp-npos-elections-fuzzer = { path = "/Users/mhau/projects/paritytech/substrate/primitives/npos-elections/fuzzer" } +sp-runtime-interface-test = { path = "/Users/mhau/projects/paritytech/substrate/primitives/runtime-interface/test" } +sp-runtime-interface-test-wasm-deprecated = { path = "/Users/mhau/projects/paritytech/substrate/primitives/runtime-interface/test-wasm-deprecated" } +substrate-test-utils-test-crate = { path = "/Users/mhau/projects/paritytech/substrate/test-utils/test-crate" } +substrate-frame-rpc-support = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/rpc/support" } +generate-bags = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/generate-bags" } +node-runtime-generate-bags = { path = "/Users/mhau/projects/paritytech/substrate/utils/frame/generate-bags/node-runtime" } diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index b03c68ada10..ff3f00aa338 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -99,7 +99,7 @@ use xcm_config::{DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; pub use sp_runtime::BuildStorage; // Polkadot imports -use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; +use pallet_xcm::{EnsureXcm, IsMajorityOfBody, IsVoiceOfBody}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm::latest::BodyId; use xcm_executor::XcmExecutor; @@ -348,6 +348,7 @@ impl Default for ProxyType { impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { + // todo update ProxyType::Any => true, ProxyType::NonTransfer => !matches!( c, @@ -470,6 +471,11 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} +parameter_types! { + // Fellows pluralistic body. + pub const FellowsBodyId: BodyId = BodyId::Technical; +} + impl cumulus_pallet_xcmp_queue::Config for Runtime { type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; type RuntimeEvent = RuntimeEvent; @@ -479,7 +485,10 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm<( + IsMajorityOfBody, + IsVoiceOfBody, + )>, >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type PriceForSiblingDelivery = (); @@ -522,11 +531,18 @@ parameter_types! { pub const MinCandidates: u32 = 5; pub const SessionLength: BlockNumber = 6 * HOURS; pub const MaxInvulnerables: u32 = 100; + // StakingAdmin pluralistic body. + pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root and the Relay Chain council to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = - EitherOfDiverse, EnsureXcm>>; +/// We allow root, the Relay Chain council and the StakingAdmin to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm<( + IsMajorityOfBody, + IsVoiceOfBody, + )>, +>; impl pallet_collator_selection::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index 49b459bb34f..31555b1e2dd 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -26,13 +26,18 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-referenda = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -95,6 +100,10 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-ranked-collective/runtime-benchmarks", ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", @@ -119,6 +128,10 @@ try-runtime = [ "pallet-utility/try-runtime", "pallet-xcm/try-runtime", "parachain-info/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-preimage/try-runtime", + "pallet-referenda/try-runtime", + "pallet-ranked-collective/try-runtime", ] std = [ "codec/std", @@ -170,4 +183,8 @@ std = [ "pallet-collator-selection/std", "parachain-info/std", "parachains-common/std", + "pallet-scheduler/std", + "pallet-preimage/std", + "pallet-referenda/std", + "pallet-ranked-collective/std", ] diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index cc41d5c6378..b544c688da5 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -15,12 +15,15 @@ pub mod account { use frame_support::PalletId; - use sp_runtime::AccountId32; /// Relay Chain treasury pallet id, used to convert into AccountId pub const RELAY_TREASURY_PALL_ID: PalletId = PalletId(*b"py/trsry"); - /// account used to temporarily deposit slashed imbalance before teleporting - pub const SLASHED_IMBALANCE_ACC_ID: AccountId32 = AccountId32::new([7u8; 32]); + /// Alliance pallet id. + /// Used as an account to temporarily deposit slashed imbalance before teleporting. + pub const ALLIANCE_PALLET_ID: PalletId = PalletId(*b"py/allia"); + /// Referenda pallet id. + /// Used as an account to temporarily deposit slashed imbalance before teleporting. + pub const REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/refer"); } pub mod currency { diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs new file mode 100644 index 00000000000..6d1c4b6b269 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -0,0 +1,150 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! The Polkadot Fellowship. + +mod origins; +mod tracks; +pub use origins::{ + pallet_origins as pallet_fellowship_origins, Fellows, FellowshipExperts, FellowshipInitiates, + FellowshipMasters, +}; + +use crate::{ + constants, impls::ToParentTreasury, AccountId, Balance, Balances, BlockNumber, DotLocation, + FellowshipReferenda, Preimage, Runtime, RuntimeCall, RuntimeEvent, Scheduler, DAYS, +}; +use frame_support::{ + parameter_types, + traits::{EitherOf, MapSuccess, TryMapSuccess}, +}; +use pallet_xcm::{EnsureXcm, IsMajorityOfBody, IsVoiceOfBody}; +use polkadot_runtime_constants::xcm::body::FELLOWSHIP_ADMIN_INDEX; +use sp_arithmetic::traits::CheckedSub; +use sp_core::ConstU32; +use sp_runtime::{ + morph_types, + traits::{AccountIdConversion, ConstU16, Replace, TypedGet}, +}; +use xcm::latest::BodyId; + +use self::origins::EnsureFellowship; + +/// The Fellowship members' ranks. +pub mod ranks { + use pallet_ranked_collective::Rank; + + pub const INITIATES: Rank = 0; + pub const DAN_1: Rank = 1; + pub const DAN_2: Rank = 2; + pub const DAN_3: Rank = 3; // aka Fellows. + pub const DAN_4: Rank = 4; + pub const DAN_5: Rank = 5; // aka Experts. + pub const DAN_6: Rank = 6; + pub const DAN_7: Rank = 7; // aka Masters. + pub const DAN_8: Rank = 8; + pub const DAN_9: Rank = 9; +} + +parameter_types! { + pub const AlarmInterval: BlockNumber = 1; + pub const SubmissionDeposit: Balance = 0; + pub const UndecidingTimeout: BlockNumber = 7 * DAYS; + pub const TechnicalCommittee: BodyId = BodyId::Technical; + // Referenda pallet account, used to temporarily deposit slashed imbalance before teleporting. + pub ReferendaPalletAccId: AccountId = constants::account::REFERENDA_PALLET_ID.into_account_truncating(); + pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); + pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX); +} + +impl pallet_fellowship_origins::Config for Runtime {} + +pub type FellowshipReferendaInstance = pallet_referenda::Instance1; + +impl pallet_referenda::Config for Runtime { + type WeightInfo = (); // todo + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Currency = Balances; + type SubmitOrigin = + pallet_ranked_collective::EnsureMember; + type CancelOrigin = FellowshipExperts; + type KillOrigin = FellowshipMasters; + type Slash = ToParentTreasury; + type Votes = pallet_ranked_collective::Votes; + type Tally = pallet_ranked_collective::TallyOf; + type SubmissionDeposit = SubmissionDeposit; + type MaxQueued = ConstU32<100>; + type UndecidingTimeout = UndecidingTimeout; + type AlarmInterval = AlarmInterval; + type Tracks = tracks::TracksInfo; + type Preimages = Preimage; +} + +pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; + +morph_types! { + /// A `TryMorph` implementation to reduce a scalar by a particular amount, checking for + /// underflow. + pub type CheckedReduceBy: TryMorph = |r: N::Type| -> Result { + r.checked_sub(&N::get()).ok_or(()) + } where N::Type: CheckedSub; +} + +// IsMajorityOfBody, + +impl pallet_ranked_collective::Config for Runtime { + type WeightInfo = (); // todo + type RuntimeEvent = RuntimeEvent; + // Promotion is by any of: + // - Root can demote arbitrarily. + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote by the rank *above* the new rank. + type PromoteOrigin = EitherOf< + EitherOf< + frame_system::EnsureRootWithSuccess>, + MapSuccess< + EnsureXcm>, + Replace>, + >, + >, + EitherOf< + MapSuccess< + EnsureXcm>, + Replace>, + >, + TryMapSuccess>>, + >, + >; + // Demotion is by any of: + // - Root can demote arbitrarily. + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote by the rank two above the current rank. + type DemoteOrigin = EitherOf< + frame_system::EnsureRootWithSuccess>, + EitherOf< + MapSuccess< + EnsureXcm>, + Replace>, + >, + TryMapSuccess>>, + >, + >; + type Polls = FellowshipReferenda; + type MinRankOfClass = sp_runtime::traits::Identity; + type VoteWeight = pallet_ranked_collective::Geometric; +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs new file mode 100644 index 00000000000..efa06c1acbf --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -0,0 +1,148 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Fellowship custom origins. + +use super::ranks; +pub use pallet_origins::*; + +#[frame_support::pallet] +pub mod pallet_origins { + use super::ranks; + use frame_support::pallet_prelude::*; + use pallet_ranked_collective::Rank; + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet(_); + + #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)] + #[pallet::origin] + pub enum Origin { + /// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed). + FellowshipInitiates, + /// Origin commanded by Polkadot Fellows (3rd Dan fellows or greater). + Fellows, + /// Origin commanded by Polkadot Experts (5th Dan fellows or greater). + FellowshipExperts, + /// Origin commanded by Polkadot Masters (7th Dan fellows of greater). + FellowshipMasters, + /// Origin commanded by rank 1 of the Polkadot Fellowship and with a success of 1. + Fellowship1Dan, + /// Origin commanded by rank 2 of the Polkadot Fellowship and with a success of 2. + Fellowship2Dan, + /// Origin commanded by rank 3 of the Polkadot Fellowship and with a success of 3. + Fellowship3Dan, + /// Origin commanded by rank 4 of the Polkadot Fellowship and with a success of 4. + Fellowship4Dan, + /// Origin commanded by rank 5 of the Polkadot Fellowship and with a success of 5. + Fellowship5Dan, + /// Origin commanded by rank 6 of the Polkadot Fellowship and with a success of 6. + Fellowship6Dan, + /// Origin commanded by rank 7 of the Polkadot Fellowship and with a success of 7. + Fellowship7Dan, + /// Origin commanded by rank 8 of the Polkadot Fellowship and with a success of 8. + Fellowship8Dan, + /// Origin commanded by rank 9 of the Polkadot Fellowship and with a success of 9. + Fellowship9Dan, + } + + macro_rules! decl_unit_ensures { + ( $name:ident: $success_type:ty = $success:expr ) => { + pub struct $name; + impl> + From> + EnsureOrigin for $name + { + type Success = $success_type; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::$name => Ok($success), + r => Err(O::from(r)), + }) + } + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::$name)) + } + } + }; + ( $name:ident ) => { decl_unit_ensures! { $name : () = () } }; + ( $name:ident: $success_type:ty = $success:expr, $( $rest:tt )* ) => { + decl_unit_ensures! { $name: $success_type = $success } + decl_unit_ensures! { $( $rest )* } + }; + ( $name:ident, $( $rest:tt )* ) => { + decl_unit_ensures! { $name } + decl_unit_ensures! { $( $rest )* } + }; + () => {} + } + decl_unit_ensures!( + FellowshipInitiates: Rank = ranks::INITIATES, + Fellows: Rank = ranks::DAN_3, + FellowshipExperts: Rank = ranks::DAN_5, + FellowshipMasters: Rank = ranks::DAN_7, + ); + + macro_rules! decl_ensure { + ( + $vis:vis type $name:ident: EnsureOrigin { + $( $item:ident = $success:expr, )* + } + ) => { + $vis struct $name; + impl> + From> + EnsureOrigin for $name + { + type Success = $success_type; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + $( + Origin::$item => Ok($success), + )* + r => Err(O::from(r)), + }) + } + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + // By convention the more privileged origins go later, so for greatest chance + // of success, we want the last one. + let _result: Result = Err(()); + $( + let _result: Result = Ok(O::from(Origin::$item)); + )* + _result + } + } + } + } + + decl_ensure! { + pub type EnsureFellowship: EnsureOrigin { + Fellowship1Dan = ranks::DAN_1, + Fellowship2Dan = ranks::DAN_2, + Fellowship3Dan = ranks::DAN_3, + Fellowship4Dan = ranks::DAN_4, + Fellowship5Dan = ranks::DAN_5, + Fellowship6Dan = ranks::DAN_6, + Fellowship7Dan = ranks::DAN_7, + Fellowship8Dan = ranks::DAN_8, + Fellowship9Dan = ranks::DAN_9, + } + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs new file mode 100644 index 00000000000..2cfd05868d1 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -0,0 +1,299 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Track configurations for Fellowship. + +use crate::{Balance, BlockNumber, RuntimeOrigin, DAYS, DOLLARS, MINUTES}; +use sp_runtime::Perbill; + +/// Referendum `TrackId` type. +pub type TrackId = u16; + +/// Referendum track IDs. +pub mod constants { + use super::TrackId; + + pub const CANDIDATES: TrackId = 0; + pub const MEMBERS: TrackId = 1; + pub const PROFICIENTS: TrackId = 2; + pub const FELLOWS: TrackId = 3; + pub const SENIOR_FELLOWS: TrackId = 4; + pub const EXPERTS: TrackId = 5; + pub const SENIOR_EXPERTS: TrackId = 6; + pub const MASTERS: TrackId = 7; + pub const SENIOR_MASTERS: TrackId = 8; + pub const GRAND_MASTERS: TrackId = 9; +} + +pub struct TracksInfo; +impl pallet_referenda::TracksInfo for TracksInfo { + type Id = TrackId; + type RuntimeOrigin = ::PalletsOrigin; + fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + static DATA: [(TrackId, pallet_referenda::TrackInfo); 10] = [ + ( + constants::CANDIDATES, + pallet_referenda::TrackInfo { + name: "candidates", + max_deciding: 10, + decision_deposit: 100 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::MEMBERS, + pallet_referenda::TrackInfo { + name: "members", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::PROFICIENTS, + pallet_referenda::TrackInfo { + name: "proficients", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::FELLOWS, + pallet_referenda::TrackInfo { + name: "fellows", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::SENIOR_FELLOWS, + pallet_referenda::TrackInfo { + name: "senior fellows", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::EXPERTS, + pallet_referenda::TrackInfo { + name: "experts", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::SENIOR_EXPERTS, + pallet_referenda::TrackInfo { + name: "senior experts", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::MASTERS, + pallet_referenda::TrackInfo { + name: "masters", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::SENIOR_MASTERS, + pallet_referenda::TrackInfo { + name: "senior masters", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::GRAND_MASTERS, + pallet_referenda::TrackInfo { + name: "grand masters", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 30 * MINUTES, + decision_period: 7 * DAYS, + confirm_period: 30 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ]; + &DATA[..] + } + fn track_for(id: &Self::RuntimeOrigin) -> Result { + use super::origins::Origin; + use constants::*; + + #[cfg(feature = "runtime-benchmarks")] + { + // For benchmarks, we enable a root origin. + // It is important that this is not available in production! + let root: Self::RuntimeOrigin = frame_system::RawOrigin::Root.into(); + if &root == id { + return Ok(GRAND_MASTERS) + } + } + + match Origin::try_from(id.clone()) { + Ok(Origin::FellowshipInitiates) => Ok(CANDIDATES), + Ok(Origin::Fellowship1Dan) => Ok(MEMBERS), + Ok(Origin::Fellowship2Dan) => Ok(PROFICIENTS), + Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(FELLOWS), + Ok(Origin::Fellowship4Dan) => Ok(SENIOR_FELLOWS), + Ok(Origin::Fellowship5Dan) | Ok(Origin::FellowshipExperts) => Ok(EXPERTS), + Ok(Origin::Fellowship6Dan) => Ok(SENIOR_EXPERTS), + Ok(Origin::Fellowship7Dan | Origin::FellowshipMasters) => Ok(MASTERS), + Ok(Origin::Fellowship8Dan) => Ok(SENIOR_MASTERS), + Ok(Origin::Fellowship9Dan) => Ok(GRAND_MASTERS), + _ => Err(()), + } + } +} +pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs index d8c7d4247ac..b38e86116b2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs @@ -13,14 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +use crate::OriginCaller; use frame_support::{ dispatch::{DispatchError, DispatchResultWithPostInfo}, log, - traits::{Currency, Get, Imbalance, OnUnbalanced, OriginTrait}, + traits::{Currency, Get, Imbalance, OnUnbalanced, OriginTrait, PrivilegeCmp}, weights::Weight, }; use pallet_alliance::{ProposalIndex, ProposalProvider}; -use sp_std::{marker::PhantomData, prelude::*}; +use parachains_common::impls::NegativeImbalance; +use sp_std::{cmp::Ordering, marker::PhantomData, prelude::*}; use xcm::latest::{Fungibility, Junction, Parent}; type AccountIdOf = ::AccountId; @@ -29,40 +31,36 @@ type ProposalOf = >::Proposal; type HashOf = ::Hash; -type NegativeImbalanceOf = <>::Currency as Currency< - ::AccountId, ->>::NegativeImbalance; - -type CurrencyOf = >::Currency; - -type BalanceOf = <>::Currency as Currency< - ::AccountId, ->>::Balance; +/// Type alias to conveniently refer to the `Currency::Balance` associated type. +pub type BalanceOf = + as Currency<::AccountId>>::Balance; /// Implements `OnUnbalanced::on_unbalanced` to teleport slashed assets to relay chain treasury account. -pub struct ToParentTreasury( - PhantomData<(TreasuryAcc, TempAcc, T, I)>, -); +pub struct ToParentTreasury(PhantomData<(TreasuryAcc, PalletAcc, T)>); -impl OnUnbalanced> - for ToParentTreasury +impl OnUnbalanced> + for ToParentTreasury where - TreasuryAcc: Get>, - TempAcc: Get>, - T: pallet_xcm::Config + frame_system::Config + pallet_alliance::Config, - [u8; 32]: From>, - BalanceOf: Into, + T: pallet_balances::Config + pallet_xcm::Config + frame_system::Config, <::RuntimeOrigin as OriginTrait>::AccountId: From>, + [u8; 32]: From<::AccountId>, + TreasuryAcc: Get>, + PalletAcc: Get>, + BalanceOf: Into, { - fn on_unbalanced(amount: NegativeImbalanceOf) { - let temp_account: AccountIdOf = TempAcc::get(); - let treasury_acc: AccountIdOf = TreasuryAcc::get(); + fn on_unbalanced(amount: NegativeImbalance) { + let amount = match amount.drop_zero() { + Ok(..) => return, + Err(amount) => amount, + }; let imbalance = amount.peek(); + let pallet_acc: AccountIdOf = PalletAcc::get(); + let treasury_acc: AccountIdOf = TreasuryAcc::get(); - >::resolve_creating(&temp_account, amount); + >::resolve_creating(&pallet_acc.clone(), amount); - let result = pallet_xcm::Pallet::::teleport_assets( - ::RuntimeOrigin::signed(temp_account.into()), + let result = >::teleport_assets( + <::RuntimeOrigin>::signed(pallet_acc.into()), Box::new(Parent.into()), Box::new( Junction::AccountId32 { network: None, id: treasury_acc.into() } @@ -131,3 +129,19 @@ where pallet_collective::Pallet::::proposal_of(proposal_hash) } } + +/// Used to compare the privilege of an origin inside the scheduler. +pub struct EqualOrGreatestRootCmp; + +impl PrivilegeCmp for EqualOrGreatestRootCmp { + fn cmp_privilege(left: &OriginCaller, right: &OriginCaller) -> Option { + if left == right { + return Some(Ordering::Equal) + } + match (left, right) { + // Root is greater than anything. + (OriginCaller::system(frame_system::RawOrigin::Root), _) => Some(Ordering::Greater), + _ => None, + } + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 80e0b46af1c..8681044c2fd 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -41,16 +41,19 @@ pub mod constants; pub mod impls; mod weights; pub mod xcm_config; +// Fellowship configurations. +pub mod fellowship; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; -use impls::{AllianceProposalProvider, ToParentTreasury}; +use fellowship::pallet_fellowship_origins; +use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp, ToParentTreasury}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, + ApplyExtrinsicResult, Perbill, }; use sp_std::prelude::*; @@ -75,7 +78,7 @@ use frame_system::{ pub use parachains_common as common; use parachains_common::{ impls::DealWithFees, opaque, AccountId, AuraId, Balance, BlockNumber, Hash, Header, Index, - Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, + Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; @@ -290,6 +293,7 @@ impl Default for ProxyType { impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { + // todo update proxy ProxyType::Any => true, ProxyType::NonTransfer => !matches!(c, RuntimeCall::Balances { .. }), ProxyType::CancelProxy => matches!( @@ -444,6 +448,7 @@ impl pallet_collective::Config for Runtime { type MaxMembers = ConstU32; type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; type WeightInfo = weights::pallet_collective::WeightInfo; + type SetMembersOrigin = EnsureRoot; } pub const MAX_FELLOWS: u32 = ALLIANCE_MAX_MEMBERS; @@ -451,8 +456,8 @@ pub const MAX_ALLIES: u32 = 100; parameter_types! { pub const AllyDeposit: Balance = 1_000 * UNITS; // 1,000 DOT bond to join as an Ally - // account used to temporarily deposit slashed imbalance before teleporting - pub SlashedImbalanceAccId: AccountId = constants::account::SLASHED_IMBALANCE_ACC_ID.into(); + // Alliance pallet account, used to temporarily deposit slashed imbalance before teleporting. + pub AlliancePalletAccId: AccountId = constants::account::ALLIANCE_PALLET_ID.into_account_truncating(); pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); // The number of blocks a member must wait between giving a retirement notice and retiring. // Supposed to be greater than time required to `kick_member` with alliance motion. @@ -466,7 +471,7 @@ impl pallet_alliance::Config for Runtime { type MembershipManager = RootOrAllianceTwoThirdsMajority; type AnnouncementOrigin = RootOrAllianceTwoThirdsMajority; type Currency = Balances; - type Slashed = ToParentTreasury; + type Slashed = ToParentTreasury; type InitializeMembers = AllianceMotion; type MembershipChanged = AllianceMotion; type RetirementPeriod = AllianceRetirementPeriod; @@ -483,6 +488,47 @@ impl pallet_alliance::Config for Runtime { type WeightInfo = weights::pallet_alliance::WeightInfo; } +parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block; +} + +#[cfg(not(feature = "runtime-benchmarks"))] +parameter_types! { + pub const MaxScheduledPerBlock: u32 = 50; +} + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub const MaxScheduledPerBlock: u32 = 200; +} + +impl pallet_scheduler::Config for Runtime { + type RuntimeOrigin = RuntimeOrigin; + type RuntimeEvent = RuntimeEvent; + type PalletsOrigin = OriginCaller; + type RuntimeCall = RuntimeCall; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = EnsureRoot; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = (); // todo weights::pallet_scheduler::WeightInfo; + type OriginPrivilegeCmp = EqualOrGreatestRootCmp; + type Preimages = Preimage; +} + +parameter_types! { + pub const PreimageBaseDeposit: Balance = deposit(2, 64); + pub const PreimageByteDeposit: Balance = deposit(0, 1); +} + +impl pallet_preimage::Config for Runtime { + type WeightInfo = (); // todo weights::pallet_preimage::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type ManagerOrigin = EnsureRoot; + type BaseDeposit = PreimageBaseDeposit; + type ByteDeposit = PreimageByteDeposit; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -519,10 +565,18 @@ construct_runtime!( Utility: pallet_utility::{Pallet, Call, Event} = 40, Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 42, + Preimage: pallet_preimage::{Pallet, Call, Storage, Event} = 43, + Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 44, // The main stage. Alliance: pallet_alliance::{Pallet, Call, Storage, Event, Config} = 50, AllianceMotion: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 51, + + // pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; + FellowshipCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 60, + // pub type FellowshipReferendaInstance = pallet_referenda::Instance1; + FellowshipReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 61, + FellowshipOrigins: pallet_fellowship_origins::{Origin} = 62, } ); @@ -582,6 +636,10 @@ mod benches { [pallet_alliance, Alliance] [pallet_collective, AllianceMotion] [pallet_xcm, PolkadotXcm] + [pallet_preimage, Preimage] + [pallet_scheduler, Scheduler] + [pallet_referenda, FellowshipReferenda] + [pallet_ranked_collective, FellowshipCollective] ); } From 2d6f124b87c6ddcd372da525a4e8701679c78a82 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 15 Feb 2023 10:00:32 +0100 Subject: [PATCH 02/32] cargo.lock --- Cargo.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 28a722d89ad..62e5105eb7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1291,7 +1291,11 @@ dependencies = [ "pallet-collator-selection", "pallet-collective", "pallet-multisig", + "pallet-preimage", "pallet-proxy", + "pallet-ranked-collective", + "pallet-referenda", + "pallet-scheduler", "pallet-session", "pallet-timestamp", "pallet-transaction-payment", @@ -1308,6 +1312,7 @@ dependencies = [ "scale-info", "smallvec", "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-core", From 2ccb3d7dca02db15fe6015e5fb7620c77c5a9fef Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 15 Feb 2023 10:04:32 +0100 Subject: [PATCH 03/32] tracks alias --- .../src/fellowship/tracks.rs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index 2cfd05868d1..f495d53e99d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -269,7 +269,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { } fn track_for(id: &Self::RuntimeOrigin) -> Result { use super::origins::Origin; - use constants::*; + use constants as tracks; #[cfg(feature = "runtime-benchmarks")] { @@ -282,16 +282,16 @@ impl pallet_referenda::TracksInfo for TracksInfo { } match Origin::try_from(id.clone()) { - Ok(Origin::FellowshipInitiates) => Ok(CANDIDATES), - Ok(Origin::Fellowship1Dan) => Ok(MEMBERS), - Ok(Origin::Fellowship2Dan) => Ok(PROFICIENTS), - Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(FELLOWS), - Ok(Origin::Fellowship4Dan) => Ok(SENIOR_FELLOWS), - Ok(Origin::Fellowship5Dan) | Ok(Origin::FellowshipExperts) => Ok(EXPERTS), - Ok(Origin::Fellowship6Dan) => Ok(SENIOR_EXPERTS), - Ok(Origin::Fellowship7Dan | Origin::FellowshipMasters) => Ok(MASTERS), - Ok(Origin::Fellowship8Dan) => Ok(SENIOR_MASTERS), - Ok(Origin::Fellowship9Dan) => Ok(GRAND_MASTERS), + Ok(Origin::FellowshipInitiates) => Ok(tracks::CANDIDATES), + Ok(Origin::Fellowship1Dan) => Ok(tracks::MEMBERS), + Ok(Origin::Fellowship2Dan) => Ok(tracks::PROFICIENTS), + Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(tracks::FELLOWS), + Ok(Origin::Fellowship4Dan) => Ok(tracks::SENIOR_FELLOWS), + Ok(Origin::Fellowship5Dan) | Ok(Origin::FellowshipExperts) => Ok(tracks::EXPERTS), + Ok(Origin::Fellowship6Dan) => Ok(tracks::SENIOR_EXPERTS), + Ok(Origin::Fellowship7Dan | Origin::FellowshipMasters) => Ok(tracks::MASTERS), + Ok(Origin::Fellowship8Dan) => Ok(tracks::SENIOR_MASTERS), + Ok(Origin::Fellowship9Dan) => Ok(tracks::GRAND_MASTERS), _ => Err(()), } } From a1332a9c313ed47c879dc76c74bb14da1f8c080a Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 15 Feb 2023 10:09:03 +0100 Subject: [PATCH 04/32] allow to send Fellows origin over XCM --- .../collectives-polkadot/src/lib.rs | 2 +- .../collectives-polkadot/src/xcm_config.rs | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 7ff1828be62..03a5282b80b 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -45,7 +45,7 @@ pub mod xcm_config; pub mod fellowship; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; -use fellowship::pallet_fellowship_origins; +use fellowship::{pallet_fellowship_origins, Fellows}; use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp, ToParentTreasury}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index a97c7677570..1674fd0c87c 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -14,8 +14,8 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, - Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Balances, Fellows, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -32,10 +32,10 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, - WithComputedOrigin, + FixedWeightBounds, IsConcrete, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, WithComputedOrigin, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -104,6 +104,8 @@ parameter_types! { pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; + // Fellows pluralistic body. + pub const FellowsBodyId: BodyId = BodyId::Technical; } match_types! { @@ -253,10 +255,13 @@ parameter_types! { pub ReachableDest: Option = Some(Parent.into()); } +/// Type to convert the Fellows origin to a Plurality `MultiLocation` value. +pub type FellowsToPlurality = OriginToPluralityVoice; + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; - // We want to disallow users sending (arbitrary) XCMs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; + // We only allow the Fellows to send messages. + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... type ExecuteXcmOrigin = EnsureXcmOrigin; From 63d799c351f8dddf0860505138856ba1fd443903 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 15 Feb 2023 10:27:10 +0100 Subject: [PATCH 05/32] update todos, remove duplication of type --- parachains/runtimes/assets/statemint/src/lib.rs | 3 +-- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index ff3f00aa338..9f888cb9c8e 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -348,7 +348,6 @@ impl Default for ProxyType { impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { - // todo update ProxyType::Any => true, ProxyType::NonTransfer => !matches!( c, @@ -487,7 +486,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { EnsureRoot, EnsureXcm<( IsMajorityOfBody, - IsVoiceOfBody, + IsVoiceOfBody,// todo Collectives locations )>, >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 03a5282b80b..f8dceeb403c 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -449,7 +449,6 @@ impl pallet_collective::Config for Runtime { type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; type SetMembersOrigin = EnsureRoot; type WeightInfo = weights::pallet_collective::WeightInfo; - type SetMembersOrigin = EnsureRoot; } pub const MAX_FELLOWS: u32 = ALLIANCE_MAX_MEMBERS; From 916997ab7c9a5442664af5738b37d380bebfe757 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 15 Feb 2023 11:00:59 +0100 Subject: [PATCH 06/32] use Collectives location for Fellows body --- parachains/runtimes/assets/statemint/src/lib.rs | 4 ++-- parachains/runtimes/assets/statemint/src/xcm_config.rs | 1 + .../runtimes/collectives/collectives-polkadot/src/lib.rs | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 9f888cb9c8e..0775d996e3d 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -93,7 +93,7 @@ use parachains_common::{ Signature, StatemintAuraId as AuraId, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{CollectivesLocation, DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -486,7 +486,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { EnsureRoot, EnsureXcm<( IsMajorityOfBody, - IsVoiceOfBody,// todo Collectives locations + IsVoiceOfBody, )>, >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index 21daa980cc5..cc8d5b844a7 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -56,6 +56,7 @@ parameter_types! { pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); + pub CollectivesLocation: MultiLocation = MultiLocation::new(1, Parachain(1001)); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index f8dceeb403c..aaff32eda8b 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -569,9 +569,12 @@ construct_runtime!( Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 44, // The main stage. + + // The Alliance. Alliance: pallet_alliance::{Pallet, Call, Storage, Event, Config} = 50, AllianceMotion: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 51, + // The Fellowship. // pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; FellowshipCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 60, // pub type FellowshipReferendaInstance = pallet_referenda::Instance1; From 7b772d2bb9bc2f56bca6d91c425ab7be7bb65c25 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 16 Feb 2023 05:57:39 +0100 Subject: [PATCH 07/32] alias for ranks constants --- .../src/fellowship/tracks.rs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index f495d53e99d..666a06a78d6 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -43,9 +43,10 @@ impl pallet_referenda::TracksInfo for TracksInfo { type Id = TrackId; type RuntimeOrigin = ::PalletsOrigin; fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + use constants as tracks; static DATA: [(TrackId, pallet_referenda::TrackInfo); 10] = [ ( - constants::CANDIDATES, + tracks::CANDIDATES, pallet_referenda::TrackInfo { name: "candidates", max_deciding: 10, @@ -67,7 +68,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::MEMBERS, + tracks::MEMBERS, pallet_referenda::TrackInfo { name: "members", max_deciding: 10, @@ -89,7 +90,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::PROFICIENTS, + tracks::PROFICIENTS, pallet_referenda::TrackInfo { name: "proficients", max_deciding: 10, @@ -111,7 +112,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::FELLOWS, + tracks::FELLOWS, pallet_referenda::TrackInfo { name: "fellows", max_deciding: 10, @@ -133,7 +134,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::SENIOR_FELLOWS, + tracks::SENIOR_FELLOWS, pallet_referenda::TrackInfo { name: "senior fellows", max_deciding: 10, @@ -155,7 +156,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::EXPERTS, + tracks::EXPERTS, pallet_referenda::TrackInfo { name: "experts", max_deciding: 10, @@ -177,7 +178,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::SENIOR_EXPERTS, + tracks::SENIOR_EXPERTS, pallet_referenda::TrackInfo { name: "senior experts", max_deciding: 10, @@ -199,7 +200,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::MASTERS, + tracks::MASTERS, pallet_referenda::TrackInfo { name: "masters", max_deciding: 10, @@ -221,7 +222,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::SENIOR_MASTERS, + tracks::SENIOR_MASTERS, pallet_referenda::TrackInfo { name: "senior masters", max_deciding: 10, @@ -243,7 +244,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { }, ), ( - constants::GRAND_MASTERS, + tracks::GRAND_MASTERS, pallet_referenda::TrackInfo { name: "grand masters", max_deciding: 10, @@ -277,7 +278,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { // It is important that this is not available in production! let root: Self::RuntimeOrigin = frame_system::RawOrigin::Root.into(); if &root == id { - return Ok(GRAND_MASTERS) + return Ok(tracks::GRAND_MASTERS) } } From 97f662906e5150566d239b4bf199f365cc5355e4 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 16 Feb 2023 06:20:01 +0100 Subject: [PATCH 08/32] benchmarks --- .../src/fellowship/mod.rs | 9 +- .../collectives-polkadot/src/lib.rs | 4 +- .../collectives-polkadot/src/weights/mod.rs | 4 + .../src/weights/pallet_preimage.rs | 209 +++++++ .../src/weights/pallet_ranked_collective.rs | 160 ++++++ .../src/weights/pallet_referenda.rs | 538 ++++++++++++++++++ .../src/weights/pallet_scheduler.rs | 191 +++++++ scripts/benchmarks-ci.sh | 4 + 8 files changed, 1113 insertions(+), 6 deletions(-) create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 6d1c4b6b269..847777885b1 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -24,8 +24,9 @@ pub use origins::{ }; use crate::{ - constants, impls::ToParentTreasury, AccountId, Balance, Balances, BlockNumber, DotLocation, - FellowshipReferenda, Preimage, Runtime, RuntimeCall, RuntimeEvent, Scheduler, DAYS, + constants, impls::ToParentTreasury, weights, AccountId, Balance, Balances, BlockNumber, + DotLocation, FellowshipReferenda, Preimage, Runtime, RuntimeCall, RuntimeEvent, Scheduler, + DAYS, }; use frame_support::{ parameter_types, @@ -75,7 +76,7 @@ impl pallet_fellowship_origins::Config for Runtime {} pub type FellowshipReferendaInstance = pallet_referenda::Instance1; impl pallet_referenda::Config for Runtime { - type WeightInfo = (); // todo + type WeightInfo = weights::pallet_referenda::WeightInfo; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; @@ -108,7 +109,7 @@ morph_types! { // IsMajorityOfBody, impl pallet_ranked_collective::Config for Runtime { - type WeightInfo = (); // todo + type WeightInfo = weights::pallet_ranked_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; // Promotion is by any of: // - Root can demote arbitrarily. diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index aaff32eda8b..0145b3587f7 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -510,7 +510,7 @@ impl pallet_scheduler::Config for Runtime { type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = (); // todo weights::pallet_scheduler::WeightInfo; + type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = EqualOrGreatestRootCmp; type Preimages = Preimage; } @@ -521,7 +521,7 @@ parameter_types! { } impl pallet_preimage::Config for Runtime { - type WeightInfo = (); // todo weights::pallet_preimage::WeightInfo; + type WeightInfo = weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs index 76fbc081bc5..34ed36e3b62 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs @@ -7,7 +7,11 @@ pub mod pallet_balances; pub mod pallet_collator_selection; pub mod pallet_collective; pub mod pallet_multisig; +pub mod pallet_preimage; pub mod pallet_proxy; +pub mod pallet_ranked_collective; +pub mod pallet_referenda; +pub mod pallet_scheduler; pub mod pallet_session; pub mod pallet_timestamp; pub mod pallet_utility; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs new file mode 100644 index 00000000000..c8c834fd616 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs @@ -0,0 +1,209 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_preimage` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_preimage +// --extrinsic=* +// --steps=2 +// --repeat=1 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_preimage`. +pub struct WeightInfo(PhantomData); +impl pallet_preimage::WeightInfo for WeightInfo { + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Preimage PreimageFor (r:0 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 4194304]`. + fn note_preimage(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `175` + // Estimated: `2566` + // Minimum execution time: 35_000 nanoseconds. + Weight::from_ref_time(7_039_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Preimage PreimageFor (r:0 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 4194304]`. + fn note_requested_preimage(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `106` + // Estimated: `2566` + // Minimum execution time: 19_000 nanoseconds. + Weight::from_ref_time(7_247_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Preimage PreimageFor (r:0 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 4194304]`. + fn note_no_deposit_preimage(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `106` + // Estimated: `2566` + // Minimum execution time: 20_000 nanoseconds. + Weight::from_ref_time(7_516_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Preimage PreimageFor (r:0 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + fn unnote_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `353` + // Estimated: `2566` + // Minimum execution time: 61_000 nanoseconds. + Weight::from_ref_time(61_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Preimage PreimageFor (r:0 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + fn unnote_no_deposit_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `144` + // Estimated: `2566` + // Minimum execution time: 39_000 nanoseconds. + Weight::from_ref_time(39_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn request_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `220` + // Estimated: `2566` + // Minimum execution time: 38_000 nanoseconds. + Weight::from_ref_time(38_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn request_no_deposit_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `144` + // Estimated: `2566` + // Minimum execution time: 23_000 nanoseconds. + Weight::from_ref_time(23_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn request_unnoted_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `2566` + // Minimum execution time: 28_000 nanoseconds. + Weight::from_ref_time(28_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn request_requested_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `106` + // Estimated: `2566` + // Minimum execution time: 10_000 nanoseconds. + Weight::from_ref_time(10_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Preimage PreimageFor (r:0 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + fn unrequest_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `144` + // Estimated: `2566` + // Minimum execution time: 36_000 nanoseconds. + Weight::from_ref_time(36_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn unrequest_unnoted_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `106` + // Estimated: `2566` + // Minimum execution time: 14_000 nanoseconds. + Weight::from_ref_time(14_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn unrequest_multi_referenced_preimage() -> Weight { + // Proof Size summary in bytes: + // Measured: `106` + // Estimated: `2566` + // Minimum execution time: 11_000 nanoseconds. + Weight::from_ref_time(11_000_000) + .saturating_add(Weight::from_proof_size(2566)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs new file mode 100644 index 00000000000..b5428de8e9c --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs @@ -0,0 +1,160 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_ranked_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_ranked_collective +// --extrinsic=* +// --steps=2 +// --repeat=1 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_ranked_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_ranked_collective::WeightInfo for WeightInfo { + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IndexToId (r:0 w:1) + /// Proof: FellowshipCollective IndexToId (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:0 w:1) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + fn add_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `5006` + // Minimum execution time: 31_000 nanoseconds. + Weight::from_ref_time(31_000_000) + .saturating_add(Weight::from_proof_size(5006)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:11 w:11) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:11 w:11) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IndexToId (r:11 w:11) + /// Proof: FellowshipCollective IndexToId (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// The range of component `r` is `[0, 10]`. + fn remove_member(_r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `575 + r * (281 ±0)` + // Estimated: `85534` + // Minimum execution time: 39_000 nanoseconds. + Weight::from_ref_time(197_000_000) + .saturating_add(Weight::from_proof_size(85534)) + .saturating_add(T::DbWeight::get().reads(34)) + .saturating_add(T::DbWeight::get().writes(34)) + } + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IndexToId (r:0 w:1) + /// Proof: FellowshipCollective IndexToId (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:0 w:1) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// The range of component `r` is `[0, 10]`. + fn promote_member(_r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `277 + r * (17 ±0)` + // Estimated: `5006` + // Minimum execution time: 29_000 nanoseconds. + Weight::from_ref_time(32_000_000) + .saturating_add(Weight::from_proof_size(5006)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipCollective Members (r:1 w:1) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:1) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IdToIndex (r:1 w:1) + /// Proof: FellowshipCollective IdToIndex (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: FellowshipCollective IndexToId (r:1 w:1) + /// Proof: FellowshipCollective IndexToId (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// The range of component `r` is `[0, 10]`. + fn demote_member(_r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `575 + r * (71 ±0)` + // Estimated: `10064` + // Minimum execution time: 45_000 nanoseconds. + Weight::from_ref_time(81_000_000) + .saturating_add(Weight::from_proof_size(10064)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Voting (r:1 w:1) + /// Proof: FellowshipCollective Voting (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `665` + // Estimated: `325010` + // Minimum execution time: 58_000 nanoseconds. + Weight::from_ref_time(58_000_000) + .saturating_add(Weight::from_proof_size(325010)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective VotingCleanup (r:1 w:0) + /// Proof: FellowshipCollective VotingCleanup (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: FellowshipCollective Voting (r:0 w:100) + /// Proof: FellowshipCollective Voting (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) + /// The range of component `n` is `[0, 100]`. + fn cleanup_poll(_n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `308 + n * (52 ±0)` + // Estimated: `5964` + // Minimum execution time: 20_000 nanoseconds. + Weight::from_ref_time(160_000_000) + .saturating_add(Weight::from_proof_size(5964)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(100)) + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs new file mode 100644 index 00000000000..958ed06d580 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs @@ -0,0 +1,538 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_referenda` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_referenda +// --extrinsic=* +// --steps=2 +// --repeat=1 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_referenda`. +pub struct WeightInfo(PhantomData); +impl pallet_referenda::WeightInfo for WeightInfo { + /// Storage: FellowshipCollective Members (r:1 w:0) + /// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda ReferendumCount (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda ReferendumInfoFor (r:0 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + fn submit() -> Weight { + // Proof Size summary in bytes: + // Measured: `322` + // Estimated: `161305` + // Minimum execution time: 38_000 nanoseconds. + Weight::from_ref_time(38_000_000) + .saturating_add(Weight::from_proof_size(161305)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn place_decision_deposit_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `430` + // Estimated: `319953` + // Minimum execution time: 60_000 nanoseconds. + Weight::from_ref_time(60_000_000) + .saturating_add(Weight::from_proof_size(319953)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:0) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + fn place_decision_deposit_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `1941` + // Estimated: `9151` + // Minimum execution time: 89_000 nanoseconds. + Weight::from_ref_time(89_000_000) + .saturating_add(Weight::from_proof_size(9151)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:0) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + fn place_decision_deposit_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `1982` + // Estimated: `9151` + // Minimum execution time: 82_000 nanoseconds. + Weight::from_ref_time(82_000_000) + .saturating_add(Weight::from_proof_size(9151)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:1) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn place_decision_deposit_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `833` + // Estimated: `324931` + // Minimum execution time: 161_000 nanoseconds. + Weight::from_ref_time(161_000_000) + .saturating_add(Weight::from_proof_size(324931)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:1) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + fn place_decision_deposit_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `643` + // Estimated: `8353` + // Minimum execution time: 60_000 nanoseconds. + Weight::from_ref_time(60_000_000) + .saturating_add(Weight::from_proof_size(8353)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + fn refund_decision_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `381` + // Estimated: `3375` + // Minimum execution time: 38_000 nanoseconds. + Weight::from_ref_time(38_000_000) + .saturating_add(Weight::from_proof_size(3375)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + fn refund_submission_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `199` + // Estimated: `3375` + // Minimum execution time: 19_000 nanoseconds. + Weight::from_ref_time(19_000_000) + .saturating_add(Weight::from_proof_size(3375)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn cancel() -> Weight { + // Proof Size summary in bytes: + // Measured: `343` + // Estimated: `319953` + // Minimum execution time: 45_000 nanoseconds. + Weight::from_ref_time(45_000_000) + .saturating_add(Weight::from_proof_size(319953)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: PolkadotXcm SupportedVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem HostConfiguration (r:1 w:0) + /// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: FellowshipReferenda MetadataOf (r:1 w:0) + /// Proof: FellowshipReferenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + fn kill() -> Weight { + // Proof Size summary in bytes: + // Measured: `581` + // Estimated: `332942` + // Minimum execution time: 170_000 nanoseconds. + Weight::from_ref_time(170_000_000) + .saturating_add(Weight::from_proof_size(332942)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: FellowshipReferenda TrackQueue (r:1 w:0) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:1) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + fn one_fewer_deciding_queue_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `140` + // Estimated: `5776` + // Minimum execution time: 13_000 nanoseconds. + Weight::from_ref_time(13_000_000) + .saturating_add(Weight::from_proof_size(5776)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn one_fewer_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3991` + // Estimated: `325729` + // Minimum execution time: 236_000 nanoseconds. + Weight::from_ref_time(236_000_000) + .saturating_add(Weight::from_proof_size(325729)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn one_fewer_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3991` + // Estimated: `325729` + // Minimum execution time: 293_000 nanoseconds. + Weight::from_ref_time(293_000_000) + .saturating_add(Weight::from_proof_size(325729)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_requeued_insertion() -> Weight { + // Proof Size summary in bytes: + // Measured: `3589` + // Estimated: `164951` + // Minimum execution time: 160_000 nanoseconds. + Weight::from_ref_time(160_000_000) + .saturating_add(Weight::from_proof_size(164951)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_requeued_slide() -> Weight { + // Proof Size summary in bytes: + // Measured: `3542` + // Estimated: `164951` + // Minimum execution time: 146_000 nanoseconds. + Weight::from_ref_time(146_000_000) + .saturating_add(Weight::from_proof_size(164951)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:0) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `3528` + // Estimated: `167440` + // Minimum execution time: 161_000 nanoseconds. + Weight::from_ref_time(161_000_000) + .saturating_add(Weight::from_proof_size(167440)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:0) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda TrackQueue (r:1 w:1) + /// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `3583` + // Estimated: `167440` + // Minimum execution time: 158_000 nanoseconds. + Weight::from_ref_time(158_000_000) + .saturating_add(Weight::from_proof_size(167440)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_no_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `295` + // Estimated: `161664` + // Minimum execution time: 32_000 nanoseconds. + Weight::from_ref_time(32_000_000) + .saturating_add(Weight::from_proof_size(161664)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `343` + // Estimated: `161664` + // Minimum execution time: 29_000 nanoseconds. + Weight::from_ref_time(29_000_000) + .saturating_add(Weight::from_proof_size(161664)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + fn nudge_referendum_timed_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `240` + // Estimated: `3375` + // Minimum execution time: 20_000 nanoseconds. + Weight::from_ref_time(20_000_000) + .saturating_add(Weight::from_proof_size(3375)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:1) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_begin_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `611` + // Estimated: `166642` + // Minimum execution time: 42_000 nanoseconds. + Weight::from_ref_time(42_000_000) + .saturating_add(Weight::from_proof_size(166642)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda DecidingCount (r:1 w:1) + /// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_begin_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `746` + // Estimated: `166642` + // Minimum execution time: 92_000 nanoseconds. + Weight::from_ref_time(92_000_000) + .saturating_add(Weight::from_proof_size(166642)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_begin_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `799` + // Estimated: `164153` + // Minimum execution time: 89_000 nanoseconds. + Weight::from_ref_time(89_000_000) + .saturating_add(Weight::from_proof_size(164153)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_end_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `782` + // Estimated: `164153` + // Minimum execution time: 103_000 nanoseconds. + Weight::from_ref_time(103_000_000) + .saturating_add(Weight::from_proof_size(164153)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_continue_not_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `799` + // Estimated: `164153` + // Minimum execution time: 84_000 nanoseconds. + Weight::from_ref_time(84_000_000) + .saturating_add(Weight::from_proof_size(164153)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_continue_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `803` + // Estimated: `164153` + // Minimum execution time: 91_000 nanoseconds. + Weight::from_ref_time(91_000_000) + .saturating_add(Weight::from_proof_size(164153)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:2 w:2) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// Storage: Scheduler Lookup (r:1 w:1) + /// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) + fn nudge_referendum_approved() -> Weight { + // Proof Size summary in bytes: + // Measured: `803` + // Estimated: `324965` + // Minimum execution time: 151_000 nanoseconds. + Weight::from_ref_time(151_000_000) + .saturating_add(Weight::from_proof_size(324965)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipCollective MemberCount (r:1 w:0) + /// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + fn nudge_referendum_rejected() -> Weight { + // Proof Size summary in bytes: + // Measured: `799` + // Estimated: `164153` + // Minimum execution time: 92_000 nanoseconds. + Weight::from_ref_time(92_000_000) + .saturating_add(Weight::from_proof_size(164153)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: Preimage StatusFor (r:1 w:0) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda MetadataOf (r:0 w:1) + /// Proof: FellowshipReferenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + fn set_some_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `384` + // Estimated: `5941` + // Minimum execution time: 26_000 nanoseconds. + Weight::from_ref_time(26_000_000) + .saturating_add(Weight::from_proof_size(5941)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0) + /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) + /// Storage: FellowshipReferenda MetadataOf (r:1 w:1) + /// Proof: FellowshipReferenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `317` + // Estimated: `5902` + // Minimum execution time: 22_000 nanoseconds. + Weight::from_ref_time(22_000_000) + .saturating_add(Weight::from_proof_size(5902)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs new file mode 100644 index 00000000000..9e51da83fe4 --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs @@ -0,0 +1,191 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_scheduler` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_scheduler +// --extrinsic=* +// --steps=2 +// --repeat=1 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_scheduler`. +pub struct WeightInfo(PhantomData); +impl pallet_scheduler::WeightInfo for WeightInfo { + /// Storage: Scheduler IncompleteSince (r:1 w:1) + /// Proof: Scheduler IncompleteSince (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn service_agendas_base() -> Weight { + // Proof Size summary in bytes: + // Measured: `31` + // Estimated: `499` + // Minimum execution time: 5_000 nanoseconds. + Weight::from_ref_time(5_000_000) + .saturating_add(Weight::from_proof_size(499)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 200]`. + fn service_agenda_base(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `4 + s * (177 ±0)` + // Estimated: `158289` + // Minimum execution time: 4_000 nanoseconds. + Weight::from_ref_time(175_000_000) + .saturating_add(Weight::from_proof_size(158289)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + fn service_task_base() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_000 nanoseconds. + Weight::from_ref_time(8_000_000) + .saturating_add(Weight::from_proof_size(0)) + } + /// Storage: Preimage PreimageFor (r:1 w:1) + /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured) + /// Storage: Preimage StatusFor (r:1 w:1) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `204 + s * (1 ±0)` + // Estimated: `4199553` + // Minimum execution time: 25_000 nanoseconds. + Weight::from_ref_time(4_063_000_000) + .saturating_add(Weight::from_proof_size(4199553)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Scheduler Lookup (r:0 w:1) + /// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) + fn service_task_named() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_000 nanoseconds. + Weight::from_ref_time(10_000_000) + .saturating_add(Weight::from_proof_size(0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + fn service_task_periodic() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_000 nanoseconds. + Weight::from_ref_time(7_000_000) + .saturating_add(Weight::from_proof_size(0)) + } + fn execute_dispatch_signed() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000 nanoseconds. + Weight::from_ref_time(5_000_000) + .saturating_add(Weight::from_proof_size(0)) + } + fn execute_dispatch_unsigned() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000 nanoseconds. + Weight::from_ref_time(5_000_000) + .saturating_add(Weight::from_proof_size(0)) + } + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 199]`. + fn schedule(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `4 + s * (177 ±0)` + // Estimated: `158289` + // Minimum execution time: 21_000 nanoseconds. + Weight::from_ref_time(198_000_000) + .saturating_add(Weight::from_proof_size(158289)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// Storage: Scheduler Lookup (r:0 w:1) + /// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) + /// The range of component `s` is `[1, 200]`. + fn cancel(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `109 + s * (177 ±0)` + // Estimated: `158289` + // Minimum execution time: 20_000 nanoseconds. + Weight::from_ref_time(315_000_000) + .saturating_add(Weight::from_proof_size(158289)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Scheduler Lookup (r:1 w:1) + /// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 199]`. + fn schedule_named(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `4 + s * (181 ±0)` + // Estimated: `160812` + // Minimum execution time: 34_000 nanoseconds. + Weight::from_ref_time(223_000_000) + .saturating_add(Weight::from_proof_size(160812)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Scheduler Lookup (r:1 w:1) + /// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) + /// Storage: Scheduler Agenda (r:1 w:1) + /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) + /// The range of component `s` is `[1, 200]`. + fn cancel_named(_s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `141 + s * (181 ±0)` + // Estimated: `160812` + // Minimum execution time: 24_000 nanoseconds. + Weight::from_ref_time(331_000_000) + .saturating_add(Weight::from_proof_size(160812)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index 09f3d536885..94d653b7f4d 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -38,6 +38,10 @@ elif [[ $runtimeName == "collectives-polkadot" ]]; then pallet_utility cumulus_pallet_xcmp_queue frame_system + pallet_scheduler + pallet_preimage + pallet_referenda + pallet_ranked_collective ) elif [[ $runtimeName == "bridge-hub-kusama" ]] || [[ $runtimeName == "bridge-hub-polkadot" ]]; then pallets=( From 1f9cfdde3edb8e26c41fb6a7170ce542f14979f9 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 16 Feb 2023 06:32:35 +0100 Subject: [PATCH 09/32] proxy for Fellowship --- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 0145b3587f7..d97950aa371 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -284,6 +284,8 @@ pub enum ProxyType { Collator, /// Alliance proxy. Allows calls related to the Alliance. Alliance, + /// Fellowship proxy. Allows calls related to the Fellowship. + Fellowship, } impl Default for ProxyType { fn default() -> Self { @@ -293,7 +295,6 @@ impl Default for ProxyType { impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { - // todo update proxy ProxyType::Any => true, ProxyType::NonTransfer => !matches!(c, RuntimeCall::Balances { .. }), ProxyType::CancelProxy => matches!( @@ -315,6 +316,10 @@ impl InstanceFilter for ProxyType { RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), + ProxyType::Fellowship => matches!( + c, + RuntimeCall::FellowshipCollective { .. } | RuntimeCall::FellowshipReferenda { .. } + ), } } fn is_superset(&self, o: &Self) -> bool { From 34a7bd3d2e170c60e6e223db8024d7f457f7141d Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 16 Feb 2023 08:27:50 +0100 Subject: [PATCH 10/32] docs --- .../collectives/collectives-polkadot/src/constants.rs | 6 ++++-- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index b544c688da5..7a439f5ee27 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -19,10 +19,12 @@ pub mod account { /// Relay Chain treasury pallet id, used to convert into AccountId pub const RELAY_TREASURY_PALL_ID: PalletId = PalletId(*b"py/trsry"); /// Alliance pallet id. - /// Used as an account to temporarily deposit slashed imbalance before teleporting. + /// It is used as a temporarily place to deposit a slashed imbalance + /// before the teleport to the treasury. pub const ALLIANCE_PALLET_ID: PalletId = PalletId(*b"py/allia"); /// Referenda pallet id. - /// Used as an account to temporarily deposit slashed imbalance before teleporting. + /// It is used as a temporarily place to deposit a slashed imbalance + /// before the teleport to the treasury. pub const REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/refer"); } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index d97950aa371..ec7af6e92b8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -461,7 +461,8 @@ pub const MAX_ALLIES: u32 = 100; parameter_types! { pub const AllyDeposit: Balance = 1_000 * UNITS; // 1,000 DOT bond to join as an Ally - // Alliance pallet account, used to temporarily deposit slashed imbalance before teleporting. + // The Alliance pallet account, used as a temporarily place to deposit a slashed imbalance + // before the teleport to the treasury. pub AlliancePalletAccId: AccountId = constants::account::ALLIANCE_PALLET_ID.into_account_truncating(); pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); // The number of blocks a member must wait between giving a retirement notice and retiring. From 6ece4f324ccec679bfb9409a6c380bc04d5d9175 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 20 Feb 2023 09:18:25 +0100 Subject: [PATCH 11/32] correct copyright date --- .../collectives/collectives-polkadot/src/fellowship/mod.rs | 2 +- .../collectives/collectives-polkadot/src/fellowship/origins.rs | 2 +- .../collectives/collectives-polkadot/src/fellowship/tracks.rs | 2 +- .../collectives-polkadot/src/weights/pallet_preimage.rs | 2 +- .../src/weights/pallet_ranked_collective.rs | 2 +- .../collectives-polkadot/src/weights/pallet_referenda.rs | 2 +- .../collectives-polkadot/src/weights/pallet_scheduler.rs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 847777885b1..688b2d08f04 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs index efa06c1acbf..517a8d898d7 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index 666a06a78d6..5a3da35d5d9 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs index c8c834fd616..fc454d1243d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs index b5428de8e9c..ae3b1ab7c47 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs index 958ed06d580..b73540c32d2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs index 9e51da83fe4..342f153c5fd 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2023 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify From 7213d57484c78bd1e73a85ff2ab32762b6f95145 Mon Sep 17 00:00:00 2001 From: Muharem Ismailov Date: Sat, 25 Feb 2023 01:43:31 +0100 Subject: [PATCH 12/32] Apply suggestions from code review Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> --- .../collectives-polkadot/src/fellowship/mod.rs | 6 +++--- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 688b2d08f04..f2312dc808f 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -//! The Polkadot Fellowship. +//! The Polkadot Technical Fellowship. mod origins; mod tracks; @@ -112,8 +112,8 @@ impl pallet_ranked_collective::Config for Runtime type WeightInfo = weights::pallet_ranked_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; // Promotion is by any of: - // - Root can demote arbitrarily. - // - the FellowshipAdmin origin (i.e. token holder referendum); + // - Root can promote arbitrarily. + // - a majority of the Technical Committee (for initialization, to be later removed); // - a vote by the rank *above* the new rank. type PromoteOrigin = EitherOf< EitherOf< diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index ec7af6e92b8..890bd752ada 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -318,7 +318,9 @@ impl InstanceFilter for ProxyType { ), ProxyType::Fellowship => matches!( c, - RuntimeCall::FellowshipCollective { .. } | RuntimeCall::FellowshipReferenda { .. } + RuntimeCall::FellowshipCollective { .. } | RuntimeCall::FellowshipReferenda { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -461,8 +463,8 @@ pub const MAX_ALLIES: u32 = 100; parameter_types! { pub const AllyDeposit: Balance = 1_000 * UNITS; // 1,000 DOT bond to join as an Ally - // The Alliance pallet account, used as a temporarily place to deposit a slashed imbalance - // before the teleport to the treasury. + // The Alliance pallet account, used as a temporary place to deposit a slashed imbalance + // before the teleport to the Treasury. pub AlliancePalletAccId: AccountId = constants::account::ALLIANCE_PALLET_ID.into_account_truncating(); pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); // The number of blocks a member must wait between giving a retirement notice and retiring. From 0b82eaf14409112874f3b85c0bfb51385f739f29 Mon Sep 17 00:00:00 2001 From: muharem Date: Sat, 25 Feb 2023 02:28:39 +0100 Subject: [PATCH 13/32] rustfmt --- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 890bd752ada..3e44a17114d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -318,7 +318,8 @@ impl InstanceFilter for ProxyType { ), ProxyType::Fellowship => matches!( c, - RuntimeCall::FellowshipCollective { .. } | RuntimeCall::FellowshipReferenda { .. } | + RuntimeCall::FellowshipCollective { .. } | + RuntimeCall::FellowshipReferenda { .. } | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), From 03f5c87174fd66f6ca22977aba717fd5cf391ebf Mon Sep 17 00:00:00 2001 From: muharem Date: Sat, 25 Feb 2023 16:35:38 +0100 Subject: [PATCH 14/32] remove council, update origins --- parachain-template/runtime/src/lib.rs | 15 +++++++---- .../runtimes/assets/statemine/src/lib.rs | 20 +++++--------- .../runtimes/assets/statemint/src/lib.rs | 20 +++++--------- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 27 ++++++++++++------- .../bridge-hub-polkadot/src/lib.rs | 27 ++++++++++++------- .../bridge-hub-polkadot/src/xcm_config.rs | 1 + .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 2 -- .../src/fellowship/mod.rs | 2 -- .../collectives-polkadot/src/lib.rs | 17 ++++++------ 9 files changed, 67 insertions(+), 64 deletions(-) diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index 7b5d0b4e2f8..f51c684b20f 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -29,7 +29,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU64, ConstU8, Everything}, + traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -40,9 +40,10 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{RelayLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -425,11 +426,15 @@ parameter_types! { pub const MinCandidates: u32 = 5; pub const SessionLength: BlockNumber = 6 * HOURS; pub const MaxInvulnerables: u32 = 100; - pub const ExecutiveBody: BodyId = BodyId::Executive; + // StakingAdmin pluralistic body. + pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -// We allow root only to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = EnsureRoot; +/// We allow root and the StakingAdmin to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; impl pallet_collator_selection::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 90cd768f989..935b4d5bd6e 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -70,7 +70,7 @@ use xcm_config::{KsmLocation, XcmConfig}; pub use sp_runtime::BuildStorage; // Polkadot imports -use pallet_xcm::{EnsureXcm, IsMajorityOfBody, IsVoiceOfBody}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm::latest::BodyId; use xcm_executor::XcmExecutor; @@ -223,12 +223,10 @@ parameter_types! { // https://github.com/paritytech/substrate/blob/069917b/frame/assets/src/lib.rs#L257L271 pub const MetadataDepositBase: Balance = deposit(1, 68); pub const MetadataDepositPerByte: Balance = deposit(0, 1); - pub const ExecutiveBody: BodyId = BodyId::Executive; } -/// We allow root and the Relay Chain council to execute privileged asset operations. -pub type AssetsForceOrigin = - EitherOfDiverse, EnsureXcm>>; +/// We allow root to execute privileged asset operations. +pub type AssetsForceOrigin = EnsureRoot; // Called "Trust Backed" assets because these are generally registered by some account, and users of // the asset assume it has some claimed backing. The pallet is called `Assets` in @@ -468,10 +466,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm<( - IsMajorityOfBody, - IsVoiceOfBody, - )>, + EnsureXcm>, >; type ControllerOriginConverter = xcm_config::XcmOriginToTransactDispatchOrigin; type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; @@ -519,13 +514,10 @@ parameter_types! { pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root, the Relay Chain council and the StakingAdmin to execute privileged collator selection operations. +/// We allow root the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm<( - IsMajorityOfBody, - IsVoiceOfBody, - )>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 0775d996e3d..ce3296b89a3 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -99,7 +99,7 @@ use xcm_config::{CollectivesLocation, DotLocation, XcmConfig, XcmOriginToTransac pub use sp_runtime::BuildStorage; // Polkadot imports -use pallet_xcm::{EnsureXcm, IsMajorityOfBody, IsVoiceOfBody}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm::latest::BodyId; use xcm_executor::XcmExecutor; @@ -238,12 +238,10 @@ parameter_types! { // https://github.com/paritytech/substrate/blob/069917b/frame/assets/src/lib.rs#L257L271 pub const MetadataDepositBase: Balance = deposit(1, 68); pub const MetadataDepositPerByte: Balance = deposit(0, 1); - pub const ExecutiveBody: BodyId = BodyId::Executive; } -/// We allow root and the Relay Chain council to execute privileged asset operations. -pub type AssetsForceOrigin = - EitherOfDiverse, EnsureXcm>>; +/// We allow root to execute privileged asset operations. +pub type AssetsForceOrigin = EnsureRoot; // Called "Trust Backed" assets because these are generally registered by some account, and users of // the asset assume it has some claimed backing. The pallet is called `Assets` in @@ -484,10 +482,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm<( - IsMajorityOfBody, - IsVoiceOfBody, - )>, + EnsureXcm>, >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type PriceForSiblingDelivery = (); @@ -534,13 +529,10 @@ parameter_types! { pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root, the Relay Chain council and the StakingAdmin to execute privileged collator selection operations. +/// We allow root and the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm<( - IsMajorityOfBody, - IsVoiceOfBody, - )>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 4e53753548a..6d68fbbb162 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -54,7 +54,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; @@ -287,11 +287,15 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} -// TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895 -/// Privileged origin that represents Root or the majority of the Relay Chain Council. -pub type RootOrExecutiveSimpleMajority = EitherOfDiverse< +parameter_types! { + // Fellows pluralistic body. + pub const FellowsBodyId: BodyId = BodyId::Technical; +} + +/// Privileged origin that represents Root or Fellows pluralistic body. +pub type RootOrFellows = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl cumulus_pallet_xcmp_queue::Config for Runtime { @@ -300,7 +304,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; type ExecuteOverweightOrigin = EnsureRoot; - type ControllerOrigin = RootOrExecutiveSimpleMajority; + type ControllerOrigin = RootOrFellows; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; type PriceForSiblingDelivery = (); @@ -338,12 +342,15 @@ impl pallet_aura::Config for Runtime { parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); pub const SessionLength: BlockNumber = 6 * HOURS; - pub const ExecutiveBody: BodyId = BodyId::Executive; + // StakingAdmin pluralistic body. + pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -// TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895 -/// We allow root and the Relay Chain council to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; +/// We allow root, the StakingAdmin to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; impl pallet_collator_selection::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index bf2213a4bbf..6f9f4cc6ee2 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -54,10 +54,10 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{CollectivesLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -287,10 +287,15 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} -/// Privileged origin that represents Root or the majority of the Relay Chain Council. -pub type RootOrExecutiveSimpleMajority = EitherOfDiverse< +parameter_types! { + // Fellows pluralistic body. + pub const FellowsBodyId: BodyId = BodyId::Technical; +} + +/// Privileged origin that represents Root or Fellows. +pub type RootOrFellows = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl cumulus_pallet_xcmp_queue::Config for Runtime { @@ -299,7 +304,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; type ExecuteOverweightOrigin = EnsureRoot; - type ControllerOrigin = RootOrExecutiveSimpleMajority; + type ControllerOrigin = RootOrFellows; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; type PriceForSiblingDelivery = (); @@ -337,11 +342,15 @@ impl pallet_aura::Config for Runtime { parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); pub const SessionLength: BlockNumber = 6 * HOURS; - pub const ExecutiveBody: BodyId = BodyId::Executive; + // StakingAdmin pluralistic body. + pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root and the Relay Chain council to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; +/// We allow root, the StakingAdmin to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; impl pallet_collator_selection::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index c7988e7d99f..5be606fd8df 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -47,6 +47,7 @@ parameter_types! { X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; + pub CollectivesLocation: MultiLocation = MultiLocation::new(1, Parachain(1001)); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index a545b83f143..6a40d98778d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -75,7 +75,6 @@ use parachains_common::{ opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; /// The address format for describing accounts. @@ -368,7 +367,6 @@ impl pallet_aura::Config for Runtime { parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); pub const SessionLength: BlockNumber = 6 * HOURS; - pub const ExecutiveBody: BodyId = BodyId::Executive; } pub type CollatorSelectionUpdateOrigin = EnsureRoot; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index f2312dc808f..f541286ad05 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -106,8 +106,6 @@ morph_types! { } where N::Type: CheckedSub; } -// IsMajorityOfBody, - impl pallet_ranked_collective::Config for Runtime { type WeightInfo = weights::pallet_ranked_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 3e44a17114d..165d27efd60 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -87,7 +87,7 @@ use xcm_config::{DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; pub use sp_runtime::BuildStorage; // Polkadot imports -use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use xcm::latest::BodyId; use xcm_executor::XcmExecutor; @@ -118,9 +118,6 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } -/// Privileged origin that represents Root or the majority of the Relay Chain Council. -pub type RootOrExecutiveSimpleMajority = - EitherOfDiverse, EnsureXcm>>; /// Privileged origin that represents Root or more than two thirds of the Alliance. pub type RootOrAllianceTwoThirdsMajority = EitherOfDiverse< EnsureRoot, @@ -378,7 +375,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; type ExecuteOverweightOrigin = EnsureRoot; - type ControllerOrigin = RootOrExecutiveSimpleMajority; + type ControllerOrigin = EitherOfDiverse, Fellows>; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; type PriceForSiblingDelivery = (); @@ -416,11 +413,15 @@ impl pallet_aura::Config for Runtime { parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); pub const SessionLength: BlockNumber = 6 * HOURS; - pub const ExecutiveBody: BodyId = BodyId::Executive; + // StakingAdmin pluralistic body. + pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root and the Relay Chain council to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; +/// We allow root and the StakingAdmin to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; impl pallet_collator_selection::Config for Runtime { type RuntimeEvent = RuntimeEvent; From 73a2f36a7b7063d14c81188a94e8f08fa622acbe Mon Sep 17 00:00:00 2001 From: muharem Date: Sat, 25 Feb 2023 16:47:50 +0100 Subject: [PATCH 15/32] renames --- .../collectives/collectives-polkadot/src/constants.rs | 2 +- .../collectives-polkadot/src/fellowship/mod.rs | 11 +++++------ .../collectives-polkadot/src/fellowship/origins.rs | 2 +- .../collectives/collectives-polkadot/src/lib.rs | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index 7a439f5ee27..14a11234a3a 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -17,7 +17,7 @@ pub mod account { use frame_support::PalletId; /// Relay Chain treasury pallet id, used to convert into AccountId - pub const RELAY_TREASURY_PALL_ID: PalletId = PalletId(*b"py/trsry"); + pub const RELAY_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry"); /// Alliance pallet id. /// It is used as a temporarily place to deposit a slashed imbalance /// before the teleport to the treasury. diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index f541286ad05..097a4163508 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -25,8 +25,8 @@ pub use origins::{ use crate::{ constants, impls::ToParentTreasury, weights, AccountId, Balance, Balances, BlockNumber, - DotLocation, FellowshipReferenda, Preimage, Runtime, RuntimeCall, RuntimeEvent, Scheduler, - DAYS, + DotLocation, FellowshipReferenda, Preimage, RelayTreasuryAccount, Runtime, RuntimeCall, + RuntimeEvent, Scheduler, DAYS, }; use frame_support::{ parameter_types, @@ -48,7 +48,7 @@ use self::origins::EnsureFellowship; pub mod ranks { use pallet_ranked_collective::Rank; - pub const INITIATES: Rank = 0; + pub const CANDIDATES: Rank = 0; pub const DAN_1: Rank = 1; pub const DAN_2: Rank = 2; pub const DAN_3: Rank = 3; // aka Fellows. @@ -66,8 +66,7 @@ parameter_types! { pub const UndecidingTimeout: BlockNumber = 7 * DAYS; pub const TechnicalCommittee: BodyId = BodyId::Technical; // Referenda pallet account, used to temporarily deposit slashed imbalance before teleporting. - pub ReferendaPalletAccId: AccountId = constants::account::REFERENDA_PALLET_ID.into_account_truncating(); - pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); + pub ReferendaPalletAccount: AccountId = constants::account::REFERENDA_PALLET_ID.into_account_truncating(); pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX); } @@ -85,7 +84,7 @@ impl pallet_referenda::Config for Runtime { pallet_ranked_collective::EnsureMember; type CancelOrigin = FellowshipExperts; type KillOrigin = FellowshipMasters; - type Slash = ToParentTreasury; + type Slash = ToParentTreasury; type Votes = pallet_ranked_collective::Votes; type Tally = pallet_ranked_collective::TallyOf; type SubmissionDeposit = SubmissionDeposit; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs index 517a8d898d7..13914d485ab 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -93,7 +93,7 @@ pub mod pallet_origins { () => {} } decl_unit_ensures!( - FellowshipInitiates: Rank = ranks::INITIATES, + FellowshipInitiates: Rank = ranks::CANDIDATES, Fellows: Rank = ranks::DAN_3, FellowshipExperts: Rank = ranks::DAN_5, FellowshipMasters: Rank = ranks::DAN_7, diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 165d27efd60..baaa3f95fa3 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -467,8 +467,8 @@ parameter_types! { pub const AllyDeposit: Balance = 1_000 * UNITS; // 1,000 DOT bond to join as an Ally // The Alliance pallet account, used as a temporary place to deposit a slashed imbalance // before the teleport to the Treasury. - pub AlliancePalletAccId: AccountId = constants::account::ALLIANCE_PALLET_ID.into_account_truncating(); - pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating(); + pub AlliancePalletAccount: AccountId = constants::account::ALLIANCE_PALLET_ID.into_account_truncating(); + pub RelayTreasuryAccount: AccountId = constants::account::RELAY_TREASURY_PALLET_ID.into_account_truncating(); // The number of blocks a member must wait between giving a retirement notice and retiring. // Supposed to be greater than time required to `kick_member` with alliance motion. pub const AllianceRetirementPeriod: BlockNumber = (90 * DAYS) + ALLIANCE_MOTION_DURATION; @@ -481,7 +481,7 @@ impl pallet_alliance::Config for Runtime { type MembershipManager = RootOrAllianceTwoThirdsMajority; type AnnouncementOrigin = RootOrAllianceTwoThirdsMajority; type Currency = Balances; - type Slashed = ToParentTreasury; + type Slashed = ToParentTreasury; type InitializeMembers = AllianceMotion; type MembershipChanged = AllianceMotion; type RetirementPeriod = AllianceRetirementPeriod; From 58c986e07af4d97e3e0bcf068097c269c67ead20 Mon Sep 17 00:00:00 2001 From: muharem Date: Sat, 25 Feb 2023 16:52:18 +0100 Subject: [PATCH 16/32] remove tech committee from promote origin --- .../collectives-polkadot/src/fellowship/mod.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 097a4163508..8453f8c833f 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -32,7 +32,7 @@ use frame_support::{ parameter_types, traits::{EitherOf, MapSuccess, TryMapSuccess}, }; -use pallet_xcm::{EnsureXcm, IsMajorityOfBody, IsVoiceOfBody}; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_constants::xcm::body::FELLOWSHIP_ADMIN_INDEX; use sp_arithmetic::traits::CheckedSub; use sp_core::ConstU32; @@ -64,7 +64,6 @@ parameter_types! { pub const AlarmInterval: BlockNumber = 1; pub const SubmissionDeposit: Balance = 0; pub const UndecidingTimeout: BlockNumber = 7 * DAYS; - pub const TechnicalCommittee: BodyId = BodyId::Technical; // Referenda pallet account, used to temporarily deposit slashed imbalance before teleporting. pub ReferendaPalletAccount: AccountId = constants::account::REFERENDA_PALLET_ID.into_account_truncating(); pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX); @@ -110,16 +109,10 @@ impl pallet_ranked_collective::Config for Runtime type RuntimeEvent = RuntimeEvent; // Promotion is by any of: // - Root can promote arbitrarily. - // - a majority of the Technical Committee (for initialization, to be later removed); + // - the FellowshipAdmin origin (i.e. token holder referendum); // - a vote by the rank *above* the new rank. type PromoteOrigin = EitherOf< - EitherOf< - frame_system::EnsureRootWithSuccess>, - MapSuccess< - EnsureXcm>, - Replace>, - >, - >, + frame_system::EnsureRootWithSuccess>, EitherOf< MapSuccess< EnsureXcm>, From c0fe803909a05cd09603e277e67b77d27430d5b4 Mon Sep 17 00:00:00 2001 From: muharem Date: Sun, 26 Feb 2023 14:31:10 +0100 Subject: [PATCH 17/32] renames --- parachains/runtimes/assets/statemine/src/lib.rs | 6 +++--- .../runtimes/assets/statemine/src/xcm_config.rs | 2 ++ parachains/runtimes/assets/statemint/src/lib.rs | 8 +++++--- .../runtimes/assets/statemint/src/xcm_config.rs | 3 ++- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 11 ++++++----- .../bridge-hub-kusama/src/xcm_config.rs | 2 ++ .../bridge-hubs/bridge-hub-polkadot/src/lib.rs | 11 ++++++----- .../bridge-hub-polkadot/src/xcm_config.rs | 3 ++- .../collectives-polkadot/src/fellowship/mod.rs | 8 ++++---- .../src/fellowship/origins.rs | 4 ++-- .../src/fellowship/tracks.rs | 2 +- .../collectives-polkadot/src/impls.rs | 16 +++++++++------- .../collectives/collectives-polkadot/src/lib.rs | 4 ++-- .../collectives-polkadot/src/xcm_config.rs | 1 + 14 files changed, 47 insertions(+), 34 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 935b4d5bd6e..1bbb393fbdd 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -64,7 +64,7 @@ use parachains_common::{ Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{KsmLocation, XcmConfig}; +use xcm_config::{FellowshipLocation, GovernanceLocation, XcmConfig}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -466,7 +466,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; type ControllerOriginConverter = xcm_config::XcmOriginToTransactDispatchOrigin; type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; @@ -517,7 +517,7 @@ parameter_types! { /// We allow root the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index 43b1c67f0bd..83abb3d787a 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -56,6 +56,8 @@ parameter_types! { pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); + pub const GovernanceLocation: MultiLocation = MultiLocation::parent(); + pub const FellowshipLocation: MultiLocation = MultiLocation::parent(); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index ce3296b89a3..71a78f4ac3a 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -93,7 +93,9 @@ use parachains_common::{ Signature, StatemintAuraId as AuraId, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{CollectivesLocation, DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{ + FellowshipLocation, GovernanceLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, +}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -482,7 +484,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type PriceForSiblingDelivery = (); @@ -532,7 +534,7 @@ parameter_types! { /// We allow root and the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index cc8d5b844a7..8c65632f423 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -56,7 +56,8 @@ parameter_types! { pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); - pub CollectivesLocation: MultiLocation = MultiLocation::new(1, Parachain(1001)); + pub FellowshipLocation: MultiLocation = MultiLocation::new(1, Parachain(1001)); + pub const GovernanceLocation: MultiLocation = MultiLocation::parent(); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 6d68fbbb162..ed8e4860920 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -57,7 +57,9 @@ use frame_system::{ use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{ + FellowshipLocation, GovernanceLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, +}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -67,12 +69,11 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -// XCM Imports -use crate::xcm_config::KsmRelayLocation; use parachains_common::{ opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; +// XCM Imports use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; @@ -295,7 +296,7 @@ parameter_types! { /// Privileged origin that represents Root or Fellows pluralistic body. pub type RootOrFellows = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl cumulus_pallet_xcmp_queue::Config for Runtime { @@ -349,7 +350,7 @@ parameter_types! { /// We allow root, the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index c2e95c6ed4e..28b6585d4dd 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -47,6 +47,8 @@ parameter_types! { X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; + pub const GovernanceLocation: MultiLocation = MultiLocation::parent(); + pub const FellowshipLocation: MultiLocation = MultiLocation::parent(); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 6f9f4cc6ee2..8a5d61d52c7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -57,7 +57,9 @@ use frame_system::{ use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -use xcm_config::{CollectivesLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{ + FellowshipLocation, GovernanceLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, +}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -67,12 +69,11 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -// XCM Imports -use crate::xcm_config::DotRelayLocation; use parachains_common::{ opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; +// XCM Imports use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; @@ -295,7 +296,7 @@ parameter_types! { /// Privileged origin that represents Root or Fellows. pub type RootOrFellows = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl cumulus_pallet_xcmp_queue::Config for Runtime { @@ -349,7 +350,7 @@ parameter_types! { /// We allow root, the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 5be606fd8df..64053428386 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -47,7 +47,8 @@ parameter_types! { X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; - pub CollectivesLocation: MultiLocation = MultiLocation::new(1, Parachain(1001)); + pub FellowshipLocation: MultiLocation = MultiLocation::new(1, Parachain(1001)); + pub const GovernanceLocation: MultiLocation = MultiLocation::parent(); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 8453f8c833f..3b822d99073 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -19,13 +19,13 @@ mod origins; mod tracks; pub use origins::{ - pallet_origins as pallet_fellowship_origins, Fellows, FellowshipExperts, FellowshipInitiates, + pallet_origins as pallet_fellowship_origins, Fellows, FellowshipCandidates, FellowshipExperts, FellowshipMasters, }; use crate::{ constants, impls::ToParentTreasury, weights, AccountId, Balance, Balances, BlockNumber, - DotLocation, FellowshipReferenda, Preimage, RelayTreasuryAccount, Runtime, RuntimeCall, + FellowshipReferenda, GovernanceLocation, Preimage, RelayTreasuryAccount, Runtime, RuntimeCall, RuntimeEvent, Scheduler, DAYS, }; use frame_support::{ @@ -115,7 +115,7 @@ impl pallet_ranked_collective::Config for Runtime frame_system::EnsureRootWithSuccess>, EitherOf< MapSuccess< - EnsureXcm>, + EnsureXcm>, Replace>, >, TryMapSuccess>>, @@ -129,7 +129,7 @@ impl pallet_ranked_collective::Config for Runtime frame_system::EnsureRootWithSuccess>, EitherOf< MapSuccess< - EnsureXcm>, + EnsureXcm>, Replace>, >, TryMapSuccess>>, diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs index 13914d485ab..db778f38cb4 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -35,7 +35,7 @@ pub mod pallet_origins { #[pallet::origin] pub enum Origin { /// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed). - FellowshipInitiates, + FellowshipCandidates, /// Origin commanded by Polkadot Fellows (3rd Dan fellows or greater). Fellows, /// Origin commanded by Polkadot Experts (5th Dan fellows or greater). @@ -93,7 +93,7 @@ pub mod pallet_origins { () => {} } decl_unit_ensures!( - FellowshipInitiates: Rank = ranks::CANDIDATES, + FellowshipCandidates: Rank = ranks::CANDIDATES, Fellows: Rank = ranks::DAN_3, FellowshipExperts: Rank = ranks::DAN_5, FellowshipMasters: Rank = ranks::DAN_7, diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index 5a3da35d5d9..5d75bde9e18 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -283,7 +283,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { } match Origin::try_from(id.clone()) { - Ok(Origin::FellowshipInitiates) => Ok(tracks::CANDIDATES), + Ok(Origin::FellowshipCandidates) => Ok(tracks::CANDIDATES), Ok(Origin::Fellowship1Dan) => Ok(tracks::MEMBERS), Ok(Origin::Fellowship2Dan) => Ok(tracks::PROFICIENTS), Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(tracks::FELLOWS), diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs index b38e86116b2..f70fb30bff7 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs @@ -36,16 +36,18 @@ pub type BalanceOf = as Currency<::AccountId>>::Balance; /// Implements `OnUnbalanced::on_unbalanced` to teleport slashed assets to relay chain treasury account. -pub struct ToParentTreasury(PhantomData<(TreasuryAcc, PalletAcc, T)>); +pub struct ToParentTreasury( + PhantomData<(TreasuryAccount, PalletAccount, T)>, +); -impl OnUnbalanced> - for ToParentTreasury +impl OnUnbalanced> + for ToParentTreasury where T: pallet_balances::Config + pallet_xcm::Config + frame_system::Config, <::RuntimeOrigin as OriginTrait>::AccountId: From>, [u8; 32]: From<::AccountId>, - TreasuryAcc: Get>, - PalletAcc: Get>, + TreasuryAccount: Get>, + PalletAccount: Get>, BalanceOf: Into, { fn on_unbalanced(amount: NegativeImbalance) { @@ -54,8 +56,8 @@ where Err(amount) => amount, }; let imbalance = amount.peek(); - let pallet_acc: AccountIdOf = PalletAcc::get(); - let treasury_acc: AccountIdOf = TreasuryAcc::get(); + let pallet_acc: AccountIdOf = PalletAccount::get(); + let treasury_acc: AccountIdOf = TreasuryAccount::get(); >::resolve_creating(&pallet_acc.clone(), amount); diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index baaa3f95fa3..38f97635d97 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -81,7 +81,7 @@ use parachains_common::{ Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{GovernanceLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -420,7 +420,7 @@ parameter_types! { /// We allow root and the StakingAdmin to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, - EnsureXcm>, + EnsureXcm>, >; impl pallet_collator_selection::Config for Runtime { diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index 2ebe64396fb..cac30d0e213 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -47,6 +47,7 @@ parameter_types! { X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = Here.into_location(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); + pub const GovernanceLocation: MultiLocation = MultiLocation::parent(); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used From ea1cc24bf7a2b5a2294255695b4c81c621249fa3 Mon Sep 17 00:00:00 2001 From: muharem Date: Sun, 26 Feb 2023 14:32:35 +0100 Subject: [PATCH 18/32] Fellowship import --- .../collectives-polkadot/Cargo.toml | 6 +- .../src/fellowship/migrations.rs | 233 ++++++++++++++++++ .../src/fellowship/mod.rs | 1 + .../collectives-polkadot/src/lib.rs | 7 +- 4 files changed, 240 insertions(+), 7 deletions(-) create mode 100644 parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index 31555b1e2dd..02667f539b5 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -7,7 +7,7 @@ description = "Polkadot Collectives Parachain Runtime" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -hex-literal = { version = "0.3.4", optional = true } +hex-literal = { version = "0.3.4" } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } smallvec = "1.10.0" @@ -73,16 +73,12 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } -[dev-dependencies] -hex-literal = "0.3.4" - [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } [features] default = [ "std" ] runtime-benchmarks = [ - "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs new file mode 100644 index 00000000000..ac33f41f4be --- /dev/null +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs @@ -0,0 +1,233 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Migrations. + +use frame_support::{pallet_prelude::*, traits::OnRuntimeUpgrade, weights::Weight}; +use log; + +/// Initial import of the Kusama Technical Fellowship. +pub(crate) mod import_kusama_fellowship { + use super::*; + use frame_support::parameter_types; + use pallet_ranked_collective::{ + Config, IdToIndex, IndexToId, MemberCount, MemberRecord, Members, + Pallet as RankedCollective, Rank, + }; + + const TARGET: &'static str = "runtime::migration::import_fellowship"; + + parameter_types! { + // The Fellowship addresses from Kusama state. + pub const FellowshipAddresses: [(Rank, [u8; 32]); 45] = [ + (6, hex_literal::hex!("86b7409a11700afb027924cb40fa43889d98709ea35319d48fea85dd35004e64"),), + (6, hex_literal::hex!("f60f9b64ebf26b9487c65ada132908745572692aef7cd9c987daf8c9c0c2ff3a"),), + (6, hex_literal::hex!("7628a5be63c4d3c8dbb96c2904b1a9682e02831a1af836c7efc808020b92fa63"),), + (5, hex_literal::hex!("9c84f75e0b1b92f6b003bde6212a8b2c9b776f3720f942b33fed8709f103a268"),), + (5, hex_literal::hex!("86bdd82d59404ffe1d6120c6358c14c1bef69a013fa91771c2594f6fa310187e"),), + (5, hex_literal::hex!("2e1884c53071526483b14004e894415f02b55fc2e2aef8e1df8ccf7ce5bd5570"),), + (5, hex_literal::hex!("f6b21d624832094b03aa672e016462a020e217cc67b1434785b99114a2b4fa5a"),), + (4, hex_literal::hex!("4adf51a47b72795366d52285e329229c836ea7bbfe139dbe8fa0700c4f86fc56"),), + (4, hex_literal::hex!("d25af2fedd4eb672f218932fde44f97f10c1d7788efd0079957ffad4f186ae78"),), + (4, hex_literal::hex!("ee9e0a9ced1d9809056b4adca8d224ea3c359ab9af1fb6986028fe816e37665a"),), + (3, hex_literal::hex!("9ec982d60f3779d8f0043933ee6d1b2a4346df17d07e44a22a2cd91a31076352"),), + (3, hex_literal::hex!("c4965f7fe7be8174717a24ffddf684986d122c7e293ddf875cdf9700a07b6812"),), + (3, hex_literal::hex!("beae5bcad1a8c156291b7ddf46b38b0c61a6aaacebd57b21c75627bfe7f9ab71"),), + (3, hex_literal::hex!("9ad97bf6cfb3fb36b24b221c27ea22cbdbfb4dd4b2c54f80d8235d490be9113b"),), + (3, hex_literal::hex!("e0f0f94962fc0a8c1a0f0527dc8e592c67939c46c903b6016cc0a8515da0044d"),), + (3, hex_literal::hex!("2658c2083dcab9b118b5e828fb81344c4245deb8eed43fa890c8c0ae9cae526d"),), + (3, hex_literal::hex!("123ca466ff6a76cdf3e73dc01bc1e8c4db195249e3b2e39a90036c6ded3db93a"),), + (2, hex_literal::hex!("2eba9a39dbfdd5f3cba964355d45e27319f0271023c0353d97dc6df2401b0e3d"),), + (2, hex_literal::hex!("b2636043fc3b8dfa608167a9fb6fb9d065b9f2f5821dc4bfc9785a244b24a92a"),), + (2, hex_literal::hex!("9e6eb74b0a6b39de36fb58d1fab20bc2b3fea96023ce5a47941c20480d99f92e"),), + (2, hex_literal::hex!("ee3d9d8c48ee88dce78fd7bafe3ce2052900eb465085b9324d4f5da26b145f2b"),), + (2, hex_literal::hex!("d8290537d6e31fe1ff165eaa62b63f6f3556dcc720b0d3a6d7eab96275617304"),), + (2, hex_literal::hex!("5a090c88f0438b46b451026597cee760a7bac9d396c9c7b529b68fb78aec5f43"),), + (2, hex_literal::hex!("18d30040a8245c5ff17afc9a8169d7d0771fe7ab4135a64a022c254117340720"),), + (1, hex_literal::hex!("b4f7f03bebc56ebe96bc52ea5ed3159d45a0ce3a8d7f082983c33ef133274747"),), + (1, hex_literal::hex!("caafae0aaa6333fcf4dc193146945fe8e4da74aa6c16d481eef0ca35b8279d73"),), + (1, hex_literal::hex!("e3d658975d1894d14c40bfa6f8b7e661cd2ee47b3f3c83f9258a4e9e8331df4e"),), + (1, hex_literal::hex!("584d715bcb7a2d3b6a3120891dba91b19b12df42cd50f1c76103e2581d5b4274"),), + (1, hex_literal::hex!("00ac81b86d05495a73dd7e98d33fb5bf55a837c6b87e3da0bf45618fed00be6d"),), + (1, hex_literal::hex!("78e4813814891bd48bc745b79254a978833d41fbe0f387df93cd87eae2468926"),), + (1, hex_literal::hex!("68170716ab7c6735dd0a1012045d9ea33891b5f6596cf97eb217d0962d86a518"),), + (1, hex_literal::hex!("585e982d74da4f4290d20a73800cfd705cf59e1f5880aaee5506b5eaaf544f49"),), + (1, hex_literal::hex!("d851f44a6f0d0d2f3439a51f2f75f66f4ea1a8e6c33c32f9af75fc188afb7546"),), + (1, hex_literal::hex!("dca89b135d1a6aee0a498610a70eeaed056727c8a4d220da245842e540a54a74"),), + (1, hex_literal::hex!("aa91fc0201f26b713a018669bcd269babf25368eee2493323b1ce0190a178a27"),), + (1, hex_literal::hex!("dc20836f2e4b88c1858d1e3f918e7358043b4a8abcd2874e74d91d26c52eca2a"),), + (1, hex_literal::hex!("9ebeef0150a33357023e678bfff549602e6943b5b85d8bfdb58473992fcfaf63"),), + (1, hex_literal::hex!("307183930b2264c5165f4a210a99520c5f1672b0413d57769fabc19e6866fb25"),), + (1, hex_literal::hex!("6201961514cf5ad87f1c4dd0c392ee28231f805f77975147bf2c33bd671b9822"),), + (1, hex_literal::hex!("c6f57237cd4abfbeed99171495fc784e45a9d5d2814d435de40de00991a73c06"),), + (1, hex_literal::hex!("c1df5c7e8ca56037450c58734326ebe34aec8f7d1928322a12164856365fea73"),), + (1, hex_literal::hex!("12c039004da5e1e846aae808277098c719cef1f4985aed00161a42ac4f0e002f"),), + (1, hex_literal::hex!("7460ac178015d2a7c289bb68ef9fdaac071596ab4425c276a0040aaac7055566"),), + (1, hex_literal::hex!("eec4bd650a277342ebba0954ac786df2623bd6a9d6d3e69b484482336c549f79"),), + (1, hex_literal::hex!("ca76c36de0085c8c561dbb64575cb016d4d6e7cef42b666d3ea978543f1c935a"),), + ]; + } + + /// Implements `OnRuntimeUpgrade` trait. + pub struct Migration(PhantomData<(T, I)>); + + impl, I: 'static> OnRuntimeUpgrade for Migration + where + ::AccountId: From<[u8; 32]>, + { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + let onchain_version = Pallet::::on_chain_storage_version(); + assert_eq!(onchain_version, 0, "the storage version must be 0."); + let member_count = MemberCount::::get(0); + assert_eq!(member_count, 0, "the collective must be uninitialized."); + + Ok(()) + } + + fn on_runtime_upgrade() -> Weight { + let current_version = RankedCollective::::current_storage_version(); + let onchain_version = RankedCollective::::on_chain_storage_version(); + let mut weight = T::DbWeight::get().reads(1); + log::info!( + target: TARGET, + "running migration with current storage version {:?} / onchain {:?}.", + current_version, + onchain_version + ); + if onchain_version != 0 { + log::warn!( + target: TARGET, + "unsupported storage version, skipping import_fellowship migration." + ); + return weight + } + let member_count = MemberCount::::get(0); + weight.saturating_accrue(T::DbWeight::get().reads(1)); + if member_count != 0 { + log::warn!( + target: TARGET, + "the collective already initialized, skipping import_fellowship migration." + ); + return weight + } + + let mut max_rank = 0; + for (rank, account_id32) in FellowshipAddresses::get() { + let who: T::AccountId = account_id32.into(); + Members::::insert(&who, MemberRecord::new(rank)); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + for inner_rank in 0..rank + 1 { + let index = MemberCount::::get(rank); + MemberCount::::insert(inner_rank, index + 1); + IdToIndex::::insert(inner_rank, &who, index); + IndexToId::::insert(inner_rank, index, &who); + max_rank = max_rank.max(inner_rank); + // 2 writes to IdToIndex and IndexToId. + weight.saturating_accrue(T::DbWeight::get().writes(2)); + } + } + // writes to MemberCount. + weight.saturating_accrue(T::DbWeight::get().writes((max_rank as u64) + 1)); + + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: Vec) -> Result<(), &'static str> { + assert_eq!(MemberCount::::get(0), 45, "invalid members count at rank 0."); + assert_eq!(MemberCount::::get(1), 45, "invalid members count at rank 1."); + assert_eq!(MemberCount::::get(2), 24, "invalid members count at rank 2."); + assert_eq!(MemberCount::::get(3), 17, "invalid members count at rank 3."); + assert_eq!(MemberCount::::get(4), 10, "invalid members count at rank 4."); + assert_eq!(MemberCount::::get(5), 7, "invalid members count at rank 5."); + assert_eq!(MemberCount::::get(6), 3, "invalid members count at rank 6."); + assert_eq!(MemberCount::::get(7), 0, "invalid members count at rank 7."); + Ok(()) + } + } +} + +#[cfg(test)] +pub mod tests { + use super::import_kusama_fellowship::FellowshipAddresses; + use pallet_ranked_collective::Rank; + use parachains_common::AccountId; + use sp_core::crypto::Ss58Codec; + use sp_runtime::AccountId32; + + #[test] + fn check_fellowship_addresses() { + let fellowship_addresses = FellowshipAddresses::get(); + let kusama_fellowship_ss58: [(Rank, _); 45] = [ + (6, "FcxNWVy5RESDsErjwyZmPCW6Z8Y3fbfLzmou34YZTrbcraL"), + (6, "J8ww78Qx3LVLW54bva3t4SzXcWKMdUWHEZR3V2VNKbmQgE8"), + (6, "FFFF3gBSSDFSvK2HBq4qgLH75DHqXWPHeCnR1BSksAMacBs"), + (5, "G7YVCdxZb8JLpAm9WMnJdNuojNT84AzU62zmvx5P1FMNtg2"), + (5, "FczL661VujsMFqZT32Y3iBmNpSxUw4gMnq2JtdoFT6rJzr4"), + (5, "Dcm1BqR4N7nHuV43TXdET7pNibt1Nzm42FggPHpxKRven53"), + (5, "J9nD3s7zssCX7bion1xctAF6xcVexcpy2uwy4jTm9JL8yuK"), + (4, "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"), + (4, "HL8bEp8YicBdrUmJocCAWVLKUaR2dd1y6jnD934pbre3un1"), + (4, "HyBryanRsB1GGKa9ZfqvRc3XpTDipYyRvxNNyZYfWFcenhd"), + (3, "GAWwkmjbLhM5pnAVbdZEkwd3QjHE7kaxJSCi3Ec91Q3QSDW"), + (3, "H25aCspunTUqAt4D1gC776vKZ8FX3MvQJ3Jde6qDXPQaFxk"), + (3, "GtLQoW4ZqcjExMPq6qB22bYc6NaX1yMzRuGWpSRiHqnzRb9"), + (3, "G5MVrgFmBaYei8N6t6DnDrb8JE53wKDkazLv5f46wVpi14y"), + (3, "HfFpz4QUxfbocHudf8UU7cMgHqkHpf855Me5X846PZAsAYE"), + (3, "DSbhnaGBytDGRfZTmdcArzCL6T3HQ8gcZxWpF5gLBP6y1Qe"), + (3, "CzEPpMr7XNS6dK7nQFnQbfnJQYLq7nvULK5kL9U8Zb6CTJm"), + (2, "Ddb9puChKMHq4gM6o47E551wAmaNeu6kHngX1jzNNqAw782"), + (2, "GcDZZCVPwkPqoWxx8vfLb4Yfpz9yQ1f4XEyqngSH8ygsL9p"), + (2, "GA3yPifemubFga7sTSFtLY2KFFiSRp6Bb8w31FS4xqgAvCz"), + (2, "HxhDbS3grLurk1dhDgPiuDaRowHY1xHCU8Vu8on3fdg85tx"), + (2, "HTk3eccL7WBkiyxz1gBcqQRghsJigoDMD7mnQaz1UAbMpQV"), + (2, "EcNWrSPSDcVBRymwr26kk4JVFg92PdoU5Xwp87W2FgFSt9c"), + (2, "D8sM6vKjWaeKy2zCPYWGkLLbWdUtWQrXBTQqr4dSYnVQo21"), + (1, "GfbnnEgRU94n9ed4RFZ6Z9dBAWs5obykigJSwXKU9hsT2uU"), + (1, "HA5NtttvyZsxo4wGxGoJJSMaWtdEFZAuGUMFHVWD7fgenPv"), + (1, "Hj44XnjZui7SQ3A5eBMoJFa4H4nVhiyWnL2i2xw5f1YqzRX"), + (1, "Ea6jhP5gF4r7NqhkEoAXJDgSgYpNQNaTYU6gPsrEGfctaKR"), + (1, "CbCmCwFkfFkQo7bQtVczYg7sJ3oue6Ez2Z4RMGR8gi8deRk"), + (1, "FJq9JpA9P7EXbmfsN9YiewJaDbQyL6vQyksGtJvzfbn6zf8"), + (1, "EvoLanodoqDsgHb98Ymbu41uXXKfCPDKxeM6dXHyJ2JoVus"), + (1, "EaBqDJJNsZmYdQ4xn1vomPJVNh7fjA6UztZeEjn7ZzdeT7V"), + (1, "HTxCvXKVvUZ7PQq175kCRRLu7XkGfTfErrdNXr1ZuuwVZWv"), + (1, "HZe91A6a1xqbKaw6ofx3GFepJjhVXHrwHEwn6YUDDFphpX9"), + (1, "GRy2P3kBEzSHCbmDJfquku1cyUyhZaAqojRcNE4A4U3MnLd"), + (1, "HYwiBo7Mcv7uUDg4MUoKm2fxzv4dMLAtmmNfzHV8qcQJpAE"), + (1, "GAToWXwmQoMmxHKCmFJ615WbhdGRcRfyDZi7pg7PBRpQuNY"), + (1, "DfqY6XQUSETTszBQ1juocTcG9iiDoXhvq1CoVadBSUqTGJS"), + (1, "EnpgVWGGQVrFdSB2qeXRVdtccV6U5ZscNELBoERbkFD8Wi6"), + (1, "H5BuqCmucJhUUuvjAzPazeVwVCtUSXVQdc5Dnx2q5zD7rVn"), + (1, "GxX7S1pTDdeaGUjpEPPF2we6tgHDhbatFG25pVmVFtGHLH6"), + (1, "CzuUtvKhZNZBjyAXeYviaRXwrLhVrsupJ9PrWmdq7BJTjGR"), + (1, "FCunn2Rx8JqfT5g6noUKKazph4jLDba5rUee7o3ZmJ362Ju"), + (1, "HyPMjWRHCpJS7x2SZ2R6M2XG5ZiCiZag4U4r7gBHRsE5mTc"), + (1, "H9nUFL5DasuMeAiTC77QyZFCVX39crW6h7knXNrDF4PrSJf"), + ]; + + for (index, val) in kusama_fellowship_ss58.iter().enumerate() { + let account: AccountId32 = ::from_string(val.1).unwrap(); + let account32: [u8; 32] = account.clone().into(); + assert_eq!( + fellowship_addresses[index].0, kusama_fellowship_ss58[index].0, + "ranks must be equal." + ); + assert_eq!(fellowship_addresses[index].1, account32, "accounts must be equal."); + } + } +} diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 3b822d99073..75c671ab630 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -16,6 +16,7 @@ //! The Polkadot Technical Fellowship. +pub(crate) mod migrations; mod origins; mod tracks; pub use origins::{ diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 38f97635d97..b87bc5440db 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -45,7 +45,10 @@ pub mod xcm_config; pub mod fellowship; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; -use fellowship::{pallet_fellowship_origins, Fellows}; +use fellowship::{ + migrations::import_kusama_fellowship, pallet_fellowship_origins, Fellows, + FellowshipCollectiveInstance, +}; use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp, ToParentTreasury}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -618,7 +621,7 @@ pub type UncheckedExtrinsic = pub type CheckedExtrinsic = generic::CheckedExtrinsic; // All migrations executed on runtime upgrade as a nested tuple of types implementing // `OnRuntimeUpgrade`. Included migrations must be idempotent. -type Migrations = (); +type Migrations = import_kusama_fellowship::Migration; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< From 79052068a34d7191d216941574794b960984e75a Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 27 Feb 2023 04:23:21 +0100 Subject: [PATCH 19/32] test --- .../collectives-polkadot/Cargo.toml | 3 +++ .../src/fellowship/migrations.rs | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index 02667f539b5..8b4446f68a5 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -76,6 +76,9 @@ parachains-common = { path = "../../../common", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } +[dev-dependencies] +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } + [features] default = [ "std" ] runtime-benchmarks = [ diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs index ac33f41f4be..7a925eda67a 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs @@ -164,6 +164,8 @@ pub(crate) mod import_kusama_fellowship { #[cfg(test)] pub mod tests { use super::import_kusama_fellowship::FellowshipAddresses; + use crate::{FellowshipCollectiveInstance as Fellowship, Runtime, System}; + use frame_support::traits::OnRuntimeUpgrade; use pallet_ranked_collective::Rank; use parachains_common::AccountId; use sp_core::crypto::Ss58Codec; @@ -230,4 +232,29 @@ pub mod tests { assert_eq!(fellowship_addresses[index].1, account32, "accounts must be equal."); } } + + #[test] + fn test_fellowship_import() { + use super::import_kusama_fellowship::Migration; + use pallet_ranked_collective::{IdToIndex, IndexToId, MemberCount, MemberRecord, Members}; + + let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext.execute_with(|| { + assert_eq!(MemberCount::::get(0), 0); + Migration::::on_runtime_upgrade(); + for (rank, account_id32) in FellowshipAddresses::get() { + let who = ::AccountId::from(account_id32); + assert!(IdToIndex::::get(0, &who).is_some()); + assert!(IdToIndex::::get(rank + 1, &who).is_none()); + let index = IdToIndex::::get(rank, &who).unwrap(); + assert_eq!(IndexToId::::get(rank, &index).unwrap(), who); + assert_eq!( + Members::::get(&who).unwrap(), + MemberRecord::new(rank) + ); + } + }); + } } From 14622acce5e65598aa7f245f9f434241eaabf134 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 27 Feb 2023 04:24:21 +0100 Subject: [PATCH 20/32] rename mod --- .../src/fellowship/{migrations.rs => migration.rs} | 0 .../collectives/collectives-polkadot/src/fellowship/mod.rs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename parachains/runtimes/collectives/collectives-polkadot/src/fellowship/{migrations.rs => migration.rs} (100%) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs similarity index 100% rename from parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migrations.rs rename to parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 75c671ab630..22926d1d27d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -16,7 +16,7 @@ //! The Polkadot Technical Fellowship. -pub(crate) mod migrations; +pub(crate) mod migration; mod origins; mod tracks; pub use origins::{ From f61fb92902852ed5951950d5a5c7bde1c0f0da18 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 6 Mar 2023 10:13:32 +0100 Subject: [PATCH 21/32] fix import --- parachains/runtimes/collectives/collectives-polkadot/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index b87bc5440db..b1ddaf05b0d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -46,7 +46,7 @@ pub mod fellowship; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use fellowship::{ - migrations::import_kusama_fellowship, pallet_fellowship_origins, Fellows, + migration::import_kusama_fellowship, pallet_fellowship_origins, Fellows, FellowshipCollectiveInstance, }; use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp, ToParentTreasury}; From 9e363bc75a56eb4efb9883bca5bc03ef41a2b3f2 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 6 Mar 2023 12:09:11 +0100 Subject: [PATCH 22/32] updated addresses (only ss58 version) --- .../collectives-polkadot/src/fellowship/migration.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 7a925eda67a..16c887df76b 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -175,7 +175,7 @@ pub mod tests { fn check_fellowship_addresses() { let fellowship_addresses = FellowshipAddresses::get(); let kusama_fellowship_ss58: [(Rank, _); 45] = [ - (6, "FcxNWVy5RESDsErjwyZmPCW6Z8Y3fbfLzmou34YZTrbcraL"), + (6, "16SDAKg9N6kKAbhgDyxBXdHEwpwHUHs2CNEiLNGeZV55qHna"), // proof https://kusama.subscan.io/extrinsic/16832707-4 (6, "J8ww78Qx3LVLW54bva3t4SzXcWKMdUWHEZR3V2VNKbmQgE8"), (6, "FFFF3gBSSDFSvK2HBq4qgLH75DHqXWPHeCnR1BSksAMacBs"), (5, "G7YVCdxZb8JLpAm9WMnJdNuojNT84AzU62zmvx5P1FMNtg2"), @@ -184,16 +184,16 @@ pub mod tests { (5, "J9nD3s7zssCX7bion1xctAF6xcVexcpy2uwy4jTm9JL8yuK"), (4, "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"), (4, "HL8bEp8YicBdrUmJocCAWVLKUaR2dd1y6jnD934pbre3un1"), - (4, "HyBryanRsB1GGKa9ZfqvRc3XpTDipYyRvxNNyZYfWFcenhd"), + (4, "14DsLzVyTUTDMm2eP3czwPbH53KgqnQRp3CJJZS9GR7yxGDP"), // proof https://kusama.subscan.io/extrinsic/16917519-2 (3, "GAWwkmjbLhM5pnAVbdZEkwd3QjHE7kaxJSCi3Ec91Q3QSDW"), (3, "H25aCspunTUqAt4D1gC776vKZ8FX3MvQJ3Jde6qDXPQaFxk"), (3, "GtLQoW4ZqcjExMPq6qB22bYc6NaX1yMzRuGWpSRiHqnzRb9"), - (3, "G5MVrgFmBaYei8N6t6DnDrb8JE53wKDkazLv5f46wVpi14y"), + (3, "15db5ksZgmhWE9U8MDq4wLKUdFivLVBybztWV8nmaJvv3NU1"), // proof https://kusama.subscan.io/extrinsic/16876631-2 (3, "HfFpz4QUxfbocHudf8UU7cMgHqkHpf855Me5X846PZAsAYE"), (3, "DSbhnaGBytDGRfZTmdcArzCL6T3HQ8gcZxWpF5gLBP6y1Qe"), (3, "CzEPpMr7XNS6dK7nQFnQbfnJQYLq7nvULK5kL9U8Zb6CTJm"), (2, "Ddb9puChKMHq4gM6o47E551wAmaNeu6kHngX1jzNNqAw782"), - (2, "GcDZZCVPwkPqoWxx8vfLb4Yfpz9yQ1f4XEyqngSH8ygsL9p"), + (2, "15DCWHQknBjc5YPFoVj8Pn2KoqrqYywJJ95BYNYJ4Fj3NLqz"), // proof https://kusama.subscan.io/extrinsic/16834952-2 (2, "GA3yPifemubFga7sTSFtLY2KFFiSRp6Bb8w31FS4xqgAvCz"), (2, "HxhDbS3grLurk1dhDgPiuDaRowHY1xHCU8Vu8on3fdg85tx"), (2, "HTk3eccL7WBkiyxz1gBcqQRghsJigoDMD7mnQaz1UAbMpQV"), @@ -202,10 +202,10 @@ pub mod tests { (1, "GfbnnEgRU94n9ed4RFZ6Z9dBAWs5obykigJSwXKU9hsT2uU"), (1, "HA5NtttvyZsxo4wGxGoJJSMaWtdEFZAuGUMFHVWD7fgenPv"), (1, "Hj44XnjZui7SQ3A5eBMoJFa4H4nVhiyWnL2i2xw5f1YqzRX"), - (1, "Ea6jhP5gF4r7NqhkEoAXJDgSgYpNQNaTYU6gPsrEGfctaKR"), + (1, "16a357f5Sxab3V2ne4emGQvqJaCLeYpTMx3TCjnQhmJQ71DX"), // proof https://kusama.subscan.io/extrinsic/16836396-5 (1, "CbCmCwFkfFkQo7bQtVczYg7sJ3oue6Ez2Z4RMGR8gi8deRk"), (1, "FJq9JpA9P7EXbmfsN9YiewJaDbQyL6vQyksGtJvzfbn6zf8"), - (1, "EvoLanodoqDsgHb98Ymbu41uXXKfCPDKxeM6dXHyJ2JoVus"), + (1, "15oLanodWWweiZJSoDTEBtrX7oGfq6e8ct5y5E6fVRDPhUgj"), // proof https://kusama.subscan.io/extrinsic/16876423-7 (1, "EaBqDJJNsZmYdQ4xn1vomPJVNh7fjA6UztZeEjn7ZzdeT7V"), (1, "HTxCvXKVvUZ7PQq175kCRRLu7XkGfTfErrdNXr1ZuuwVZWv"), (1, "HZe91A6a1xqbKaw6ofx3GFepJjhVXHrwHEwn6YUDDFphpX9"), From ec5a4ecdfad7b1a5171cbd04dcdaae3c7dd6a17e Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 6 Mar 2023 12:39:50 +0100 Subject: [PATCH 23/32] update addresses --- .../src/fellowship/migration.rs | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 16c887df76b..4ac3fb33312 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -32,26 +32,26 @@ pub(crate) mod import_kusama_fellowship { parameter_types! { // The Fellowship addresses from Kusama state. - pub const FellowshipAddresses: [(Rank, [u8; 32]); 45] = [ - (6, hex_literal::hex!("86b7409a11700afb027924cb40fa43889d98709ea35319d48fea85dd35004e64"),), + pub const FellowshipAddresses: [(Rank, [u8; 32]); 46] = [ + (6, hex_literal::hex!("f0673d30606ee26672707e4fd2bc8b58d3becb7aba2d5f60add64abb5fea4710"),), (6, hex_literal::hex!("f60f9b64ebf26b9487c65ada132908745572692aef7cd9c987daf8c9c0c2ff3a"),), (6, hex_literal::hex!("7628a5be63c4d3c8dbb96c2904b1a9682e02831a1af836c7efc808020b92fa63"),), (5, hex_literal::hex!("9c84f75e0b1b92f6b003bde6212a8b2c9b776f3720f942b33fed8709f103a268"),), - (5, hex_literal::hex!("86bdd82d59404ffe1d6120c6358c14c1bef69a013fa91771c2594f6fa310187e"),), + (5, hex_literal::hex!("bc64065524532ed9e805fb0d39a5c0199216b52871168e5e4d0ab612f8797d61"),), (5, hex_literal::hex!("2e1884c53071526483b14004e894415f02b55fc2e2aef8e1df8ccf7ce5bd5570"),), (5, hex_literal::hex!("f6b21d624832094b03aa672e016462a020e217cc67b1434785b99114a2b4fa5a"),), (4, hex_literal::hex!("4adf51a47b72795366d52285e329229c836ea7bbfe139dbe8fa0700c4f86fc56"),), (4, hex_literal::hex!("d25af2fedd4eb672f218932fde44f97f10c1d7788efd0079957ffad4f186ae78"),), - (4, hex_literal::hex!("ee9e0a9ced1d9809056b4adca8d224ea3c359ab9af1fb6986028fe816e37665a"),), - (3, hex_literal::hex!("9ec982d60f3779d8f0043933ee6d1b2a4346df17d07e44a22a2cd91a31076352"),), + (4, hex_literal::hex!("8e851ed992228f2268ee8c614fe6075d3800060ae14098e0309413a0a81c4470"),), + (3, hex_literal::hex!("720d807d46b941703ffe0278e8b173dc6738c5af8af812ceffc90c69390bbf1f"),), (3, hex_literal::hex!("c4965f7fe7be8174717a24ffddf684986d122c7e293ddf875cdf9700a07b6812"),), (3, hex_literal::hex!("beae5bcad1a8c156291b7ddf46b38b0c61a6aaacebd57b21c75627bfe7f9ab71"),), - (3, hex_literal::hex!("9ad97bf6cfb3fb36b24b221c27ea22cbdbfb4dd4b2c54f80d8235d490be9113b"),), + (3, hex_literal::hex!("ccd87fa65729f7bdaa8305581a7a499aa24c118e83f5714152c0e22617c6fc63"),), (3, hex_literal::hex!("e0f0f94962fc0a8c1a0f0527dc8e592c67939c46c903b6016cc0a8515da0044d"),), (3, hex_literal::hex!("2658c2083dcab9b118b5e828fb81344c4245deb8eed43fa890c8c0ae9cae526d"),), (3, hex_literal::hex!("123ca466ff6a76cdf3e73dc01bc1e8c4db195249e3b2e39a90036c6ded3db93a"),), (2, hex_literal::hex!("2eba9a39dbfdd5f3cba964355d45e27319f0271023c0353d97dc6df2401b0e3d"),), - (2, hex_literal::hex!("b2636043fc3b8dfa608167a9fb6fb9d065b9f2f5821dc4bfc9785a244b24a92a"),), + (2, hex_literal::hex!("ba3e9b87792bcfcc237fa8181185b8883c77f3e24f45e4a92ab31d07a4703520"),), (2, hex_literal::hex!("9e6eb74b0a6b39de36fb58d1fab20bc2b3fea96023ce5a47941c20480d99f92e"),), (2, hex_literal::hex!("ee3d9d8c48ee88dce78fd7bafe3ce2052900eb465085b9324d4f5da26b145f2b"),), (2, hex_literal::hex!("d8290537d6e31fe1ff165eaa62b63f6f3556dcc720b0d3a6d7eab96275617304"),), @@ -60,16 +60,16 @@ pub(crate) mod import_kusama_fellowship { (1, hex_literal::hex!("b4f7f03bebc56ebe96bc52ea5ed3159d45a0ce3a8d7f082983c33ef133274747"),), (1, hex_literal::hex!("caafae0aaa6333fcf4dc193146945fe8e4da74aa6c16d481eef0ca35b8279d73"),), (1, hex_literal::hex!("e3d658975d1894d14c40bfa6f8b7e661cd2ee47b3f3c83f9258a4e9e8331df4e"),), - (1, hex_literal::hex!("584d715bcb7a2d3b6a3120891dba91b19b12df42cd50f1c76103e2581d5b4274"),), + (1, hex_literal::hex!("f65f3cade8f68e8f34c6266b0d37e58a754059ca96816e964f98e17c79505073"),), (1, hex_literal::hex!("00ac81b86d05495a73dd7e98d33fb5bf55a837c6b87e3da0bf45618fed00be6d"),), (1, hex_literal::hex!("78e4813814891bd48bc745b79254a978833d41fbe0f387df93cd87eae2468926"),), - (1, hex_literal::hex!("68170716ab7c6735dd0a1012045d9ea33891b5f6596cf97eb217d0962d86a518"),), + (1, hex_literal::hex!("d44824ac8d1edecca67639ca74d208bd2044a10e67c9677e288080191e3fec13"),), (1, hex_literal::hex!("585e982d74da4f4290d20a73800cfd705cf59e1f5880aaee5506b5eaaf544f49"),), (1, hex_literal::hex!("d851f44a6f0d0d2f3439a51f2f75f66f4ea1a8e6c33c32f9af75fc188afb7546"),), (1, hex_literal::hex!("dca89b135d1a6aee0a498610a70eeaed056727c8a4d220da245842e540a54a74"),), (1, hex_literal::hex!("aa91fc0201f26b713a018669bcd269babf25368eee2493323b1ce0190a178a27"),), (1, hex_literal::hex!("dc20836f2e4b88c1858d1e3f918e7358043b4a8abcd2874e74d91d26c52eca2a"),), - (1, hex_literal::hex!("9ebeef0150a33357023e678bfff549602e6943b5b85d8bfdb58473992fcfaf63"),), + (1, hex_literal::hex!("145d6c503d0cf97f4c7725ca773741bd02e1760bfb52e021af5a9f2de283012c"),), (1, hex_literal::hex!("307183930b2264c5165f4a210a99520c5f1672b0413d57769fabc19e6866fb25"),), (1, hex_literal::hex!("6201961514cf5ad87f1c4dd0c392ee28231f805f77975147bf2c33bd671b9822"),), (1, hex_literal::hex!("c6f57237cd4abfbeed99171495fc784e45a9d5d2814d435de40de00991a73c06"),), @@ -78,6 +78,7 @@ pub(crate) mod import_kusama_fellowship { (1, hex_literal::hex!("7460ac178015d2a7c289bb68ef9fdaac071596ab4425c276a0040aaac7055566"),), (1, hex_literal::hex!("eec4bd650a277342ebba0954ac786df2623bd6a9d6d3e69b484482336c549f79"),), (1, hex_literal::hex!("ca76c36de0085c8c561dbb64575cb016d4d6e7cef42b666d3ea978543f1c935a"),), + (1, hex_literal::hex!("82bf733f44a840f0a5c1935a002d4e541d81298fad6d1da8124073485983860e"),), ]; } @@ -148,8 +149,8 @@ pub(crate) mod import_kusama_fellowship { #[cfg(feature = "try-runtime")] fn post_upgrade(state: Vec) -> Result<(), &'static str> { - assert_eq!(MemberCount::::get(0), 45, "invalid members count at rank 0."); - assert_eq!(MemberCount::::get(1), 45, "invalid members count at rank 1."); + assert_eq!(MemberCount::::get(0), 46, "invalid members count at rank 0."); + assert_eq!(MemberCount::::get(1), 46, "invalid members count at rank 1."); assert_eq!(MemberCount::::get(2), 24, "invalid members count at rank 2."); assert_eq!(MemberCount::::get(3), 17, "invalid members count at rank 3."); assert_eq!(MemberCount::::get(4), 10, "invalid members count at rank 4."); @@ -174,18 +175,18 @@ pub mod tests { #[test] fn check_fellowship_addresses() { let fellowship_addresses = FellowshipAddresses::get(); - let kusama_fellowship_ss58: [(Rank, _); 45] = [ + let kusama_fellowship_ss58: [(Rank, _); 46] = [ (6, "16SDAKg9N6kKAbhgDyxBXdHEwpwHUHs2CNEiLNGeZV55qHna"), // proof https://kusama.subscan.io/extrinsic/16832707-4 (6, "J8ww78Qx3LVLW54bva3t4SzXcWKMdUWHEZR3V2VNKbmQgE8"), (6, "FFFF3gBSSDFSvK2HBq4qgLH75DHqXWPHeCnR1BSksAMacBs"), (5, "G7YVCdxZb8JLpAm9WMnJdNuojNT84AzU62zmvx5P1FMNtg2"), - (5, "FczL661VujsMFqZT32Y3iBmNpSxUw4gMnq2JtdoFT6rJzr4"), + (5, "15G1iXDLgFyfnJ51FKq1ts44TduMyUtekvzQi9my4hgYt2hs"), // proof https://kusama.subscan.io/extrinsic/16917610-2 (5, "Dcm1BqR4N7nHuV43TXdET7pNibt1Nzm42FggPHpxKRven53"), (5, "J9nD3s7zssCX7bion1xctAF6xcVexcpy2uwy4jTm9JL8yuK"), (4, "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"), (4, "HL8bEp8YicBdrUmJocCAWVLKUaR2dd1y6jnD934pbre3un1"), (4, "14DsLzVyTUTDMm2eP3czwPbH53KgqnQRp3CJJZS9GR7yxGDP"), // proof https://kusama.subscan.io/extrinsic/16917519-2 - (3, "GAWwkmjbLhM5pnAVbdZEkwd3QjHE7kaxJSCi3Ec91Q3QSDW"), + (3, "13aYUFHB3umoPoxBEAHSv451iR3RpsNi3t5yBZjX2trCtTp6"), // proof https://kusama.subscan.io/extrinsic/16917832-3 (3, "H25aCspunTUqAt4D1gC776vKZ8FX3MvQJ3Jde6qDXPQaFxk"), (3, "GtLQoW4ZqcjExMPq6qB22bYc6NaX1yMzRuGWpSRiHqnzRb9"), (3, "15db5ksZgmhWE9U8MDq4wLKUdFivLVBybztWV8nmaJvv3NU1"), // proof https://kusama.subscan.io/extrinsic/16876631-2 @@ -211,7 +212,7 @@ pub mod tests { (1, "HZe91A6a1xqbKaw6ofx3GFepJjhVXHrwHEwn6YUDDFphpX9"), (1, "GRy2P3kBEzSHCbmDJfquku1cyUyhZaAqojRcNE4A4U3MnLd"), (1, "HYwiBo7Mcv7uUDg4MUoKm2fxzv4dMLAtmmNfzHV8qcQJpAE"), - (1, "GAToWXwmQoMmxHKCmFJ615WbhdGRcRfyDZi7pg7PBRpQuNY"), + (1, "1ThiBx5DDxFhoD9GY6tz5Fp4Y7Xn1xfLmDddcoFQghDvvjg"), // proof https://kusama.subscan.io/extrinsic/16918130-2 (1, "DfqY6XQUSETTszBQ1juocTcG9iiDoXhvq1CoVadBSUqTGJS"), (1, "EnpgVWGGQVrFdSB2qeXRVdtccV6U5ZscNELBoERbkFD8Wi6"), (1, "H5BuqCmucJhUUuvjAzPazeVwVCtUSXVQdc5Dnx2q5zD7rVn"), @@ -220,6 +221,7 @@ pub mod tests { (1, "FCunn2Rx8JqfT5g6noUKKazph4jLDba5rUee7o3ZmJ362Ju"), (1, "HyPMjWRHCpJS7x2SZ2R6M2XG5ZiCiZag4U4r7gBHRsE5mTc"), (1, "H9nUFL5DasuMeAiTC77QyZFCVX39crW6h7knXNrDF4PrSJf"), + (1, "13xS6fK6MHjApLnjdX7TJYw1niZmiXasSN91bNtiXQjgEtNx"), // proof https://kusama.subscan.io/extrinsic/16918212-7 ]; for (index, val) in kusama_fellowship_ss58.iter().enumerate() { From 8127b8fb87db6dca9c5a365df37b8bd62c389239 Mon Sep 17 00:00:00 2001 From: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:10:57 +0100 Subject: [PATCH 24/32] doc nits --- parachains/runtimes/assets/statemint/src/lib.rs | 4 ++-- .../collectives/collectives-polkadot/src/constants.rs | 8 ++++---- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 71a78f4ac3a..dbaf7f6f525 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -527,11 +527,11 @@ parameter_types! { pub const MinCandidates: u32 = 5; pub const SessionLength: BlockNumber = 6 * HOURS; pub const MaxInvulnerables: u32 = 100; - // StakingAdmin pluralistic body. + // `StakingAdmin` pluralistic body. pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root and the StakingAdmin to execute privileged collator selection operations. +/// We allow root and the `StakingAdmin` to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, EnsureXcm>, diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index 14a11234a3a..ee28c1921b8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -18,13 +18,13 @@ pub mod account { /// Relay Chain treasury pallet id, used to convert into AccountId pub const RELAY_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry"); - /// Alliance pallet id. + /// Alliance pallet ID. /// It is used as a temporarily place to deposit a slashed imbalance - /// before the teleport to the treasury. + /// before the teleport to the Treasury. pub const ALLIANCE_PALLET_ID: PalletId = PalletId(*b"py/allia"); - /// Referenda pallet id. + /// Referenda pallet ID. /// It is used as a temporarily place to deposit a slashed imbalance - /// before the teleport to the treasury. + /// before the teleport to the Treasury. pub const REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/refer"); } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 38f97635d97..12106323908 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -413,11 +413,11 @@ impl pallet_aura::Config for Runtime { parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); pub const SessionLength: BlockNumber = 6 * HOURS; - // StakingAdmin pluralistic body. + // `StakingAdmin` pluralistic body. pub const StakingAdminBodyId: BodyId = BodyId::Defense; } -/// We allow root and the StakingAdmin to execute privileged collator selection operations. +/// We allow root and the `StakingAdmin` to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< EnsureRoot, EnsureXcm>, From 45a5976102184266864d9b99922eae1acdd2fad1 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 6 Mar 2023 20:16:09 +0100 Subject: [PATCH 25/32] weights with new api --- .../src/weights/pallet_preimage.rs | 130 ++++----- .../src/weights/pallet_ranked_collective.rs | 86 +++--- .../src/weights/pallet_referenda.rs | 274 +++++++++--------- .../src/weights/pallet_scheduler.rs | 120 ++++---- 4 files changed, 273 insertions(+), 337 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs index fc454d1243d..706568a5ff6 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs @@ -1,41 +1,25 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-03-06, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `cob`, CPU: `` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Native), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot-parachain +// ./target/debug/polkadot-parachain // benchmark // pallet // --chain=collectives-polkadot-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet_preimage -// --extrinsic=* // --steps=2 // --repeat=1 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs +// --pallet=pallet_preimage +// --extrinsic=* +// --execution=native +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,10 +39,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn note_preimage(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `175` - // Estimated: `2566` - // Minimum execution time: 35_000 nanoseconds. - Weight::from_ref_time(7_039_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 316_000_000 picoseconds. + Weight::from_parts(152_722_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -70,10 +54,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn note_requested_preimage(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 19_000 nanoseconds. - Weight::from_ref_time(7_247_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 147_000_000 picoseconds. + Weight::from_parts(152_365_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -85,10 +69,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn note_no_deposit_preimage(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 20_000 nanoseconds. - Weight::from_ref_time(7_516_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 145_000_000 picoseconds. + Weight::from_parts(152_298_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -99,10 +83,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn unnote_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `353` - // Estimated: `2566` - // Minimum execution time: 61_000 nanoseconds. - Weight::from_ref_time(61_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 333_000_000 picoseconds. + Weight::from_parts(333_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -113,10 +97,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn unnote_no_deposit_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `144` - // Estimated: `2566` - // Minimum execution time: 39_000 nanoseconds. - Weight::from_ref_time(39_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 202_000_000 picoseconds. + Weight::from_parts(202_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -125,10 +109,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn request_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `220` - // Estimated: `2566` - // Minimum execution time: 38_000 nanoseconds. - Weight::from_ref_time(38_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 189_000_000 picoseconds. + Weight::from_parts(189_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -137,10 +121,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn request_no_deposit_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `144` - // Estimated: `2566` - // Minimum execution time: 23_000 nanoseconds. - Weight::from_ref_time(23_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 137_000_000 picoseconds. + Weight::from_parts(137_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -149,10 +133,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn request_unnoted_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `42` - // Estimated: `2566` - // Minimum execution time: 28_000 nanoseconds. - Weight::from_ref_time(28_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 140_000_000 picoseconds. + Weight::from_parts(140_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -161,10 +145,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn request_requested_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 10_000 nanoseconds. - Weight::from_ref_time(10_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 109_000_000 picoseconds. + Weight::from_parts(109_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -175,10 +159,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn unrequest_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `144` - // Estimated: `2566` - // Minimum execution time: 36_000 nanoseconds. - Weight::from_ref_time(36_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 208_000_000 picoseconds. + Weight::from_parts(208_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -187,10 +171,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn unrequest_unnoted_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 14_000 nanoseconds. - Weight::from_ref_time(14_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 117_000_000 picoseconds. + Weight::from_parts(117_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -199,10 +183,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { fn unrequest_multi_referenced_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 11_000 nanoseconds. - Weight::from_ref_time(11_000_000) - .saturating_add(Weight::from_proof_size(2566)) + // Estimated: `3556` + // Minimum execution time: 107_000_000 picoseconds. + Weight::from_parts(107_000_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs index ae3b1ab7c47..4be551d4bd5 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs @@ -1,41 +1,25 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . //! Autogenerated weights for `pallet_ranked_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-03-06, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `cob`, CPU: `` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Native), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot-parachain +// ./target/debug/polkadot-parachain // benchmark // pallet // --chain=collectives-polkadot-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet_ranked_collective -// --extrinsic=* // --steps=2 // --repeat=1 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs +// --pallet=pallet_ranked_collective +// --extrinsic=* +// --execution=native +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -58,10 +42,10 @@ impl pallet_ranked_collective::WeightInfo for WeightInf fn add_member() -> Weight { // Proof Size summary in bytes: // Measured: `109` - // Estimated: `5006` - // Minimum execution time: 31_000 nanoseconds. - Weight::from_ref_time(31_000_000) - .saturating_add(Weight::from_proof_size(5006)) + // Estimated: `6986` + // Minimum execution time: 129_000_000 picoseconds. + Weight::from_parts(129_000_000, 0) + .saturating_add(Weight::from_parts(0, 6986)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -77,10 +61,10 @@ impl pallet_ranked_collective::WeightInfo for WeightInf fn remove_member(_r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `575 + r * (281 ±0)` - // Estimated: `85534` - // Minimum execution time: 39_000 nanoseconds. - Weight::from_ref_time(197_000_000) - .saturating_add(Weight::from_proof_size(85534)) + // Estimated: `89494` + // Minimum execution time: 325_000_000 picoseconds. + Weight::from_parts(1_695_000_000, 0) + .saturating_add(Weight::from_parts(0, 89494)) .saturating_add(T::DbWeight::get().reads(34)) .saturating_add(T::DbWeight::get().writes(34)) } @@ -96,10 +80,10 @@ impl pallet_ranked_collective::WeightInfo for WeightInf fn promote_member(_r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `277 + r * (17 ±0)` - // Estimated: `5006` - // Minimum execution time: 29_000 nanoseconds. - Weight::from_ref_time(32_000_000) - .saturating_add(Weight::from_proof_size(5006)) + // Estimated: `6986` + // Minimum execution time: 206_000_000 picoseconds. + Weight::from_parts(450_000_000, 0) + .saturating_add(Weight::from_parts(0, 6986)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -115,10 +99,10 @@ impl pallet_ranked_collective::WeightInfo for WeightInf fn demote_member(_r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `575 + r * (71 ±0)` - // Estimated: `10064` - // Minimum execution time: 45_000 nanoseconds. - Weight::from_ref_time(81_000_000) - .saturating_add(Weight::from_proof_size(10064)) + // Estimated: `14024` + // Minimum execution time: 309_000_000 picoseconds. + Weight::from_parts(449_000_000, 0) + .saturating_add(Weight::from_parts(0, 14024)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -133,10 +117,10 @@ impl pallet_ranked_collective::WeightInfo for WeightInf fn vote() -> Weight { // Proof Size summary in bytes: // Measured: `665` - // Estimated: `325010` - // Minimum execution time: 58_000 nanoseconds. - Weight::from_ref_time(58_000_000) - .saturating_add(Weight::from_proof_size(325010)) + // Estimated: `328970` + // Minimum execution time: 536_000_000 picoseconds. + Weight::from_parts(536_000_000, 0) + .saturating_add(Weight::from_parts(0, 328970)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -144,17 +128,17 @@ impl pallet_ranked_collective::WeightInfo for WeightInf /// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen) /// Storage: FellowshipCollective VotingCleanup (r:1 w:0) /// Proof: FellowshipCollective VotingCleanup (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: FellowshipCollective Voting (r:0 w:100) + /// Storage: FellowshipCollective Voting (r:100 w:100) /// Proof: FellowshipCollective Voting (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) /// The range of component `n` is `[0, 100]`. fn cleanup_poll(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `308 + n * (52 ±0)` - // Estimated: `5964` - // Minimum execution time: 20_000 nanoseconds. - Weight::from_ref_time(160_000_000) - .saturating_add(Weight::from_proof_size(5964)) - .saturating_add(T::DbWeight::get().reads(2)) + // Estimated: `262934` + // Minimum execution time: 246_000_000 picoseconds. + Weight::from_parts(1_572_000_000, 0) + .saturating_add(Weight::from_parts(0, 262934)) + .saturating_add(T::DbWeight::get().reads(102)) .saturating_add(T::DbWeight::get().writes(100)) } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs index b73540c32d2..471aa55a767 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs @@ -1,41 +1,25 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . //! Autogenerated weights for `pallet_referenda` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-03-06, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `cob`, CPU: `` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Native), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot-parachain +// ./target/debug/polkadot-parachain // benchmark // pallet // --chain=collectives-polkadot-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet_referenda -// --extrinsic=* // --steps=2 // --repeat=1 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs +// --pallet=pallet_referenda +// --extrinsic=* +// --execution=native +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -58,10 +42,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn submit() -> Weight { // Proof Size summary in bytes: // Measured: `322` - // Estimated: `161305` - // Minimum execution time: 38_000 nanoseconds. - Weight::from_ref_time(38_000_000) - .saturating_add(Weight::from_proof_size(161305)) + // Estimated: `164275` + // Minimum execution time: 283_000_000 picoseconds. + Weight::from_parts(283_000_000, 0) + .saturating_add(Weight::from_parts(0, 164275)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -72,10 +56,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn place_decision_deposit_preparing() -> Weight { // Proof Size summary in bytes: // Measured: `430` - // Estimated: `319953` - // Minimum execution time: 60_000 nanoseconds. - Weight::from_ref_time(60_000_000) - .saturating_add(Weight::from_proof_size(319953)) + // Estimated: `321933` + // Minimum execution time: 472_000_000 picoseconds. + Weight::from_parts(472_000_000, 0) + .saturating_add(Weight::from_parts(0, 321933)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -88,10 +72,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn place_decision_deposit_queued() -> Weight { // Proof Size summary in bytes: // Measured: `1941` - // Estimated: `9151` - // Minimum execution time: 89_000 nanoseconds. - Weight::from_ref_time(89_000_000) - .saturating_add(Weight::from_proof_size(9151)) + // Estimated: `12121` + // Minimum execution time: 547_000_000 picoseconds. + Weight::from_parts(547_000_000, 0) + .saturating_add(Weight::from_parts(0, 12121)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -104,10 +88,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn place_decision_deposit_not_queued() -> Weight { // Proof Size summary in bytes: // Measured: `1982` - // Estimated: `9151` - // Minimum execution time: 82_000 nanoseconds. - Weight::from_ref_time(82_000_000) - .saturating_add(Weight::from_proof_size(9151)) + // Estimated: `12121` + // Minimum execution time: 555_000_000 picoseconds. + Weight::from_parts(555_000_000, 0) + .saturating_add(Weight::from_parts(0, 12121)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -122,10 +106,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn place_decision_deposit_passing() -> Weight { // Proof Size summary in bytes: // Measured: `833` - // Estimated: `324931` - // Minimum execution time: 161_000 nanoseconds. - Weight::from_ref_time(161_000_000) - .saturating_add(Weight::from_proof_size(324931)) + // Estimated: `328891` + // Minimum execution time: 871_000_000 picoseconds. + Weight::from_parts(871_000_000, 0) + .saturating_add(Weight::from_parts(0, 328891)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -138,10 +122,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn place_decision_deposit_failing() -> Weight { // Proof Size summary in bytes: // Measured: `643` - // Estimated: `8353` - // Minimum execution time: 60_000 nanoseconds. - Weight::from_ref_time(60_000_000) - .saturating_add(Weight::from_proof_size(8353)) + // Estimated: `11323` + // Minimum execution time: 460_000_000 picoseconds. + Weight::from_parts(460_000_000, 0) + .saturating_add(Weight::from_parts(0, 11323)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -150,10 +134,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn refund_decision_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `381` - // Estimated: `3375` - // Minimum execution time: 38_000 nanoseconds. - Weight::from_ref_time(38_000_000) - .saturating_add(Weight::from_proof_size(3375)) + // Estimated: `4365` + // Minimum execution time: 281_000_000 picoseconds. + Weight::from_parts(281_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -162,10 +146,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn refund_submission_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `199` - // Estimated: `3375` - // Minimum execution time: 19_000 nanoseconds. - Weight::from_ref_time(19_000_000) - .saturating_add(Weight::from_proof_size(3375)) + // Estimated: `4365` + // Minimum execution time: 172_000_000 picoseconds. + Weight::from_parts(172_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,10 +160,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn cancel() -> Weight { // Proof Size summary in bytes: // Measured: `343` - // Estimated: `319953` - // Minimum execution time: 45_000 nanoseconds. - Weight::from_ref_time(45_000_000) - .saturating_add(Weight::from_proof_size(319953)) + // Estimated: `321933` + // Minimum execution time: 334_000_000 picoseconds. + Weight::from_parts(334_000_000, 0) + .saturating_add(Weight::from_parts(0, 321933)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -206,10 +190,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn kill() -> Weight { // Proof Size summary in bytes: // Measured: `581` - // Estimated: `332942` - // Minimum execution time: 170_000 nanoseconds. - Weight::from_ref_time(170_000_000) - .saturating_add(Weight::from_proof_size(332942)) + // Estimated: `342842` + // Minimum execution time: 1_580_000_000 picoseconds. + Weight::from_parts(1_580_000_000, 0) + .saturating_add(Weight::from_parts(0, 342842)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -220,10 +204,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn one_fewer_deciding_queue_empty() -> Weight { // Proof Size summary in bytes: // Measured: `140` - // Estimated: `5776` - // Minimum execution time: 13_000 nanoseconds. - Weight::from_ref_time(13_000_000) - .saturating_add(Weight::from_proof_size(5776)) + // Estimated: `7756` + // Minimum execution time: 203_000_000 picoseconds. + Weight::from_parts(203_000_000, 0) + .saturating_add(Weight::from_parts(0, 7756)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -238,10 +222,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn one_fewer_deciding_failing() -> Weight { // Proof Size summary in bytes: // Measured: `3991` - // Estimated: `325729` - // Minimum execution time: 236_000 nanoseconds. - Weight::from_ref_time(236_000_000) - .saturating_add(Weight::from_proof_size(325729)) + // Estimated: `329689` + // Minimum execution time: 1_025_000_000 picoseconds. + Weight::from_parts(1_025_000_000, 0) + .saturating_add(Weight::from_parts(0, 329689)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -256,10 +240,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn one_fewer_deciding_passing() -> Weight { // Proof Size summary in bytes: // Measured: `3991` - // Estimated: `325729` - // Minimum execution time: 293_000 nanoseconds. - Weight::from_ref_time(293_000_000) - .saturating_add(Weight::from_proof_size(325729)) + // Estimated: `329689` + // Minimum execution time: 1_076_000_000 picoseconds. + Weight::from_parts(1_076_000_000, 0) + .saturating_add(Weight::from_parts(0, 329689)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -272,10 +256,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_requeued_insertion() -> Weight { // Proof Size summary in bytes: // Measured: `3589` - // Estimated: `164951` - // Minimum execution time: 160_000 nanoseconds. - Weight::from_ref_time(160_000_000) - .saturating_add(Weight::from_proof_size(164951)) + // Estimated: `167921` + // Minimum execution time: 621_000_000 picoseconds. + Weight::from_parts(621_000_000, 0) + .saturating_add(Weight::from_parts(0, 167921)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -288,10 +272,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_requeued_slide() -> Weight { // Proof Size summary in bytes: // Measured: `3542` - // Estimated: `164951` - // Minimum execution time: 146_000 nanoseconds. - Weight::from_ref_time(146_000_000) - .saturating_add(Weight::from_proof_size(164951)) + // Estimated: `167921` + // Minimum execution time: 643_000_000 picoseconds. + Weight::from_parts(643_000_000, 0) + .saturating_add(Weight::from_parts(0, 167921)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -306,10 +290,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_queued() -> Weight { // Proof Size summary in bytes: // Measured: `3528` - // Estimated: `167440` - // Minimum execution time: 161_000 nanoseconds. - Weight::from_ref_time(161_000_000) - .saturating_add(Weight::from_proof_size(167440)) + // Estimated: `171400` + // Minimum execution time: 704_000_000 picoseconds. + Weight::from_parts(704_000_000, 0) + .saturating_add(Weight::from_parts(0, 171400)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -324,10 +308,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_not_queued() -> Weight { // Proof Size summary in bytes: // Measured: `3583` - // Estimated: `167440` - // Minimum execution time: 158_000 nanoseconds. - Weight::from_ref_time(158_000_000) - .saturating_add(Weight::from_proof_size(167440)) + // Estimated: `171400` + // Minimum execution time: 695_000_000 picoseconds. + Weight::from_parts(695_000_000, 0) + .saturating_add(Weight::from_parts(0, 171400)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -338,10 +322,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_no_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `295` - // Estimated: `161664` - // Minimum execution time: 32_000 nanoseconds. - Weight::from_ref_time(32_000_000) - .saturating_add(Weight::from_proof_size(161664)) + // Estimated: `163644` + // Minimum execution time: 259_000_000 picoseconds. + Weight::from_parts(259_000_000, 0) + .saturating_add(Weight::from_parts(0, 163644)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -352,10 +336,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_preparing() -> Weight { // Proof Size summary in bytes: // Measured: `343` - // Estimated: `161664` - // Minimum execution time: 29_000 nanoseconds. - Weight::from_ref_time(29_000_000) - .saturating_add(Weight::from_proof_size(161664)) + // Estimated: `163644` + // Minimum execution time: 260_000_000 picoseconds. + Weight::from_parts(260_000_000, 0) + .saturating_add(Weight::from_parts(0, 163644)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -364,10 +348,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_timed_out() -> Weight { // Proof Size summary in bytes: // Measured: `240` - // Estimated: `3375` - // Minimum execution time: 20_000 nanoseconds. - Weight::from_ref_time(20_000_000) - .saturating_add(Weight::from_proof_size(3375)) + // Estimated: `4365` + // Minimum execution time: 184_000_000 picoseconds. + Weight::from_parts(184_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -382,10 +366,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_begin_deciding_failing() -> Weight { // Proof Size summary in bytes: // Measured: `611` - // Estimated: `166642` - // Minimum execution time: 42_000 nanoseconds. - Weight::from_ref_time(42_000_000) - .saturating_add(Weight::from_proof_size(166642)) + // Estimated: `170602` + // Minimum execution time: 445_000_000 picoseconds. + Weight::from_parts(445_000_000, 0) + .saturating_add(Weight::from_parts(0, 170602)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -400,10 +384,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_begin_deciding_passing() -> Weight { // Proof Size summary in bytes: // Measured: `746` - // Estimated: `166642` - // Minimum execution time: 92_000 nanoseconds. - Weight::from_ref_time(92_000_000) - .saturating_add(Weight::from_proof_size(166642)) + // Estimated: `170602` + // Minimum execution time: 625_000_000 picoseconds. + Weight::from_parts(625_000_000, 0) + .saturating_add(Weight::from_parts(0, 170602)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -416,10 +400,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_begin_confirming() -> Weight { // Proof Size summary in bytes: // Measured: `799` - // Estimated: `164153` - // Minimum execution time: 89_000 nanoseconds. - Weight::from_ref_time(89_000_000) - .saturating_add(Weight::from_proof_size(164153)) + // Estimated: `167123` + // Minimum execution time: 623_000_000 picoseconds. + Weight::from_parts(623_000_000, 0) + .saturating_add(Weight::from_parts(0, 167123)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -432,10 +416,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_end_confirming() -> Weight { // Proof Size summary in bytes: // Measured: `782` - // Estimated: `164153` - // Minimum execution time: 103_000 nanoseconds. - Weight::from_ref_time(103_000_000) - .saturating_add(Weight::from_proof_size(164153)) + // Estimated: `167123` + // Minimum execution time: 580_000_000 picoseconds. + Weight::from_parts(580_000_000, 0) + .saturating_add(Weight::from_parts(0, 167123)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -448,10 +432,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_continue_not_confirming() -> Weight { // Proof Size summary in bytes: // Measured: `799` - // Estimated: `164153` - // Minimum execution time: 84_000 nanoseconds. - Weight::from_ref_time(84_000_000) - .saturating_add(Weight::from_proof_size(164153)) + // Estimated: `167123` + // Minimum execution time: 595_000_000 picoseconds. + Weight::from_parts(595_000_000, 0) + .saturating_add(Weight::from_parts(0, 167123)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -464,10 +448,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_continue_confirming() -> Weight { // Proof Size summary in bytes: // Measured: `803` - // Estimated: `164153` - // Minimum execution time: 91_000 nanoseconds. - Weight::from_ref_time(91_000_000) - .saturating_add(Weight::from_proof_size(164153)) + // Estimated: `167123` + // Minimum execution time: 556_000_000 picoseconds. + Weight::from_parts(556_000_000, 0) + .saturating_add(Weight::from_parts(0, 167123)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -482,10 +466,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_approved() -> Weight { // Proof Size summary in bytes: // Measured: `803` - // Estimated: `324965` - // Minimum execution time: 151_000 nanoseconds. - Weight::from_ref_time(151_000_000) - .saturating_add(Weight::from_proof_size(324965)) + // Estimated: `328925` + // Minimum execution time: 704_000_000 picoseconds. + Weight::from_parts(704_000_000, 0) + .saturating_add(Weight::from_parts(0, 328925)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -498,10 +482,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn nudge_referendum_rejected() -> Weight { // Proof Size summary in bytes: // Measured: `799` - // Estimated: `164153` - // Minimum execution time: 92_000 nanoseconds. - Weight::from_ref_time(92_000_000) - .saturating_add(Weight::from_proof_size(164153)) + // Estimated: `167123` + // Minimum execution time: 615_000_000 picoseconds. + Weight::from_parts(615_000_000, 0) + .saturating_add(Weight::from_parts(0, 167123)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -514,10 +498,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn set_some_metadata() -> Weight { // Proof Size summary in bytes: // Measured: `384` - // Estimated: `5941` - // Minimum execution time: 26_000 nanoseconds. - Weight::from_ref_time(26_000_000) - .saturating_add(Weight::from_proof_size(5941)) + // Estimated: `7921` + // Minimum execution time: 262_000_000 picoseconds. + Weight::from_parts(262_000_000, 0) + .saturating_add(Weight::from_parts(0, 7921)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -528,10 +512,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { fn clear_metadata() -> Weight { // Proof Size summary in bytes: // Measured: `317` - // Estimated: `5902` - // Minimum execution time: 22_000 nanoseconds. - Weight::from_ref_time(22_000_000) - .saturating_add(Weight::from_proof_size(5902)) + // Estimated: `7882` + // Minimum execution time: 223_000_000 picoseconds. + Weight::from_parts(223_000_000, 0) + .saturating_add(Weight::from_parts(0, 7882)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs index 342f153c5fd..0bdb8dba1ef 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs @@ -1,41 +1,25 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-16, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-03-06, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `cob`, CPU: `` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! EXECUTION: Some(Native), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot-parachain +// ./target/debug/polkadot-parachain // benchmark // pallet // --chain=collectives-polkadot-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet_scheduler -// --extrinsic=* // --steps=2 // --repeat=1 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs +// --pallet=pallet_scheduler +// --extrinsic=* +// --execution=native +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -52,10 +36,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn service_agendas_base() -> Weight { // Proof Size summary in bytes: // Measured: `31` - // Estimated: `499` - // Minimum execution time: 5_000 nanoseconds. - Weight::from_ref_time(5_000_000) - .saturating_add(Weight::from_proof_size(499)) + // Estimated: `1489` + // Minimum execution time: 61_000_000 picoseconds. + Weight::from_parts(61_000_000, 0) + .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -65,10 +49,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn service_agenda_base(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `4 + s * (177 ±0)` - // Estimated: `158289` - // Minimum execution time: 4_000 nanoseconds. - Weight::from_ref_time(175_000_000) - .saturating_add(Weight::from_proof_size(158289)) + // Estimated: `159279` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(484_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -76,9 +60,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_000 nanoseconds. - Weight::from_ref_time(8_000_000) - .saturating_add(Weight::from_proof_size(0)) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(28_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: Preimage PreimageFor (r:1 w:1) /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured) @@ -88,10 +72,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn service_task_fetched(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `204 + s * (1 ±0)` - // Estimated: `4199553` - // Minimum execution time: 25_000 nanoseconds. - Weight::from_ref_time(4_063_000_000) - .saturating_add(Weight::from_proof_size(4199553)) + // Estimated: `4201533` + // Minimum execution time: 168_000_000 picoseconds. + Weight::from_parts(2_047_000_000, 0) + .saturating_add(Weight::from_parts(0, 4201533)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -101,34 +85,34 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_000 nanoseconds. - Weight::from_ref_time(10_000_000) - .saturating_add(Weight::from_proof_size(0)) + // Minimum execution time: 37_000_000 picoseconds. + Weight::from_parts(37_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } fn service_task_periodic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_000 nanoseconds. - Weight::from_ref_time(7_000_000) - .saturating_add(Weight::from_proof_size(0)) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_signed() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000 nanoseconds. - Weight::from_ref_time(5_000_000) - .saturating_add(Weight::from_proof_size(0)) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_unsigned() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000 nanoseconds. - Weight::from_ref_time(5_000_000) - .saturating_add(Weight::from_proof_size(0)) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: Scheduler Agenda (r:1 w:1) /// Proof: Scheduler Agenda (max_values: None, max_size: Some(155814), added: 158289, mode: MaxEncodedLen) @@ -136,10 +120,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn schedule(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `4 + s * (177 ±0)` - // Estimated: `158289` - // Minimum execution time: 21_000 nanoseconds. - Weight::from_ref_time(198_000_000) - .saturating_add(Weight::from_proof_size(158289)) + // Estimated: `159279` + // Minimum execution time: 94_000_000 picoseconds. + Weight::from_parts(526_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -151,10 +135,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn cancel(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `109 + s * (177 ±0)` - // Estimated: `158289` - // Minimum execution time: 20_000 nanoseconds. - Weight::from_ref_time(315_000_000) - .saturating_add(Weight::from_proof_size(158289)) + // Estimated: `159279` + // Minimum execution time: 123_000_000 picoseconds. + Weight::from_parts(807_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -166,10 +150,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn schedule_named(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `4 + s * (181 ±0)` - // Estimated: `160812` - // Minimum execution time: 34_000 nanoseconds. - Weight::from_ref_time(223_000_000) - .saturating_add(Weight::from_proof_size(160812)) + // Estimated: `162792` + // Minimum execution time: 113_000_000 picoseconds. + Weight::from_parts(580_000_000, 0) + .saturating_add(Weight::from_parts(0, 162792)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -181,10 +165,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn cancel_named(_s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `141 + s * (181 ±0)` - // Estimated: `160812` - // Minimum execution time: 24_000 nanoseconds. - Weight::from_ref_time(331_000_000) - .saturating_add(Weight::from_proof_size(160812)) + // Estimated: `162792` + // Minimum execution time: 167_000_000 picoseconds. + Weight::from_parts(869_000_000, 0) + .saturating_add(Weight::from_parts(0, 162792)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } From a45f78af63116b69a3d4cab319c7fcbf677b80e4 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 6 Mar 2023 20:55:51 +0100 Subject: [PATCH 26/32] update addresses --- Cargo.lock | 1 + .../src/fellowship/migration.rs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d822e667d59..181e6b686cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1290,6 +1290,7 @@ dependencies = [ "sp-consensus-aura", "sp-core", "sp-inherents", + "sp-io", "sp-offchain", "sp-runtime", "sp-session", diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 4ac3fb33312..76c2ce10cf2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -41,14 +41,14 @@ pub(crate) mod import_kusama_fellowship { (5, hex_literal::hex!("2e1884c53071526483b14004e894415f02b55fc2e2aef8e1df8ccf7ce5bd5570"),), (5, hex_literal::hex!("f6b21d624832094b03aa672e016462a020e217cc67b1434785b99114a2b4fa5a"),), (4, hex_literal::hex!("4adf51a47b72795366d52285e329229c836ea7bbfe139dbe8fa0700c4f86fc56"),), - (4, hex_literal::hex!("d25af2fedd4eb672f218932fde44f97f10c1d7788efd0079957ffad4f186ae78"),), + (4, hex_literal::hex!("1c90e3dabd3fd0f6bc648045018f78fcee8fe24122c22d8d2a14e9905073d10f"),), (4, hex_literal::hex!("8e851ed992228f2268ee8c614fe6075d3800060ae14098e0309413a0a81c4470"),), (3, hex_literal::hex!("720d807d46b941703ffe0278e8b173dc6738c5af8af812ceffc90c69390bbf1f"),), (3, hex_literal::hex!("c4965f7fe7be8174717a24ffddf684986d122c7e293ddf875cdf9700a07b6812"),), (3, hex_literal::hex!("beae5bcad1a8c156291b7ddf46b38b0c61a6aaacebd57b21c75627bfe7f9ab71"),), (3, hex_literal::hex!("ccd87fa65729f7bdaa8305581a7a499aa24c118e83f5714152c0e22617c6fc63"),), (3, hex_literal::hex!("e0f0f94962fc0a8c1a0f0527dc8e592c67939c46c903b6016cc0a8515da0044d"),), - (3, hex_literal::hex!("2658c2083dcab9b118b5e828fb81344c4245deb8eed43fa890c8c0ae9cae526d"),), + (3, hex_literal::hex!("984e16482c99cfad1436111e321a86d87d0fac203bf64538f888e45d793b5413"),), (3, hex_literal::hex!("123ca466ff6a76cdf3e73dc01bc1e8c4db195249e3b2e39a90036c6ded3db93a"),), (2, hex_literal::hex!("2eba9a39dbfdd5f3cba964355d45e27319f0271023c0353d97dc6df2401b0e3d"),), (2, hex_literal::hex!("ba3e9b87792bcfcc237fa8181185b8883c77f3e24f45e4a92ab31d07a4703520"),), @@ -59,9 +59,9 @@ pub(crate) mod import_kusama_fellowship { (2, hex_literal::hex!("18d30040a8245c5ff17afc9a8169d7d0771fe7ab4135a64a022c254117340720"),), (1, hex_literal::hex!("b4f7f03bebc56ebe96bc52ea5ed3159d45a0ce3a8d7f082983c33ef133274747"),), (1, hex_literal::hex!("caafae0aaa6333fcf4dc193146945fe8e4da74aa6c16d481eef0ca35b8279d73"),), - (1, hex_literal::hex!("e3d658975d1894d14c40bfa6f8b7e661cd2ee47b3f3c83f9258a4e9e8331df4e"),), + (1, hex_literal::hex!("a66e0f4e1a121cc83fddf3096e8ec8c9e9c85989f276e39e951fb0e4a5398763"),), (1, hex_literal::hex!("f65f3cade8f68e8f34c6266b0d37e58a754059ca96816e964f98e17c79505073"),), - (1, hex_literal::hex!("00ac81b86d05495a73dd7e98d33fb5bf55a837c6b87e3da0bf45618fed00be6d"),), + (1, hex_literal::hex!("8c232c91ef2a9983ba65c4b75bb86fcbae4d909900ea8aa06c3644ca1161db48"),), (1, hex_literal::hex!("78e4813814891bd48bc745b79254a978833d41fbe0f387df93cd87eae2468926"),), (1, hex_literal::hex!("d44824ac8d1edecca67639ca74d208bd2044a10e67c9677e288080191e3fec13"),), (1, hex_literal::hex!("585e982d74da4f4290d20a73800cfd705cf59e1f5880aaee5506b5eaaf544f49"),), @@ -77,7 +77,7 @@ pub(crate) mod import_kusama_fellowship { (1, hex_literal::hex!("12c039004da5e1e846aae808277098c719cef1f4985aed00161a42ac4f0e002f"),), (1, hex_literal::hex!("7460ac178015d2a7c289bb68ef9fdaac071596ab4425c276a0040aaac7055566"),), (1, hex_literal::hex!("eec4bd650a277342ebba0954ac786df2623bd6a9d6d3e69b484482336c549f79"),), - (1, hex_literal::hex!("ca76c36de0085c8c561dbb64575cb016d4d6e7cef42b666d3ea978543f1c935a"),), + (1, hex_literal::hex!("e287c7494655d636a846f5c3347ad2cb3c462a8d46e0832be70fcc0ab54ee62d"),), (1, hex_literal::hex!("82bf733f44a840f0a5c1935a002d4e541d81298fad6d1da8124073485983860e"),), ]; } @@ -184,14 +184,14 @@ pub mod tests { (5, "Dcm1BqR4N7nHuV43TXdET7pNibt1Nzm42FggPHpxKRven53"), (5, "J9nD3s7zssCX7bion1xctAF6xcVexcpy2uwy4jTm9JL8yuK"), (4, "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"), - (4, "HL8bEp8YicBdrUmJocCAWVLKUaR2dd1y6jnD934pbre3un1"), + (4, "1eTPAR2TuqLyidmPT9rMmuycHVm9s9czu78sePqg2KHMDrE"), // proof https://kusama.subscan.io/extrinsic/16921712-3 (4, "14DsLzVyTUTDMm2eP3czwPbH53KgqnQRp3CJJZS9GR7yxGDP"), // proof https://kusama.subscan.io/extrinsic/16917519-2 (3, "13aYUFHB3umoPoxBEAHSv451iR3RpsNi3t5yBZjX2trCtTp6"), // proof https://kusama.subscan.io/extrinsic/16917832-3 (3, "H25aCspunTUqAt4D1gC776vKZ8FX3MvQJ3Jde6qDXPQaFxk"), (3, "GtLQoW4ZqcjExMPq6qB22bYc6NaX1yMzRuGWpSRiHqnzRb9"), (3, "15db5ksZgmhWE9U8MDq4wLKUdFivLVBybztWV8nmaJvv3NU1"), // proof https://kusama.subscan.io/extrinsic/16876631-2 (3, "HfFpz4QUxfbocHudf8UU7cMgHqkHpf855Me5X846PZAsAYE"), - (3, "DSbhnaGBytDGRfZTmdcArzCL6T3HQ8gcZxWpF5gLBP6y1Qe"), + (3, "14ShUZUYUR35RBZW6uVVt1zXDxmSQddkeDdXf1JkMA6P721N"), // proof https://kusama.subscan.io/extrinsic/16918890-8 (3, "CzEPpMr7XNS6dK7nQFnQbfnJQYLq7nvULK5kL9U8Zb6CTJm"), (2, "Ddb9puChKMHq4gM6o47E551wAmaNeu6kHngX1jzNNqAw782"), (2, "15DCWHQknBjc5YPFoVj8Pn2KoqrqYywJJ95BYNYJ4Fj3NLqz"), // proof https://kusama.subscan.io/extrinsic/16834952-2 @@ -202,9 +202,9 @@ pub mod tests { (2, "D8sM6vKjWaeKy2zCPYWGkLLbWdUtWQrXBTQqr4dSYnVQo21"), (1, "GfbnnEgRU94n9ed4RFZ6Z9dBAWs5obykigJSwXKU9hsT2uU"), (1, "HA5NtttvyZsxo4wGxGoJJSMaWtdEFZAuGUMFHVWD7fgenPv"), - (1, "Hj44XnjZui7SQ3A5eBMoJFa4H4nVhiyWnL2i2xw5f1YqzRX"), + (1, "14mDeKZ7qp9hqBjjDg51c8BFrf9o69om8piSSRwj2fT5Yb1i"), // proof https://kusama.subscan.io/extrinsic/16919020-4 (1, "16a357f5Sxab3V2ne4emGQvqJaCLeYpTMx3TCjnQhmJQ71DX"), // proof https://kusama.subscan.io/extrinsic/16836396-5 - (1, "CbCmCwFkfFkQo7bQtVczYg7sJ3oue6Ez2Z4RMGR8gi8deRk"), + (1, "14Ak9rrF6RKHHoLLRUYMnzcvvi1t8E1yAMa7tcmiwUfaqzYK"), // proof https://kusama.subscan.io/extrinsic/16921990-3 (1, "FJq9JpA9P7EXbmfsN9YiewJaDbQyL6vQyksGtJvzfbn6zf8"), (1, "15oLanodWWweiZJSoDTEBtrX7oGfq6e8ct5y5E6fVRDPhUgj"), // proof https://kusama.subscan.io/extrinsic/16876423-7 (1, "EaBqDJJNsZmYdQ4xn1vomPJVNh7fjA6UztZeEjn7ZzdeT7V"), @@ -220,7 +220,7 @@ pub mod tests { (1, "CzuUtvKhZNZBjyAXeYviaRXwrLhVrsupJ9PrWmdq7BJTjGR"), (1, "FCunn2Rx8JqfT5g6noUKKazph4jLDba5rUee7o3ZmJ362Ju"), (1, "HyPMjWRHCpJS7x2SZ2R6M2XG5ZiCiZag4U4r7gBHRsE5mTc"), - (1, "H9nUFL5DasuMeAiTC77QyZFCVX39crW6h7knXNrDF4PrSJf"), + (1, "1682A5hxfiS1Kn1jrUnMYv14T9EuEnsgnBbujGfYbeEbSK3w"), // proof https://kusama.subscan.io/extrinsic/16919077-2 (1, "13xS6fK6MHjApLnjdX7TJYw1niZmiXasSN91bNtiXQjgEtNx"), // proof https://kusama.subscan.io/extrinsic/16918212-7 ]; From 4ba12cbd0ce4d9a4a5238021659a7e18d05d3b37 Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 6 Mar 2023 21:30:12 +0100 Subject: [PATCH 27/32] fix try runtime --- .../collectives-polkadot/src/fellowship/migration.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 76c2ce10cf2..7c57a88a661 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -27,6 +27,8 @@ pub(crate) mod import_kusama_fellowship { Config, IdToIndex, IndexToId, MemberCount, MemberRecord, Members, Pallet as RankedCollective, Rank, }; + #[cfg(feature = "try-runtime")] + use sp_std::vec::Vec; const TARGET: &'static str = "runtime::migration::import_fellowship"; @@ -91,12 +93,12 @@ pub(crate) mod import_kusama_fellowship { { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, &'static str> { - let onchain_version = Pallet::::on_chain_storage_version(); + let onchain_version = RankedCollective::::on_chain_storage_version(); assert_eq!(onchain_version, 0, "the storage version must be 0."); let member_count = MemberCount::::get(0); assert_eq!(member_count, 0, "the collective must be uninitialized."); - Ok(()) + Ok(Vec::new()) } fn on_runtime_upgrade() -> Weight { @@ -148,7 +150,7 @@ pub(crate) mod import_kusama_fellowship { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), &'static str> { + fn post_upgrade(_state: Vec) -> Result<(), &'static str> { assert_eq!(MemberCount::::get(0), 46, "invalid members count at rank 0."); assert_eq!(MemberCount::::get(1), 46, "invalid members count at rank 1."); assert_eq!(MemberCount::::get(2), 24, "invalid members count at rank 2."); From 15aaa70ffe3b329096c5bb25122669a9e2dd37b1 Mon Sep 17 00:00:00 2001 From: muharem Date: Fri, 10 Mar 2023 17:52:35 +0100 Subject: [PATCH 28/32] update addresses --- .../src/fellowship/migration.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 7c57a88a661..926f1093f2d 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -36,12 +36,12 @@ pub(crate) mod import_kusama_fellowship { // The Fellowship addresses from Kusama state. pub const FellowshipAddresses: [(Rank, [u8; 32]); 46] = [ (6, hex_literal::hex!("f0673d30606ee26672707e4fd2bc8b58d3becb7aba2d5f60add64abb5fea4710"),), - (6, hex_literal::hex!("f60f9b64ebf26b9487c65ada132908745572692aef7cd9c987daf8c9c0c2ff3a"),), + (6, hex_literal::hex!("3c235e80e35082b668682531b9b062fda39a46edb94f884d9122d86885fd5f1b"),), (6, hex_literal::hex!("7628a5be63c4d3c8dbb96c2904b1a9682e02831a1af836c7efc808020b92fa63"),), (5, hex_literal::hex!("9c84f75e0b1b92f6b003bde6212a8b2c9b776f3720f942b33fed8709f103a268"),), (5, hex_literal::hex!("bc64065524532ed9e805fb0d39a5c0199216b52871168e5e4d0ab612f8797d61"),), (5, hex_literal::hex!("2e1884c53071526483b14004e894415f02b55fc2e2aef8e1df8ccf7ce5bd5570"),), - (5, hex_literal::hex!("f6b21d624832094b03aa672e016462a020e217cc67b1434785b99114a2b4fa5a"),), + (5, hex_literal::hex!("5c5062779d44ea2ab0469e155b8cf3e004fce71b3b3d38263cd9fa9478f12f28"),), (4, hex_literal::hex!("4adf51a47b72795366d52285e329229c836ea7bbfe139dbe8fa0700c4f86fc56"),), (4, hex_literal::hex!("1c90e3dabd3fd0f6bc648045018f78fcee8fe24122c22d8d2a14e9905073d10f"),), (4, hex_literal::hex!("8e851ed992228f2268ee8c614fe6075d3800060ae14098e0309413a0a81c4470"),), @@ -51,7 +51,7 @@ pub(crate) mod import_kusama_fellowship { (3, hex_literal::hex!("ccd87fa65729f7bdaa8305581a7a499aa24c118e83f5714152c0e22617c6fc63"),), (3, hex_literal::hex!("e0f0f94962fc0a8c1a0f0527dc8e592c67939c46c903b6016cc0a8515da0044d"),), (3, hex_literal::hex!("984e16482c99cfad1436111e321a86d87d0fac203bf64538f888e45d793b5413"),), - (3, hex_literal::hex!("123ca466ff6a76cdf3e73dc01bc1e8c4db195249e3b2e39a90036c6ded3db93a"),), + (3, hex_literal::hex!("44a3efb5bfa9023d4ef27b7d31d76f531b4d7772b1679b7fb32b6263ac39100e"),), (2, hex_literal::hex!("2eba9a39dbfdd5f3cba964355d45e27319f0271023c0353d97dc6df2401b0e3d"),), (2, hex_literal::hex!("ba3e9b87792bcfcc237fa8181185b8883c77f3e24f45e4a92ab31d07a4703520"),), (2, hex_literal::hex!("9e6eb74b0a6b39de36fb58d1fab20bc2b3fea96023ce5a47941c20480d99f92e"),), @@ -179,12 +179,12 @@ pub mod tests { let fellowship_addresses = FellowshipAddresses::get(); let kusama_fellowship_ss58: [(Rank, _); 46] = [ (6, "16SDAKg9N6kKAbhgDyxBXdHEwpwHUHs2CNEiLNGeZV55qHna"), // proof https://kusama.subscan.io/extrinsic/16832707-4 - (6, "J8ww78Qx3LVLW54bva3t4SzXcWKMdUWHEZR3V2VNKbmQgE8"), + (6, "12MrP337azmkTdfCUKe5XLnSQrbgEKqqfZ4PQC7CZTJKAWR3"), // proof https://kusama.subscan.io/extrinsic/16967809-2 (6, "FFFF3gBSSDFSvK2HBq4qgLH75DHqXWPHeCnR1BSksAMacBs"), (5, "G7YVCdxZb8JLpAm9WMnJdNuojNT84AzU62zmvx5P1FMNtg2"), (5, "15G1iXDLgFyfnJ51FKq1ts44TduMyUtekvzQi9my4hgYt2hs"), // proof https://kusama.subscan.io/extrinsic/16917610-2 (5, "Dcm1BqR4N7nHuV43TXdET7pNibt1Nzm42FggPHpxKRven53"), - (5, "J9nD3s7zssCX7bion1xctAF6xcVexcpy2uwy4jTm9JL8yuK"), + (5, "1363HWTPzDrzAQ6ChFiMU6mP4b6jmQid2ae55JQcKtZnpLGv"), // proof https://kusama.subscan.io/extrinsic/16961180-2 (4, "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"), (4, "1eTPAR2TuqLyidmPT9rMmuycHVm9s9czu78sePqg2KHMDrE"), // proof https://kusama.subscan.io/extrinsic/16921712-3 (4, "14DsLzVyTUTDMm2eP3czwPbH53KgqnQRp3CJJZS9GR7yxGDP"), // proof https://kusama.subscan.io/extrinsic/16917519-2 @@ -194,10 +194,10 @@ pub mod tests { (3, "15db5ksZgmhWE9U8MDq4wLKUdFivLVBybztWV8nmaJvv3NU1"), // proof https://kusama.subscan.io/extrinsic/16876631-2 (3, "HfFpz4QUxfbocHudf8UU7cMgHqkHpf855Me5X846PZAsAYE"), (3, "14ShUZUYUR35RBZW6uVVt1zXDxmSQddkeDdXf1JkMA6P721N"), // proof https://kusama.subscan.io/extrinsic/16918890-8 - (3, "CzEPpMr7XNS6dK7nQFnQbfnJQYLq7nvULK5kL9U8Zb6CTJm"), + (3, "12YzxR5TvGzfMVZNnhAJ5Hwi5zExpRWMKv2MuMwZTrddvgoi"), // proof https://kusama.subscan.io/extrinsic/16924324-3 (2, "Ddb9puChKMHq4gM6o47E551wAmaNeu6kHngX1jzNNqAw782"), (2, "15DCWHQknBjc5YPFoVj8Pn2KoqrqYywJJ95BYNYJ4Fj3NLqz"), // proof https://kusama.subscan.io/extrinsic/16834952-2 - (2, "GA3yPifemubFga7sTSFtLY2KFFiSRp6Bb8w31FS4xqgAvCz"), + (2, "14ajTQdrtCA8wZmC4PgD8Y1B2Gy8L4Z3oi2fodxq9FehcFrM"), // proof https://kusama.subscan.io/extrinsic/16944257-2 (2, "HxhDbS3grLurk1dhDgPiuDaRowHY1xHCU8Vu8on3fdg85tx"), (2, "HTk3eccL7WBkiyxz1gBcqQRghsJigoDMD7mnQaz1UAbMpQV"), (2, "EcNWrSPSDcVBRymwr26kk4JVFg92PdoU5Xwp87W2FgFSt9c"), From 6a32bbe94571260b0d108d7c251d488be5f65469 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 5 Apr 2023 11:37:06 +0200 Subject: [PATCH 29/32] use pallet api to import the members --- .../src/fellowship/migration.rs | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 926f1093f2d..165d37b71f5 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -22,11 +22,8 @@ use log; /// Initial import of the Kusama Technical Fellowship. pub(crate) mod import_kusama_fellowship { use super::*; - use frame_support::parameter_types; - use pallet_ranked_collective::{ - Config, IdToIndex, IndexToId, MemberCount, MemberRecord, Members, - Pallet as RankedCollective, Rank, - }; + use frame_support::{parameter_types, traits::RankedMembers}; + use pallet_ranked_collective::{Config, MemberCount, Pallet as RankedCollective, Rank}; #[cfg(feature = "try-runtime")] use sp_std::vec::Vec; @@ -128,24 +125,19 @@ pub(crate) mod import_kusama_fellowship { return weight } - let mut max_rank = 0; for (rank, account_id32) in FellowshipAddresses::get() { let who: T::AccountId = account_id32.into(); - Members::::insert(&who, MemberRecord::new(rank)); - weight.saturating_accrue(T::DbWeight::get().writes(1)); - for inner_rank in 0..rank + 1 { - let index = MemberCount::::get(rank); - MemberCount::::insert(inner_rank, index + 1); - IdToIndex::::insert(inner_rank, &who, index); - IndexToId::::insert(inner_rank, index, &who); - max_rank = max_rank.max(inner_rank); - // 2 writes to IdToIndex and IndexToId. + let _ = as RankedMembers>::induct(&who); + for _ in 0..rank { + let _ = as RankedMembers>::promote(&who); + // 1 write to `IdToIndex` and `IndexToId` per member on each rank. weight.saturating_accrue(T::DbWeight::get().writes(2)); } + // 1 write to `IdToIndex` and `IndexToId` per member on each rank. + weight.saturating_accrue(T::DbWeight::get().writes(2)); + // 1 read and 1 write to `Members` and `MemberCount` per member. + weight.saturating_accrue(T::DbWeight::get().reads_writes(2, 2)); } - // writes to MemberCount. - weight.saturating_accrue(T::DbWeight::get().writes((max_rank as u64) + 1)); - weight } @@ -248,6 +240,9 @@ pub mod tests { ext.execute_with(|| { assert_eq!(MemberCount::::get(0), 0); Migration::::on_runtime_upgrade(); + assert_eq!(MemberCount::::get(0), 46); + assert_eq!(MemberCount::::get(6), 3); + assert_eq!(MemberCount::::get(7), 0); for (rank, account_id32) in FellowshipAddresses::get() { let who = ::AccountId::from(account_id32); assert!(IdToIndex::::get(0, &who).is_some()); From f46644faf1b864556bb6a4711cac25c16470915f Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 5 Apr 2023 11:41:14 +0200 Subject: [PATCH 30/32] merge fix --- parachains/runtimes/collectives/collectives-polkadot/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index c7687ad5d1c..dec62a43fe2 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -73,7 +73,7 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } -[dev-dependencies] +[build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } [dev-dependencies] From 42b1ca9e79dc3f4782720a754d24b93a91c5e489 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 5 Apr 2023 11:43:19 +0200 Subject: [PATCH 31/32] hex-literal version --- parachains/runtimes/collectives/collectives-polkadot/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index dec62a43fe2..d8ad3a30408 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -7,7 +7,7 @@ description = "Polkadot Collectives Parachain Runtime" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -hex-literal = { version = "0.3.4" } +hex-literal = { version = "0.4.0" } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" From 66a61d08bd915d2a5f5e409a90abda37d9fdef8c Mon Sep 17 00:00:00 2001 From: muharem Date: Sun, 9 Apr 2023 11:56:19 +0200 Subject: [PATCH 32/32] add Bradley to the 1 rank --- .../collectives-polkadot/src/fellowship/migration.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 165d37b71f5..5056abb2e22 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -31,7 +31,7 @@ pub(crate) mod import_kusama_fellowship { parameter_types! { // The Fellowship addresses from Kusama state. - pub const FellowshipAddresses: [(Rank, [u8; 32]); 46] = [ + pub const FellowshipAddresses: [(Rank, [u8; 32]); 47] = [ (6, hex_literal::hex!("f0673d30606ee26672707e4fd2bc8b58d3becb7aba2d5f60add64abb5fea4710"),), (6, hex_literal::hex!("3c235e80e35082b668682531b9b062fda39a46edb94f884d9122d86885fd5f1b"),), (6, hex_literal::hex!("7628a5be63c4d3c8dbb96c2904b1a9682e02831a1af836c7efc808020b92fa63"),), @@ -78,6 +78,7 @@ pub(crate) mod import_kusama_fellowship { (1, hex_literal::hex!("eec4bd650a277342ebba0954ac786df2623bd6a9d6d3e69b484482336c549f79"),), (1, hex_literal::hex!("e287c7494655d636a846f5c3347ad2cb3c462a8d46e0832be70fcc0ab54ee62d"),), (1, hex_literal::hex!("82bf733f44a840f0a5c1935a002d4e541d81298fad6d1da8124073485983860e"),), + (1, hex_literal::hex!("d5b89078eed9b9dfec5c7d8413bac0b720bad3bd4078c4d8c894325713192502"),), ]; } @@ -143,8 +144,8 @@ pub(crate) mod import_kusama_fellowship { #[cfg(feature = "try-runtime")] fn post_upgrade(_state: Vec) -> Result<(), &'static str> { - assert_eq!(MemberCount::::get(0), 46, "invalid members count at rank 0."); - assert_eq!(MemberCount::::get(1), 46, "invalid members count at rank 1."); + assert_eq!(MemberCount::::get(0), 47, "invalid members count at rank 0."); + assert_eq!(MemberCount::::get(1), 47, "invalid members count at rank 1."); assert_eq!(MemberCount::::get(2), 24, "invalid members count at rank 2."); assert_eq!(MemberCount::::get(3), 17, "invalid members count at rank 3."); assert_eq!(MemberCount::::get(4), 10, "invalid members count at rank 4."); @@ -169,7 +170,7 @@ pub mod tests { #[test] fn check_fellowship_addresses() { let fellowship_addresses = FellowshipAddresses::get(); - let kusama_fellowship_ss58: [(Rank, _); 46] = [ + let kusama_fellowship_ss58: [(Rank, _); 47] = [ (6, "16SDAKg9N6kKAbhgDyxBXdHEwpwHUHs2CNEiLNGeZV55qHna"), // proof https://kusama.subscan.io/extrinsic/16832707-4 (6, "12MrP337azmkTdfCUKe5XLnSQrbgEKqqfZ4PQC7CZTJKAWR3"), // proof https://kusama.subscan.io/extrinsic/16967809-2 (6, "FFFF3gBSSDFSvK2HBq4qgLH75DHqXWPHeCnR1BSksAMacBs"), @@ -216,6 +217,7 @@ pub mod tests { (1, "HyPMjWRHCpJS7x2SZ2R6M2XG5ZiCiZag4U4r7gBHRsE5mTc"), (1, "1682A5hxfiS1Kn1jrUnMYv14T9EuEnsgnBbujGfYbeEbSK3w"), // proof https://kusama.subscan.io/extrinsic/16919077-2 (1, "13xS6fK6MHjApLnjdX7TJYw1niZmiXasSN91bNtiXQjgEtNx"), // proof https://kusama.subscan.io/extrinsic/16918212-7 + (1, "15qE2YAQCs5Y962RHE7RzNjQxU6Pei21nhkkSM9Sojq1hHps"), // https://kusama.subscan.io/extrinsic/17352973-2 ]; for (index, val) in kusama_fellowship_ss58.iter().enumerate() { @@ -240,7 +242,7 @@ pub mod tests { ext.execute_with(|| { assert_eq!(MemberCount::::get(0), 0); Migration::::on_runtime_upgrade(); - assert_eq!(MemberCount::::get(0), 46); + assert_eq!(MemberCount::::get(0), 47); assert_eq!(MemberCount::::get(6), 3); assert_eq!(MemberCount::::get(7), 0); for (rank, account_id32) in FellowshipAddresses::get() {