Also, the current rules is essentially "undefined behavior"; it says to miners to mine on the first they recieved. However, miners may very well choose to accept the most accurate block, and it would not fork the chain, so they are totally free to choose what they want.
I never realized that. Thank you. I guess I assumed it was the block with the highest value (transactions) or some other tiebreak. So a miner may collect 2-3 blocks found at the same time, but will keep working on the one they heard about first. As soon as someone finds a 2nd block, the one they were working on becomes the "real" block since they have a longer chain and the other blocks are now orphaned.
If two miners working on different blocks also find 2nd blocks at the same time, they keep mining separate chains until someone first finds a 3rd block for one of those two chains?
Thanks for the education.
No, the current rule is really "You mine on the first topmost valid block you recieved", which means three things can happen:
a) You find another block, you broadcast it to the network; it becomes the longest chain.
b) Somebody else finds another block after the block you were working on, it becomes the longest chain and you start mining on that block.
c) Somebody else finds another block on top of another block as equally valid as the one you were working on, you discard your block and accept that chain as the new longest, and mine on top of it.
And yes, in the unlikely case another block was found simultaneously on both chains, both of them would continue to coexist.
But it must be noted that "simulteneaously" is relative here. Two blocks cannot be found at the exact same time. However, accounting network latency, it takes about 1 min for all the nodes to be aware of a new block, in that timeframe, if another block is found, some part of the network may hear about that other block first.
Finally, it must be be noted that work spent on those "alternate" chain is completely lost. Once a block is orphaned, nobody can claim it's reward. And since a potentially large fraction of the network spent time mining on blocks that were, ultimately, discarded, the apparent hashrate of the longest chain is diminished, which means, slower confirmations, and difficulty decrease.