---
eip: 1240
label: EIP-1240
title: Remove Difficulty Bomb
status: Withdrawn
type: Standards Track
category: Core
created: 2018-07-21
official: https://eips.ethereum.org/EIPS/eip-1240
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1240.md
canonical: https://eips.huatuo.xyz/zh/eip-1240/
lang: zh
tldr: 一个 2018 年被撤回的提案，主张彻底删除以太坊工作量证明的难度炸弹，使转向权益证明成为一种选择，而不是由越来越慢的区块所迫。
tags: [difficulty-bomb, pow, core, withdrawn, governance]
---

# EIP-1240: Remove Difficulty Bomb

> The average block times are increasing due to the difficulty bomb (also known as the "ice age") slowly accelerating. This EIP proposes to remove the difficulty increase over time and replace it with a fixed difficulty targeting 15 second blocks.

**TL;DR:** 一个 2018 年被撤回的提案，主张彻底删除以太坊工作量证明的难度炸弹，使转向权益证明成为一种选择，而不是由越来越慢的区块所迫。

## 它解决什么问题？

以太坊工作量证明的难度公式包含一个呈指数增长的"炸弹"项（即 *ice age*）。随着它不断增大，挖出区块所需的时间越来越长，迫使社区不断升级，并最终转向权益证明。到 2018 年年中，出块时间已明显变长。

Micah Zoltu 认为，炸弹建立在一个错误的假设之上：即矿工决定经济用户运行哪条链。在他看来，矿工追随用户，因为没人使用的链没有价值。如果开发者想要 Casper（权益证明），应该由用户自由选择，而不是被人为设定的期限推着走。因此，EIP-1240 提议的不是再次推迟炸弹，而是将它移除。

## 它如何运作

从某个分叉区块开始，`calc_difficulty` 中的炸弹项（称为 *epsilon*）被设为 `0`，而不再是区块号的函数。根据区块时间戳作出反应、使出块时间保持在目标附近的常规难度调整照常继续。其结果是难度不再随时间不断上漂。

因为它改变了难度计算，所以不向后兼容，需要一次预定的硬分叉。

## 示例代码

工作量证明难度计算的简化伪代码，以及该改动适用的位置：

```python
def calc_difficulty(parent, block):
    # Regular adjustment: keeps block time near target (details vary per fork)
    adjustment = parent.difficulty // 2048 * time_adjustment_factor(parent, block)
    difficulty = parent.difficulty + adjustment

    # The "bomb" (epsilon)
    if block.number >= FORK_BLOCK_NUMBER:   # EIP-1240
        epsilon = 0
    else:
        period = (block.number - BOMB_DELAY) // 100_000
        epsilon = 2 ** (period - 2) if period >= 2 else 0

    return max(difficulty + epsilon, MIN_DIFFICULTY)
```

## 需要注意

- 状态为 **Withdrawn**。它从未被激活。
- 以太坊反而在硬分叉中一再*推迟*炸弹，例如 [EIP-649](/eip-649/)（Byzantium）、[EIP-1234](/eip-1234/)（Constantinople）和 [EIP-2384](/eip-2384/)（Muir Glacier），此后还有进一步的推迟。
- 随着合并（Merge，[EIP-3675](/eip-3675/)），这个问题变得无关紧要：在权益证明下不存在 PoW 难度，因此炸弹对主网不再有任何影响。
- 该提案主要具有历史意义：它记录了这样一种论点，即协议不应包含推动用户升级的强制机制。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1240
