0

I am running loads of transactions in a private POA network, even a few per seconds. The nonces are being managed by a specific service. The issue I encountered was that one sealer somehow didn't manage to mine a transaction (it wasn't reverted) and the next 40-50 transactions were staying in pending tx pool, due to the nonce gap. My question is what would web3.eth.getTransactionCount(sender_address, 'pending') return in this case? The nonce of the unprocessed transaction or NUMBER_OF_MINED_TX_FOR_SENDER + PENDING_TX_COUNT_FOR_SENDER? Or something else?

Thanks in advance

2
  • Maybe it's a good idea to split your question into 2 questions. – Daniel Luca CleanUnicorn Feb 18 at 13:59
  • Done, thank you – 3DLures Feb 18 at 15:13
0

If there is a nonce gap, the call will not take those transactions into consideration.

This means, that a call to:

web3.eth.getTransactionCount(sender_address, 'pending')

Will return NUMBER_OF_MINED_TX_FOR_SENDER + PENDING_TX_COUNT_FOR_SENDER only for the transactions that have sequential nonces, without any gap.

But it will take into consideration the not mined transactions that have sequential, non-gapped nonce.

1
  • Thank you for confirming this. – 3DLures Feb 19 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.