-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Labels
Milestone
Description
With #1614, we allow messages of up to 65k size to be stored on an auth mailbox server.
Currently there is no cleanup mechanism defined or implemented, so messages aren't deleted.
Because of the way we'll want to implement backups, we can't just remove the messages after a certain time or number of blocks.
Instead we should wait for the outpoint to be spent before deleting messages.
Steps to completion:
- Periodically (perhaps once a day in the background?) check all mailbox messages for their declared outpoint, if it was spent (using
bitcoind'sgettxoutmethod that returnsnullif a transaction output is no longer unspent). If it was spent, we can delete the message, as it is no longer relevant. - Add a new
RemoveMessagemethod to theauthmailboxrpcpackage that allows the receiver to delete a message.- The receiver needs to provide a signature (for example over the claimed message outpoints to delete) to prove who they are (using the receiver key that is also used to fetch the messages).
- The
tapgarden.Custodianshould use thatRemoveMessageRPC to remove processed messages. But only after all proofs were fetched correctly and the receive event is fully completed. And after implementing [feature]: backup and recovery #426, we also want to make sure the new backup file is written before deleting any messages. Once we have the proof files and the proof's locators written to the backup file, we no longer need the auth mailbox message.