Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4ee6edc
reduce exec time of fast-unstake benchmarks
kianenigma Jan 10, 2023
e276470
fix test
kianenigma Jan 10, 2023
04070ef
fmt
kianenigma Jan 10, 2023
b36779a
fix patch the tests
kianenigma Jan 10, 2023
f1c2bef
fix patch the tests
kianenigma Jan 10, 2023
438276b
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jan 10, 2023
886a3a6
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 10, 2023
2e4507d
add batch size as well
kianenigma Jan 13, 2023
8d70116
update some benches to be better
kianenigma Jan 13, 2023
5f0ec9d
fix one last test
kianenigma Jan 13, 2023
48bce32
Merge branch 'master' of github.com:paritytech/substrate into kiz-fas…
kianenigma Jan 13, 2023
058a2fd
fix
kianenigma Jan 13, 2023
652290c
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jan 13, 2023
7995be0
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 13, 2023
bd63cb2
reduce time even more
kianenigma Jan 13, 2023
5c1509c
Merge branch 'kiz-fast-unstake-bench' of github.com:paritytech/substr…
kianenigma Jan 13, 2023
2c747b2
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 13, 2023
61e8370
fix tests
kianenigma Jan 13, 2023
8c9fd91
Merge branch 'kiz-fast-unstake-bench' of github.com:paritytech/substr…
kianenigma Jan 13, 2023
ca143b5
nit
kianenigma Jan 13, 2023
a8a1dd7
remove
kianenigma Jan 13, 2023
6509fa0
improve the weight calc further
kianenigma Jan 13, 2023
49c6bdf
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jan 13, 2023
afe2572
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 13, 2023
5562243
fix benchmarks
kianenigma Jan 13, 2023
9a1d282
Merge branch 'kiz-fast-unstake-bench' of github.com:paritytech/substr…
kianenigma Jan 13, 2023
6719bf4
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 13, 2023
9111601
update
kianenigma Jan 13, 2023
046d5e4
merged
kianenigma Jan 13, 2023
680cbd1
fix
kianenigma Jan 13, 2023
6fc2f57
fix
kianenigma Jan 13, 2023
0b73e3e
fmt
kianenigma Jan 13, 2023
b86857e
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 13, 2023
61b6e0a
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 13, 2023
0b1948c
lots of changes again...
kianenigma Jan 14, 2023
ea58674
smaller input
kianenigma Jan 14, 2023
7bfee34
update
kianenigma Jan 14, 2023
7cd5419
fmt
kianenigma Jan 14, 2023
666e354
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 14, 2023
46e62e3
cleanup
kianenigma Jan 15, 2023
bf92744
small simplification
kianenigma Jan 15, 2023
57ac38b
fmt
kianenigma Jan 15, 2023
87ff25c
reduce exec time a bit
kianenigma Jan 15, 2023
cb423f1
fix
kianenigma Jan 15, 2023
aecae12
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jan 15, 2023
e60c015
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 15, 2023
53dfad3
test
kianenigma Jan 15, 2023
4669277
Merge branch 'kiz-fast-unstake-bench' of github.com:paritytech/substr…
kianenigma Jan 15, 2023
02650e5
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 15, 2023
107ab47
increase again
kianenigma Jan 15, 2023
c4b454c
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 15, 2023
1e32449
Merge branch 'master' of github.com:paritytech/substrate into kiz-fas…
kianenigma Jan 23, 2023
4989a7d
review comments
kianenigma Jan 23, 2023
4d680a5
Merge branch 'kiz-fast-unstake-bench' of github.com:paritytech/substr…
kianenigma Jan 23, 2023
865e395
fmt
kianenigma Jan 23, 2023
56e47f6
Merge branch 'master' of github.com:paritytech/substrate into kiz-fas…
kianenigma Jan 25, 2023
1493d41
fix
kianenigma Jan 25, 2023
489802c
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
Jan 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lots of changes again...
  • Loading branch information
kianenigma committed Jan 14, 2023
commit 0b1948c919d40b394c95bf2c7fd89ce59fc926dc
3 changes: 3 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,10 @@ impl pallet_fast_unstake::Config for Runtime {
type Deposit = ConstU128<{ DOLLARS }>;
type Currency = Balances;
type Staking = Staking;
type MaxErasToCheckPerBlock = ConstU32<4>;
type WeightInfo = ();
#[cfg(feature = "runtime-benchmarks")]
type MaxBackersPerValidator = MaxNominatorRewardedPerValidator;
}

parameter_types! {
Expand Down
18 changes: 7 additions & 11 deletions frame/fast-unstake/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ use sp_staking::{EraIndex, StakingInterface};
use sp_std::prelude::*;

const USER_SEED: u32 = 0;
const DEFAULT_BACKER_PER_VALIDATOR: u32 = 32;
const MAX_VALIDATORS: u32 = 16;
const MAX_BONDING_DURATION: u32 = 16;

type CurrencyOf<T> = <T as Config>::Currency;

Expand Down Expand Up @@ -77,7 +74,7 @@ fn setup_staking<T: Config>(v: u32, until: EraIndex) {
.collect::<Vec<_>>();

for era in 0..=until {
let others = (0..DEFAULT_BACKER_PER_VALIDATOR)
let others = (0..T::MaxBackersPerValidator::get())
.map(|s| {
let who = frame_benchmarking::account::<T::AccountId>("nominator", era, s);
let value = ed;
Expand Down Expand Up @@ -132,15 +129,14 @@ benchmarks! {

// on_idle, when we check some number of eras and when we need to build the queue.
on_idle_check {
let x in (MAX_BONDING_DURATION * 1) .. (MAX_BONDING_DURATION * MAX_VALIDATORS);
let v in 1 .. 1000;
let b in 1 .. T::BatchSize::get();

// both of these can be fetched from `T::Staking`, but the values might be unnecessarily
// large and make the benchmarks too slow. We know the complexity is linear, a small range
// should be enough. Also, we use the multiplied version because this helps the benchmarking
// tool establish the fact that we have a total of `uv` reads in total.
let u = (x / MAX_BONDING_DURATION).min(T::Staking::bonding_duration());
let v = x / u;
// large and make the benchmarks too slow. Also, we use the multiplied version because this
// helps the benchmarking tool establish the fact that we have a total of `uv` reads in
// total. Although, this means that for a lot of the other aspects, we are assuming
let u = T::MaxErasToCheckPerBlock::get().min(T::Staking::bonding_duration());

ErasToCheckPerBlock::<T>::put(u);
T::Staking::set_current_era(u);
Expand Down Expand Up @@ -205,7 +201,7 @@ benchmarks! {
control {
let origin = <T as Config>::ControlOrigin::successful_origin();
}
: _<T::RuntimeOrigin>(origin, 128)
: _<T::RuntimeOrigin>(origin, T::MaxErasToCheckPerBlock::get())
verify {}

impl_benchmark_test_suite!(Pallet, crate::mock::ExtBuilder::default().build(), crate::mock::Runtime)
Expand Down
55 changes: 29 additions & 26 deletions frame/fast-unstake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ pub mod pallet {
traits::{Defensive, ReservableCurrency, StorageVersion},
};
use frame_system::pallet_prelude::*;
use sp_runtime::{
traits::{Saturating, Zero},
DispatchResult,
};
use sp_runtime::{traits::Zero, DispatchResult};
use sp_staking::{EraIndex, StakingInterface};
use sp_std::{collections::btree_set::BTreeSet, prelude::*, vec::Vec};
pub use weights::WeightInfo;
Expand Down Expand Up @@ -138,6 +135,14 @@ pub mod pallet {

/// The weight information of this pallet.
type WeightInfo: WeightInfo;

/// Maximum value for `ErasToCheckPerBlock`. This should be as close as possible, but more
/// than the actual value, in order to have accurate benchmarks.
type MaxErasToCheckPerBlock: Get<u32>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its quite sad that we still cannot express relations between config types…
Both options are a bit ugly and maybe not as widely applicable as it first looks.

Suggested change
type MaxErasToCheckPerBlock: Get<u32>;
type MaxErasToCheckPerBlock: Get<u32, Min=Self::ErasToCheckPerBlock>;

of

Suggested change
type MaxErasToCheckPerBlock: Get<u32>;
#[constraint(self >= Self::ErasToCheckPerBlock)]
type MaxErasToCheckPerBlock: Get<u32>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢


/// Use only for benchmarking.
#[cfg(feature = "runtime-benchmarks")]
type MaxBackersPerValidator: Get<u32>;
}

/// The current "head of the queue" being unstaked.
Expand Down Expand Up @@ -288,9 +293,10 @@ pub mod pallet {
/// Dispatch origin must be signed by the [`Config::ControlOrigin`].
#[pallet::call_index(2)]
#[pallet::weight(<T as Config>::WeightInfo::control())]
pub fn control(origin: OriginFor<T>, unchecked_eras_to_check: EraIndex) -> DispatchResult {
pub fn control(origin: OriginFor<T>, eras_to_check: EraIndex) -> DispatchResult {
let _ = T::ControlOrigin::ensure_origin(origin)?;
ErasToCheckPerBlock::<T>::put(unchecked_eras_to_check);
ensure!(eras_to_check <= T::MaxErasToCheckPerBlock::get(), Error::<T>::CallNotAllowed);
ErasToCheckPerBlock::<T>::put(eras_to_check);
Ok(())
}
}
Expand Down Expand Up @@ -327,35 +333,35 @@ pub mod pallet {
// any weight that is unaccounted for
let mut unaccounted_weight = Weight::from_ref_time(0);

let mut eras_to_check_per_block = ErasToCheckPerBlock::<T>::get();
let eras_to_check_per_block = ErasToCheckPerBlock::<T>::get();
if eras_to_check_per_block.is_zero() {
return T::DbWeight::get().reads(1).saturating_add(unaccounted_weight)
}

// NOTE: here we're assuming that the number of validators has only ever increased,
// meaning that the number of exposures to check is either this per era, or less.
let validator_count = T::Staking::desired_validator_count();
let next_batch_size = Head::<T>::get()
.map_or(Queue::<T>::count().min(T::BatchSize::get()), |head| {
head.stashes.len() as u32
let (next_batch_size, reads_from_queue) = Head::<T>::get()
.map_or((Queue::<T>::count().min(T::BatchSize::get()), true), |head| {
(head.stashes.len() as u32, false)
});

// determine the number of eras to check. This is based on both `ErasToCheckPerBlock`
// and `remaining_weight` passed on to us from the runtime executive.
let max_weight = |v, u: u32, b| {
let max_weight = |v, b| {
// NOTE: this potentially under-counts by up to `BatchSize` reads from the queue.
<T as Config>::WeightInfo::on_idle_check(u.saturating_mul(v), b)
<T as Config>::WeightInfo::on_idle_check(v, b)
.max(<T as Config>::WeightInfo::on_idle_unstake(b))
.saturating_add(T::DbWeight::get().reads(T::BatchSize::get() as u64))
.saturating_add(if reads_from_queue {
T::DbWeight::get().reads(next_batch_size.into())
} else {
Zero::zero()
})
};
while max_weight(validator_count, eras_to_check_per_block, next_batch_size)
.any_gt(remaining_weight)
{
eras_to_check_per_block.saturating_dec();
if eras_to_check_per_block.is_zero() {
log!(debug, "early exit because eras_to_check_per_block is zero");
return T::DbWeight::get().reads(3).saturating_add(unaccounted_weight)
}

if max_weight(validator_count, next_batch_size).any_gt(remaining_weight) {
log!(debug, "early exit because eras_to_check_per_block is zero");
return T::DbWeight::get().reads(3).saturating_add(unaccounted_weight)
}

if T::Staking::election_ongoing() {
Expand Down Expand Up @@ -507,11 +513,8 @@ pub mod pallet {
},
}

<T as Config>::WeightInfo::on_idle_check(
(eras_checked.len() as u32).saturating_mul(validator_count),
pre_length as u32,
)
.saturating_add(unaccounted_weight)
<T as Config>::WeightInfo::on_idle_check(validator_count, pre_length as u32)
.saturating_add(unaccounted_weight)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions frame/fast-unstake/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ impl fast_unstake::Config for Runtime {
type ControlOrigin = frame_system::EnsureRoot<Self::AccountId>;
type BatchSize = BatchSize;
type WeightInfo = ();
type MaxErasToCheckPerBlock = ConstU32<16>;
#[cfg(feature = "runtime-benchmarks")]
type MaxBackersPerValidator = ConstU32<128>;
}

type Block = frame_system::mocking::MockBlock<Runtime>;
Expand Down
19 changes: 6 additions & 13 deletions frame/fast-unstake/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Tests for pallet-fast-unstake.

use super::*;
use crate::{mock::*, types::*, Event};
use crate::{mock::*, types::*, Event};
use frame_support::{assert_noop, assert_ok, bounded_vec, pallet_prelude::*, traits::Currency};
use pallet_staking::{CurrentEra, RewardDestination};

Expand Down Expand Up @@ -1216,23 +1216,16 @@ mod batched {
#[test]
fn kusama_estimate() {
use crate::WeightInfo;
let block_time = frame_support::weights::Weight::from_ref_time(
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2,
)
.ref_time() as f32;
let on_idle =
crate::weights::SubstrateWeight::<T>::on_idle_check(1 * 1000, 64).ref_time() as f32;
let block_time = frame_support::weights::Weight::from_ref_time(frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2).ref_time() as f32;
let on_idle = crate::weights::SubstrateWeight::<T>::on_idle_check(1000, 64).ref_time() as f32;
dbg!(block_time, on_idle, on_idle / block_time);
}


#[test]
fn polkadot_estimate() {
use crate::WeightInfo;
let block_time = frame_support::weights::Weight::from_ref_time(
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2,
)
.ref_time() as f32;
let on_idle =
crate::weights::SubstrateWeight::<T>::on_idle_check(1 * 300, 64).ref_time() as f32;
let block_time = frame_support::weights::Weight::from_ref_time(frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2).ref_time() as f32;
let on_idle = crate::weights::SubstrateWeight::<T>::on_idle_check(300, 64).ref_time() as f32;
dbg!(block_time, on_idle, on_idle / block_time);
}
85 changes: 42 additions & 43 deletions frame/fast-unstake/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,20 @@
//! Autogenerated weights for pallet_fast_unstake
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-01-13, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! DATE: 2023-01-14, STEPS: `10`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `Kians-MacBook-Pro-2.local`, CPU: `<UNKNOWN>`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

// Executed Command:
// /home/benchbot/cargo_target_dir/production/substrate
// target/debug/substrate
// benchmark
// pallet
// --steps=50
// --repeat=20
// --steps=10
// --repeat=5
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/substrate/.git/.artifacts/bench.json
// --pallet=pallet_fast_unstake
// --chain=dev
// --header=./HEADER-APACHE2
Expand All @@ -49,7 +48,7 @@ use sp_std::marker::PhantomData;
/// Weight functions needed for pallet_fast_unstake.
pub trait WeightInfo {
fn on_idle_unstake(b: u32, ) -> Weight;
fn on_idle_check(x: u32, b: u32, ) -> Weight;
fn on_idle_check(v: u32, b: u32, ) -> Weight;
fn register_fast_unstake() -> Weight;
fn deregister() -> Weight;
fn control() -> Weight;
Expand All @@ -74,10 +73,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Staking Payee (r:0 w:1)
/// The range of component `b` is `[1, 32]`.
fn on_idle_unstake(b: u32, ) -> Weight {
// Minimum execution time: 104_891 nanoseconds.
Weight::from_ref_time(81_179_276)
// Standard Error: 69_111
.saturating_add(Weight::from_ref_time(37_598_449).saturating_mul(b.into()))
// Minimum execution time: 1_337_000 nanoseconds.
Weight::from_ref_time(746_206_289)
// Standard Error: 2_119_343
.saturating_add(Weight::from_ref_time(713_517_207).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(b.into())))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -90,16 +89,16 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
// Storage: Staking CurrentEra (r:1 w:0)
// Storage: Staking ErasStakers (r:17 w:0)
/// The range of component `x` is `[16, 256]`.
/// The range of component `x` is `[16, 1024]`.
/// The range of component `b` is `[1, 32]`.
fn on_idle_check(x: u32, b: u32, ) -> Weight {
// Minimum execution time: 2_366_234 nanoseconds.
Weight::from_ref_time(2_389_275_000)
// Standard Error: 2_667_329
.saturating_add(Weight::from_ref_time(77_884_068).saturating_mul(x.into()))
// Standard Error: 21_532_980
.saturating_add(Weight::from_ref_time(638_582_459).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(8))
// Minimum execution time: 48_524_000 nanoseconds.
Weight::from_ref_time(48_619_000_000)
// Standard Error: 167_085_763
.saturating_add(Weight::from_ref_time(1_211_164_800).saturating_mul(x.into()))
// Standard Error: 5_360_315_553
.saturating_add(Weight::from_ref_time(37_490_662_723).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into())))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -118,8 +117,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Balances Locks (r:1 w:1)
// Storage: FastUnstake CounterForQueue (r:1 w:1)
fn register_fast_unstake() -> Weight {
// Minimum execution time: 146_745 nanoseconds.
Weight::from_ref_time(148_464_000)
// Minimum execution time: 2_035_000 nanoseconds.
Weight::from_ref_time(2_144_000_000)
.saturating_add(T::DbWeight::get().reads(15))
.saturating_add(T::DbWeight::get().writes(10))
}
Expand All @@ -129,15 +128,15 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: FastUnstake Head (r:1 w:0)
// Storage: FastUnstake CounterForQueue (r:1 w:1)
fn deregister() -> Weight {
// Minimum execution time: 67_591 nanoseconds.
Weight::from_ref_time(68_455_000)
// Minimum execution time: 707_000 nanoseconds.
Weight::from_ref_time(714_000_000)
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
// Storage: FastUnstake ErasToCheckPerBlock (r:0 w:1)
fn control() -> Weight {
// Minimum execution time: 4_553 nanoseconds.
Weight::from_ref_time(4_813_000)
// Minimum execution time: 63_000 nanoseconds.
Weight::from_ref_time(64_000_000)
.saturating_add(T::DbWeight::get().writes(1))
}
}
Expand All @@ -160,10 +159,10 @@ impl WeightInfo for () {
// Storage: Staking Payee (r:0 w:1)
/// The range of component `b` is `[1, 32]`.
fn on_idle_unstake(b: u32, ) -> Weight {
// Minimum execution time: 104_891 nanoseconds.
Weight::from_ref_time(81_179_276)
// Standard Error: 69_111
.saturating_add(Weight::from_ref_time(37_598_449).saturating_mul(b.into()))
// Minimum execution time: 1_337_000 nanoseconds.
Weight::from_ref_time(746_206_289)
// Standard Error: 2_119_343
.saturating_add(Weight::from_ref_time(713_517_207).saturating_mul(b.into()))
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().reads((6_u64).saturating_mul(b.into())))
.saturating_add(RocksDbWeight::get().writes(1))
Expand All @@ -176,16 +175,16 @@ impl WeightInfo for () {
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
// Storage: Staking CurrentEra (r:1 w:0)
// Storage: Staking ErasStakers (r:17 w:0)
/// The range of component `x` is `[16, 256]`.
/// The range of component `x` is `[16, 1024]`.
/// The range of component `b` is `[1, 32]`.
fn on_idle_check(x: u32, b: u32, ) -> Weight {
// Minimum execution time: 2_366_234 nanoseconds.
Weight::from_ref_time(2_389_275_000)
// Standard Error: 2_667_329
.saturating_add(Weight::from_ref_time(77_884_068).saturating_mul(x.into()))
// Standard Error: 21_532_980
.saturating_add(Weight::from_ref_time(638_582_459).saturating_mul(b.into()))
.saturating_add(RocksDbWeight::get().reads(8))
// Minimum execution time: 48_524_000 nanoseconds.
Weight::from_ref_time(48_619_000_000)
// Standard Error: 167_085_763
.saturating_add(Weight::from_ref_time(1_211_164_800).saturating_mul(x.into()))
// Standard Error: 5_360_315_553
.saturating_add(Weight::from_ref_time(37_490_662_723).saturating_mul(b.into()))
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(x.into())))
.saturating_add(RocksDbWeight::get().writes(1))
}
Expand All @@ -204,8 +203,8 @@ impl WeightInfo for () {
// Storage: Balances Locks (r:1 w:1)
// Storage: FastUnstake CounterForQueue (r:1 w:1)
fn register_fast_unstake() -> Weight {
// Minimum execution time: 146_745 nanoseconds.
Weight::from_ref_time(148_464_000)
// Minimum execution time: 2_035_000 nanoseconds.
Weight::from_ref_time(2_144_000_000)
.saturating_add(RocksDbWeight::get().reads(15))
.saturating_add(RocksDbWeight::get().writes(10))
}
Expand All @@ -215,15 +214,15 @@ impl WeightInfo for () {
// Storage: FastUnstake Head (r:1 w:0)
// Storage: FastUnstake CounterForQueue (r:1 w:1)
fn deregister() -> Weight {
// Minimum execution time: 67_591 nanoseconds.
Weight::from_ref_time(68_455_000)
// Minimum execution time: 707_000 nanoseconds.
Weight::from_ref_time(714_000_000)
.saturating_add(RocksDbWeight::get().reads(5))
.saturating_add(RocksDbWeight::get().writes(2))
}
// Storage: FastUnstake ErasToCheckPerBlock (r:0 w:1)
fn control() -> Weight {
// Minimum execution time: 4_553 nanoseconds.
Weight::from_ref_time(4_813_000)
// Minimum execution time: 63_000 nanoseconds.
Weight::from_ref_time(64_000_000)
.saturating_add(RocksDbWeight::get().writes(1))
}
}