awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 make Y "infinite" meaning that we always accept a message (we still keep X 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 function prune_ratchets(generation) on PriorEpoch that deletes ratchets older than generation