MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12k stars 4.91k forks source link

[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 #27824

Open seaona opened 2 weeks ago

seaona commented 2 weeks ago

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

Error messages or log output

No response

Detection stage

In production (default)

Version

12.4.0

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

Gudahtt commented 2 weeks ago

The "infinite load after submitting a higher nonce on Ganache/localhost" issue shown in both before and after cases is covered by this separate bug: https://github.com/MetaMask/metamask-extension/issues/21259