fix: correct speed-up eligibility for pending transactions#41444
fix: correct speed-up eligibility for pending transactions#41444vinistevam merged 8 commits intomainfrom
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…sk/metamask-extension into vs/fix-speed-up-queued-tx
Builds ready [be0677d]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 3 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [12cc96f]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [da00736]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [6c668b8]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|
|
Builds ready [3410401]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|



Description
CONF-1116 — pending transactions in Activity sometimes showed Queued with no Speed up, even when lower nonces were already confirmed.
On the Activity tab, when several transactions were submitted with low gas, only the first stayed Pending with Speed up and Cancel. Later pending transactions were shown as Queued and Speed up was hidden, even when earlier nonces had already confirmed.
Problem
selectLocalTransactionscan include confirmed locally originated transactions (not only pending).useEarliestNonceByChainwas taking the minimum nonce over all of those groups. A confirmed entry at a lower nonce kept the “earliest nonce” map stale, so higher pending nonces no longer matchedisEarliestNonce, which drives queued vs pending UI and speed-up visibility.Solution
useEarliestNonceByChainnow only considers groups whoseprimaryTransaction.statusis inPENDING_STATUS_HASH(same idea asnonceSortedPendingTransactionsSelectorin the legacy transaction list).ActivityListpasses the fulllocalTransactionslist unchanged; filtering lives in the hook so the list stays dumb and the hook stays the single place that defines “earliest pending nonce per chain.”Note on expected vs on-chain behavior
If two transactions are both pending with different nonces (e.g. 395 still in mempool and 396 submitted after), Ethereum processes them in order; only the lowest pending nonce is meaningfully “active” for replacement / speed-up. The bug we fixed is when the UI treated a higher nonce as queued because a non-pending lower nonce was still counted. If product truly wants Speed up on every row regardless of nonce order, that would be a separate product/UX change.
Changelog
CHANGELOG entry: Fixed Activity tab Speed up and pending status using the wrong earliest nonce when completed local transactions were still in the list
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1116
Related discussion: Activity v2 PR review
Manual testing steps
Screenshots/Recordings
3x-speed-up-tx.webm
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Small, well-tested change to a single UI hook that only adjusts filtering logic for nonce selection; main risk is subtle UI behavior changes if any status mapping is incorrect.
Overview
Fixes earliest-nonce calculation used by Activity speed-up/queued UI by updating
useEarliestNonceByChainto only consider transaction groups whoseprimaryTransaction.statusis pending (viaPENDING_STATUS_HASH), ignoring confirmed groups that may still be present for display.Updates and expands
useEarliestNonceByChaintests to use a sharedbuildGrouphelper and to cover confirmed-only lists and pending-vs-confirmed mixes (including treatingunapproved/approvedas pending).Reviewed by Cursor Bugbot for commit 3410401. Bugbot is set up for automated code reviews on this repo. Configure here.