Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions prdoc/pr_11050.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: 'staking-aync: remove stale prune_era_total_stake'
doc:
- audience: Runtime Dev
description: "Leftover from #10810 backport. The function was replaced by prune_era_single_entry_cleanups\
\ in #10502.\r\n"
crates:
- name: pallet-staking-async
bump: patch
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ pub trait WeightInfo {
fn prune_era_claimed_rewards(v: u32, ) -> Weight;
fn prune_era_validator_reward() -> Weight;
fn prune_era_reward_points() -> Weight;
fn prune_era_total_stake() -> Weight;
}

/// Weights for `pallet_staking_async` using the Substrate node and recommended hardware.
Expand Down Expand Up @@ -977,21 +976,6 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
/// Storage: `Staking::ActiveEra` (r:1 w:0)
/// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `Measured`)
/// Storage: `Staking::EraPruningState` (r:1 w:1)
/// Proof: `Staking::EraPruningState` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`)
/// Storage: `Staking::ErasTotalStake` (r:0 w:1)
/// Proof: `Staking::ErasTotalStake` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`)
fn prune_era_total_stake() -> Weight {
// Proof Size summary in bytes:
// Measured: `798`
// Estimated: `4263`
// Minimum execution time: 27_000_000 picoseconds.
Weight::from_parts(27_000_000, 4263)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
}

// For backwards compatibility and tests.
Expand Down Expand Up @@ -1870,19 +1854,4 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
/// Storage: `Staking::ActiveEra` (r:1 w:0)
/// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `Measured`)
/// Storage: `Staking::EraPruningState` (r:1 w:1)
/// Proof: `Staking::EraPruningState` (`max_values`: None, `max_size`: Some(13), added: 2488, mode: `Measured`)
/// Storage: `Staking::ErasTotalStake` (r:0 w:1)
/// Proof: `Staking::ErasTotalStake` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`)
fn prune_era_total_stake() -> Weight {
// Proof Size summary in bytes:
// Measured: `798`
// Estimated: `4263`
// Minimum execution time: 27_000_000 picoseconds.
Weight::from_parts(27_000_000, 4263)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
}
19 changes: 0 additions & 19 deletions substrate/frame/staking-async/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,25 +1446,6 @@ mod benchmarks {
Ok(())
}

// Benchmark pruning ErasTotalStake (final step)
#[benchmark(pov_mode = Measured)]
fn prune_era_total_stake() -> Result<(), BenchmarkError> {
let era = setup_era_for_pruning::<T>(1);
EraPruningState::<T>::insert(era, PruningStep::SingleEntryCleanups);

let caller: T::AccountId = whitelisted_caller();

let result;
#[block]
{
result = Pallet::<T>::prune_era_step(RawOrigin::Signed(caller).into(), era);
}

validate_pruning_weight::<T>(&result, "SingleEntryCleanups", 1);

Ok(())
}

// Benchmark pruning single-entry cleanups (seventh step)
#[benchmark(pov_mode = Measured)]
fn prune_era_single_entry_cleanups() -> Result<(), BenchmarkError> {
Expand Down
Loading