MetaMask / MetaMask/metamask-extension

[Bug]: Transactions - Sending a tx with higher nonce makes the tx remain with status `Signed` and blocks the wallet for sending tx's in all networks

Open
#27,824 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bugs---Low-Priority INVALID-ISSUE-TEMPLATE Sev2-normal team-confirmations type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

Describe the bug

When I try to send a transaction with a higher nonce than the suggested one, using a local network (ganache) I see that the transaction remains in a Signed status and MM loading.
If I refresh and I try to send a transaction I cannot do it since I see the error A previous transaction is still being signed or submitted. After that, even if I change networks and try to send a transaction in a different network I see the same error and the wallet is stuck. For this reason I added a sev1 label, as there is no way of getting out of this state, unless you terminate the local network (this might not be an option to the users if this happens with a network they are not controlling)

This explains the behaviour I was seeing here: https://github.com/MetaMask/metamask-extension/pull/27561#issuecomment-2402731232 combined with another bug, where the nonce is not updated after switching networks (I'm currently trying to find repro steps for this one).

Smart transactions are disabled.

Expected behavior

In 12.3.1, this Signed transaction is discarded once we switch networks, unblocking the wallet from this state. Should we aim something similar?

Screenshots/Recordings

https://github.com/user-attachments/assets/c180ea5a-38b6-44d9-b21f-d109eed01e1e

See how in 12.3.1, this Signed transaction is discarded after switching networks, unblocking the wallet from this state and allowing to perform transactions in different networks.

https://github.com/user-attachments/assets/c153350d-791f-4513-95a3-1c8f359d9233

Steps to reproduce

  1. Run ganache in a local server
  2. Import localhost
  3. Start a transaction
  4. Customize the nonce to a higher value than expected
  5. Confirm
  6. See how MM stays loading and transaction remains in Signed state
  7. Refresh
  8. Switch networks
  9. Try to send a tx on another network
  10. See it's not possible as you get the error A previous transaction is still being signed or submitted

Detection stage

In production (default)

Version

12.4.0

Build type

None

Browser

Chrome

Operating system

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the higher-nonce transaction flow on a Ganache local network, then compare how the Signed transaction is handled before and after switching networks, including the behavior described for version 12.3.1. Done means the wallet no longer remains blocked after this failure and can send transactions on another network.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.