Skip to content

Rollback unsuccessful preconfs in the mempool #3098

@Voxelot

Description

@Voxelot

When the mempool receives a pre-confirmation, it optimistically marks the inputs as "spent" in it's local cache.

Currently there is no mechanism to rollback failed preconfs in the mempool, apart from a full restart of the node. This means when a preconfirmation doesn't finalize, those inputs remain "stuck", and users are prevented from using those inputs until the mempool is reset.

This has been observed nearly anytime the block producer is restarted, we find there are stuck utxos in the RPC mempools.

  1. We need to investigate why restarting the block producer causes so many dropped transactions from a pre-conf perspective. Ideally if there is graceful shutdown, the in-flight blocks / transactions get finalized before the process exits.
  2. We need a mechanism to automatically clear these cached utxos in the mempool without manual intervention (i.e. rebooting the mempool), either via TTL or some other reconciliation process that detects if a transaction did not finalize. Ie. any cached preconf data older than 1 block ago should be discarded.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions