Implement Difficulty Freeze
The EIP-2515 proposal suggests implementing a Difficulty Freeze as an alternative to the current Difficulty Bomb in Ethereum's difficulty adjustment algorithm. The Difficulty Freeze would begin at a predetermined block height and freeze the difficulty, increasing by 1% after that block indefinitely. This would incentivize developers to upgrade regularly and require any chain split to address the difficulty freeze. The proposal argues that the current difficulty bomb is complex to model and has negatively affected miners and users in the past. The Difficulty Freeze would be more predictable and the consequences of missing it would be more directly felt by client maintainers, who are better positioned to respond to it. The proposal includes adding a variable for DIFFICULTY_FREEZE_HEIGHT and defines the logic of the Difficulty Freeze. An optional implementation includes adding the variable DIFFICULTY_FREEZE_DIFFERENCE and using LAST_FORK_HEIGHT to calculate when the Difficulty Freeze would occur.
Video
Original
Simple Summary
The difficulty Freeze is an alternative to the Difficulty Bomb that is implemented within the protocols difficulty adjustment algorithm. The Difficulty Freeze begins at a certain block height, determined in advance, freezes the difficulty and increases by 1% after that block forever. This does not stop the chain, but it incentivizes devs to upgrade at a regular cadence and requires any chain split to address the difficulty freeze.
Abstract
The difficulty Freeze is a mechanism that is easy to predict and model, and the pressures of missing it are more readily felt by the core developers and client maintainers. The client maintainers are also positioned as the group that is most able to respond to an incoming Difficulty Freeze. This combined with the predictability is more likely to lead to the timely diffusual of the bomb.
Motivation
The current difficulty bombs' effect on the Block Time Targeting mechanism is rather complex to model, and it has both appeared when it was not expected (Muir Glacier) and negatively affected miners when they are not the target (in the case of delaying forks due to technical difficulties). Miners are affected by a reduction in block rewards due to the increase in block time. Users are affected as a function of the usability of the chain is affected by increased block times. Both of these groups are unable on their own to address the difficulty bomb. In the case of the Difficulty Freeze, the consequences of missing it are more directly felt by the client maintainers and it is more predictiable and so knowing when to make the change is readily apparent.
Specification
Add variable DIFFICULTY_FREEZE_HEIGHT
The logic of the Difficulty Freeze is defined as follows:
if (BLOCK_HEIGHT <= DIFFICULTY_FREEZE_HEIGHT):
block_diff = parent_diff + parent_diff // 2048 * max(
1 - (block_timestamp - parent_timestamp) // 10, -99)
else:
block_diff = parent_diff + parent_diff * 0.01
Optional Implementation
Add the variable DIFFICULTY_FREEZE_DIFFERENCE
and use the LAST_FORK_HEIGHT
to calculate when the Difficulty Freeze would occur.
For example we can set the DFD = 1,800,000 blocks
or approximately 9 months. The Difficulty Calculation would then be.
if (BLOCK_HEIGHT <= LAST_FORK_HEIGHT + DIFFICULTY_FREEZE_DIFFERENCE) :
block_diff = parent_diff + parent_diff // 2048 * max(
1 - (block_timestamp - parent_timestamp) // 10, -99)
else:
block_diff = parent_diff + parent_diff * 0.01
This approach would have the added benefit that updating the Difficulty Freeze is easier as it happens automatically at the time of every upgrade. The trade-off is that the logic for checking is more complex and would require further analysis and test cases to ensure no consensus bugs arise.
Rationale
Block height is very easy to predict and evaluate within the system. This removes the effect of the Difficulty Bomb on block time, simplifying the block time targeting mechanism. The addition of an increase in the difficulty was added after feedback that the game theory of the mechanism did not reliably result in .
https://twitter.com/quentinc137/status/1227110578235330562
Backwards Compatibility
No backward incompatibilities
Test Cases
TBD
Implementation
TBD
Security Considerations
The effect of missing the Difficulty Freeze has a different impact than missing the Difficulty Bomb. At the point of a Difficulty freeze, the protocol is no longer able to adapt to changes in hash power on the network. This can lead to one of three scenarios.
- The Hash rate Increases: Block Times would increase on the network for short time until the increase in difficulty is too high for the network to add any more miners.
- The Hash rate decreases: Block times would increase.
- The Hash rate stays the same: A consistent increase in blocktimes.
Clients are motivated to have their client sync fully to the network and so are very motivated to keep this situation from occurring. Simultaneously delaying the Difficulty Freeze is most easily implemented by client teams. Therefore the group that is most negatively affected is also the group that can most efficiently address it.
Economic Considerations
Under the current Difficult, Bomb issuance of ETH is reduced as the Ice Age takes affect. Under the Difficulty Freeze, it is more likely that issuance would increase for a short time; however, clients are motivated to prevent this and keep clients syncing effectively. This means it is much less likely to occur. The increase to the difficulty over time will eventually reduce blocktimes and also issuance.
It is also easy to predict when this change would happen, and stakeholders who are affected (Eth Holders) can keep client developers accountable by observing when the Difficulty Freeze is approaching and yell at them on twitter.
Copyright
Copyright and related rights waived via CC0.
Adopted by projects
Not miss a beat of EIPs' update?
Subscribe EIPs Fun to receive the latest updates of EIPs Good for Buidlers to follow up.
View all