From 80edb1b3d729c28a7654f20e7cbd30328bfe506c Mon Sep 17 00:00:00 2001 From: Zeke Mostov <32168567+emostov@users.noreply.github.com> Date: Mon, 20 Sep 2021 16:46:37 -0700 Subject: [PATCH] weights: pallet-staking & pallet-bags-list (#3872) * Get ready to weight staking & bags-list * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/ * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/ * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/ * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/ * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/ * fmt Co-authored-by: Parity Bot --- .../kusama/src/weights/pallet_bags_list.rs | 59 ++- .../kusama/src/weights/pallet_staking.rs | 413 +++++++++++++----- .../polkadot/src/weights/pallet_staking.rs | 366 +++++++++++----- .../westend/src/weights/pallet_bags_list.rs | 59 ++- .../westend/src/weights/pallet_staking.rs | 409 ++++++++++++----- 5 files changed, 925 insertions(+), 381 deletions(-) diff --git a/polkadot/runtime/kusama/src/weights/pallet_bags_list.rs b/polkadot/runtime/kusama/src/weights/pallet_bags_list.rs index 6792d0d5d6..38285f4c21 100644 --- a/polkadot/runtime/kusama/src/weights/pallet_bags_list.rs +++ b/polkadot/runtime/kusama/src/weights/pallet_bags_list.rs @@ -1,30 +1,28 @@ -// This file is part of Substrate. +// Copyright 2017-2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. -// Copyright (C) 2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// Polkadot 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. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Polkadot 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. -//! Autogenerated weights for pallet_bags_list +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . +//! Autogenerated weights for `pallet_bags_list` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-09-02, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 // Executed Command: -// target/release/substrate +// target/release/polkadot // benchmark -// --chain=dev +// --chain=kusama-dev // --steps=50 // --repeat=20 // --pallet=pallet_bags_list @@ -32,34 +30,35 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./frame/bags-list/src/weights.rs -// --template=./.maintain/frame-weight-template.hbs +// --header=./file_header.txt +// --output=./runtime/kusama/src/weights/ -// NOTE: this is copy pasta from substrate % some tweaks #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -/// Weight functions needed for pallet_bags_list. - -/// Weights for pallet_bags_list using the Substrate node and recommended hardware. +/// Weight functions for `pallet_bags_list`. pub struct WeightInfo(PhantomData); impl pallet_bags_list::WeightInfo for WeightInfo { + // Storage: Staking Bonded (r:1 w:0) + // Storage: Staking Ledger (r:1 w:0) + // Storage: BagsList ListNodes (r:4 w:4) + // Storage: BagsList ListBags (r:1 w:1) fn rebag_non_terminal() -> Weight { - (75_718_000 as Weight) + (65_491_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Staking Bonded (r:1 w:0) // Storage: Staking Ledger (r:1 w:0) - // Storage: BagsList ListNodes (r:4 w:4) - // Storage: BagsList ListBags (r:1 w:1) + // Storage: BagsList ListNodes (r:3 w:3) + // Storage: BagsList ListBags (r:2 w:2) fn rebag_terminal() -> Weight { - (75_718_000 as Weight) + (64_253_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } diff --git a/polkadot/runtime/kusama/src/weights/pallet_staking.rs b/polkadot/runtime/kusama/src/weights/pallet_staking.rs index ff7f8b9fb8..5f385be716 100644 --- a/polkadot/runtime/kusama/src/weights/pallet_staking.rs +++ b/polkadot/runtime/kusama/src/weights/pallet_staking.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2020 Parity Technologies (UK) Ltd. +// Copyright 2017-2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -15,8 +15,8 @@ // along with Polkadot. If not, see . //! Autogenerated weights for `pallet_staking` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-07-07, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 // Executed Command: @@ -31,8 +31,10 @@ // --wasm-execution=compiled // --heap-pages=4096 // --header=./file_header.txt -// --output=runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] @@ -42,181 +44,368 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_staking`. pub struct WeightInfo(PhantomData); impl pallet_staking::WeightInfo for WeightInfo { + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (68_673_000 as Weight) + (66_934_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } + // Storage: Staking Bonded (r:1 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: BagsList ListNodes (r:3 w:3) + // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (57_515_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn unbond() -> Weight { - (56_018_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn withdraw_unbonded_update(s: u32) -> Weight { - (49_532_000 as Weight) - // Standard Error: 0 - .saturating_add((29_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)) - } - fn withdraw_unbonded_kill(s: u32) -> Weight { - (81_722_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_331_000 as Weight).saturating_mul(s as Weight)) + (106_496_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) } + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Nominators (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: BagsList ListNodes (r:3 w:3) + // Storage: Staking Bonded (r:1 w:0) + // Storage: BagsList ListBags (r:2 w:2) + fn unbond() -> Weight { + (115_916_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:1) + // 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 { + (47_633_000 as Weight) + // Standard Error: 0 + .saturating_add((25_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)) + } + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) + fn withdraw_unbonded_kill(_s: u32, ) -> Weight { + (94_253_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 Validators (r:1 w:1) + // Storage: Staking MaxValidatorsCount (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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 CounterForValidators (r:1 w:1) fn validate() -> Weight { - (64_915_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + (63_555_000 as Weight) + .saturating_add(T::DbWeight::get().reads(11 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) } - fn kick(k: u32) -> Weight { - (10_120_000 as Weight) - // Standard Error: 6_000 - .saturating_add((18_142_000 as Weight).saturating_mul(k as Weight)) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + fn kick(k: u32, ) -> Weight { + (9_518_000 as Weight) + // Standard Error: 11_000 + .saturating_add((16_662_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 nominate(n: u32) -> Weight { - (37_716_000 as Weight) - // Standard Error: 6_000 - .saturating_add((5_240_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) + // 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 { + (74_049_000 as Weight) + // Standard Error: 16_000 + .saturating_add((5_118_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(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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) fn chill() -> Weight { - (16_594_000 as Weight).saturating_add(T::DbWeight::get().reads(3 as Weight)) + (62_972_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 { (10_848_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 { - (23_658_000 as Weight) + (23_892_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_123_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_no_eras() -> Weight { - (2_458_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era() -> Weight { - (2_428_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era_always() -> Weight { - (2_435_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_invulnerables(v: u32) -> Weight { - (2_524_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(v as Weight)) + (2_279_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - fn force_unstake(s: u32) -> Weight { - (57_861_000 as Weight) + // Storage: Staking ForceEra (r:0 w:1) + fn force_no_eras() -> Weight { + (2_614_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_592_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_572_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 { + (2_700_000 as Weight) + // Standard Error: 0 + .saturating_add((57_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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: System Account (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:2) + fn force_unstake(s: u32, ) -> Weight { + (90_113_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_315_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + .saturating_add((2_230_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 cancel_deferred_slash(s: u32) -> Weight { - (3_460_645_000 as Weight) - // Standard Error: 221_000 - .saturating_add((19_673_000 as Weight).saturating_mul(s as Weight)) + // Storage: Staking UnappliedSlashes (r:1 w:1) + fn cancel_deferred_slash(s: u32, ) -> Weight { + (2_809_466_000 as Weight) + // Standard Error: 181_000 + .saturating_add((16_204_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)) } - fn payout_stakers_dead_controller(n: u32) -> Weight { - (108_055_000 as Weight) - // Standard Error: 15_000 - .saturating_add((49_008_000 as Weight).saturating_mul(n as Weight)) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasValidatorReward (r:1 w:0) + // Storage: Staking Bonded (r:2 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking ErasStakersClipped (r:1 w:0) + // Storage: Staking ErasRewardPoints (r:1 w:0) + // 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 { + (113_536_000 as Weight) + // Standard Error: 16_000 + .saturating_add((45_494_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_alive_staked(n: u32) -> Weight { - (122_624_000 as Weight) - // Standard Error: 22_000 - .saturating_add((60_815_000 as Weight).saturating_mul(n as Weight)) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasValidatorReward (r:1 w:0) + // Storage: Staking Bonded (r:2 w:0) + // Storage: Staking Ledger (r:2 w:2) + // Storage: Staking ErasStakersClipped (r:1 w:0) + // Storage: Staking ErasRewardPoints (r:1 w:0) + // Storage: Staking ErasValidatorPrefs (r:1 w:0) + // 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 { + (134_960_000 as Weight) + // Standard Error: 25_000 + .saturating_add((58_130_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 rebond(l: u32) -> Weight { - (46_725_000 as Weight) - // Standard Error: 1_000 - .saturating_add((61_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // 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 { + (103_717_000 as Weight) + // Standard Error: 4_000 + .saturating_add((65_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)) } - fn set_history_depth(e: u32) -> Weight { + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:1) + // Storage: Staking ErasStakersClipped (r:0 w:2) + // Storage: Staking ErasValidatorPrefs (r:0 w:2) + // Storage: Staking ErasValidatorReward (r:0 w:1) + // Storage: Staking ErasRewardPoints (r:0 w:1) + // 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: 70_000 - .saturating_add((33_332_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 69_000 + .saturating_add((31_059_000 as Weight).saturating_mul(e 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))) } - fn reap_stash(s: u32) -> Weight { - (68_887_000 as Weight) - // Standard Error: 0 - .saturating_add((2_318_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + // Storage: System Account (r:1 w:1) + // Storage: Staking Bonded (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) + // Storage: Staking CounterForNominators (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: 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 { + (93_312_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_226_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 new_era(v: u32, n: u32) -> Weight { + // Storage: Staking CounterForNominators (r:1 w:0) + // Storage: Staking CounterForValidators (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking Bonded (r:101 w:0) + // Storage: Staking Ledger (r:101 w:0) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Nominators (r:101 w:0) + // Storage: System BlockWeight (r:1 w:1) + // Storage: Staking ValidatorCount (r:1 w:0) + // Storage: Staking MinimumValidatorCount (r:1 w:0) + // Storage: Staking CurrentEra (r:1 w:1) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasStakersClipped (r:0 w:1) + // Storage: Staking ErasValidatorPrefs (r:0 w:1) + // Storage: Staking ErasStakers (r:0 w:1) + // Storage: Staking ErasTotalStake (r:0 w:1) + // Storage: Staking ErasStartSessionIndex (r:0 w:1) + fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 765_000 - .saturating_add((309_896_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 38_000 - .saturating_add((53_011_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(192 as Weight)) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) + // Standard Error: 724_000 + .saturating_add((300_240_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 36_000 + .saturating_add((49_412_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(v as Weight))) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) } - fn get_npos_voters(v: u32, n: u32, s: u32) -> Weight { + // Storage: Staking CounterForNominators (r:1 w:0) + // Storage: Staking CounterForValidators (r:1 w:0) + // Storage: Staking Validators (r:501 w:0) + // Storage: Staking Bonded (r:1500 w:0) + // Storage: Staking Ledger (r:1500 w:0) + // Storage: Staking SlashingSpans (r:21 w:0) + // Storage: Staking Nominators (r:1001 w:0) + // Storage: System BlockWeight (r:1 w:1) + fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 92_000 - .saturating_add((24_187_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 92_000 - .saturating_add((27_771_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_152_000 - .saturating_add((40_493_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + // Standard Error: 83_000 + .saturating_add((23_656_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 83_000 + .saturating_add((31_191_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 2_847_000 + .saturating_add((37_983_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(6 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((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - fn get_npos_targets(v: u32) -> Weight { + // Storage: Staking Validators (r:501 w:0) + // Storage: System BlockWeight (r:1 w:1) + fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 50_000 - .saturating_add((10_984_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + // Standard Error: 27_000 + .saturating_add((9_398_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // 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_limits() -> Weight { - (5_708_000 as Weight).saturating_add(T::DbWeight::get().writes(5 as Weight)) + (5_996_000 as Weight) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking ChillThreshold (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: BagsList ListNodes (r:2 w:2) + // Storage: BagsList ListBags (r:1 w:1) + // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (84_065_000 as Weight) + (76_568_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } diff --git a/polkadot/runtime/polkadot/src/weights/pallet_staking.rs b/polkadot/runtime/polkadot/src/weights/pallet_staking.rs index 66b10f9758..2e30aabcbf 100644 --- a/polkadot/runtime/polkadot/src/weights/pallet_staking.rs +++ b/polkadot/runtime/polkadot/src/weights/pallet_staking.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2020 Parity Technologies (UK) Ltd. +// Copyright 2017-2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -15,8 +15,8 @@ // along with Polkadot. If not, see . //! Autogenerated weights for `pallet_staking` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-07-07, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 // Executed Command: @@ -31,8 +31,10 @@ // --wasm-execution=compiled // --heap-pages=4096 // --header=./file_header.txt -// --output=runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] @@ -42,180 +44,344 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_staking`. pub struct WeightInfo(PhantomData); impl pallet_staking::WeightInfo for WeightInfo { + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (70_233_000 as Weight) + (64_842_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } + // Storage: Staking Bonded (r:1 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Nominators (r:1 w:0) fn bond_extra() -> Weight { - (58_956_000 as Weight) + (63_943_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Nominators (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) fn unbond() -> Weight { - (56_669_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) + (67_903_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - fn withdraw_unbonded_update(s: u32) -> Weight { - (49_182_000 as Weight) + // Storage: Staking Ledger (r:1 w:1) + // 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 { + (46_134_000 as Weight) // Standard Error: 0 - .saturating_add((28_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((36_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)) } - fn withdraw_unbonded_kill(s: u32) -> Weight { - (81_006_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_258_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) + fn withdraw_unbonded_kill(_s: u32, ) -> Weight { + (67_717_000 as Weight) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking MinValidatorBond (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) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (65_617_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + (36_901_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) } - fn kick(k: u32) -> Weight { - (10_487_000 as Weight) - // Standard Error: 7_000 - .saturating_add((16_334_000 as Weight).saturating_mul(k as Weight)) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + fn kick(k: u32, ) -> Weight { + (9_945_000 as Weight) + // Standard Error: 10_000 + .saturating_add((15_330_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 nominate(n: u32) -> Weight { - (38_083_000 as Weight) - // Standard Error: 10_000 - .saturating_add((5_185_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) + fn nominate(n: u32, ) -> Weight { + (48_492_000 as Weight) + // Standard Error: 14_000 + .saturating_add((4_775_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (r:1 w:1) fn chill() -> Weight { - (16_783_000 as Weight).saturating_add(T::DbWeight::get().reads(3 as Weight)) + (36_148_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (11_087_000 as Weight) + (10_737_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_640_000 as Weight) + (23_913_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 { - (1_879_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_no_eras() -> Weight { - (2_139_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era() -> Weight { - (2_096_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era_always() -> Weight { - (2_089_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_invulnerables(v: u32) -> Weight { - (2_143_000 as Weight) - // Standard Error: 0 - .saturating_add((6_000 as Weight).saturating_mul(v as Weight)) + (2_027_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - fn force_unstake(s: u32) -> Weight { - (58_264_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_252_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: Staking ForceEra (r:0 w:1) + fn force_no_eras() -> Weight { + (2_343_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_369_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_400_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 { + (2_197_000 as Weight) + // Standard Error: 0 + .saturating_add((56_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: System Account (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:2) + fn force_unstake(s: u32, ) -> Weight { + (62_032_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_220_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } - fn cancel_deferred_slash(s: u32) -> Weight { - (3_444_385_000 as Weight) - // Standard Error: 224_000 - .saturating_add((19_743_000 as Weight).saturating_mul(s as Weight)) + // Storage: Staking UnappliedSlashes (r:1 w:1) + fn cancel_deferred_slash(s: u32, ) -> Weight { + (2_811_250_000 as Weight) + // Standard Error: 182_000 + .saturating_add((16_184_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)) } - fn payout_stakers_dead_controller(n: u32) -> Weight { - (106_496_000 as Weight) - // Standard Error: 13_000 - .saturating_add((46_186_000 as Weight).saturating_mul(n as Weight)) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasValidatorReward (r:1 w:0) + // Storage: Staking Bonded (r:2 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking ErasStakersClipped (r:1 w:0) + // Storage: Staking ErasRewardPoints (r:1 w:0) + // 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 { + (118_075_000 as Weight) + // Standard Error: 20_000 + .saturating_add((44_116_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_alive_staked(n: u32) -> Weight { - (131_706_000 as Weight) - // Standard Error: 20_000 - .saturating_add((60_519_000 as Weight).saturating_mul(n as Weight)) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasValidatorReward (r:1 w:0) + // Storage: Staking Bonded (r:2 w:0) + // Storage: Staking Ledger (r:2 w:2) + // Storage: Staking ErasStakersClipped (r:1 w:0) + // Storage: Staking ErasRewardPoints (r:1 w:0) + // Storage: Staking ErasValidatorPrefs (r:1 w:0) + // 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 { + (126_296_000 as Weight) + // Standard Error: 27_000 + .saturating_add((57_142_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 rebond(l: u32) -> Weight { - (46_089_000 as Weight) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: Staking Nominators (r:1 w:0) + // Storage: Staking Bonded (r:1 w:0) + fn rebond(l: u32, ) -> Weight { + (60_559_000 as Weight) // Standard Error: 1_000 - .saturating_add((64_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add((63_000 as Weight).saturating_mul(l as Weight)) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - fn set_history_depth(e: u32) -> Weight { + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:1) + // Storage: Staking ErasStakersClipped (r:0 w:2) + // Storage: Staking ErasValidatorPrefs (r:0 w:2) + // Storage: Staking ErasValidatorReward (r:0 w:1) + // Storage: Staking ErasRewardPoints (r:0 w:1) + // 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: 75_000 - .saturating_add((32_680_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 68_000 + .saturating_add((30_894_000 as Weight).saturating_mul(e 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))) } - fn reap_stash(s: u32) -> Weight { - (69_019_000 as Weight) - // Standard Error: 0 - .saturating_add((2_317_000 as Weight).saturating_mul(s as Weight)) + // Storage: System Account (r:1 w:1) + // Storage: Staking Bonded (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) + // Storage: Staking CounterForNominators (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 { + (65_173_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_213_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } - fn new_era(v: u32, n: u32) -> Weight { + // Storage: Staking CounterForNominators (r:1 w:0) + // Storage: Staking CounterForValidators (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking Bonded (r:101 w:0) + // Storage: Staking Ledger (r:101 w:0) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Nominators (r:101 w:0) + // Storage: System BlockWeight (r:1 w:1) + // Storage: Staking ValidatorCount (r:1 w:0) + // Storage: Staking MinimumValidatorCount (r:1 w:0) + // Storage: Staking CurrentEra (r:1 w:1) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasStakersClipped (r:0 w:1) + // Storage: Staking ErasValidatorPrefs (r:0 w:1) + // Storage: Staking ErasStakers (r:0 w:1) + // Storage: Staking ErasTotalStake (r:0 w:1) + // Storage: Staking ErasStartSessionIndex (r:0 w:1) + fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_020_000 - .saturating_add((329_151_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 51_000 - .saturating_add((53_726_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(187 as Weight)) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) + // Standard Error: 811_000 + .saturating_add((298_100_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 40_000 + .saturating_add((49_163_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(v as Weight))) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) } - fn get_npos_voters(v: u32, n: u32, s: u32) -> Weight { + // Storage: Staking CounterForNominators (r:1 w:0) + // Storage: Staking CounterForValidators (r:1 w:0) + // Storage: Staking Validators (r:501 w:0) + // Storage: Staking Bonded (r:1500 w:0) + // Storage: Staking Ledger (r:1500 w:0) + // Storage: Staking SlashingSpans (r:21 w:0) + // Storage: Staking Nominators (r:1001 w:0) + // Storage: System BlockWeight (r:1 w:1) + fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 108_000 - .saturating_add((24_576_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 108_000 - .saturating_add((33_364_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(179 as Weight)) + // Standard Error: 101_000 + .saturating_add((23_378_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 101_000 + .saturating_add((29_757_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 3_446_000 + .saturating_add((45_519_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(6 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((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - fn get_npos_targets(v: u32) -> Weight { + // Storage: Staking Validators (r:501 w:0) + // Storage: System BlockWeight (r:1 w:1) + fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 26_000 - .saturating_add((10_139_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + // Standard Error: 30_000 + .saturating_add((9_490_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // 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_limits() -> Weight { - (5_584_000 as Weight).saturating_add(T::DbWeight::get().writes(5 as Weight)) + (5_680_000 as Weight) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking ChillThreshold (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) fn chill_other() -> Weight { - (80_902_000 as Weight) - .saturating_add(T::DbWeight::get().reads(11 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + (48_185_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } } diff --git a/polkadot/runtime/westend/src/weights/pallet_bags_list.rs b/polkadot/runtime/westend/src/weights/pallet_bags_list.rs index 6792d0d5d6..5ba9cbe83b 100644 --- a/polkadot/runtime/westend/src/weights/pallet_bags_list.rs +++ b/polkadot/runtime/westend/src/weights/pallet_bags_list.rs @@ -1,30 +1,28 @@ -// This file is part of Substrate. +// Copyright 2017-2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. -// Copyright (C) 2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// Polkadot 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. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Polkadot 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. -//! Autogenerated weights for pallet_bags_list +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . +//! Autogenerated weights for `pallet_bags_list` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-09-02, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 // Executed Command: -// target/release/substrate +// target/release/polkadot // benchmark -// --chain=dev +// --chain=westend-dev // --steps=50 // --repeat=20 // --pallet=pallet_bags_list @@ -32,34 +30,35 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./frame/bags-list/src/weights.rs -// --template=./.maintain/frame-weight-template.hbs +// --header=./file_header.txt +// --output=./runtime/westend/src/weights/ -// NOTE: this is copy pasta from substrate % some tweaks #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -/// Weight functions needed for pallet_bags_list. - -/// Weights for pallet_bags_list using the Substrate node and recommended hardware. +/// Weight functions for `pallet_bags_list`. pub struct WeightInfo(PhantomData); impl pallet_bags_list::WeightInfo for WeightInfo { + // Storage: Staking Bonded (r:1 w:0) + // Storage: Staking Ledger (r:1 w:0) + // Storage: BagsList ListNodes (r:4 w:4) + // Storage: BagsList ListBags (r:1 w:1) fn rebag_non_terminal() -> Weight { - (75_718_000 as Weight) + (65_506_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Staking Bonded (r:1 w:0) // Storage: Staking Ledger (r:1 w:0) - // Storage: BagsList ListNodes (r:4 w:4) - // Storage: BagsList ListBags (r:1 w:1) + // Storage: BagsList ListNodes (r:3 w:3) + // Storage: BagsList ListBags (r:2 w:2) fn rebag_terminal() -> Weight { - (75_718_000 as Weight) + (65_008_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } diff --git a/polkadot/runtime/westend/src/weights/pallet_staking.rs b/polkadot/runtime/westend/src/weights/pallet_staking.rs index c80ec0799a..7392df46e2 100644 --- a/polkadot/runtime/westend/src/weights/pallet_staking.rs +++ b/polkadot/runtime/westend/src/weights/pallet_staking.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2020 Parity Technologies (UK) Ltd. +// Copyright 2017-2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -15,8 +15,8 @@ // along with Polkadot. If not, see . //! Autogenerated weights for `pallet_staking` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-07-07, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 // Executed Command: @@ -31,8 +31,10 @@ // --wasm-execution=compiled // --heap-pages=4096 // --header=./file_header.txt -// --output=runtime/westend/src/weights/ +// --output=./runtime/westend/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] @@ -42,179 +44,368 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_staking`. pub struct WeightInfo(PhantomData); impl pallet_staking::WeightInfo for WeightInfo { + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (70_644_000 as Weight) + (67_211_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } + // Storage: Staking Bonded (r:1 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: BagsList ListNodes (r:3 w:3) + // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (57_596_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn unbond() -> Weight { - (57_410_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn withdraw_unbonded_update(s: u32) -> Weight { - (50_384_000 as Weight) - // Standard Error: 0 - .saturating_add((33_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)) - } - fn withdraw_unbonded_kill(s: u32) -> Weight { - (82_905_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_287_000 as Weight).saturating_mul(s as Weight)) + (107_863_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) } + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Nominators (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: BagsList ListNodes (r:3 w:3) + // Storage: Staking Bonded (r:1 w:0) + // Storage: BagsList ListBags (r:2 w:2) + fn unbond() -> Weight { + (113_462_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:1) + // 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 { + (48_161_000 as Weight) + // Standard Error: 0 + .saturating_add((20_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)) + } + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) + fn withdraw_unbonded_kill(_s: u32, ) -> Weight { + (95_012_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 Validators (r:1 w:1) + // Storage: Staking MaxValidatorsCount (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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 CounterForValidators (r:1 w:1) fn validate() -> Weight { - (69_191_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + (65_171_000 as Weight) + .saturating_add(T::DbWeight::get().reads(11 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) } - fn kick(k: u32) -> Weight { - (11_371_000 as Weight) - // Standard Error: 7_000 - .saturating_add((16_959_000 as Weight).saturating_mul(k as Weight)) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + fn kick(k: u32, ) -> Weight { + (9_070_000 as Weight) + // Standard Error: 12_000 + .saturating_add((15_429_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 nominate(n: u32) -> Weight { - (40_353_000 as Weight) - // Standard Error: 12_000 - .saturating_add((5_341_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) + // 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 { + (75_755_000 as Weight) + // Standard Error: 10_000 + .saturating_add((5_153_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(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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) fn chill() -> Weight { - (17_740_000 as Weight).saturating_add(T::DbWeight::get().reads(3 as Weight)) + (64_425_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_867_000 as Weight) + (11_264_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 { - (26_102_000 as Weight) + (24_783_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_082_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_no_eras() -> Weight { - (2_311_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era() -> Weight { - (2_282_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era_always() -> Weight { - (2_230_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_invulnerables(v: u32) -> Weight { - (2_352_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(v as Weight)) + (2_355_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - fn force_unstake(s: u32) -> Weight { - (58_375_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_220_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: Staking ForceEra (r:0 w:1) + fn force_no_eras() -> Weight { + (2_566_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_501_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_542_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 { + (2_747_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) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (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: System Account (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:2) + fn force_unstake(s: u32, ) -> Weight { + (89_294_000 as Weight) + // Standard Error: 3_000 + .saturating_add((2_136_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 cancel_deferred_slash(s: u32) -> Weight { - (3_430_757_000 as Weight) - // Standard Error: 222_000 - .saturating_add((19_760_000 as Weight).saturating_mul(s as Weight)) + // Storage: Staking UnappliedSlashes (r:1 w:1) + fn cancel_deferred_slash(s: u32, ) -> Weight { + (2_804_887_000 as Weight) + // Standard Error: 181_000 + .saturating_add((16_202_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)) } - fn payout_stakers_dead_controller(n: u32) -> Weight { - (103_686_000 as Weight) - // Standard Error: 17_000 - .saturating_add((47_044_000 as Weight).saturating_mul(n as Weight)) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasValidatorReward (r:1 w:0) + // Storage: Staking Bonded (r:2 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking ErasStakersClipped (r:1 w:0) + // Storage: Staking ErasRewardPoints (r:1 w:0) + // 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 { + (108_674_000 as Weight) + // Standard Error: 27_000 + .saturating_add((43_449_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_alive_staked(n: u32) -> Weight { - (128_168_000 as Weight) - // Standard Error: 21_000 - .saturating_add((59_293_000 as Weight).saturating_mul(n as Weight)) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasValidatorReward (r:1 w:0) + // Storage: Staking Bonded (r:2 w:0) + // Storage: Staking Ledger (r:2 w:2) + // Storage: Staking ErasStakersClipped (r:1 w:0) + // Storage: Staking ErasRewardPoints (r:1 w:0) + // Storage: Staking ErasValidatorPrefs (r:1 w:0) + // 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 { + (133_185_000 as Weight) + // Standard Error: 30_000 + .saturating_add((55_519_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 rebond(l: u32) -> Weight { - (46_916_000 as Weight) - // Standard Error: 1_000 - .saturating_add((64_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // 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 { + (103_089_000 as Weight) + // Standard Error: 4_000 + .saturating_add((73_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)) } - fn set_history_depth(e: u32) -> Weight { + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:1) + // Storage: Staking ErasStakersClipped (r:0 w:2) + // Storage: Staking ErasValidatorPrefs (r:0 w:2) + // Storage: Staking ErasValidatorReward (r:0 w:1) + // Storage: Staking ErasRewardPoints (r:0 w:1) + // 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: 76_000 - .saturating_add((33_612_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 64_000 + .saturating_add((31_498_000 as Weight).saturating_mul(e 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))) } - fn reap_stash(s: u32) -> Weight { - (69_690_000 as Weight) + // Storage: System Account (r:1 w:1) + // Storage: Staking Bonded (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) + // Storage: Staking CounterForNominators (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: 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 { + (92_220_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_214_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_132_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 new_era(v: u32, n: u32) -> Weight { + // Storage: Staking CounterForNominators (r:1 w:0) + // Storage: Staking CounterForValidators (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking Bonded (r:101 w:0) + // Storage: Staking Ledger (r:101 w:0) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Nominators (r:101 w:0) + // Storage: System BlockWeight (r:1 w:1) + // Storage: Staking ValidatorCount (r:1 w:0) + // Storage: Staking MinimumValidatorCount (r:1 w:0) + // Storage: Staking CurrentEra (r:1 w:1) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Staking ErasStakersClipped (r:0 w:1) + // Storage: Staking ErasValidatorPrefs (r:0 w:1) + // Storage: Staking ErasStakers (r:0 w:1) + // Storage: Staking ErasTotalStake (r:0 w:1) + // Storage: Staking ErasStartSessionIndex (r:0 w:1) + fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_065_000 - .saturating_add((309_528_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 53_000 - .saturating_add((52_832_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(187 as Weight)) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) + // Standard Error: 802_000 + .saturating_add((294_926_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 40_000 + .saturating_add((49_452_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(v as Weight))) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) } - fn get_npos_voters(v: u32, n: u32, s: u32) -> Weight { + // Storage: Staking CounterForNominators (r:1 w:0) + // Storage: Staking CounterForValidators (r:1 w:0) + // Storage: Staking Validators (r:501 w:0) + // Storage: Staking Bonded (r:1500 w:0) + // Storage: Staking Ledger (r:1500 w:0) + // Storage: Staking SlashingSpans (r:21 w:0) + // Storage: Staking Nominators (r:1001 w:0) + // Storage: System BlockWeight (r:1 w:1) + fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 110_000 - .saturating_add((25_393_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 110_000 - .saturating_add((34_992_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(179 as Weight)) + // Standard Error: 106_000 + .saturating_add((25_237_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 106_000 + .saturating_add((31_267_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 3_621_000 + .saturating_add((51_975_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(6 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((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - fn get_npos_targets(v: u32) -> Weight { + // Storage: Staking Validators (r:501 w:0) + // Storage: System BlockWeight (r:1 w:1) + fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 42_000 - .saturating_add((11_340_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + // Standard Error: 34_000 + .saturating_add((9_890_000 as Weight).saturating_mul(v as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // 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_limits() -> Weight { - (5_696_000 as Weight).saturating_add(T::DbWeight::get().writes(5 as Weight)) + (5_641_000 as Weight) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking ChillThreshold (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: BagsList ListNodes (r:2 w:2) + // Storage: BagsList ListBags (r:1 w:1) + // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (84_796_000 as Weight) + (76_657_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) }