Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonce too low #1791

Closed
pathornteng opened this issue Oct 5, 2023 · 9 comments
Closed

Nonce too low #1791

pathornteng opened this issue Oct 5, 2023 · 9 comments
Assignees
Labels
bug Something isn't working limechain

Comments

@pathornteng
Copy link

Description

I received this error report and sometimes experience it myself from time to time, but I cannot come up with steps to reliably reproduce the problem. It’s worth keeping an eye on it. It might be caused by caching issue.

{"jsonrpc":"2.0","id":67,"error":{"code":32001,"name":"Nonce too low","message":"[Request ID: 83883bf1-cb09-440c-8acd-791b68693dea] Nonce too low. Provided nonce: 81, current nonce: 81"}}

Steps to reproduce

The problem could happen when submitting a number of transactions through JSON RPC relay.

Additional context

No response

Hedera network

mainnet, testnet, previewnet

Version

v0.32.0

Operating system

None

@pathornteng pathornteng added the bug Something isn't working label Oct 5, 2023
@nubeasado
Copy link

nubeasado commented Oct 5, 2023

I've received this error twice, both times using the thirdweb testnet json-rpc in metamask. The error message would appear in metamask and state the transaction had failed in the history, however when viewed on hashscan the transaction succeeded.

e.g.
https://hashscan.io/testnet/transaction/1696365503.126657206

image

@Nana-EC Nana-EC changed the title Nounce too low Nonce too low Oct 6, 2023
@Nana-EC
Copy link
Collaborator

Nana-EC commented Oct 6, 2023

@pathornteng thanks.
Looking into this it seems the actual transaction failed from consensus with the wrong nonce.
This may occur at high TPS of execution as there's an initial check based on mirror node data before submission that passed.
You can see the failed transaction here https://hashscan.io/testnet/transaction/1696414144.138337003
Will dig in a bit further to see.

If the flow is a low TPS scenario please let us know as that might suggest something else.

@Nana-EC
Copy link
Collaborator

Nana-EC commented Oct 6, 2023

I've received this error twice, both times using the thirdweb testnet json-rpc in metamask. The error message would appear in metamask and state the transaction had failed in the history, however when viewed on hashscan the transaction succeeded.

e.g. https://hashscan.io/testnet/transaction/1696365503.126657206

image

@nubeasado I'm not sure if the issue you are noting is the same as here as you can see the nonces in your case differ. It seems the transaction provided has a nonce of 1 whiles the accounts nonce is 2.

Occasionally we have seen Metamask act a bit weird, in which case an account activity and nonce reset usually helps.
Can you review metamasks official instructions and give it a try - https://support.metamask.io/hc/en-us/articles/360015488891-How-to-clear-your-account-activity-reset-account

If you still see this try other relay options https://docs.hedera.com/hedera/core-concepts/smart-contracts/deploying-smart-contracts/json-rpc-relay
If the problem is only with thirdweb you might want to check with them for more details.

@Nana-EC
Copy link
Collaborator

Nana-EC commented Oct 19, 2023

@konstantinabl is this the same as 1803?

@pathornteng
Copy link
Author

Another governing council also reported the same problem. The following is message from them.

I'm currently having unresolved issues with SmartContract execution on Hedera. The problem is that the 'Nonce too low' situation is not recovered as shown below.
The problem was that an unexpected transaction execution error occurred while testing a smart contract using the Hashio relay node. And from then on, the 'Nonce too low' error continuously occurs in all transaction executions. And what's worse is that there is no recovery from problematic situations.
As expected, there seems to be a problem controlling the nonce.
Below is the error log, please refer to it.

       should be able to deploy a contract:
     ProviderError: [Request ID: 5e6ee1ed-17b8-4631-8799-026be754d628] Nonce too low. Provided nonce: 24, current nonce: 24
      at HttpProvider.request (/Users/moojin/workspace/hscs_example/node_modules/hardhat/src/internal/core/providers/http.ts:88:21)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at HardhatEthersSigner.sendTransaction (/Users/moojin/workspace/hscs_example/node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:125:18)
      at ContractFactory.deploy (/Users/moojin/workspace/hscs_example/node_modules/ethers/src.ts/contract/factory.ts:111:24)
      at module.exports (/Users/moojin/workspace/hscs_example/scripts/deployContract.js:33:19)
      at Environment._runTaskDefinition (/Users/moojin/workspace/hscs_example/node_modules/hardhat/src/internal/core/runtime-environment.ts:358:14)
      at Environment.run (/Users/moojin/workspace/hscs_example/node_modules/hardhat/src/internal/core/runtime-environment.ts:191:14)
      at Context.<anonymous> (/Users/moojin/workspace/hscs_example/test/rpc.js:38:15)

@Nana-EC
Copy link
Collaborator

Nana-EC commented Nov 7, 2023

Thanks @pathornteng
We're aware of the issue and exploring the appropriate fix.
As a workaround clients may modify their nonce appropriately to submit their transaction with a nonce 1 unit higher than the current nonce.
FYI @stoqnkpL

@pathornteng
Copy link
Author

Thank you @Nana-EC for the confirmation and workaround.

@stefan-stefanooov
Copy link
Contributor

I'll drop this just for information purposes.
This is the PR that should fix the issue. It's still in review.
Will close this issue when it is merged.

@stefan-stefanooov stefan-stefanooov moved this from In Progress to In Review in Smart Contract Sprint Board Feb 7, 2024
@stefan-stefanooov stefan-stefanooov moved this from In Review to In Progress in Smart Contract Sprint Board Feb 7, 2024
@stefan-stefanooov stefan-stefanooov moved this from In Progress to In Review in Smart Contract Sprint Board Feb 8, 2024
@stefan-stefanooov stefan-stefanooov moved this from In Review to Done in Smart Contract Sprint Board Feb 14, 2024
@georgi-l95
Copy link
Collaborator

This fix is on previewnet already, closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working limechain
Projects
Archived in project
Development

No branches or pull requests

5 participants