Skip to content

feat(txpool): add --txpool.enforce-tracked-nonce (backport of #28526) - #47

Merged
joshklop merged 1 commit into
joshklop/op-v2.7.0-deny-advisoriesfrom
joshklop/op-v2.7.0-enforce-tracked-nonce
Nov 20, 2026
Merged

joshklop merged 1 commit into
joshklop/op-v2.7.0-deny-advisoriesfrom
joshklop/op-v2.7.0-enforce-tracked-nonce

Conversation

@joshklop

@joshklop joshklop commented Nov 20, 2026 •

Copy link
Copy Markdown

Backports paradigmxyz#28526 onto op-v2.7.0, for the next op-v2.7.0-<n> tag. It tracks ethereum-optimism/optimism#24321.

Stacked on #48, which fixes the lint-deny failure that now hits every PR into op-v2.7.0, so this PR's CI can go green. Review only this PR's own commit. When #48 merges, GitHub deletes its branch and retargets this PR to op-v2.7.0.

What

Cherry-picks 3e88af42a04264f1ad32d1bde14f67025de152be with -x. It applied cleanly on op-v2.7.0-1 (ed91041f36b973eda3521ff90b3a25165087c133), the current branch tip.

  • Adds --txpool.enforce-tracked-nonce, off by default, and DefaultTxPoolValues::with_enforce_tracked_nonce.
  • TxPoolArgs::pool_config now reads enforce_tracked_nonce from the flag. Before, it always took PoolConfig::default()'s false.
  • Adds the flag to the CLI reference and a unit test that it reaches PoolConfig.

Why

The guard (PoolConfig::enforce_tracked_nonce, paradigmxyz#26981) is already on this branch. But without this flag, the only way to turn it on is to replace the pool builder.

An OP Stack sequencer with 1 s blocks hit the race the guard closes. The validator reads the sender's nonce outside the pool lock. When nonce N+1 is validated just before the block that mines N is committed, the pool records the stale nonce N, sees a nonce gap, and queues N+1. Nothing promotes it until the sender's account changes again. It happened 3 times in about 17k transactions, each time holding the transaction for 5–10 minutes. With the guard on, the pool uses its tracked nonce, which is newer, and N+1 goes to pending.

Not included

This picks a feature, not a fix, so it runs no forward sweep. #44 swept up to its own tip, and the next sweep is planned for a later tag. No upstream release contains paradigmxyz#28526 yet, so it has to be carried onto the next op-* branch too.

Testing

  • cargo test -p reth-node-core --lib args::txpool: 6 passed, including the new txpool_enforce_tracked_nonce_reaches_the_pool_config.
  • cargo +nightly-2026-07-14 fmt --all --check passes.

Merging: after #48 lands and this PR is retargeted, squash-merge it, keeping the (cherry picked from commit 3e88af42…) line in the message, which the next update's carried-patch audit reads. The squash then contains only this backport, with no rebase or push needed. A rebase-merge would replay #48's commit too.

🤖 Generated with Claude Code

Co-authored-by: raz-glm <178501331+raz-glm@users.noreply.github.com>
(cherry picked from commit 3e88af4)
@joshklop
joshklop force-pushed the joshklop/op-v2.7.0-enforce-tracked-nonce branch from d6e407a to 34f8e37 Compare November 20, 2026 20:38
@joshklop
joshklop changed the base branch from op-v2.7.0 to joshklop/op-v2.7.0-deny-advisories November 20, 2026 20:38
@joshklop
joshklop added this pull request to stack #49 November 20, 2026 20:56
@joshklop
joshklop enabled stacked auto-merge (squash) November 20, 2026 21:03
@joshklop
joshklop merged commit ce8cfb1 into op-v2.7.0 Nov 20, 2026
30 checks passed
@joshklop
joshklop deleted the joshklop/op-v2.7.0-enforce-tracked-nonce branch November 20, 2026 21:10
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.

3 participants