Post
Topic
Board Development & Technical Discussion
Re: A question about miners choosing fork.
by
o_e_l_e_o
on 20/05/2023, 07:48:19 UTC
For some reason, I thought it was the mean of the last 11 blocks.
As far as I understand, the reason median is used is because it guarantees that the lower bound never goes backwards. With each new block found it either advances, or doesn't change. If the mean was used, then there is the possibility that the minimum timestamp could move backwards.

If the last block of one epoch is not the first of the next, then I can see the opportunity for the epoch duration to be continuously manipulated by always jumping back in time for the first block of the epoch.
Thanks to an off-by-one error, not only is the last block of one epoch different to the first block of the next epoch, but actually the time it took to mine the first block of every epoch is not taken in to account whatsoever when calculating the difficulty.