bitcoin-dev
BIP for Testnet 4
Posted on: May 28, 2024 23:41 UTC
The recent amendment to the Block Storm Fix introduces a critical clarification regarding the calculation of work required for the first block in a new difficulty period.
Previously, the difficulty of the last block in the previous period was used as the base for this calculation. However, the update specifies that if the last block's difficulty is 1, a reverse search through the blocks of the previous period is conducted until a block with a different difficulty is found. This encountered difficulty level then serves as the actual network difficulty for calculating the new difficulty level.
Moreover, it emphasizes that the first block in a new difficulty period should reflect the actual difficulty of the network, regardless of whether other blocks were mined under the 20-min rule, which previously allowed for adjustments in mining difficulty within a shorter timeframe. This rule cannot be applied to the first block in a new period, ensuring consistency in how difficulty is assessed at the beginning of each period.
Finally, the clarification points out that while the actual difficulty used for calculations might come from any block within the previous period, the timestamp of the last block is always used as the end time for that difficulty period. This detail ensures a consistent and precise measurement of time intervals between difficulty adjustments, maintaining the integrity and predictability of the mining process.