And another one!
It was another Stale -
but I'll leave it marked as an Orphan.The winning block by btc.com was from inside China and was also slow getting out - I get the impression that even the Fibre Relay isn't always very fast at getting blocks out of China either.
The 2 nodes we have inside China for block propagation were even on opposite sides of the orphan fork to each other.
Everything we have outside China was on our side of the orphan race, but I'd guess that most other pools were also working against us due to the share being stale.
What happened this time, is that the code in ckpool that calls the precious block function that I harassed the core devs about
actively switched us to our stale block.
The idea behind this is that if we get a stale block a few seconds after the network has seen a block, we'll switch to it instead.
Our chances of winning the orphan race then end up being directly related to our % size of the bitcoin network (and getting a double block), since no other pool will be working on our stale block.
It doesn't matter which side of a single level orphan race you are working on, coz it's only the next block that matters, so in this case we were hoping to get a double block and thus win the orphan race and get everyone else on bitcoin to switch to our block(s) but alas we didn't get a double to make it happen
In general it's actually a pretty bad idea to do this for the sake of network convergence, but considering some of the worse things done on other pools with empty blocks and SPV/SPY mining, it's certainly not the worst thing we could do, and we can win a double block once in a blue moon (instead of it being a stale block that effectively should count as nothing since it shouldn't really exist)
Edit: and just to make it clear about it being stale, we switched to the btc.com block at 10:16:43 UTC, and the stale share arrived at 10:16:47 UTC so we switched to that stale block then.
Edit: I'll add a little explanation about Stale vs Orphan in case any don't understand the difference:1) an Orphan race is when 2 pools mine a block at 'effectively' the same time.
What happens with any block is that one pool gets a block, process it, then send it out onto the network, then everyone out there gets it and switches to it.
The reason an Orphan can happen is that there is a delay between when a pool know's one of it's miners found a block and when the rest of Bitcoin knows about it.
This delay is a list of things: time for the miner to send the share to the pool + time for the pool to validate the share and submit the block to it's bitcoind + time for the bitcoind to process the block + time for the bitcoind to distribute the block to other pools.
During this delay, another pool could also find a block - thus you get an orphan race.
Our aim is of course to minimise our length of that delay which we do in multiple ways:
Faster bitcoind than others, faster block distribution than others via nodes near all the Fibre Relay points, lots of nodes to help distribute the blocks around the world if the Relay is slow or not working, and nodes in China to help get our blocks past the GFW faster.
2) a Stale block is when a miner finds a block after the pool has already switched to a new block.
The reasons are any of: the miner is slow to send the share to the pool due to however the miner works (this isn't uncommon), the miner is slow to send it to the pool due to a slow network or a distant network, the pool was slow switching blocks and sending new work to the miner, or again the miner network is slow getting new work or distant getting new work.
Stales basically count as nothing and under normal circumstances should just be ignored. However with the addition of the preciousblock command in bitcoind (or if the pool wrote their own version of the same in the past as many already did) you can turn a stale into a block if you get a 2nd block on top of the stale block before anyone else on the network gets the block on top of the network block at the same height as your stale.