If I check some specific block, for example: https://etherscan.io/block/12906346 I can see that the transactions are ordered within the block.
I would like to understand how that ordering is done.
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
A miner has the ability to choose the transaction ordering for the block they are attempting to mine however they want. (The only constraint I can think of is that if one address has multiple transactions submitted, the miner must order lower nonces first.) This has a number of interesting ramifications - Flashbots, for example, can (and do) request from miners that their bundles are ordered at the top of the block.
Here is an older question that looks at the default strategies for inclusion in a block. I do not know if the information there is still current, and even if it is, do not know that miners would be using default strategies, but figure it could be useful in giving some ideas about the potential options miners have when constructing a block.