Skip to content

Ethers JSON RPC provider doesn't return correct nonce when used with hardhat #4549

@valeriivanchev

Description

@valeriivanchev

Ethers Version

6.8.1

Search Terms

nonce, provider doesn't get correct nonce,

Describe the Problem

Hi EthersJs Team,
We have a hardhat deployed inside a docker locally and we have tests that are connecting to the deployed hardhat and issue transactions. The provider we are using is JsonRpcProvider, when we issue multiple transaction one after the other sometimes the nonce is not correct. We also checked if we request the nonce from the hardhat network using the JSON-RPC request ("eth_getTransactionCount") and request the transaction count using the provider we get different outcomes.
Do you have some cache setup, because we are getting the nonce from the prev transaction.

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

Metadata

Metadata

Assignees

Labels

investigateUnder investigation and may be a bug.v6Issues regarding v6

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions