fix(l1): bump EIP-1559 fees on same-nonce poster retries - #34
Conversation
|
@jplgarcia FYI |
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.
9e084bc to
77a4a61
Compare
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.
|
Fixes the permanent poster wedge from asymmetric replacement bumps; limits re-escalation to the head nonce; adds geth underpriced fast-path floor raise. |
812e198 to
b09dbc1
Compare
|
Thanks for the fix @stephenctw . I validated this against the current PR head with a real pending transaction on Anvil ( The fee-bump logic itself is correct: the retry uses the same nonce and raises both EIP-1559 values by at least 10%:
However, the poster still does not reach The failure occurs earlier, during gas estimation: At that point, nonce As a control, I estimated the same I think the remaining change should be scoped to the same-nonce replacement path:
To test this I've been performing an E2E test: Anvil with mining disabled, original poster tx, confirmation timeout, real same-nonce replacement, then resume mining and assert the receipt/nonce progression. So, for this scenario, this PR fixes the fee-bump half of F3, but needs the gas-estimation adjustment for the poster to actually submit the replacement. |
Anvil rejects eth_estimateGas with "nonce too low" when the same nonce is already pending, so replacements never reached eth_sendRawTransaction.
Assert the original pending tx is evicted and on-wire fees clear the ≥10% floor after mining resumes.
|
@jplgarcia Thanks for catching this — the fee bump was correct, but the real replacement path never reached eth_sendRawTransaction because Anvil rejected eth_estimateGas with the pending nonce (nonce too low). Addressed by scoping the change to the same-nonce replacement path: estimate gas without that nonce, pin the result on the replacement tx, and keep the existing ≥10% fee floor/bump. Also added an Anvil E2E along the lines of your repro: --no-mining → original poster tx → confirmation timeout → same-nonce replacement → mine → assert receipt/nonce progression (plus original eviction and on-wire fee floor). |
768dde0 to
9256c40
Compare
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.
bumped_replacement_feesintol1::eip1559and addfees_for_nonceso poster + flusher share one replacement policy.Test plan
cargo test -p sequencer --lib eip1559cargo test -p sequencer --lib submitter::posterbumped_replacement_fees(cargo test -p sequencer --lib recovery::flusher)submit_batches_replacement_clears_ten_percent_bump)