Improve sender ratchets deletion schedule
mulmarta opened this issue · comments
Currently we have a constant const MAX_RATCHET_BACK_HISTORY: u32 = 1024
which is used for two things: we keep X = 1024
past ratchets for a sender and we throw an error if we get a message more than Y = 1024
ratchets in the future.
We need something more flexible:
- allow applications to configure
Y
with the option to makeY
"infinite" meaning that we always accept a message (we still keepX
past ratchets from the most recent message) - allow applications to configure
X
. Consider the option to let the StorageProvider deal with ratchet deletion by adding a functionprune_ratchets(generation)
on PriorEpoch that deletes ratchets older thangeneration