Does transaction with next nonce get mined only after transaction with current nonce confirmed, not just mined?

Viewed 169

When we send transactions with incremental nonce from a single account to Ethereum blockchain (public or private), for example we submitted very first two transactions with nonces 0 and 1:

Would the transaction with nonce 1 be executed only after transaction with nonce 0 was "confirmed" (meaning its block won't be orphaned), or after transaction with nonce 0 was merely mined (and then its block could become orphaned)? - In the latter case, there is a possibility that transactions with nonces 0 and 1 will end up in the reverse order on the blockchain, or only transaction with nonce 1 will be executed, while transaction with nonce 0 won't, which can undermine the original business intent of both transactions being in the intended sequence.

Generally, a transaction is considered "confirmed" after six block confirmations in public Ethereum. So the question boils down to: Does Ethereum wait for such confirmation for a transaction with a previous nonce in order to start processing transaction with the next nonce? (for example if these two transactions get into separate blocks). If it does, what confirmation threshold does Ethereum use for this?

1 Answers

Yes. Transactions will be ignored until the transaction with lower nonce is processed, no matter which one is broadcasted earlier to the network.

Below quotes is from the book "Mastering Ethereum" by Dr.Gavin Wood. Page 101 :

Without the nonce, it would be random as to which one gets accepted and which rejected. However, with the nonce included, the first transaction you sent will have a nonce of, let’s say, 3, while the 8-ether transaction has the next nonce value (i.e., 4). So, that transac‐ tion will be ignored until the transactions with nonces from 0 to 3 have been pro‐ cessed, even if it is received first. Phew!

Related