Add Nomination Pools to Kusama (#5447)

* add nomination pools to kusama

* Update runtime/kusama/src/lib.rs

Co-authored-by: Mara Robin B. <mara@broda.me>

* Update runtime/kusama/src/lib.rs

* probably fix build

* really fix build

* fix benches

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/

* whitelist transactional storage limit

* make defensive

* fix

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/

* update

* fix benches

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

* change head

* fmt

Co-authored-by: Mara Robin B. <mara@broda.me>
Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
Kian Paimani
2022-05-11 06:35:05 +01:00
committed by GitHub
parent be8cbc8001
commit 9f21ec97b8
9 changed files with 4864 additions and 62 deletions
+4 -1
View File
@@ -990,7 +990,8 @@ impl sp_runtime::traits::Convert<Balance, sp_core::U256> for BalanceToU256 {
pub struct U256ToBalance;
impl sp_runtime::traits::Convert<sp_core::U256, Balance> for U256ToBalance {
fn convert(n: sp_core::U256) -> Balance {
n.try_into().unwrap_or(Balance::MAX)
use frame_support::traits::Defensive;
n.try_into().defensive_unwrap_or(Balance::MAX)
}
}
@@ -1686,6 +1687,8 @@ sp_api::impl_runtime_apis! {
hex_literal::hex!("63f78c98723ddc9073523ef3beefda0ca95dac46c07a40d91506e7637ec4ba57").to_vec().into(),
// Configuration ActiveConfig
hex_literal::hex!("06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385").to_vec().into(),
// The transactional storage limit.
hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),
];
let mut batches = Vec::<BenchmarkBatch>::new();
@@ -1,4 +1,4 @@
// Copyright 2022 Parity Technologies (UK) Ltd.
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
@@ -13,14 +13,14 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_multisig`
//! Autogenerated weights for `pallet_nomination_pools`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-04-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-05-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// target/production/polkadot
// benchmark
// pallet
// --chain=westend-dev
@@ -32,7 +32,7 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/pallet_nomination_pools.rs
// --output=./runtime/westend/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -44,7 +44,6 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_nomination_pools`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo<T> {
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools MinJoinBond (r:1 w:0)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: NominationPools BondedPools (r:1 w:1)
@@ -59,11 +58,10 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: BagsList ListNodes (r:3 w:3)
// Storage: BagsList ListBags (r:2 w:2)
fn join() -> Weight {
(117_870_000 as Weight)
.saturating_add(T::DbWeight::get().reads(18 as Weight))
.saturating_add(T::DbWeight::get().writes(12 as Weight))
(108_606_000 as Weight)
.saturating_add(T::DbWeight::get().reads(17 as Weight))
.saturating_add(T::DbWeight::get().writes(11 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: NominationPools BondedPools (r:1 w:1)
// Storage: NominationPools RewardPools (r:1 w:1)
@@ -74,11 +72,10 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: BagsList ListNodes (r:3 w:3)
// Storage: BagsList ListBags (r:2 w:2)
fn bond_extra_transfer() -> Weight {
(110_176_000 as Weight)
.saturating_add(T::DbWeight::get().reads(14 as Weight))
.saturating_add(T::DbWeight::get().writes(13 as Weight))
(99_112_000 as Weight)
.saturating_add(T::DbWeight::get().reads(13 as Weight))
.saturating_add(T::DbWeight::get().writes(12 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: NominationPools BondedPools (r:1 w:1)
// Storage: NominationPools RewardPools (r:1 w:1)
@@ -86,24 +83,22 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: Staking Ledger (r:1 w:1)
// Storage: Staking Bonded (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
// Storage: BagsList ListNodes (r:2 w:2)
// Storage: BagsList ListNodes (r:3 w:3)
// Storage: BagsList ListBags (r:2 w:2)
fn bond_extra_reward() -> Weight {
(122_829_000 as Weight)
(117_308_000 as Weight)
.saturating_add(T::DbWeight::get().reads(14 as Weight))
.saturating_add(T::DbWeight::get().writes(13 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: NominationPools BondedPools (r:1 w:1)
// Storage: NominationPools RewardPools (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn claim_payout() -> Weight {
(50_094_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
(46_249_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: NominationPools BondedPools (r:1 w:1)
// Storage: NominationPools RewardPools (r:1 w:1)
@@ -119,23 +114,21 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: NominationPools SubPoolsStorage (r:1 w:1)
// Storage: NominationPools CounterForSubPoolsStorage (r:1 w:1)
fn unbond() -> Weight {
(119_288_000 as Weight)
.saturating_add(T::DbWeight::get().reads(19 as Weight))
.saturating_add(T::DbWeight::get().writes(14 as Weight))
(104_620_000 as Weight)
.saturating_add(T::DbWeight::get().reads(18 as Weight))
.saturating_add(T::DbWeight::get().writes(13 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools BondedPools (r:1 w:0)
// Storage: Staking Ledger (r:1 w:1)
// Storage: Staking CurrentEra (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
fn pool_withdraw_unbonded(s: u32, ) -> Weight {
(39_986_000 as Weight)
(35_407_000 as Weight)
// Standard Error: 0
.saturating_add((50_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
.saturating_add((26_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: Staking CurrentEra (r:1 w:0)
// Storage: NominationPools BondedPools (r:1 w:1)
@@ -145,13 +138,12 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: System Account (r:1 w:1)
// Storage: NominationPools CounterForPoolMembers (r:1 w:1)
fn withdraw_unbonded_update(s: u32, ) -> Weight {
(76_897_000 as Weight)
(71_250_000 as Weight)
// Standard Error: 0
.saturating_add((48_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(9 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
.saturating_add((42_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: NominationPools PoolMembers (r:1 w:1)
// Storage: Staking CurrentEra (r:1 w:0)
// Storage: NominationPools BondedPools (r:1 w:1)
@@ -171,12 +163,13 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: NominationPools CounterForSubPoolsStorage (r:1 w:1)
// Storage: NominationPools CounterForBondedPools (r:1 w:1)
// Storage: Staking Payee (r:0 w:1)
fn withdraw_unbonded_kill(_s: u32, ) -> Weight {
(135_837_000 as Weight)
.saturating_add(T::DbWeight::get().reads(20 as Weight))
.saturating_add(T::DbWeight::get().writes(17 as Weight))
fn withdraw_unbonded_kill(s: u32, ) -> Weight {
(125_903_000 as Weight)
// Standard Error: 1_000
.saturating_add((1_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(19 as Weight))
.saturating_add(T::DbWeight::get().writes(16 as Weight))
}
// Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
// Storage: Staking MinNominatorBond (r:1 w:0)
// Storage: NominationPools MinCreateBond (r:1 w:0)
// Storage: NominationPools MinJoinBond (r:1 w:0)
@@ -200,9 +193,9 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: NominationPools BondedPools (r:1 w:1)
// Storage: Staking Payee (r:0 w:1)
fn create() -> Weight {
(129_265_000 as Weight)
.saturating_add(T::DbWeight::get().reads(23 as Weight))
.saturating_add(T::DbWeight::get().writes(16 as Weight))
(113_124_000 as Weight)
.saturating_add(T::DbWeight::get().reads(22 as Weight))
.saturating_add(T::DbWeight::get().writes(15 as Weight))
}
// Storage: NominationPools BondedPools (r:1 w:0)
// Storage: Staking Ledger (r:1 w:0)
@@ -212,22 +205,22 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: Staking Validators (r:2 w:0)
// Storage: Staking CurrentEra (r:1 w:0)
// Storage: Staking Bonded (r:1 w:0)
// Storage: BagsList ListNodes (r:1 w:1)
// Storage: BagsList ListNodes (r:2 w:2)
// Storage: BagsList ListBags (r:1 w:1)
// Storage: BagsList CounterForListNodes (r:1 w:1)
// Storage: Staking CounterForNominators (r:1 w:1)
fn nominate(n: u32, ) -> Weight {
(45_546_000 as Weight)
// Standard Error: 11_000
.saturating_add((2_075_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(12 as Weight))
(46_574_000 as Weight)
// Standard Error: 13_000
.saturating_add((1_992_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(13 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight)))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
// Storage: NominationPools BondedPools (r:1 w:1)
// Storage: Staking Ledger (r:1 w:0)
fn set_state() -> Weight {
(23_256_000 as Weight)
(19_838_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -235,7 +228,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: NominationPools Metadata (r:1 w:1)
// Storage: NominationPools CounterForMetadata (r:1 w:1)
fn set_metadata(n: u32, ) -> Weight {
(10_893_000 as Weight)
(8_733_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
@@ -247,7 +240,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Storage: NominationPools MinCreateBond (r:0 w:1)
// Storage: NominationPools MaxPools (r:0 w:1)
fn set_configs() -> Weight {
(2_793_000 as Weight)
(2_160_000 as Weight)
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
@@ -258,4 +251,3 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}