Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically mark mempool transactions with conflicting nonces as failed #2041

Closed
rafaelcr opened this issue Aug 3, 2024 · 2 comments · Fixed by #2091
Closed

automatically mark mempool transactions with conflicting nonces as failed #2041

rafaelcr opened this issue Aug 3, 2024 · 2 comments · Fixed by #2091
Assignees
Labels
bug Something isn't working

Comments

@rafaelcr
Copy link
Collaborator

rafaelcr commented Aug 3, 2024

The API returns a bunch of mempool transactions that are impossible to mine given that they conflict with other confirmed transactions from the same senders with the same nonce, so they end up being stuck for days (until they get pruned after 256 blocks). For example, this transaction with nonce 4461 is still pending:

Screenshot 2024-08-02 at 22 33 06

However, that sender STX address already has a confirmed transaction with the same nonce (in this case a coinbase, but the same happens with any tx type):

Screenshot 2024-08-02 at 22 34 20

These stuck transactions can cause user confusion but they most definitely affect the fee estimation algorithms. (I'm not sure why the Stacks node does not drop them automatically.)

  • We should add logic to the API that upon a tx confirmation, it checks the mempool table for txs from that sender with that nonce and marks them as failed or pruned.
@rafaelcr rafaelcr added the bug Something isn't working label Aug 3, 2024
@smcclellan
Copy link
Contributor

@zone117x for feedback.

@zone117x
Copy link
Member

We should add logic to the API that upon a tx confirmation, it checks the mempool table for txs from that sender with that nonce and marks them as failed or pruned.

This makes sense to me. The only thing to be careful about is "restoration" / un-pruning txs during re-orgs when necessary, otherwise it can give the appearance of txs "disappearing", when they are not included in a canonical block and are also pruned from the mempool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
3 participants