I am trying to understand how do transactions are actually ordered within a block. I have found something strange specifically which confuses me:

  • Txid 1: 0xab144b6bf8aa7fb6a5927a26a0e556607d33612de814909399fade591f1ef212
  • Txid 2: 0x5e910ca9fea65438c0844b8a397233d4a2663b58af2ca683f3732570fed58f82

These two smart contracts have swapped the same coin within the same block using the same router; Txid 1 has position 1 within the block, while Txid 2 has position 9 in the same block. Nonetheless, Txid 1 has given as input a lower max and priority gas respect to Txid 2.

How is this even possibile? Thanks.

  • The protocol doesn't define a specific order. The block proposer could order them in any way they want.
    – Ismael
    Oct 24, 2022 at 6:45

1 Answer 1


The validator is the one that decides the tx ordering. If it was a swap in a DEX maybe there is something like an MEV sandwich attack. You can read more about it here.

The take away: the block proposer decides the ordering.

Side note: A proposer is the node that proposes the block to be validated by the network.

  • I know. I am sure it was not a sandwich attack, neither the transaction was 'manipulated' - as when it happens I see within the transaction some ETH moving to Validators/staking pools which "support MEV democratization"
    – Skid11
    Oct 17, 2022 at 18:22

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.