I have a decentralised application deployed on RSK, and has been working for several months. Everything works correctly using the public node, however infrequently, we start getting a totally random error:
Unknown Error: {
"jsonrpc": "2.0",
"id": 2978041344968143,
"error": {
"code": -32010,
"message": "transaction nonce too high"
}
}
There is no information about “too high” nonces but many threads about “too slow”. I’m using web3.Contract.method.send()
.
In the MetaMask, Go to Settings > Advanced > Reset Account. This will reset the Nonce count associated with your wallet to 0 by clearing all previous transaction history stored in the cache of your browser. The next transaction that you initiate will be Nonce 0 and will be executed first.
Step-1: Go to your account on the top right corner of your MetaMask extension and click on Settings. Step-2: Under Settings, click on Advanced Settings. Then find the setting that says: “Customize transaction nonce” Turn this on to change the nonce (transaction number) on confirmation screens.
The nonce is the number of transactions sent from a given address. In English, a nonce is a number that can only be used once. In cryptography, a nonce is a one-time code selected in a random or pseudo-random manner that is used to securely transmit a main password, preventing replay attacks.
In Metamask, ensure you are on your dev/test account then:
1 click on the avatar circle top right 2 In the menu, choose Settings 3 Click Advanced 4 Scroll down a bit, make sure again you are on your testnet account, click Reset Account
There is a limit on the number transactions the same address can have on the transaction pool.
This limit is 4 for RSK,
and is defined within TxValidatorNonceRangeValidator
within the rskj code base:
BigInteger maxNumberOfTxsPerAddress = BigInteger.valueOf(4);
Note that Ethereum has a similar limit, but the limit that is configured in geth is 10. So if we have already sent 4 transactions, that have not been mined yet, and send a 5th transaction before the next block is mined, it will get an error that the nonce is too high. If a block was mined and it had let's say all 4 of the transactions, then we would be able to add up to 4 transactions for the next block.
Workarounds
(1) Send no more than 4 transactions from an address, until there is a new block.
(2) Aggregate all of the calls and then use a contract that executes them in a single go.
An example of this is seen in
RNS Batch Client ExecuteRegistrations
.
For me it happened when i restarted the node, following instruction fixed it:
Open up your MetaMask window and click on the icon in the top right to display accounts. Go to Settings, then Advanced and hit Reset Account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With