You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Stop using deprecated remove_prefix to clear era information in Staking Pallet #13439
We currently clear state for eras older than HistoryDepth by using the fn map.remove_prefix which is deprecated. Use map.clear_prefix that can be paged.
This is how we clear old era information today
/// Clear all era information for given era.
pub(crate) fn clear_era_information(era_index: EraIndex) {
#[allow(deprecated)]
<ErasStakers<T>>::remove_prefix(era_index, None);
#[allow(deprecated)]
<ErasStakersClipped<T>>::remove_prefix(era_index, None);
#[allow(deprecated)]
<ErasValidatorPrefs<T>>::remove_prefix(era_index, None);
#[allow(deprecated)]
<ClaimedRewards<T>>::remove_prefix(era_index, None);
#[allow(deprecated)]
<ErasStakersPaged<T>>::remove_prefix((era_index,), None);
#[allow(deprecated)]
<ErasStakersOverview<T>>::remove_prefix(era_index, None);
<ErasValidatorReward<T>>::remove(era_index);
<ErasRewardPoints<T>>::remove(era_index);
<ErasTotalStake<T>>::remove(era_index);
ErasStartSessionIndex::<T>::remove(era_index);
}
Activity
gflow33 commentedon Mar 7, 2023
Can I handle this task?