feat(p2p): reject and evict txs with insufficient max fee per gas#22118
Merged
PhilWindle merged 14 commits intomerge-train/spartanfrom Apr 22, 2026
Merged
feat(p2p): reject and evict txs with insufficient max fee per gas#22118PhilWindle merged 14 commits intomerge-train/spartanfrom
PhilWindle merged 14 commits intomerge-train/spartanfrom
Conversation
45746b9 to
809ca2f
Compare
0492bf0 to
17f5fca
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…f stale block header The gossip validator was checking tx maxFeePerGas against the last block's header fees, while the wallet and tx pool already use projected next-block fees from L1. When the L1 fee oracle transitions from high to low values (e.g. after a time warp in tests), this caused a large discrepancy where valid transactions were rejected at the gossip layer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nResult Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9f191d6 to
cffa74e
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eason Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merges TEST_DEFAULT_MIN_FEE_PADDING and E2E_DEFAULT_MIN_FEE_PADDING into a single DEFAULT_MIN_FEE_PADDING (set to 5). Adds LARGE_MIN_FEE_PADDING (15) for txs that may be mined much later (spartan benchmarks). Updates all e2e usages to call getPredictedMinFees instead of getCurrentMinFees. Reverts cli-wallet MIN_FEE_PADDING to its original value of 0.5. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PhilWindle
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The tx pool currently accepts transactions with
maxFeesPerGasbelow the current block fees, marking them asskippedto wait for lower fees. This fills the pool with low-fee txs unlikely to be mined. We need to reject them outright and evict existing txs that fall below the fee threshold after a new block.Original PR: #21281
Fixes A-878
Approach
Changes
GasTxValidatorto returninvalidinstead ofskippedfor txs below current fees. ExtractsMaxFeePerGasValidatoras a standalone validator. AddsInsufficientFeePerGasEvictionRulethat evicts pending txs after each block if their fees no longer meet the minimum.Changes
MaxFeePerGasValidatorextracted fromGasTxValidator,InsufficientFeePerGasEvictionRuleadded to tx pool evictionBlockMinFeesProviderinterface for providing min fees to the tx poolglobalVariableBuilderasBlockMinFeesProvidertocreateP2PClientBlockMinFeesProvider) in gossip validator instead of stale block header feesDEFAULT_MIN_FEE_PADDING=5,LARGE_MIN_FEE_PADDING=15for long-lived txs), switched fromgetCurrentMinFeestogetPredictedMinFeesMIN_FEE_PADDINGto original0.5