Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
3 changes: 1 addition & 2 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl OnUnbalanced<NegativeImbalance> for DealWithFees {
}
}

const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_percent(10);
const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_perthousand(25);
parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
/// We allow for 2 seconds of compute with a 6 second average block time.
Expand Down Expand Up @@ -469,7 +469,6 @@ impl pallet_staking::Trait for Runtime {
type RewardCurve = RewardCurve;
type NextNewSession = Session;
type ElectionLookahead = ElectionLookahead;
type Call = Call;
type MaxIterations = MaxIterations;
type MinSolutionScoreBump = MinSolutionScoreBump;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
Expand Down
88 changes: 46 additions & 42 deletions bin/node/runtime/src/weights/pallet_staking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,8 +15,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Default weights of pallet-staking.
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
//! Weights for pallet_staking
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
//! DATE: 2020-10-16, STEPS: [50], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []

#![allow(unused_parens)]
#![allow(unused_imports)]
Expand All @@ -27,130 +28,133 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Trait> pallet_staking::WeightInfo for WeightInfo<T> {
fn bond() -> Weight {
(144278000 as Weight)
(100_663_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn bond_extra() -> Weight {
(110715000 as Weight)
(79_135_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn unbond() -> Weight {
(99840000 as Weight)
(71_690_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn withdraw_unbonded_update(s: u32, ) -> Weight {
(100728000 as Weight)
.saturating_add((63000 as Weight).saturating_mul(s as Weight))
(72_725_000 as Weight)
.saturating_add((66_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn withdraw_unbonded_kill(s: u32, ) -> Weight {
(168879000 as Weight)
.saturating_add((6666000 as Weight).saturating_mul(s as Weight))
(118_747_000 as Weight)
.saturating_add((3_967_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 validate() -> Weight {
(35539000 as Weight)
(25_420_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn nominate(n: u32, ) -> Weight {
(48596000 as Weight)
.saturating_add((308000 as Weight).saturating_mul(n as Weight))
(35_132_000 as Weight)
.saturating_add((218_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn chill() -> Weight {
(35144000 as Weight)
(24_983_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_payee() -> Weight {
(24255000 as Weight)
(17_454_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_controller() -> Weight {
(52294000 as Weight)
(37_176_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn set_validator_count() -> Weight {
(5185000 as Weight)
(3_526_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_no_eras() -> Weight {
(5907000 as Weight)
(3_910_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_new_era() -> Weight {
(5917000 as Weight)
(3_933_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_new_era_always() -> Weight {
(5952000 as Weight)
(3_926_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_invulnerables(v: u32, ) -> Weight {
(6324000 as Weight)
.saturating_add((9000 as Weight).saturating_mul(v as Weight))
(4_080_000 as Weight)
.saturating_add((9_000 as Weight).saturating_mul(v as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_unstake(s: u32, ) -> Weight {
(119691000 as Weight)
.saturating_add((6681000 as Weight).saturating_mul(s as Weight))
(81_032_000 as Weight)
.saturating_add((4_002_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(4 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 {
(5820201000 as Weight)
.saturating_add((34672000 as Weight).saturating_mul(s as Weight))
(5_861_542_000 as Weight)
.saturating_add((34_654_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 {
(0 as Weight)
.saturating_add((92486000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
(149_257_000 as Weight)
.saturating_add((60_209_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(11 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 {
(0 as Weight)
.saturating_add((117324000 as Weight).saturating_mul(n as Weight))
(191_436_000 as Weight)
.saturating_add((79_168_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(12 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 {
(71316000 as Weight)
.saturating_add((142000 as Weight).saturating_mul(l as Weight))
(50_148_000 as Weight)
.saturating_add((106_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn set_history_depth(e: u32, ) -> Weight {
(0 as Weight)
.saturating_add((51901000 as Weight).saturating_mul(e as Weight))
.saturating_add((39_233_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 {
(147166000 as Weight)
.saturating_add((6661000 as Weight).saturating_mul(s as Weight))
(101_765_000 as Weight)
.saturating_add((3_959_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(4 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 {
(0 as Weight)
.saturating_add((1440459000 as Weight).saturating_mul(v as Weight))
.saturating_add((182580000 as Weight).saturating_mul(n as Weight))
.saturating_add((952_199_000 as Weight).saturating_mul(v as Weight))
.saturating_add((117_926_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(10 as Weight))
.saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
Expand All @@ -159,10 +163,10 @@ impl<T: frame_system::Trait> pallet_staking::WeightInfo for WeightInfo<T> {
}
fn submit_solution_better(v: u32, n: u32, a: u32, w: u32, ) -> Weight {
(0 as Weight)
.saturating_add((964000 as Weight).saturating_mul(v as Weight))
.saturating_add((432000 as Weight).saturating_mul(n as Weight))
.saturating_add((204294000 as Weight).saturating_mul(a as Weight))
.saturating_add((9546000 as Weight).saturating_mul(w as Weight))
.saturating_add((733_000 as Weight).saturating_mul(v as Weight))
.saturating_add((405_000 as Weight).saturating_mul(n as Weight))
.saturating_add((100_431_000 as Weight).saturating_mul(a as Weight))
.saturating_add((7_279_000 as Weight).saturating_mul(w as Weight))
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
Expand Down
1 change: 0 additions & 1 deletion frame/babe/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ impl pallet_staking::Trait for Test {
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type NextNewSession = Session;
type ElectionLookahead = ElectionLookahead;
type Call = Call;
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = ();
type MinSolutionScoreBump = ();
Expand Down
1 change: 0 additions & 1 deletion frame/grandpa/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ impl pallet_staking::Trait for Test {
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type NextNewSession = Session;
type ElectionLookahead = ElectionLookahead;
type Call = Call;
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = ();
type MinSolutionScoreBump = ();
Expand Down
1 change: 0 additions & 1 deletion frame/offences/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ impl pallet_staking::Trait for Test {
type RewardCurve = RewardCurve;
type NextNewSession = Session;
type ElectionLookahead = ();
type Call = Call;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type UnsignedPriority = ();
type MaxIterations = ();
Expand Down
1 change: 0 additions & 1 deletion frame/session/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ impl pallet_staking::Trait for Test {
type RewardCurve = RewardCurve;
type NextNewSession = Session;
type ElectionLookahead = ();
type Call = Call;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type UnsignedPriority = UnsignedPriority;
type MaxIterations = ();
Expand Down
1 change: 0 additions & 1 deletion frame/staking/fuzzer/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ impl pallet_staking::Trait for Test {
type RewardCurve = RewardCurve;
type NextNewSession = Session;
type ElectionLookahead = ();
type Call = Call;
type MaxIterations = MaxIterations;
type MinSolutionScoreBump = ();
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
Expand Down
Loading