Skip to content

client/asset/eth: enforce RBF floors when bumping tx fees#5

Open
peterzen wants to merge 1 commit into
masterfrom
evm-bump-rbf-floor
Open

client/asset/eth: enforce RBF floors when bumping tx fees#5
peterzen wants to merge 1 commit into
masterfrom
evm-bump-rbf-floor

Conversation

@peterzen

@peterzen peterzen commented Jul 3, 2026

Copy link
Copy Markdown
Owner

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.

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]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rbfReplacementFloor helper to compute the strict geth RBF floor for fee cap and tip cap (PriceBump% + strictly greater).
  • Apply RBF floors in userActionBumpFees, including ensuring feeCap >= tipCap after 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.

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.

2 participants