Skip to content

[cleanup]: implement auth mailbox message cleanup #1683

@guggero

Description

@guggero

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's gettxout method that returns null if 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 RemoveMessage method to the authmailboxrpc package 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.Custodian should use that RemoveMessage RPC 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions