optimism icon indicating copy to clipboard operation
optimism copied to clipboard

Pending nonce doesn't update after sending tx

Open ex7ept opened this issue 3 years ago • 2 comments

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 ,

  1. Prepare an account with some ETH/ERC20 balance

  2. Call eth_getTransactionCount with param of the account, "pending" to the local node

  3. Transfer ETH/ERC20 out to another account using eth_sendTransaciont /eth_sendRawTransaction to the local node

  4. 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

ex7ept avatar Jun 22 '22 11:06 ex7ept

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.

smartcontracts avatar Jun 25 '22 00:06 smartcontracts

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

tynes avatar Jun 27 '22 21:06 tynes