The transactions to mine are selected given a process that is absolutely specific to each client but even more to each miner. Indeed the transaction (tx) selection and sorting process is not part of Ethereum protocol. That is, miners can decide to select and sort transactions the way they prefer.
However, miners are mainly incentivised by earning money (...
Miners have compete latitude to include or ignore any transactions they like, in almost any order. The only invariant is that transactions emitted from a given EOA must be mined in account once order.
Miners will probably select transactions with the highest gas price and pack blocks with the most gas allowed. That usually happens.
Hope it helps.
The answer is whatever one the miner wants first. A miner could choose a tx with a gasPrice of 0.5 Gwei and not include either of the 1 Gwei transactions.
Most mining clients will optimize for profit (highest gasPrice). In the case of two transactions with identical profit, the client will likely choose the transaction that was broadcast first.
Ethereum is a protocol specification, not an implementation.
There are, of course, discrete elements of the protocol such as node discovery, transaction propagation and consensus about transaction blocks, and more - each is handled in its own fashion. It would be over-simplifying to say there is only one simple process going on.
Most aspects of the ...