[Ethereum] How do miners decide which block should be an ommer block

mininguncle-blocks

Let's say there is a fork and there are two valid blocks. How do the miners choose which block to work on if they receive both the valid blocks at the same time(Is this possible?)? After this decision, one block becomes the ommer block and won't be placed on the main chain. What parameters are considered during this decision?

Also, how long does it take (how many blocks) for a fork to generally get resolved in the Ethereum public blockchain network?

Best Answer

Yes, it is possible because the miner's won't necessarily know the other has found a solution. The news of these discoveries spreads via gossip, so there is always latency.

A very short summary of the way this is resolved is that nodes favor the longer of the two chains. It has more proof of more work. It's a little counter-intuitive so it bears mentioning that there is no loss of transaction data when a block doesn't make it into the consensus chain.

Related Topic