---
eip: 7840
label: EIP-7840
title: Add blob schedule to EL config files
status: Final
type: Informational
created: 2024-12-12
official: https://eips.ethereum.org/EIPS/eip-7840
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7840.md
canonical: https://eips.huatuo.xyz/zh/eip-7840/
lang: zh
tldr: 在执行客户端配置文件中加入按分叉区分的 blobSchedule（目标值、最大值和基础费用更新系数），使 blob 参数可以在分叉之间变化，而无需 Engine API 握手。
tags: [blobs, config, execution-client, informational]
---

# EIP-7840: Add blob schedule to EL config files

> Include per-fork blob parameters in client configuration files

**TL;DR:** 在执行客户端配置文件中加入按分叉区分的 blobSchedule（目标值、最大值和基础费用更新系数），使 blob 参数可以在分叉之间变化，而无需 Engine API 握手。

## 它解决什么问题？

[EIP-4844](/eip-4844/) 把 blob 参数硬编码在客户端中。社区希望逐个分叉地提高 blob 吞吐量，这意味着要修改每个区块的 blob 目标值和最大值，以及 blob 基础费用的响应速度。

理想情况下，只有共识客户端需要知道这些数字。但实际上执行客户端也需要它们：例如 `eth_feeHistory` RPC 会返回 `blobGasUsedRatio`，这需要用到最大值。更早的方案 [EIP-7742](/eip-7742/) 会在每个区块通过 Engine API 发送目标值，并新增一个区块头字段。EIP-7840 采取了更简单的做法：把这些数字放进客户端的配置中。

## 它如何运作

执行客户端的配置文件（链配置 / 创世文件）新增一个以分叉名称为键的 `blobSchedule` 对象。对于每个分叉，它列出：

- `target`：每个区块的 blob 目标数量（决定 blob 基础费用）；
- `max`：每个区块的 blob 最大数量；
- `baseFeeUpdateFraction`：控制 blob 基础费用变化速度的分母。

客户端必须为每个分叉配置这三项。如果条目缺失或不完整，行为未定义，由各客户端自行决定。

理由：每个区块都通过 Engine API 传递这些值被认为过度，而按分叉的静态配置是一个不错的折中。

## 示例代码

规范中的示例，包含 Cancun 和 Prague 的取值：

```json
{
  "config": {
    "chainId": 1,
    "blobSchedule": {
      "cancun": {
        "target": 3,
        "max": 6,
        "baseFeeUpdateFraction": 3338477
      },
      "prague": {
        "target": 6,
        "max": 9,
        "baseFeeUpdateFraction": 5007716
      }
    }
  }
}
```

在工具中读取当前生效的条目（TypeScript）：

```ts
type BlobParams = { target: number; max: number; baseFeeUpdateFraction: number };

function blobParamsFor(fork: string, cfg: { blobSchedule: Record<string, BlobParams> }) {
  const p = cfg.blobSchedule[fork];
  if (!p) throw new Error(`no blobSchedule entry for ${fork}`);
  return p;
}
```

## 需要注意

- **状态：Final**（Informational）。它描述的是客户端配置约定，而不是共识规则。
- 上面的 Prague 取值对应 [EIP-7691](/eip-7691/) 中的 blob 增加。
- 之后的 blob 调整可以通过仅修改 blob 参数的分叉来进行（[EIP-7892](/eip-7892/)）；每个这样的分叉都有自己的 `blobSchedule` 条目。
- 如果你运行私有网络或 devnet，请确保你激活的每个分叉都有完整的条目；否则客户端可能拒绝启动，或表现不同。


---

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