In a perfect scenario, maybe, but the network is not perfect. The mining pool also has to build a candidate block, calculate the Merkle root, and then update all its miners with the new candidate block hash. If the whole process genuinely took only 200ms, then we wouldn't see empty blocks at all. But it simply is not that quick. It takes a few seconds in the real world, and so we still occasionally see empty blocks being mined.
I initially had the same thoughts, but turned out i was wrong, the <200ms average isn't a random figure i invented it was reported by Kano from his own pool logs, his pool is one of the oldest pools and the data he reports is probably the most accurate you can find on the internet.
By the way, the figure includes EVERYTHING from knowing about the block to the moment the pool generates work for its miners, ya some will take over 200ms, some less, but the average is around that.
It takes less than 200ms from receiving a block in bitcoind, until it can produce a full new block template with transactions.
I have a message in debug.log when the block arrives with a timestamp to microseconds, another when it has been processed, and another when the pool has been sent the new work.
The
largest block in the last 8 hours was
631950 it was
1783877 bytes.
bitcoind debug.log shows (as I mentioned)
2020-05-27 19:07:53.985131 ProcessNewBlock
2020-05-27 19:07:54.025189 Pre-allocating up to position 0x3000000 in blk02094.dat
2020-05-27 19:07:54.107985 UpdateTip: new best=000000000000000000067af76e3e524beabb9557f71413d8db9b88760e445d3b height=631950 version=0x20002000 log2_work=91.982404 tx=533594598 date='2020-05-27 19:07:33' progress=1.000000 cache=36.9MiB(236180txo) warning='75 of last 100 blocks have unexpected version'
2020-05-27 19:07:54.108131 Block 000000000000000000067af76e3e524beabb9557f71413d8db9b88760e445d3b provided by 107.191.117.193:8333
2020-05-27 19:07:54.158265 GetBlockTemplate called
2020-05-27 19:07:54.160724 CNB
2020-05-27 19:07:54.174358 CreateNewBlock(): block weight: 3964486 txs: 122 of 10917 fees: 0.04177550 sigops 20166
Also of interest in this case, it had to extend some disk space for the block.
Total time from when it arrived until the pool got new work 19:07:54.174358 - 19:07:53.985131 = 189227 microseconds
189 millisecondsAs for empty blocks, the one I see in the last 8 hours is 631926 by
ViaBTCI'll include the block before as well for more information:
2020-05-27 16:36:48.892330 ProcessNewBlock
2020-05-27 16:36:48.913863 Leaving block file 2093: CBlockFileInfo(blocks=99, size=133620045, heights=631826...631924, time=2020-05-26...2020-05-27)
2020-05-27 16:36:48.914006 Pre-allocating up to position 0x1000000 in blk02094.dat
2020-05-27 16:36:48.950898 Pre-allocating up to position 0x100000 in rev02094.dat
2020-05-27 16:36:49.011947 UpdateTip: new best=00000000000000000010dab51e5208c538fce5634104fbd059da24140911efe7 height=631925 version=0x27ffe000 log2_work=91.981925 tx=533547943 date='2020-05-27 16:36:37' progress=1.000000 cache=14.5MiB(52565txo) warning='72 of last 100 blocks have unexpected version'
2020-05-27 16:36:49.012075 Block 00000000000000000010dab51e5208c538fce5634104fbd059da24140911efe7 provided by 107.191.117.193:8333
2020-05-27 16:36:49.071051 GetBlockTemplate called
2020-05-27 16:36:49.071136 CNB
2020-05-27 16:36:49.088969 CreateNewBlock(): block weight: 3964991 txs: 1933 of 17715 fees: 0.18324281 sigops 13534
2020-05-27 16:37:08.482568 ProcessNewBlock
2020-05-27 16:37:08.490710 UpdateTip: new best=0000000000000000000f1b87afb1b95a5e681736ea387b60a8bd150b1ec8bb30 height=631926 version=0x3fff0000 log2_work=91.981944 tx=533547944 date='2020-05-27 17:06:23' progress=1.000012 cache=14.5MiB(52772txo) warning='73 of last 100 blocks have unexpected version'
2020-05-27 16:37:08.568545 CreateNewBlock(): block weight: 3964339 txs: 1903 of 17821 fees: 0.21419789 sigops 13493
In this case firstly, you can see the block before, it was 20 seconds before it.
Secondly, in this case the work kano.is generated included 1933 transactions and fees: 0.18324281 BTC
However as can be seen from the next block on the block chain, it was only 315 bytes ... instead of our "block weight: 3964991"
(You'll have to check the 315 bytes number on any block explorer to see it's an 'empty' block)
i.e. our work that miners were working on was a full block, but
ViaBTC miners were working on an empty block when they found it.
It took 196639 microseconds to process i.e.
197 milliseconds... and of course it
didn't take
197 milliseconds longer than ViaBTC - they didn't process it in 0ms
You can run a bitcoind yourself and you can see this information - though you'll have to patch it and recompile it to display the extra information
I've been around in bitcoin since 2011 working on code related to it.
Working on mining code, pool code, and even simple patches to bitcoin itself.
Now if you think <200ms isn't worth it to mine empty blocks, you can read my post in the same topic explaining how it IS worth it for mining pools to invest those 200ms
There is 86400000ms in a day, and 144 blocks to be mined, so by utilizing 100ms every 10 mins you get a total of 14400ms which is 0.0167% of the total 24 hours.
When a pool like F2pool saves 150ms for every potential block, that's 552510 terahash worth of mining, if that's hard to understand think of it this way.
When F2pool knows about a new block coming, and while going through that 150ms process they switch their hashrate to another PPS pool and say that is Viabtc, by the end of the day they would get paid $1500 from mining for 150ms every 10 mins or a total of 21.1 seconds a day with 22,100,420.00th worth of hash power, but instead of doing this, they would just mine to their own pool and still by the end of the day/week/month/year, they will theoretically make that same amount of money.
And it gets even better when you don't have to download the block in the first place when your pool is synced with the other pools via any other protocol and all you need is their hash (not even the block header) then that makes it well above 200ms, but even with these numbers F2pool can potentially make over half a million dollar in profit yearly, or otherwise, lose it if they use your code and not mine empty blocks.