EIP-4345 · Final · Core · 2021-10-05
EIP-4345: Difficulty Bomb Delay to June 2022
Pushed back Ethereum's difficulty bomb by 10.7 million blocks so it would not start slowing proof-of-work blocks until around June 2022, buying time for The Merge.
What problem does it solve?
Proof-of-work Ethereum had a difficulty bomb (also called the ice age). It is an extra term in the difficulty formula that doubles every 100,000 blocks. Once it grows large enough, blocks get slower and slower until the chain is close to unusable. The bomb was there on purpose, to force regular hard forks and, in the end, the move to proof-of-stake.
The previous delay, EIP-3554, set the bomb to be felt around December 2021. The Merge was not ready by then, so the bomb had to be pushed back again. EIP-4345 did that. It shipped in the Arrow Glacier upgrade in December 2021, a hard fork that contained only this change.
How it works
The difficulty calculation does not use the real block number for the bomb term. It uses a fake block number that is 10,700,000 blocks lower:
fake_block_number = max(0, block.number - 10_700_000) if block.number >= FORK_BLOCK_NUMBER else block.number
Only the exponential ice-age part of calc_difficulty uses this value. The regular difficulty adjustment, which keeps block times near the target, still uses the real number.
Because the bomb term is 2 ** (fake_block_number // 100_000 - 2), removing 10.7M blocks makes it vanishingly small again. The authors' projection, using chain data from October 2021, estimated about +0.1 s per block by June 2022 and about +0.5 s by July 2022. That is noticeable enough to prompt action, but leaves room to delay again if needed.
Sample code
The bomb component before and after the fork, in Python:
BOMB_DELAY = 10_700_000
def ice_age_component(block_number: int, fork_block: int) -> int:
n = max(0, block_number - BOMB_DELAY) if block_number >= fork_block else block_number
period = n // 100_000
return 2 ** (period - 2) if period >= 2 else 0
# e.g. block 14,000,000 after the fork behaves like block 3,300,000:
print(ice_age_component(14_000_000, fork_block=0)) # 2**31, tiny next to mainnet difficulty
Things to know
- Status: Final. It is part of mainnet history (Arrow Glacier).
- The delay was not enough on its own. The Merge slipped past June 2022, so EIP-5133 (Gray Glacier) delayed the bomb again.
- The bomb no longer matters. Since The Merge (EIP-3675), blocks come from proof-of-stake and there is no difficulty to inflate.
- The Security Considerations note that a drop in hashrate before The Merge could make the bomb hit earlier than predicted. The 10.7M offset was chosen with that in mind.