---
eip: 7976
label: EIP-7976
title: Increase Calldata Floor Cost
status: Last Call
type: Standards Track
category: Core
created: 2025-06-18
requires: 7623
official: https://eips.ethereum.org/EIPS/eip-7976
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7976.md
canonical: https://eips.huatuo.xyz/zh/eip-7976/
lang: zh
tldr: 将 calldata 的下限价格从 EIP-7623 的 10/40 提高到对数据密集型交易统一按每字节 64 gas，在不影响普通交易的前提下，将最坏情况下的区块大小缩减约 37 %。
tags: [gas, calldata, block-size, scaling, core]
---

# EIP-7976: Increase Calldata Floor Cost

> Increase the calldata floor cost to 64/64 gas per byte to reduce maximum block size

**TL;DR:** 将 calldata 的下限价格从 EIP-7623 的 10/40 提高到对数据密集型交易统一按每字节 64 gas，在不影响普通交易的前提下，将最坏情况下的区块大小缩减约 37 %。

## 它解决什么问题？

calldata 的定价是零字节 4 gas、非零字节 16 gas。这使得用廉价数据填满区块、产生非常大的区块成为可能，既不利于区块传播，也限制了 gas limit 能提高的幅度。[EIP-7623](/eip-7623/) 增加了一个**下限价格**（每字节 10/40 gas），只适用于以数据为主的交易。随着 gas limit 不断增长，这个下限仍然允许很大的数据密集型载荷。

EIP-7976 将下限提高到每字节 64 gas，不区分零字节与非零字节。按规范所述，在 4500 万 gas limit 下，数据密集型载荷的最大值从约 1.07 MB 降至约 0.67 MB，缩小约 37 %，为进一步提高 gas limit 留出空间，并促使数据使用者转向 blob（[EIP-4844](/eip-4844/)）。

## 它如何运作

EIP-7623 的公式保持不变；只改变下限常量和 token 的计数方式。

- `STANDARD_TOKEN_COST = 4`，`TOTAL_COST_FLOOR_PER_TOKEN = 16`。
- 标准 token：`zero_bytes + 4 * nonzero_bytes`（因此常规定价仍为 4/16）。
- 下限 token：`4 * (zero_bytes + nonzero_bytes)`，即每字节 64 gas。

```python
tx.gasUsed = 21000 + max(
    STANDARD_TOKEN_COST * tokens_in_calldata
      + execution_gas_used
      + is_create * (32000 + INITCODE_WORD_COST * words(calldata)),
    TOTAL_COST_FLOOR_PER_TOKEN * floor_tokens_in_calldata,
)
```

交易支付两者中较大的一个：常规定价加执行费用，或者下限。真正执行 EVM 工作的交易会超过下限，因此照常付费。如果交易的 gas limit 低于 `21000 + 64 * len(calldata)`（或其固有 gas，取较大者），该交易就是无效的，即使实际的 `gasUsed` 可能更低。

## 示例代码

估算钱包为某个 calldata 载荷必须设置的最小 gas limit（TypeScript）：

```ts
function calldataGas(data: Uint8Array) {
  let zero = 0;
  for (const b of data) if (b === 0) zero++;
  const nonzero = data.length - zero;
  const standard = 21000 + 4 * (zero + 4 * nonzero); // before execution gas
  const floor = 21000 + 64 * data.length;            // EIP-7976 floor
  return { standard, floor, minGasLimit: Math.max(standard, floor) };
}

console.log(calldataGas(new Uint8Array(1000).fill(1)));
// { standard: 37000, floor: 85000, minGasLimit: 85000 }
```

## 需要注意

- 状态：**Last Call**。在网络升级中被排期之前不会生效。
- 钱包和 `eth_estimateGas` 的实现必须考虑新的下限，否则数据密集型交易会被低估并失败。
- 规范对 2024 年 9 月至 2025 年 9 月区块的分析发现，约 1.5 % 的交易会受到影响，主要是数据发布，而不是 DeFi 或转账。
- 仍然用 calldata 而非 blob 发布数据的 rollup 是受影响最大的群体。


---

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