1

I found position index referring the order of txs within a block. Txs are executed in order from position 1 to the end. Is there any correlation btw the position(order of txs) and the nonce of txs?

For example, here are 3 txs from same EOA with the nonce 1~3. Should the order of positions match the order of nonces in each tx? Or is it okay if the order is different as long as there are no nonces missing ? Please see the below case. Will tx2 success?

txs in the same block

tx1: nonce 1, position 1

tx2: nonce 3, position 2 --> success?

tx3: nonce 2, position 3

1 Answer 1

0

tx2 will not succeed. The nonce3 tx must come after the nonce2 tx.

It is an invalid block for the nonce3 tx to come before the nonce2 tx. No rational miners will create such a block, because no other miner will build on it.

Should the order of positions match the order of nonces in each tx?

For clarity, it doesn't have to match 1:1. tx3 could be in position 30 and tx2 in position 40, and that would be fine.

2
  • It seems the miners should be careful when creating the block since the the order of positions match the order of nonces of txs from same EOA. What if the consensus of ethereum handles ordering of txs on behalf of miners although the txs in the block are not sorted by nonces?
    – lagoiz
    Commented Jan 10, 2022 at 5:52
  • @lagoiz Unmodified clients and miners will not accept blocks where the nonces are incorrectly sorted. Did I understand your question?
    – eth
    Commented Jan 14, 2022 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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