Replace a transaction stuck at the same nonce, for a higher fee you approve #67

Merged
backmeupplz merged 2 commits from feat/replace-underpriced into main 2026-11-02 13:43:36 +00:00
Owner

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.

  • Dapp requests (background.ts): a second approval with the bumped fee.
  • Send screen (popup/main.ts): the review comes back with the bumped fee and the note above it.
  • Watch-only accounts are unchanged: they broadcast what the other device signed.
  • lib/chain.ts: underpriced() and bump(). viem fills gasPrice next to the EIP-1559 fields, so every fee field that's present goes up.
  • New string translated into all 23 languages.

Tested

  • npm test (new bump/underpriced asserts in test-android.js), tsc clean.
  • End to end on anvil with mining off, behind a proxy that hides pool transactions from the pending nonce the way mainnet.base.org does. A transaction waits at nonce 0. prepare → send is refused with replacement transaction underpriced, and underpriced() detects it. bump → send is accepted, and the pool now holds the new transaction at nonce 0 with fees ×1.25.

🤖 Generated with Claude Code

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. - **Dapp requests** (`background.ts`): a second approval with the bumped fee. - **Send screen** (`popup/main.ts`): the review comes back with the bumped fee and the note above it. - Watch-only accounts are unchanged: they broadcast what the other device signed. - `lib/chain.ts`: `underpriced()` and `bump()`. viem fills `gasPrice` next to the EIP-1559 fields, so every fee field that's present goes up. - New string translated into all 23 languages. **Tested** - `npm test` (new `bump`/`underpriced` asserts in test-android.js), `tsc` clean. - End to end on anvil with mining off, behind a proxy that hides pool transactions from the pending nonce the way mainnet.base.org does. A transaction waits at nonce 0. `prepare` → `send` is refused with `replacement transaction underpriced`, and `underpriced()` detects it. `bump` → `send` is accepted, and the pool now holds the new transaction at nonce 0 with fees ×1.25. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Replace a transaction stuck at the same nonce, for a higher fee you approve
Some checks failed
Store release / select-stores (pull_request) Has been skipped
Store release / build (pull_request) Has been cancelled
Store release / build-apple (pull_request) Has been cancelled
Store release / github-release (pull_request) Has been cancelled
Store release / submit-apple (pull_request) Has been cancelled
Store release / report (pull_request) Has been cancelled
b3631830f2
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>
Release 0.5.9
All checks were successful
Store release / select-stores (pull_request) Has been skipped
Store release / build-apple (pull_request) Successful in 1m22s
Store release / build (pull_request) Successful in 1m48s
Store release / github-release (pull_request) Has been skipped
Store release / submit-apple (pull_request) Has been skipped
Store release / report (pull_request) Has been skipped
3fff914fc5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
backmeupplz deleted branch feat/replace-underpriced 2026-11-02 13:43:36 +00:00
Sign in to join this conversation.
No description provided.