You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In development for MetaMask or Smart Contracts I am constantly restarting my local dev node which resets the nonce. And when I try to use MetaMask after, I am forced to go into settings and Reset Account.
Steps to reproduce
Use ganache for local dev
Make a tx with metamask on localhost
restart ganache
try to make another tx with metamask on localhost
Error messages or log output
No response
Version
10.20.0
Build type
No response
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
The reason this behavior exists is because when submitting to Infura (a load balanced cluster), each node might return a different nonce (since they might be aware of different pending transactions). This is why we cache local txs, and use the greatest nonce of our local + RPC views.
If we wanted to ignore the local tx cache, it might have to be some special case, like
It is worth noting that MetaMask has improved error message for this issue now: Nonce too high. Expected nonce to be 0 but got 90 (90 represents the nonce used on the network before restart.)
The reason this behavior exists is because when submitting to Infura (a load balanced cluster), each node might return a different nonce (since they might be aware of different pending transactions). This is why we cache local txs, and use the greatest nonce of our local + RPC views.
If we wanted to ignore the local tx cache, it might have to be some special case, like
a per RPC setting
Only for localhost?
I would like to see another option:
a per-account settings
This will be handy when using one of the accounts that are pre-generated by HardHat, Ganache, etc., testing blockchains. Usually, 10 accounts are pre-generated at the testing blockchain startup. Once a developer marks an account as testing, they will be able to send transactions even after network restart (meaning destroy & recreate).
Describe the bug
In development for MetaMask or Smart Contracts I am constantly restarting my local dev node which resets the nonce. And when I try to use MetaMask after, I am forced to go into settings and
Reset Account
.Steps to reproduce
Error messages or log output
No response
Version
10.20.0
Build type
No response
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: