---
eip: 7918
label: EIP-7918
title: Blob base fee bounded by execution cost
status: Final
type: Standards Track
category: Core
created: 2025-03-25
requires: 4844, 7840
official: https://eips.ethereum.org/EIPS/eip-7918
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7918.md
canonical: https://eips.huatuo.xyz/zh/eip-7918/
lang: zh
tldr: 为 blob 基础费用设置与执行层基础费用挂钩的下限，使 blob 费用市场继续运转，而不会在执行成本占主导时坍缩到 1 wei。
tags: [blobs, fees, rollups, core, fusaka]
---

# EIP-7918: Blob base fee bounded by execution cost

> Imposes that the price of GAS_PER_BLOB blob gas is greater than the price of BLOB_BASE_COST execution gas.

**TL;DR:** 为 blob 基础费用设置与执行层基础费用挂钩的下限，使 blob 费用市场继续运转，而不会在执行成本占主导时坍缩到 1 wei。

## 它解决什么问题？

[EIP-4844](/eip-4844/) 为 blob 设立了独立的费用市场：如果区块使用的 blob gas 超过目标，blob 基础费用上升；低于目标则下降。这只有在 blob 费用是 rollup 实际支付成本中有意义的一部分时才有效。

实际上，rollup 发布 blob 的成本主要由携带 blob 的交易的执行 gas（加上证明验证和小费）决定。当 blob 需求低于目标时，blob 基础费用不断下降，直到停在 1 wei，此时费用变化 10 % 对 rollup 总成本几乎没有影响。需求回升时，需要连续很多个几乎满载的区块才能爬回市场出清价格，其间用户退回到通过小费竞价，体验更差。

还有成本方面的理由：节点必须为每个 blob 验证 KZG 证明，这是实实在在的计算。实际上近乎免费的 blob，对这项工作的补偿不足。

## 它如何运作

EIP-7918 在 `calc_excess_blob_gas()` 中增加一个 `if` 分支和一个常量 `BLOB_BASE_COST = 2**13`（8192）。

- 如果一个 blob 的价格（`GAS_PER_BLOB * blob_base_fee`）**低于** `BLOB_BASE_COST` 单位执行 gas 的价格，协议在更新 `excess_blob_gas` 时不再减去 target。此时 blob 基础费用只能上升，上升速度的上限与之前相同。
- 否则，适用正常的 EIP-4844 更新。

其效果是一个保留价格：blob 基础费用不会稳定在 `BLOB_BASE_COST * base_fee_per_gas / GAS_PER_BLOB` 以下，即每单位 blob gas 为执行层基础费用的 1/16。由于下限跟随执行层基础费用，当执行变便宜时它会自动下降，而不是一个随着以太坊扩容需要重新调整的固定数值。

它使用 [EIP-7840](/eip-7840/) 引入的按分叉划分的 `blobSchedule`（target、max、update fraction）。

## 示例代码

规范中修改后的函数：

```python
BLOB_BASE_COST = 2**13

def calc_excess_blob_gas(parent: Header) -> int:
    target_blob_gas = GAS_PER_BLOB * blobSchedule.target
    if parent.excess_blob_gas + parent.blob_gas_used < target_blob_gas:
        return 0

    if BLOB_BASE_COST * parent.base_fee_per_gas > GAS_PER_BLOB * get_base_fee_per_blob_gas(parent):
        # execution-fee-led regime: only allow the blob fee to rise
        return parent.excess_blob_gas + parent.blob_gas_used * (blobSchedule.max - blobSchedule.target) // blobSchedule.max
    else:
        return parent.excess_blob_gas + parent.blob_gas_used - target_blob_gas
```

使用 ethers v6 检查下限是否生效：

```ts
const block = await provider.send("eth_getBlockByNumber", ["latest", false]);
const blobBaseFee = BigInt(await provider.send("eth_blobBaseFee", []));
const reserve = (8192n * BigInt(block.baseFeePerGas)) / 131072n; // GAS_PER_BLOB = 2**17
console.log(blobBaseFee <= reserve ? "at/below reserve" : "market-led");
```

## 需要注意

- **状态：Final。** 它被列入 Fusaka 升级（[EIP-7607](/eip-7607/)），与 PeerDAS（[EIP-7594](/eip-7594/)）一同上线。
- rollup 在平静时期会多付一点，但需求回升时 blob 费用的剧烈波动会小得多。
- 当执行层费用快速上涨时，blob 费用会在几个区块内追上，而不是立刻追上；作者认为这种平滑是可以接受的。
- 假定 blob 费用接近零的钱包和 rollup 费用估算器，应读取实际的 `blobBaseFee`，而不是硬编码 1 wei。


---

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