Skip to content

fix(l1): bump EIP-1559 fees on same-nonce poster retries - #34

Open
stephenctw wants to merge 5 commits into
mainfrom
fix/poster-replacement-fee-bump
Open

fix(l1): bump EIP-1559 fees on same-nonce poster retries#34
stephenctw wants to merge 5 commits into
mainfrom
fix/poster-replacement-fee-bump

Conversation

@stephenctw

Copy link
Copy Markdown
Collaborator

Summary

Fixes same-nonce batch-poster retries that could rebroadcast underpriced EIP-1559 replacements when the fee market was flat. The poster now tracks in-flight fees per wallet nonce and floors each re-estimate against a shared ≥10% replacement bump (max fee ×1.1 +1; priority ×2), matching the mempool flusher’s rule.

  • Hoist bumped_replacement_fees into l1::eip1559 and add fees_for_nonce so poster + flusher share one replacement policy.
  • On successful broadcast, record fees; on failed send, leave the floor unchanged; prune entries once Latest advances past the nonce.
  • Cover bump math, mixed-component floors, Latest prune, and failed-send non-record behavior with unit/Anvil tests.

Test plan

  • cargo test -p sequencer --lib eip1559
  • cargo test -p sequencer --lib submitter::poster
  • Confirm flusher still compiles/uses shared bumped_replacement_fees (cargo test -p sequencer --lib recovery::flusher)
  • Anvil-backed poster replacement test (submit_batches_replacement_clears_ten_percent_bump)

@stephenctw
stephenctw requested a review from GCdePaula August 12, 2026 02:14
@stephenctw

Copy link
Copy Markdown
Collaborator Author

@jplgarcia FYI

@stephenctw stephenctw self-assigned this Aug 13, 2026
Track in-flight fees and floor re-estimates to the shared ≥10%
replacement rule so flat markets cannot underprice replacements.
Add mixed-component fees_for_nonce coverage, seeded replacement floor,
Latest prune, and failed-send non-record assertions.
@stephenctw
stephenctw force-pushed the fix/poster-replacement-fee-bump branch from 9e084bc to 77a4a61 Compare August 18, 2026 11:55
A 200ms sleep raced the first spawn_blocking SQLite write on loaded CI,
so the assertion still saw the default log_gas_price of 0.
Grow max_fee and priority by the same ×1.1+1 factor and clamp tip ≤ cap
so poster retries cannot wedge on ErrTipAboveFeeCap. Only the blocking
(Latest) nonce is re-escalated; suffix txs keep their original hash.
When a same-nonce send is rejected as replacement-underpriced, immediately
raise the stored head-nonce floor from the attempted fees so the next tick
self-corrects instead of repeating the same underpriced pair.
@stephenctw

stephenctw commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

Fixes the permanent poster wedge from asymmetric replacement bumps; limits re-escalation to the head nonce; adds geth underpriced fast-path floor raise.

@stephenctw
stephenctw force-pushed the fix/poster-replacement-fee-bump branch from 812e198 to b09dbc1 Compare August 20, 2026 13:08
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.

1 participant