-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Description
Mempool transactions need to be "restored" in the following scenario:
- Mempool tx is received
- Mempool tx is dropped after not being mined for a period of time
- Mempool tx is re-broadcasted
It seems like step 3 may not be handled properly during re-ingestion of the mempool tx event:
stacks-blockchain-api/src/datastore/pg-write-store.ts
Lines 1770 to 1771 in c4cba69
| 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
lgalabru