---
eip: 7915
label: EIP-7915
title: Adaptive mean reversion blob pricing
status: Stagnant
type: Standards Track
category: Core
created: 2025-03-23
requires: 4844
official: https://eips.ethereum.org/EIPS/eip-7915
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7915.md
canonical: https://eips.huatuo.xyz/zh/eip-7915/
lang: zh
tldr: 一项已停滞（Stagnant）的提案：每当 blob 基础费用低于其长期平均值时，让它上涨得比下跌更快，使 blob 定价迅速回到均衡，而不是长期停留在 1 wei。
tags: [blobs, fees, core, 4844, economics]
---

# EIP-7915: Adaptive mean reversion blob pricing

> Fee schedule accounting for the long-run average to quickly restore equilibrium under inelastic demand

**TL;DR:** 一项已停滞（Stagnant）的提案：每当 blob 基础费用低于其长期平均值时，让它上涨得比下跌更快，使 blob 定价迅速回到均衡，而不是长期停留在 1 wei。

## 它解决什么问题？

[EIP-4844](/eip-4844/) 用 [EIP-1559](/eip-1559/) 风格的基础费用为 blob 定价：blob 使用量高于目标时费用上升，低于目标时费用下降，下限为 1 wei。事实证明，blob 的需求对费用非常缺乏弹性。经过一段清淡期后，费用可能崩溃到在经济上毫无意义的 1 wei，而需求回归时，协议需要一长串接近满载的区块才能爬回来。与此同时，用户退而竞标优先费用，这是一种体验更差的第一价格拍卖，资源使用也变得起伏剧烈。

固定的最低费用（如 [EIP-7762](/eip-7762/)）会有帮助，但任何硬编码的数字都会随着 ETH 价格和吞吐量的变化而过时。EIP-7915 转而把行为锚定在**长期平均**的 blob 费用上，使该机制随时间保持中性。

## 它如何运作

1. **跟踪平均值。** 新的区块头字段 `base_fee_per_blob_gas_ema` 存储 blob 基础费用的指数移动平均。每个区块它向当前费用靠拢 `1 / EMA_DECAY`（`EMA_DECAY = 2**18`，半衰期大约一个月）。分叉后的第一个区块从 4 gwei 开始。
2. **计算均值回归权重 `w`。** 如果当前费用等于或高于平均值，则 `w = 1`，适用常规的 EIP-4844 更新。如果低于平均值，`w` 随平均值 / 当前费用之比平滑增长，使用八次方根（三次整数平方根）和值为 64 的死区常量。为避免极端反应和溢出，该比值上限为 `10**6`。
3. **弯曲 excess gas 的更新。** 更新不再是 `excess += used - target`，而变为 `excess += used·w − target/w`。blob 使用量计得更多、目标计得更少，因此当费用相对历史偏低时，费用上涨得快、下跌得慢。

该曲线在每个比值下都保持平滑，因此不存在区块生产者会想去操纵的特定 blob 数量。

## 示例代码

修改后的更新逻辑，改编自规范中的 Python：

```python
EMA_DECAY = 2**18
MEAN_REVERSION_DEADBAND = 64
MEAN_REVERSION_FULLBAND = 10**6

def calc_excess_blob_gas(parent) -> int:
    if parent.excess_blob_gas + parent.blob_gas_used < TARGET_BLOB_GAS_PER_BLOCK:
        return 0
    Up = 2**16
    fee, ema = get_base_fee_per_blob_gas(parent), parent.base_fee_per_blob_gas_ema
    if fee > ema:
        w = Up
    else:
        if ema // fee > MEAN_REVERSION_FULLBAND:
            ratio = Up * MEAN_REVERSION_FULLBAND      # cap extreme ratios
        else:
            ratio = Up * ema // fee
        w = (ratio + Up * MEAN_REVERSION_DEADBAND) // (MEAN_REVERSION_DEADBAND + 1)
        for _ in range(3):
            w = integer_squareroot(w * Up)      # eighth root, upsampled
    return parent.excess_blob_gas + parent.blob_gas_used * w // Up \
           - TARGET_BLOB_GAS_PER_BLOCK * Up // w

def calc_base_fee_per_blob_gas_ema(parent) -> int:
    return (parent.base_fee_per_blob_gas_ema
            + get_base_fee_per_blob_gas(parent) // EMA_DECAY
            - parent.base_fee_per_blob_gas_ema // EMA_DECAY)
```

## 需要注意

- 状态为 **Stagnant**：它没有被排入任何升级。
- 它所针对的问题后来由 [EIP-7918](/eip-7918/) 以另一种方式解决，后者用 blob 在执行层的成本来为 blob 基础费用设定下限。
- 它会增加一个新的区块头字段，并要求执行层实现 `integer_squareroot()`。
- 规范中的安全提示：当费用远低于平均值时，满载的区块可能使 blob 费用每个区块翻倍，因此延迟一个区块的代价可能高出一倍。


---

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