client/asset/eth: enforce RBF floors when bumping tx fees#5
Open
peterzen wants to merge 1 commit into
Open
Conversation
The tooCheap bump action recomputed replacement fees from current network conditions only, never consulting the transaction being replaced. When the provider's tip-cap suggestion is cached (1 hour TTL), the replacement could carry the exact tip the original was created with, guaranteeing rejection by geth-family mempools, which require both the fee cap and tip cap to be strictly greater than, and at least 10% above, the old values. Raise both components to at least their replace-by-fee floors relative to the transaction being replaced. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR fixes EVM transaction fee bumping for the actionTypeTooCheap (“bump stuck tx”) path by enforcing geth-family replace-by-fee (RBF) minimum bump rules on both EIP-1559 fee components, preventing deterministic “replacement transaction underpriced” rejections when network fee suggestions are stale/cached.
Changes:
- Add
rbfReplacementFloorhelper to compute the strict geth RBF floor for fee cap and tip cap (PriceBump% + strictly greater). - Apply RBF floors in
userActionBumpFees, including ensuringfeeCap >= tipCapafter adjustments. - Add unit tests covering floor math and the bump behavior when existing tx fees exceed current network recommendations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| client/asset/eth/eth.go | Adds RBF floor logic and applies it during fee bumping to satisfy geth replacement acceptance rules. |
| client/asset/eth/eth_test.go | Adds tests validating the floor calculation and ensuring bumped tx opts honor RBF floors for both fee components. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fixes the "replacement transaction underpriced" failure when bumping a stuck EVM transaction via the tooCheap action.
The bump recomputed fees from current network conditions only. With the provider tip-cap suggestion cached for up to an hour, the replacement could carry the exact same tip as the original tx, which geth-family mempools deterministically reject (both fee cap and tip cap must be strictly greater and >=10% above the old values).
The fix raises both fee components to at least their replace-by-fee floors relative to the tx being replaced. Applies to all EVM-family wallets (eth, polygon) since the implementation is shared. Observed in production on a Polygon USDC swap that stayed stuck through repeated bump attempts.