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
We currently have the following in the witnesser pallet (soon-to-merged substrate update branch):
impl<T: pallet::Config> cf_traits::EpochTransitionHandlerforPallet<T>{typeValidatorId = T::ValidatorId;/// Purge the pallet storage of stale entries. This is prevent the storage from growing/// indefinitely.fnon_expired_epoch(expired:EpochIndex){let _empty = Votes::<T>::clear_prefix(expired, u32::MAX,None);let _empty = ExtraCallData::<T>::clear_prefix(expired, u32::MAX,None);let _empty = CallHashExecuted::<T>::clear_prefix(expired, u32::MAX,None);}}
This will likely be fine initially but we should be more defensive: each of these items is potentially unbounded and will be larger as our chain is more active. Deleting them all at once is risky.
Either we use the strange new substrate api using MultiRemovalResults, or we use a similar 'garbage collection' approach to the one used for reaping dust accounts in the Flip pallet. Or some hybrid of the two approaches. I don't fully understand the reason behind / need for / proper usage of the cursor in MultiRemovalResults - will require some reading to make the right decision.
Description
See the discission here and this substrate PR.
We currently have the following in the witnesser pallet (soon-to-merged substrate update branch):
This will likely be fine initially but we should be more defensive: each of these items is potentially unbounded and will be larger as our chain is more active. Deleting them all at once is risky.
Either we use the strange new substrate api using
MultiRemovalResults
, or we use a similar 'garbage collection' approach to the one used for reaping dust accounts in the Flip pallet. Or some hybrid of the two approaches. I don't fully understand the reason behind / need for / proper usage of the cursor inMultiRemovalResults
- will require some reading to make the right decision.Relevant people
@syan095
The text was updated successfully, but these errors were encountered: