Skip to content

Ensure re-broadcasted mempool txs are "unpruned" #1817

@zone117x

Description

@zone117x

Mempool transactions need to be "restored" in the following scenario:

  1. Mempool tx is received
  2. Mempool tx is dropped after not being mined for a period of time
  3. Mempool tx is re-broadcasted

It seems like step 3 may not be handled properly during re-ingestion of the mempool tx event:

INSERT INTO mempool_txs ${sql(values)}
ON CONFLICT ON CONSTRAINT unique_tx_id DO NOTHING

The ON CONFLICT might need to instead 1) ensure the tx isn't already mined because these events can come out-of-order from /new_block, then 2) update pruned to false.

cc @lgalabru who identified this potential bug

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions