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

[BCFR-1048] - Logic to solve ocassional nonce gap issues #14984

Merged

Conversation

Farber98
Copy link
Contributor

@Farber98 Farber98 commented Oct 28, 2024

Description:

  • Change the getSequenceForAddr function to use NonceAt instead of PendingNonceAt.
  • We use the mined transaction count (SequenceAt) to determine the next nonce to use instead of the pending transaction count (PendingSequenceAt). This allows the TXM to broadcast and track transactions for nonces starting from the last mined transaction preventing the perpetuation of a potential nonce gap.
  • Consideration: Any transactions already in the mempool would be attempted to be overwritten but an older transaction can get included before being overwritten. Such could be the case if there was a nonce gap that gets filled unblocking the transactions. If that occurs, there could be short term noise in the logs surfacing that a transaction expired without ever getting a receipt.

Steps a NOP should follow to handle nonce gap issue:

  • disable NonceAutoSync
  • mark abandon all current transactions checkbox

Resources

Merge together with:

Copy link
Contributor

github-actions bot commented Oct 28, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@Farber98 Farber98 marked this pull request as ready for review October 29, 2024 18:01
@Farber98 Farber98 requested review from a team as code owners October 29, 2024 18:01
@Farber98 Farber98 self-assigned this Oct 29, 2024
core/chains/evm/txmgr/nonce_tracker.go Outdated Show resolved Hide resolved
@prashantkumar1982 prashantkumar1982 added this pull request to the merge queue Nov 4, 2024
Merged via the queue into develop with commit 1738332 Nov 4, 2024
139 of 140 checks passed
@prashantkumar1982 prashantkumar1982 deleted the bcfr-1048-refactor-nonce-gap-handling-logic branch November 4, 2024 22:17
cedric-cordenier pushed a commit that referenced this pull request Nov 5, 2024
* nonce gap handling

* add changeset

* refactor tests

* add comment explaining situation

* go sec no lint

* fix flake

* fix flakes

* fix flake

* use mock anything
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants