---
eip: 8268
label: EIP-8268
title: Storage Roots in Block Access Lists
status: Draft
type: Standards Track
category: Core
created: 2026-05-21
requires: 7928
official: https://eips.ethereum.org/EIPS/eip-8268
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8268.md
canonical: https://eips.huatuo.xyz/zh/eip-8268/
lang: zh
tldr: 在 EIP-7928 的 Block Access List 中加入每个被修改账户在区块执行后的存储根，使只持有部分状态的节点也能验证区块的状态根。
tags: [bal, state, stateless, verification, core]
---

# EIP-8268: Storage Roots in Block Access Lists

> Extend EIP-7928 with per-account post-block storage trie roots so partially stateful nodes can verify the state root

**TL;DR:** 在 EIP-7928 的 Block Access List 中加入每个被修改账户在区块执行后的存储根，使只持有部分状态的节点也能验证区块的状态根。

## 它解决什么问题？

[EIP-7928](/eip-7928/) 的 Block Access List（BAL）为每个区块记录哪些账户和存储槽被触及，以及区块执行后的值：余额、nonce、代码和被修改的存储槽。这足以在不重新执行的情况下更新状态，但还不足以验证新的**状态根**。

要在状态 trie 中重建一个账户的叶子，需要四样东西：nonce、余额、代码哈希和**存储根**。存储根取决于该账户的整个存储 trie，而不仅仅是发生变化的存储槽。"部分有状态"的节点（只保留一部分状态的节点）无法为自己没有存储的账户计算存储根，因此无法检查区块的状态根。

## 它如何运作

BAL 中每个记录了实际变更的 `AccountChanges` 条目（存储、余额、nonce 或代码变更列表中任何一个非空），都会在末尾增加一个新字段 `storage_root`：

```
AccountChanges = [
    Address,
    List[SlotChanges],     # storage_changes
    List[StorageKey],      # storage_reads
    List[BalanceChange],   # balance_changes
    List[NonceChange],     # nonce_changes
    List[CodeChange],      # code_changes
    StorageRoot,           # new: post-block storage trie root
]
```

规则：

- 如果账户在区块执行后的存储 trie **非空**，`storage_root` 就是其 32 字节的根。
- 如果**为空**，`storage_root` 是空字节串（RLP 的 `0x80`），*不得*使用众所周知的 32 字节空 trie 根。使用方把空字符串视为该根。大多数被修改的账户是没有存储的 EOA，因此每个账户可节省 32 字节。
- 仅被访问的账户（所有变更列表均为空）保持原来的六字段布局，没有 `storage_root`。
- 如果任何 `storage_root` 与执行产生的结果不符，该区块无效。该字段被 `block_access_list_hash` 所覆盖。

该规则只取决于存储是否为空，而不取决于账户类型，因此 EOA、新建或被清空的合约，以及 [EIP-7702](/eip-7702/) 委托的账户都遵循相同的逻辑。

## 示例代码

根据 BAL 条目重建状态 trie 的叶子（伪代码）：

```python
EMPTY_TRIE_ROOT = bytes.fromhex(
    "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")

def account_leaf(entry, nonce, balance, code_hash):
    # entry is a 7-field AccountChanges with state modifications
    storage_root = entry.storage_root
    if storage_root == b"":
        storage_root = EMPTY_TRIE_ROOT
    else:
        assert len(storage_root) == 32
    return rlp.encode([nonce, balance, storage_root, code_hash])
```

## 需要注意

- **状态：Draft。** 它建立在处于 Last Call 的 [EIP-7928](/eip-7928/) 之上。
- 它改变了 BAL 的编码，需要一次硬分叉。只实现 EIP-7928 的客户端和实现本 EIP 的客户端会互相拒绝对方的区块。
- 开销为每个被修改的账户最多 32 字节；仅被触及的账户不增加任何开销。
- 为空存储采用唯一的规范编码，使 `block_access_list_hash` 保持确定性。
- BAL 通过 [EIP-8159](/eip-8159/)（eth/71）在节点之间交换。


---

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