Replace a transaction stuck at the same nonce, for a higher fee you approve #67
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
backmeupplz/plainwallet!67
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/replace-underpriced"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Collecting a cast on Base failed with
replacement transaction underpriced. A transaction from the account waited at nonce 528 in a node behind mainnet.base.org, which didn't count it in the pending nonce. So every retry signed nonce 528 at the same fees and was refused.Now: when a broadcast is refused as underpriced (
replacement transaction underpriced/replacement fee too low), Plain Wallet prepares the same transaction with 25% more on every fee field (nodes need ≥10%) and asks again. The approval shows the new max fee and the note "Another transaction from this account is waiting with the same nonce. This one takes its place, for a higher fee." Nothing is signed at a fee you didn't see. Up to 3 bumps, then the error goes to the site.background.ts): a second approval with the bumped fee.popup/main.ts): the review comes back with the bumped fee and the note above it.lib/chain.ts:underpriced()andbump(). viem fillsgasPricenext to the EIP-1559 fields, so every fee field that's present goes up.Tested
npm test(newbump/underpricedasserts in test-android.js),tscclean.prepare→sendis refused withreplacement transaction underpriced, andunderpriced()detects it.bump→sendis accepted, and the pool now holds the new transaction at nonce 0 with fees ×1.25.🤖 Generated with Claude Code
A node refuses a transaction whose nonce is already taken by one waiting in its pool ("replacement transaction underpriced"), and some RPCs, mainnet.base.org among them, don't count that one in the pending nonce, so every retry hits it again. Now the wallet offers the same transaction again with 25% more on each fee field and asks before signing it, in dapp approvals and the Send screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>