From 500321b33210a649e907d73509ec5f104ba67603 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 23 Nov 2021 09:20:35 +0100 Subject: [PATCH 1/6] Minimum commission for validators --- frame/staking/src/pallet/mod.rs | 34 ++++++++++-- frame/staking/src/tests.rs | 72 ++++++++++++++++++++++--- primitives/arithmetic/src/per_things.rs | 10 ++++ 3 files changed, 107 insertions(+), 9 deletions(-) diff --git a/frame/staking/src/pallet/mod.rs b/frame/staking/src/pallet/mod.rs index 542b79b792dc7..e462d49f54abc 100644 --- a/frame/staking/src/pallet/mod.rs +++ b/frame/staking/src/pallet/mod.rs @@ -210,6 +210,12 @@ pub mod pallet { #[pallet::storage] pub type MinValidatorBond = StorageValue<_, BalanceOf, ValueQuery>; + /// The minimum amount of commission that validators can set. + /// + /// If non-existent, no limit exists. + #[pallet::storage] + pub type MinCommission = StorageValue<_, Perbill, ValueQuery>; + /// Map from all (unlocked) "controller" accounts to the info regarding the staking. #[pallet::storage] #[pallet::getter(fn ledger)] @@ -481,6 +487,8 @@ pub mod pallet { Vec<(T::AccountId, T::AccountId, BalanceOf, crate::StakerStatus)>, pub min_nominator_bond: BalanceOf, pub min_validator_bond: BalanceOf, + pub max_validator_count: Option, + pub max_nominator_count: Option, } #[cfg(feature = "std")] @@ -497,6 +505,8 @@ pub mod pallet { stakers: Default::default(), min_nominator_bond: Default::default(), min_validator_bond: Default::default(), + max_validator_count: None, + max_nominator_count: None, } } } @@ -514,6 +524,12 @@ pub mod pallet { StorageVersion::::put(Releases::V7_0_0); MinNominatorBond::::put(self.min_nominator_bond); MinValidatorBond::::put(self.min_validator_bond); + if let Some(x) = self.max_validator_count { + MaxValidatorsCount::::put(x); + } + if let Some(x) = self.max_nominator_count { + MaxNominatorsCount::::put(x); + } for &(ref stash, ref controller, balance, ref status) in &self.stakers { log!( @@ -645,6 +661,8 @@ pub mod pallet { /// There are too many validators in the system. Governance needs to adjust the staking /// settings to keep things safe for the runtime. TooManyValidators, + /// Commission is too low. Must be at least `MinCommission`. + CommissionTooLow, } #[pallet::hooks] @@ -950,9 +968,13 @@ pub mod pallet { let controller = ensure_signed(origin)?; let ledger = Self::ledger(&controller).ok_or(Error::::NotController)?; + ensure!(ledger.active >= MinValidatorBond::::get(), Error::::InsufficientBond); let stash = &ledger.stash; + // ensure their commission is correct. + ensure!(prefs.commission >= MinCommission::::get(), Error::::CommissionTooLow); + // Only check limits if they are not already a validator. if !Validators::::contains_key(stash) { // If this error is reached, we need to adjust the `MinValidatorBond` and start @@ -1503,7 +1525,7 @@ pub mod pallet { Ok(()) } - /// Update the various staking limits this pallet. + /// Update the various staking configurations . /// /// * `min_nominator_bond`: The minimum active bond needed to be a nominator. /// * `min_validator_bond`: The minimum active bond needed to be a validator. @@ -1511,6 +1533,10 @@ pub mod pallet { /// set to `None`, no limit is enforced. /// * `max_validator_count`: The max number of users who can be a validator at once. When /// set to `None`, no limit is enforced. + /// * `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which + /// should be filled in order for the `chill_other` transaction to work. + /// * `min_commission`: The minimum amount of commission that each validators must maintain. + /// This is checked only upon calling `validate`. Existing validators are not affected. /// /// Origin must be Root to call this function. /// @@ -1523,14 +1549,16 @@ pub mod pallet { min_validator_bond: BalanceOf, max_nominator_count: Option, max_validator_count: Option, - threshold: Option, + chill_threshold: Option, + min_commission: Perbill, ) -> DispatchResult { ensure_root(origin)?; MinNominatorBond::::set(min_nominator_bond); MinValidatorBond::::set(min_validator_bond); MaxNominatorsCount::::set(max_nominator_count); MaxValidatorsCount::::set(max_validator_count); - ChillThreshold::::set(threshold); + ChillThreshold::::set(chill_threshold); + MinCommission::::set(min_commission); Ok(()) } diff --git a/frame/staking/src/tests.rs b/frame/staking/src/tests.rs index f8f37bed0066c..29c076a046ca9 100644 --- a/frame/staking/src/tests.rs +++ b/frame/staking/src/tests.rs @@ -4350,7 +4350,15 @@ fn chill_other_works() { ); // Change the minimum bond... but no limits. - assert_ok!(Staking::set_staking_limits(Origin::root(), 1_500, 2_000, None, None, None)); + assert_ok!(Staking::set_staking_limits( + Origin::root(), + 1_500, + 2_000, + None, + None, + None, + Zero::zero() + )); // Still can't chill these users assert_noop!( @@ -4369,7 +4377,8 @@ fn chill_other_works() { 2_000, Some(10), Some(10), - None + None, + Zero::zero() )); // Still can't chill these users @@ -4389,7 +4398,8 @@ fn chill_other_works() { 2_000, None, None, - Some(Percent::from_percent(0)) + Some(Percent::from_percent(0)), + Zero::zero() )); // Still can't chill these users @@ -4409,7 +4419,8 @@ fn chill_other_works() { 2_000, Some(10), Some(10), - Some(Percent::from_percent(75)) + Some(Percent::from_percent(75)), + Zero::zero() )); // 16 people total because tests start with 2 active one @@ -4453,7 +4464,8 @@ fn capped_stakers_works() { 10, Some(max), Some(max), - Some(Percent::from_percent(0)) + Some(Percent::from_percent(0)), + Zero::zero(), )); // can create `max - validator_count` validators @@ -4516,12 +4528,60 @@ fn capped_stakers_works() { )); // No problem when we set to `None` again - assert_ok!(Staking::set_staking_limits(Origin::root(), 10, 10, None, None, None)); + assert_ok!(Staking::set_staking_limits( + Origin::root(), + 10, + 10, + None, + None, + None, + Zero::zero(), + )); assert_ok!(Staking::nominate(Origin::signed(last_nominator), vec![1])); assert_ok!(Staking::validate(Origin::signed(last_validator), ValidatorPrefs::default())); }) } +#[test] +fn min_commission_works() { + ExtBuilder::default().build_and_execute(|| { + assert_ok!(Staking::validate( + Origin::signed(10), + ValidatorPrefs { commission: Perbill::from_percent(5), blocked: false } + )); + + assert_ok!(Staking::set_staking_limits( + Origin::root(), + 0, + 0, + None, + None, + None, + Perbill::from_percent(10), + )); + + // can't make it less than 10 now + assert_noop!( + Staking::validate( + Origin::signed(10), + ValidatorPrefs { commission: Perbill::from_percent(5), blocked: false } + ), + Error::::CommissionTooLow + ); + + // can only change to higher. + assert_ok!(Staking::validate( + Origin::signed(10), + ValidatorPrefs { commission: Perbill::from_percent(10), blocked: false } + )); + + assert_ok!(Staking::validate( + Origin::signed(10), + ValidatorPrefs { commission: Perbill::from_percent(15), blocked: false } + )); + }) +} + mod sorted_list_provider { use super::*; use frame_election_provider_support::SortedListProvider; diff --git a/primitives/arithmetic/src/per_things.rs b/primitives/arithmetic/src/per_things.rs index f388c19de6b43..783b331b33532 100644 --- a/primitives/arithmetic/src/per_things.rs +++ b/primitives/arithmetic/src/per_things.rs @@ -833,6 +833,16 @@ macro_rules! implement_per_thing { } } + impl $crate::traits::Zero for $name { + fn zero() -> Self { + Self::zero() + } + + fn is_zero(&self) -> bool { + self == &Self::zero() + } + } + #[cfg(test)] mod $test_mod { From 410a4764bcc66fc61c7ad0284bd65eff0a27caaa Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 23 Nov 2021 09:27:02 +0100 Subject: [PATCH 2/6] rename --- frame/staking/src/benchmarking.rs | 2 +- frame/staking/src/pallet/mod.rs | 4 ++-- frame/staking/src/tests.rs | 14 +++++++------- frame/staking/src/weights.rs | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frame/staking/src/benchmarking.rs b/frame/staking/src/benchmarking.rs index e312aedbec1f3..cbee6018f39a1 100644 --- a/frame/staking/src/benchmarking.rs +++ b/frame/staking/src/benchmarking.rs @@ -841,7 +841,7 @@ benchmarks! { assert_eq!(targets.len() as u32, v); } - set_staking_limits { + set_staking_configs { // This function always does the same thing... just write to 4 storage items. }: _( RawOrigin::Root, diff --git a/frame/staking/src/pallet/mod.rs b/frame/staking/src/pallet/mod.rs index e462d49f54abc..9bf3fc419c424 100644 --- a/frame/staking/src/pallet/mod.rs +++ b/frame/staking/src/pallet/mod.rs @@ -1542,8 +1542,8 @@ pub mod pallet { /// /// NOTE: Existing nominators and validators will not be affected by this update. /// to kick people under the new limits, `chill_other` should be called. - #[pallet::weight(T::WeightInfo::set_staking_limits())] - pub fn set_staking_limits( + #[pallet::weight(T::WeightInfo::set_staking_configs())] + pub fn set_staking_configs( origin: OriginFor, min_nominator_bond: BalanceOf, min_validator_bond: BalanceOf, diff --git a/frame/staking/src/tests.rs b/frame/staking/src/tests.rs index 29c076a046ca9..4604351b52305 100644 --- a/frame/staking/src/tests.rs +++ b/frame/staking/src/tests.rs @@ -4350,7 +4350,7 @@ fn chill_other_works() { ); // Change the minimum bond... but no limits. - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 1_500, 2_000, @@ -4371,7 +4371,7 @@ fn chill_other_works() { ); // Add limits, but no threshold - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 1_500, 2_000, @@ -4392,7 +4392,7 @@ fn chill_other_works() { ); // Add threshold, but no limits - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 1_500, 2_000, @@ -4413,7 +4413,7 @@ fn chill_other_works() { ); // Add threshold and limits - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 1_500, 2_000, @@ -4458,7 +4458,7 @@ fn capped_stakers_works() { // Change the maximums let max = 10; - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 10, 10, @@ -4528,7 +4528,7 @@ fn capped_stakers_works() { )); // No problem when we set to `None` again - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 10, 10, @@ -4550,7 +4550,7 @@ fn min_commission_works() { ValidatorPrefs { commission: Perbill::from_percent(5), blocked: false } )); - assert_ok!(Staking::set_staking_limits( + assert_ok!(Staking::set_staking_configs( Origin::root(), 0, 0, diff --git a/frame/staking/src/weights.rs b/frame/staking/src/weights.rs index 32c8dc80da158..9f88bfcc74d96 100644 --- a/frame/staking/src/weights.rs +++ b/frame/staking/src/weights.rs @@ -71,7 +71,7 @@ pub trait WeightInfo { fn new_era(v: u32, n: u32, ) -> Weight; fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight; fn get_npos_targets(v: u32, ) -> Weight; - fn set_staking_limits() -> Weight; + fn set_staking_configs() -> Weight; fn chill_other() -> Weight; } @@ -423,7 +423,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ChillThreshold (r:0 w:1) // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) - fn set_staking_limits() -> Weight { + fn set_staking_configs() -> Weight { (6_353_000 as Weight) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -791,7 +791,7 @@ impl WeightInfo for () { // Storage: Staking ChillThreshold (r:0 w:1) // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) - fn set_staking_limits() -> Weight { + fn set_staking_configs() -> Weight { (6_353_000 as Weight) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } From 82eee81ff2e266be7240abd036d12a3f1aaec4c0 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 23 Nov 2021 09:31:58 +0100 Subject: [PATCH 3/6] Fix benchmakrs --- frame/staking/src/benchmarking.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frame/staking/src/benchmarking.rs b/frame/staking/src/benchmarking.rs index cbee6018f39a1..a32268a12bd7f 100644 --- a/frame/staking/src/benchmarking.rs +++ b/frame/staking/src/benchmarking.rs @@ -849,13 +849,15 @@ benchmarks! { BalanceOf::::max_value(), Some(u32::MAX), Some(u32::MAX), - Some(Percent::max_value()) + Some(Percent::max_value()), + Perbill::max_value() ) verify { assert_eq!(MinNominatorBond::::get(), BalanceOf::::max_value()); assert_eq!(MinValidatorBond::::get(), BalanceOf::::max_value()); assert_eq!(MaxNominatorsCount::::get(), Some(u32::MAX)); assert_eq!(MaxValidatorsCount::::get(), Some(u32::MAX)); assert_eq!(ChillThreshold::::get(), Some(Percent::from_percent(100))); + assert_eq!(MinCommission::::get(), Perbill::from_percent(100)); } chill_other { @@ -871,13 +873,14 @@ benchmarks! { let stash = scenario.origin_stash1.clone(); assert!(T::SortedListProvider::contains(&stash)); - Staking::::set_staking_limits( + Staking::::set_staking_configs( RawOrigin::Root.into(), BalanceOf::::max_value(), BalanceOf::::max_value(), Some(0), Some(0), - Some(Percent::from_percent(0)) + Some(Percent::from_percent(0)), + Zero::zero(), )?; let caller = whitelisted_caller(); From 64b02e4bd4739c05d96da0acec0b5e42f43131e2 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Wed, 24 Nov 2021 15:01:16 +0000 Subject: [PATCH 4/6] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/staking/src/weights.rs | 327 ++++++++++++++--------------------- 1 file changed, 131 insertions(+), 196 deletions(-) diff --git a/frame/staking/src/weights.rs b/frame/staking/src/weights.rs index 9f88bfcc74d96..fc5de5dc29569 100644 --- a/frame/staking/src/weights.rs +++ b/frame/staking/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-09-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2021-11-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: @@ -35,7 +35,6 @@ // --output=./frame/staking/src/weights.rs // --template=./.maintain/frame-weight-template.hbs - #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] @@ -85,7 +84,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (73_865_000 as Weight) + (62_769_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -95,7 +94,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (114_296_000 as Weight) + (102_774_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -109,7 +108,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (121_737_000 as Weight) + (110_516_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -117,10 +116,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking CurrentEra (r:1 w:0) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn withdraw_unbonded_update(s: u32, ) -> Weight { - (51_631_000 as Weight) - // Standard Error: 0 - .saturating_add((55_000 as Weight).saturating_mul(s as Weight)) + fn withdraw_unbonded_update(_s: u32, ) -> Weight { + (49_479_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -138,12 +135,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (101_870_000 as Weight) + (91_014_000 as Weight) .saturating_add(T::DbWeight::get().reads(13 as Weight)) .saturating_add(T::DbWeight::get().writes(11 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking MinValidatorBond (r:1 w:0) + // Storage: Staking MinCommission (r:1 w:0) // Storage: Staking Validators (r:1 w:1) // Storage: Staking MaxValidatorsCount (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) @@ -153,19 +151,16 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (69_092_000 as Weight) - .saturating_add(T::DbWeight::get().reads(11 as Weight)) + (66_307_000 as Weight) + .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) - fn kick(k: u32, ) -> Weight { - (21_468_000 as Weight) - // Standard Error: 19_000 - .saturating_add((16_415_000 as Weight).saturating_mul(k as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) + fn kick(_k: u32, ) -> Weight { + (906_377_000 as Weight) + .saturating_add(T::DbWeight::get().reads(66 as Weight)) + .saturating_add(T::DbWeight::get().writes(65 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -178,12 +173,9 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:2 w:2) // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) - fn nominate(n: u32, ) -> Weight { - (82_389_000 as Weight) - // Standard Error: 14_000 - .saturating_add((5_597_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(12 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) + fn nominate(_n: u32, ) -> Weight { + (119_946_000 as Weight) + .saturating_add(T::DbWeight::get().reads(21 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) @@ -194,49 +186,47 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (69_655_000 as Weight) + (64_644_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (12_770_000 as Weight) + (11_712_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (27_756_000 as Weight) + (24_592_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (2_446_000 as Weight) + (2_194_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (2_720_000 as Weight) + (2_430_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (2_711_000 as Weight) + (2_471_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (2_796_000 as Weight) + (2_410_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) - fn set_invulnerables(v: u32, ) -> Weight { - (3_141_000 as Weight) - // Standard Error: 0 - .saturating_add((53_000 as Weight).saturating_mul(v as Weight)) + fn set_invulnerables(_v: u32, ) -> Weight { + (28_867_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -252,19 +242,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Ledger (r:0 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) - fn force_unstake(s: u32, ) -> Weight { - (97_394_000 as Weight) - // Standard Error: 2_000 - .saturating_add((2_370_000 as Weight).saturating_mul(s as Weight)) + fn force_unstake(_s: u32, ) -> Weight { + (178_224_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) - .saturating_add(T::DbWeight::get().writes(12 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(62 as Weight)) } // Storage: Staking UnappliedSlashes (r:1 w:1) - fn cancel_deferred_slash(s: u32, ) -> Weight { - (2_783_746_000 as Weight) - // Standard Error: 182_000 - .saturating_add((16_223_000 as Weight).saturating_mul(s as Weight)) + fn cancel_deferred_slash(_s: u32, ) -> Weight { + (12_183_514_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -278,14 +263,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasValidatorPrefs (r:1 w:0) // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) - fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (109_233_000 as Weight) - // Standard Error: 17_000 - .saturating_add((47_612_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) + fn payout_stakers_dead_controller(_n: u32, ) -> Weight { + (5_642_805_000 as Weight) + .saturating_add(T::DbWeight::get().reads(403 as Weight)) + .saturating_add(T::DbWeight::get().writes(133 as Weight)) } // Storage: Staking CurrentEra (r:1 w:0) // Storage: Staking HistoryDepth (r:1 w:0) @@ -298,14 +279,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) - fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (177_392_000 as Weight) - // Standard Error: 20_000 - .saturating_add((60_771_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(11 as Weight)) - .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) + fn payout_stakers_alive_staked(_n: u32, ) -> Weight { + (7_394_770_000 as Weight) + .saturating_add(T::DbWeight::get().reads(666 as Weight)) + .saturating_add(T::DbWeight::get().writes(396 as Weight)) } // Storage: Staking Ledger (r:1 w:1) // Storage: Balances Locks (r:1 w:1) @@ -313,10 +290,8 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:3 w:3) // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) - fn rebond(l: u32, ) -> Weight { - (111_858_000 as Weight) - // Standard Error: 4_000 - .saturating_add((36_000 as Weight).saturating_mul(l as Weight)) + fn rebond(_l: u32, ) -> Weight { + (101_802_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -329,16 +304,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasStakers (r:0 w:2) // Storage: Staking ErasTotalStake (r:0 w:1) // Storage: Staking ErasStartSessionIndex (r:0 w:1) - fn set_history_depth(e: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 68_000 - .saturating_add((33_495_000 as Weight).saturating_mul(e as Weight)) + fn set_history_depth(_e: u32, ) -> Weight { + (1_312_998_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) + .saturating_add(T::DbWeight::get().writes(361 as Weight)) } // Storage: System Account (r:1 w:1) // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) // Storage: Staking SlashingSpans (r:1 w:1) // Storage: Staking Validators (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) @@ -347,16 +320,12 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Staking Ledger (r:0 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) - fn reap_stash(s: u32, ) -> Weight { - (100_178_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_358_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(11 as Weight)) - .saturating_add(T::DbWeight::get().writes(12 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + fn reap_stash(_s: u32, ) -> Weight { + (189_116_000 as Weight) + .saturating_add(T::DbWeight::get().reads(12 as Weight)) + .saturating_add(T::DbWeight::get().writes(63 as Weight)) } // Storage: Staking CounterForNominators (r:1 w:0) // Storage: Staking CounterForValidators (r:1 w:0) @@ -378,10 +347,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 860_000 - .saturating_add((298_721_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 43_000 - .saturating_add((49_427_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 834_000 + .saturating_add((284_139_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 41_000 + .saturating_add((44_463_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(208 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -399,33 +368,31 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Nominators (r:1000 w:0) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 91_000 - .saturating_add((26_605_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 91_000 - .saturating_add((31_481_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_122_000 - .saturating_add((16_672_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 92_000 + .saturating_add((25_070_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 92_000 + .saturating_add((27_803_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 3_136_000 + .saturating_add((13_639_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(204 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking Validators (r:501 w:0) - fn get_npos_targets(v: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 34_000 - .saturating_add((10_558_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) + fn get_npos_targets(_v: u32, ) -> Weight { + (7_508_877_000 as Weight) + .saturating_add(T::DbWeight::get().reads(751 as Weight)) } + // Storage: Staking MinCommission (r:0 w:1) // Storage: Staking MinValidatorBond (r:0 w:1) // Storage: Staking MaxValidatorsCount (r:0 w:1) // Storage: Staking ChillThreshold (r:0 w:1) // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (6_353_000 as Weight) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + (6_099_000 as Weight) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking ChillThreshold (r:1 w:0) @@ -438,7 +405,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (83_389_000 as Weight) + (79_637_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -453,7 +420,7 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (73_865_000 as Weight) + (62_769_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -463,7 +430,7 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (114_296_000 as Weight) + (102_774_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } @@ -477,7 +444,7 @@ impl WeightInfo for () { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (121_737_000 as Weight) + (110_516_000 as Weight) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -485,10 +452,8 @@ impl WeightInfo for () { // Storage: Staking CurrentEra (r:1 w:0) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn withdraw_unbonded_update(s: u32, ) -> Weight { - (51_631_000 as Weight) - // Standard Error: 0 - .saturating_add((55_000 as Weight).saturating_mul(s as Weight)) + fn withdraw_unbonded_update(_s: u32, ) -> Weight { + (49_479_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -506,12 +471,13 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (101_870_000 as Weight) + (91_014_000 as Weight) .saturating_add(RocksDbWeight::get().reads(13 as Weight)) .saturating_add(RocksDbWeight::get().writes(11 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking MinValidatorBond (r:1 w:0) + // Storage: Staking MinCommission (r:1 w:0) // Storage: Staking Validators (r:1 w:1) // Storage: Staking MaxValidatorsCount (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) @@ -521,19 +487,16 @@ impl WeightInfo for () { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (69_092_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(11 as Weight)) + (66_307_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) - fn kick(k: u32, ) -> Weight { - (21_468_000 as Weight) - // Standard Error: 19_000 - .saturating_add((16_415_000 as Weight).saturating_mul(k as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) + fn kick(_k: u32, ) -> Weight { + (906_377_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(66 as Weight)) + .saturating_add(RocksDbWeight::get().writes(65 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -546,12 +509,9 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:2 w:2) // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) - fn nominate(n: u32, ) -> Weight { - (82_389_000 as Weight) - // Standard Error: 14_000 - .saturating_add((5_597_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(RocksDbWeight::get().reads(12 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) + fn nominate(_n: u32, ) -> Weight { + (119_946_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(21 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) @@ -562,49 +522,47 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (69_655_000 as Weight) + (64_644_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (12_770_000 as Weight) + (11_712_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (27_756_000 as Weight) + (24_592_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (2_446_000 as Weight) + (2_194_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (2_720_000 as Weight) + (2_430_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (2_711_000 as Weight) + (2_471_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (2_796_000 as Weight) + (2_410_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) - fn set_invulnerables(v: u32, ) -> Weight { - (3_141_000 as Weight) - // Standard Error: 0 - .saturating_add((53_000 as Weight).saturating_mul(v as Weight)) + fn set_invulnerables(_v: u32, ) -> Weight { + (28_867_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -620,19 +578,14 @@ impl WeightInfo for () { // Storage: Staking Ledger (r:0 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) - fn force_unstake(s: u32, ) -> Weight { - (97_394_000 as Weight) - // Standard Error: 2_000 - .saturating_add((2_370_000 as Weight).saturating_mul(s as Weight)) + fn force_unstake(_s: u32, ) -> Weight { + (178_224_000 as Weight) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) - .saturating_add(RocksDbWeight::get().writes(12 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().writes(62 as Weight)) } // Storage: Staking UnappliedSlashes (r:1 w:1) - fn cancel_deferred_slash(s: u32, ) -> Weight { - (2_783_746_000 as Weight) - // Standard Error: 182_000 - .saturating_add((16_223_000 as Weight).saturating_mul(s as Weight)) + fn cancel_deferred_slash(_s: u32, ) -> Weight { + (12_183_514_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -646,14 +599,10 @@ impl WeightInfo for () { // Storage: Staking ErasValidatorPrefs (r:1 w:0) // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) - fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (109_233_000 as Weight) - // Standard Error: 17_000 - .saturating_add((47_612_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(RocksDbWeight::get().reads(10 as Weight)) - .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) + fn payout_stakers_dead_controller(_n: u32, ) -> Weight { + (5_642_805_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(403 as Weight)) + .saturating_add(RocksDbWeight::get().writes(133 as Weight)) } // Storage: Staking CurrentEra (r:1 w:0) // Storage: Staking HistoryDepth (r:1 w:0) @@ -666,14 +615,10 @@ impl WeightInfo for () { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) - fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (177_392_000 as Weight) - // Standard Error: 20_000 - .saturating_add((60_771_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(RocksDbWeight::get().reads(11 as Weight)) - .saturating_add(RocksDbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) + fn payout_stakers_alive_staked(_n: u32, ) -> Weight { + (7_394_770_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(666 as Weight)) + .saturating_add(RocksDbWeight::get().writes(396 as Weight)) } // Storage: Staking Ledger (r:1 w:1) // Storage: Balances Locks (r:1 w:1) @@ -681,10 +626,8 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:3 w:3) // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) - fn rebond(l: u32, ) -> Weight { - (111_858_000 as Weight) - // Standard Error: 4_000 - .saturating_add((36_000 as Weight).saturating_mul(l as Weight)) + fn rebond(_l: u32, ) -> Weight { + (101_802_000 as Weight) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -697,16 +640,14 @@ impl WeightInfo for () { // Storage: Staking ErasStakers (r:0 w:2) // Storage: Staking ErasTotalStake (r:0 w:1) // Storage: Staking ErasStartSessionIndex (r:0 w:1) - fn set_history_depth(e: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 68_000 - .saturating_add((33_495_000 as Weight).saturating_mul(e as Weight)) + fn set_history_depth(_e: u32, ) -> Weight { + (1_312_998_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) + .saturating_add(RocksDbWeight::get().writes(361 as Weight)) } // Storage: System Account (r:1 w:1) // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) // Storage: Staking SlashingSpans (r:1 w:1) // Storage: Staking Validators (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) @@ -715,16 +656,12 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Staking Ledger (r:0 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) - fn reap_stash(s: u32, ) -> Weight { - (100_178_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_358_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(11 as Weight)) - .saturating_add(RocksDbWeight::get().writes(12 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + fn reap_stash(_s: u32, ) -> Weight { + (189_116_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(12 as Weight)) + .saturating_add(RocksDbWeight::get().writes(63 as Weight)) } // Storage: Staking CounterForNominators (r:1 w:0) // Storage: Staking CounterForValidators (r:1 w:0) @@ -746,10 +683,10 @@ impl WeightInfo for () { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 860_000 - .saturating_add((298_721_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 43_000 - .saturating_add((49_427_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 834_000 + .saturating_add((284_139_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 41_000 + .saturating_add((44_463_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(208 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -767,33 +704,31 @@ impl WeightInfo for () { // Storage: Staking Nominators (r:1000 w:0) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 91_000 - .saturating_add((26_605_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 91_000 - .saturating_add((31_481_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_122_000 - .saturating_add((16_672_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 92_000 + .saturating_add((25_070_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 92_000 + .saturating_add((27_803_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 3_136_000 + .saturating_add((13_639_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(204 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking Validators (r:501 w:0) - fn get_npos_targets(v: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 34_000 - .saturating_add((10_558_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) + fn get_npos_targets(_v: u32, ) -> Weight { + (7_508_877_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(751 as Weight)) } + // Storage: Staking MinCommission (r:0 w:1) // Storage: Staking MinValidatorBond (r:0 w:1) // Storage: Staking MaxValidatorsCount (r:0 w:1) // Storage: Staking ChillThreshold (r:0 w:1) // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (6_353_000 as Weight) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + (6_099_000 as Weight) + .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking ChillThreshold (r:1 w:0) @@ -806,7 +741,7 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (83_389_000 as Weight) + (79_637_000 as Weight) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } From 77bb4fd8daef6d6723f3d88e22caf536f26f78ae Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Mon, 29 Nov 2021 15:42:39 +0100 Subject: [PATCH 5/6] Update frame/staking/src/pallet/mod.rs --- frame/staking/src/pallet/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/staking/src/pallet/mod.rs b/frame/staking/src/pallet/mod.rs index 9bf3fc419c424..fde0a0e17a91d 100644 --- a/frame/staking/src/pallet/mod.rs +++ b/frame/staking/src/pallet/mod.rs @@ -212,7 +212,7 @@ pub mod pallet { /// The minimum amount of commission that validators can set. /// - /// If non-existent, no limit exists. + /// If set to `0`, no limit exists. #[pallet::storage] pub type MinCommission = StorageValue<_, Perbill, ValueQuery>; From 43e63812bc6dbe521f6855bbd96ba1b13de902a6 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Mon, 29 Nov 2021 17:44:17 +0000 Subject: [PATCH 6/6] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/staking/src/weights.rs | 302 +++++++++++++++++++++-------------- 1 file changed, 183 insertions(+), 119 deletions(-) diff --git a/frame/staking/src/weights.rs b/frame/staking/src/weights.rs index fc5de5dc29569..0ca819898fbb0 100644 --- a/frame/staking/src/weights.rs +++ b/frame/staking/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-11-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2021-11-29, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: @@ -84,7 +84,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (62_769_000 as Weight) + (63_660_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -94,7 +94,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (102_774_000 as Weight) + (103_672_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -108,7 +108,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (110_516_000 as Weight) + (110_884_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -116,8 +116,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking CurrentEra (r:1 w:0) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn withdraw_unbonded_update(_s: u32, ) -> Weight { - (49_479_000 as Weight) + fn withdraw_unbonded_update(s: u32, ) -> Weight { + (46_379_000 as Weight) + // Standard Error: 0 + .saturating_add((55_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -135,7 +137,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (91_014_000 as Weight) + (91_303_000 as Weight) .saturating_add(T::DbWeight::get().reads(13 as Weight)) .saturating_add(T::DbWeight::get().writes(11 as Weight)) } @@ -151,16 +153,19 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (66_307_000 as Weight) + (66_587_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) - fn kick(_k: u32, ) -> Weight { - (906_377_000 as Weight) - .saturating_add(T::DbWeight::get().reads(66 as Weight)) - .saturating_add(T::DbWeight::get().writes(65 as Weight)) + fn kick(k: u32, ) -> Weight { + (21_153_000 as Weight) + // Standard Error: 16_000 + .saturating_add((13_502_000 as Weight).saturating_mul(k as Weight)) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -173,9 +178,12 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:2 w:2) // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) - fn nominate(_n: u32, ) -> Weight { - (119_946_000 as Weight) - .saturating_add(T::DbWeight::get().reads(21 as Weight)) + fn nominate(n: u32, ) -> Weight { + (75_456_000 as Weight) + // Standard Error: 12_000 + .saturating_add((5_051_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(12 as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) @@ -186,47 +194,49 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (64_644_000 as Weight) + (65_332_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (11_712_000 as Weight) + (11_757_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (24_592_000 as Weight) + (24_252_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (2_194_000 as Weight) + (2_252_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (2_430_000 as Weight) + (2_431_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (2_471_000 as Weight) + (2_397_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (2_410_000 as Weight) + (2_423_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) - fn set_invulnerables(_v: u32, ) -> Weight { - (28_867_000 as Weight) + fn set_invulnerables(v: u32, ) -> Weight { + (2_876_000 as Weight) + // Standard Error: 0 + .saturating_add((53_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -242,14 +252,19 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Ledger (r:0 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) - fn force_unstake(_s: u32, ) -> Weight { - (178_224_000 as Weight) + fn force_unstake(s: u32, ) -> Weight { + (87_540_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_791_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) - .saturating_add(T::DbWeight::get().writes(62 as Weight)) + .saturating_add(T::DbWeight::get().writes(12 as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) - fn cancel_deferred_slash(_s: u32, ) -> Weight { - (12_183_514_000 as Weight) + fn cancel_deferred_slash(s: u32, ) -> Weight { + (2_769_801_000 as Weight) + // Standard Error: 181_000 + .saturating_add((16_225_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -263,10 +278,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasValidatorPrefs (r:1 w:0) // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) - fn payout_stakers_dead_controller(_n: u32, ) -> Weight { - (5_642_805_000 as Weight) - .saturating_add(T::DbWeight::get().reads(403 as Weight)) - .saturating_add(T::DbWeight::get().writes(133 as Weight)) + fn payout_stakers_dead_controller(n: u32, ) -> Weight { + (103_452_000 as Weight) + // Standard Error: 19_000 + .saturating_add((42_909_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(10 as Weight)) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) } // Storage: Staking CurrentEra (r:1 w:0) // Storage: Staking HistoryDepth (r:1 w:0) @@ -279,10 +298,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) - fn payout_stakers_alive_staked(_n: u32, ) -> Weight { - (7_394_770_000 as Weight) - .saturating_add(T::DbWeight::get().reads(666 as Weight)) - .saturating_add(T::DbWeight::get().writes(396 as Weight)) + fn payout_stakers_alive_staked(n: u32, ) -> Weight { + (145_995_000 as Weight) + // Standard Error: 27_000 + .saturating_add((55_974_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(11 as Weight)) + .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) } // Storage: Staking Ledger (r:1 w:1) // Storage: Balances Locks (r:1 w:1) @@ -290,8 +313,10 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:3 w:3) // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) - fn rebond(_l: u32, ) -> Weight { - (101_802_000 as Weight) + fn rebond(l: u32, ) -> Weight { + (101_568_000 as Weight) + // Standard Error: 2_000 + .saturating_add((66_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -304,10 +329,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasStakers (r:0 w:2) // Storage: Staking ErasTotalStake (r:0 w:1) // Storage: Staking ErasStartSessionIndex (r:0 w:1) - fn set_history_depth(_e: u32, ) -> Weight { - (1_312_998_000 as Weight) + fn set_history_depth(e: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 69_000 + .saturating_add((29_939_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(361 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) } // Storage: System Account (r:1 w:1) // Storage: Staking Bonded (r:1 w:1) @@ -322,10 +350,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) - fn reap_stash(_s: u32, ) -> Weight { - (189_116_000 as Weight) + fn reap_stash(s: u32, ) -> Weight { + (96_886_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_790_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) - .saturating_add(T::DbWeight::get().writes(63 as Weight)) + .saturating_add(T::DbWeight::get().writes(12 as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking CounterForNominators (r:1 w:0) // Storage: Staking CounterForValidators (r:1 w:0) @@ -347,10 +378,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 834_000 - .saturating_add((284_139_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 41_000 - .saturating_add((44_463_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 873_000 + .saturating_add((286_141_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 43_000 + .saturating_add((44_712_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(208 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -368,21 +399,22 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Nominators (r:1000 w:0) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 92_000 - .saturating_add((25_070_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 92_000 - .saturating_add((27_803_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_136_000 - .saturating_add((13_639_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 87_000 + .saturating_add((24_049_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 87_000 + .saturating_add((27_514_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(204 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking Validators (r:501 w:0) - fn get_npos_targets(_v: u32, ) -> Weight { - (7_508_877_000 as Weight) - .saturating_add(T::DbWeight::get().reads(751 as Weight)) + fn get_npos_targets(v: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 32_000 + .saturating_add((10_128_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) } // Storage: Staking MinCommission (r:0 w:1) // Storage: Staking MinValidatorBond (r:0 w:1) @@ -391,7 +423,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (6_099_000 as Weight) + (6_187_000 as Weight) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) @@ -405,7 +437,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (79_637_000 as Weight) + (78_282_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -420,7 +452,7 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (62_769_000 as Weight) + (63_660_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -430,7 +462,7 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (102_774_000 as Weight) + (103_672_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } @@ -444,7 +476,7 @@ impl WeightInfo for () { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (110_516_000 as Weight) + (110_884_000 as Weight) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -452,8 +484,10 @@ impl WeightInfo for () { // Storage: Staking CurrentEra (r:1 w:0) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn withdraw_unbonded_update(_s: u32, ) -> Weight { - (49_479_000 as Weight) + fn withdraw_unbonded_update(s: u32, ) -> Weight { + (46_379_000 as Weight) + // Standard Error: 0 + .saturating_add((55_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -471,7 +505,7 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (91_014_000 as Weight) + (91_303_000 as Weight) .saturating_add(RocksDbWeight::get().reads(13 as Weight)) .saturating_add(RocksDbWeight::get().writes(11 as Weight)) } @@ -487,16 +521,19 @@ impl WeightInfo for () { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (66_307_000 as Weight) + (66_587_000 as Weight) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) - fn kick(_k: u32, ) -> Weight { - (906_377_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(66 as Weight)) - .saturating_add(RocksDbWeight::get().writes(65 as Weight)) + fn kick(k: u32, ) -> Weight { + (21_153_000 as Weight) + // Standard Error: 16_000 + .saturating_add((13_502_000 as Weight).saturating_mul(k as Weight)) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -509,9 +546,12 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:2 w:2) // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) - fn nominate(_n: u32, ) -> Weight { - (119_946_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(21 as Weight)) + fn nominate(n: u32, ) -> Weight { + (75_456_000 as Weight) + // Standard Error: 12_000 + .saturating_add((5_051_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(RocksDbWeight::get().reads(12 as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) @@ -522,47 +562,49 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (64_644_000 as Weight) + (65_332_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (11_712_000 as Weight) + (11_757_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (24_592_000 as Weight) + (24_252_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (2_194_000 as Weight) + (2_252_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (2_430_000 as Weight) + (2_431_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (2_471_000 as Weight) + (2_397_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (2_410_000 as Weight) + (2_423_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) - fn set_invulnerables(_v: u32, ) -> Weight { - (28_867_000 as Weight) + fn set_invulnerables(v: u32, ) -> Weight { + (2_876_000 as Weight) + // Standard Error: 0 + .saturating_add((53_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -578,14 +620,19 @@ impl WeightInfo for () { // Storage: Staking Ledger (r:0 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) - fn force_unstake(_s: u32, ) -> Weight { - (178_224_000 as Weight) + fn force_unstake(s: u32, ) -> Weight { + (87_540_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_791_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) - .saturating_add(RocksDbWeight::get().writes(62 as Weight)) + .saturating_add(RocksDbWeight::get().writes(12 as Weight)) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) - fn cancel_deferred_slash(_s: u32, ) -> Weight { - (12_183_514_000 as Weight) + fn cancel_deferred_slash(s: u32, ) -> Weight { + (2_769_801_000 as Weight) + // Standard Error: 181_000 + .saturating_add((16_225_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -599,10 +646,14 @@ impl WeightInfo for () { // Storage: Staking ErasValidatorPrefs (r:1 w:0) // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) - fn payout_stakers_dead_controller(_n: u32, ) -> Weight { - (5_642_805_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(403 as Weight)) - .saturating_add(RocksDbWeight::get().writes(133 as Weight)) + fn payout_stakers_dead_controller(n: u32, ) -> Weight { + (103_452_000 as Weight) + // Standard Error: 19_000 + .saturating_add((42_909_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(RocksDbWeight::get().reads(10 as Weight)) + .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) } // Storage: Staking CurrentEra (r:1 w:0) // Storage: Staking HistoryDepth (r:1 w:0) @@ -615,10 +666,14 @@ impl WeightInfo for () { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) - fn payout_stakers_alive_staked(_n: u32, ) -> Weight { - (7_394_770_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(666 as Weight)) - .saturating_add(RocksDbWeight::get().writes(396 as Weight)) + fn payout_stakers_alive_staked(n: u32, ) -> Weight { + (145_995_000 as Weight) + // Standard Error: 27_000 + .saturating_add((55_974_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(RocksDbWeight::get().reads(11 as Weight)) + .saturating_add(RocksDbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) } // Storage: Staking Ledger (r:1 w:1) // Storage: Balances Locks (r:1 w:1) @@ -626,8 +681,10 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:3 w:3) // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) - fn rebond(_l: u32, ) -> Weight { - (101_802_000 as Weight) + fn rebond(l: u32, ) -> Weight { + (101_568_000 as Weight) + // Standard Error: 2_000 + .saturating_add((66_000 as Weight).saturating_mul(l as Weight)) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -640,10 +697,13 @@ impl WeightInfo for () { // Storage: Staking ErasStakers (r:0 w:2) // Storage: Staking ErasTotalStake (r:0 w:1) // Storage: Staking ErasStartSessionIndex (r:0 w:1) - fn set_history_depth(_e: u32, ) -> Weight { - (1_312_998_000 as Weight) + fn set_history_depth(e: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 69_000 + .saturating_add((29_939_000 as Weight).saturating_mul(e as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(361 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) } // Storage: System Account (r:1 w:1) // Storage: Staking Bonded (r:1 w:1) @@ -658,10 +718,13 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) - fn reap_stash(_s: u32, ) -> Weight { - (189_116_000 as Weight) + fn reap_stash(s: u32, ) -> Weight { + (96_886_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_790_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) - .saturating_add(RocksDbWeight::get().writes(63 as Weight)) + .saturating_add(RocksDbWeight::get().writes(12 as Weight)) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking CounterForNominators (r:1 w:0) // Storage: Staking CounterForValidators (r:1 w:0) @@ -683,10 +746,10 @@ impl WeightInfo for () { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 834_000 - .saturating_add((284_139_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 41_000 - .saturating_add((44_463_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 873_000 + .saturating_add((286_141_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 43_000 + .saturating_add((44_712_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(208 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -704,21 +767,22 @@ impl WeightInfo for () { // Storage: Staking Nominators (r:1000 w:0) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 92_000 - .saturating_add((25_070_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 92_000 - .saturating_add((27_803_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_136_000 - .saturating_add((13_639_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 87_000 + .saturating_add((24_049_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 87_000 + .saturating_add((27_514_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(204 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking Validators (r:501 w:0) - fn get_npos_targets(_v: u32, ) -> Weight { - (7_508_877_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(751 as Weight)) + fn get_npos_targets(v: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 32_000 + .saturating_add((10_128_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) } // Storage: Staking MinCommission (r:0 w:1) // Storage: Staking MinValidatorBond (r:0 w:1) @@ -727,7 +791,7 @@ impl WeightInfo for () { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (6_099_000 as Weight) + (6_187_000 as Weight) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) @@ -741,7 +805,7 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (79_637_000 as Weight) + (78_282_000 as Weight) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) }