Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Fix/same nonce replacement txs #1237

Merged
merged 14 commits into from
Sep 30, 2021
Merged

Conversation

MicaiahReid
Copy link
Contributor

@MicaiahReid MicaiahReid commented Sep 22, 2021

Prevents a transaction that replaces a previously queued transaction from being re-added to the transaction pool and thus run twice.

Previously when a transaction was sent we checked:

  • do we have executable transactions in the transaction pool from the same origin?
  • does this new transaction have the same nonce as one of those?
  • if so, is this new transaction's gas price better?
  • if so, replace the previous transaction with this new one.

We now perform all of those same checks against the future-nonce transactions (transactions whose nonce is higher than the sender account's nonce) in the transaction pool, not just the executable transactions.

Fixes #1219 and #1218

@davidmurdoch
Copy link
Member

Looks like tests aren't completing right now. See the removes transactions that are in pending transactions at the start of evm_revert test. It passes, but then mocha just quits. This seems to happen when Node.js has determined that the application has hit a dead end and thus no more events will be occurring. Let me know if you want to sync on this one!

@davidmurdoch davidmurdoch linked an issue Sep 29, 2021 that may be closed by this pull request
@MicaiahReid MicaiahReid merged commit 4cf298f into develop Sep 30, 2021
@MicaiahReid MicaiahReid deleted the fix/same-nonce-replacement-txs branch September 30, 2021 15:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants