optimism
optimism copied to clipboard
Pending nonce doesn't update after sending tx
Describe the bug The eth_getTransactionCount result did not update after a tx broadcast, even confirmed.
To Reproduce Steps to reproduce the behavior: Set up a local node ,
-
Prepare an account with some ETH/ERC20 balance
-
Call eth_getTransactionCount with param of the account, "pending" to the local node
-
Transfer ETH/ERC20 out to another account using eth_sendTransaciont /eth_sendRawTransaction to the local node
-
Call eth_getTransactionCount with param of the account, "pending" to the local node
Now you would found the call result of 4th step is the same as 2nd step call result.
You can code 2nd, 3rd, 4th steps into a code snippet for easier reproducing it. You would see Expected behavior The 4th step eth_txCount call result would returned +1 value based on the 2nd step eth_txCount Call.
System Specs:
- OS: Ubuntu 20.04.2 LTS x86_64
- l2geth:0.5.21
- data-transport-layer:0.5.35
Nodes currently do not maintain a pending state, so this behavior is expected. We're fixing this in Bedrock by re-introducing the concept of pending state.
This could be a latency issue, if right after submitting a transaction the nonce doesn't increment then it means that the transaction is still propagating throughout the network