---
eip: 7742
label: EIP-7742
title: Uncouple blob count between CL and EL
status: Stagnant
type: Standards Track
category: Core
created: 2024-07-12
requires: 4844
official: https://eips.ethereum.org/EIPS/eip-7742
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7742.md
canonical: https://eips.huatuo.xyz/zh/eip-7742/
lang: zh
tldr: 提议让共识层掌管 blob 上限，并把每个区块的 blob 目标值传给执行层，这样修改 blob 参数时就不必在两种客户端里协调修改硬编码值。
tags: [blobs, core, engine-api, scaling, stagnant]
---

# EIP-7742: Uncouple blob count between CL and EL

> Have CL verify blob maximum and have EL get target value from CL

**TL;DR:** 提议让共识层掌管 blob 上限，并把每个区块的 blob 目标值传给执行层，这样修改 blob 参数时就不必在两种客户端里协调修改硬编码值。

## 它解决什么问题？

[EIP-4844](/eip-4844/) 引入 blob 时带有两个硬编码数值：每个区块的 blob **最大数量**（防 DoS 的上限）和**目标数量**（用于按 EIP-1559 的方式调整 blob 基础费用）。目标值固定为最大值的一半。

这两个值都硬编码在执行客户端（EL）里，最大值还硬编码在共识客户端（CL）里。因此，提高 blob 吞吐量（以太坊扩容路线图的关键部分）需要两类客户端同步修改，而且 `target == max / 2` 的关系也过于僵化。

EIP-7742 提议在两层之间解耦这些值。

## 它如何运作

- **在 EL 中去掉最大值检查。** CL 已经强制执行最大值，EL 则通过 Engine API 中的 versioned hash 一致性检查继承了这项检查。因此，可以移除 EL 的 `MAX_BLOB_GAS_PER_BLOCK` 逻辑，而不会削弱安全性。
- **由 CL 发送目标值。** Engine API 在每个 payload 中传递 `target_blobs_per_block`。EL 区块头新增一个 64 位字段 `target_blobs_per_block`，必须与 CL 提供的值一致（类似于提款的验证方式）。把它放在区块头中可以保持 optimistic sync 的安全性。
- **用区块头中的目标值计算费用。** excess blob gas 根据父区块的目标值计算，而不是使用常量。
- **区块构建。** CL 请求 EL 构建 payload 时，同时传入目标值和最大值。

CL 保留最大值（DoS 防护），EL 保留费用核算，从而保持职责分离。

## 示例代码

规范中更新后的 excess blob gas 计算：

```python
def calc_excess_blob_gas(parent: Header) -> int:
    target_blob_gas = parent.target_blobs_per_block * GAS_PER_BLOB
    if parent.excess_blob_gas + parent.blob_gas_used < target_blob_gas:
        return 0
    else:
        return parent.excess_blob_gas + parent.blob_gas_used - target_blob_gas
```

概念性的区块头扩展：

```python
class Header:
    ...
    blob_gas_used: uint64
    excess_blob_gas: uint64
    target_blobs_per_block: uint64  # new, supplied by the CL via the Engine API
```

## 需要注意

- **状态：Stagnant。** 它不属于当前运行的协议。
- 最终落地的方案是 [EIP-7840](/eip-7840/)：每个执行客户端配置都携带按分叉区分的 `blobSchedule`（目标值、最大值、基础费用更新系数），避免了新增区块头字段和 Engine API 握手。
- 此后 blob 参数已由 [EIP-7691](/eip-7691/) 提高，[EIP-7892](/eip-7892/) 则定义了仅调整 blob 参数的硬分叉，用于后续调整。
- 除了目标值的来源之外，blob 基础费用的核算与 EIP-4844 保持一致。


---

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