---
eip: 7862
label: EIP-7862
title: Delayed State Root
status: Draft
type: Standards Track
category: Core
created: 2024-12-23
official: https://eips.ethereum.org/EIPS/eip-7862
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7862.md
canonical: https://eips.huatuo.xyz/ko/eip-7862/
lang: ko
tldr: 각 블록 헤더가 자기 자신이 아니라 이전 블록의 state root를 담게 한다. 비용이 큰 state root 계산을 빌더와 attester의 크리티컬 패스에서 빼낸다.
tags: [consensus, state-root, performance, scaling, core]
---

# EIP-7862: Delayed State Root

> Separate state root computation from block validation

**TL;DR:** 각 블록 헤더가 자기 자신이 아니라 이전 블록의 state root를 담게 한다. 비용이 큰 state root 계산을 빌더와 attester의 크리티컬 패스에서 빼낸다.

## 어떤 문제를 해결하나요?

모든 이더리움 블록 헤더에는 `state_root`가 들어 있습니다. 블록 실행 후 모든 계정의 Merkle-Patricia 루트입니다. 이를 계산하려면 건드려진 모든 트라이 경로를 해시해야 하며, 블록을 생산하고 검증하는 과정에서 가장 느린 단계 중 하나입니다.

이 비용이 가장 나쁜 자리에 놓여 있습니다.

- **빌더**는 MEV 경매에서 시도하는 모든 후보 블록마다 루트를 다시 계산하며, 슬롯당 수천 번이 될 수도 있습니다.
- **검증자**는 블록의 루트를 다시 계산해 확인하기 전까지 그 블록이 유효하다고 attest할 수 없습니다.

gas 한도가 오르고 ePBS([EIP-7732](/eip-7732/))로 타이밍이 빡빡해지면 이것이 병목이 됩니다. [EIP-7928](/eip-7928/)의 블록 수준 액세스 리스트는 실행을 병렬화하는 데 도움이 되지만, 지금 만들고 있는 블록의 루트에는 도움이 되지 않습니다.

## 어떻게 동작하나요?

EIP-7862는 루트를 한 블록만큼 옮깁니다. 헤더 필드는 추가되지 않고 `state_root`의 의미만 바뀝니다.

- 블록 `n`의 헤더에는 **블록 `n-1`의 실행 후 state root**가 들어갑니다. 이는 블록 `n`의 실행 전 상태입니다.
- 클라이언트는 `last_computed_state_root`를 유지합니다. 헤더 검증은 `header.state_root == last_computed_state_root`를 확인합니다.
- 블록 `n`을 실행한 뒤 클라이언트는 그 실행 후 state root를 계산해 저장하고, 블록 `n+1`과 대조할 준비를 합니다.
- 포크 블록 `F`에서는 헤더가 `F-1`의 실행 후 state root를 담고, `F+1`부터는 각 블록이 부모의 루트를 담습니다.

효과:

1. 빌더는 후보마다가 아니라 슬롯마다(이전 블록에 대한) state root 하나만 계산하면 됩니다.
2. 검증자는 블록을 실행한 뒤 그 루트를 기다리지 않고 attest할 수 있습니다.
3. 블록 `n`의 루트 계산은 블록이 도착하자마자 시작할 수 있고, 블록 `n`의 액세스 리스트로 병렬화해 블록 `n+1`에 맞춰 끝낼 수 있습니다.

## 샘플 코드

execution-spec 스타일 의사 코드로 본 핵심 변경:

```python
def validate_header(chain, header):
    # Delayed: this header commits to the PARENT's post-state.
    if header.state_root != chain.last_computed_state_root:
        raise InvalidBlock
    # ... other checks unchanged

def state_transition(chain, block):
    validate_header(chain, block.header)
    out = apply_body(block_env, block.transactions, block.withdrawals)
    if out.block_gas_used != block.header.gas_used:
        raise InvalidBlock
    # receipts, logs bloom, requests ... still validated as before

    # Computed off the critical path; checked by the NEXT block.
    chain.last_computed_state_root = state_root(block_env.state)
    chain.blocks.append(block)
```

## 알아둘 점

- 상태: **Draft**. 하드포크가 필요하며, 업그레이드하지 않은 클라이언트는 새 블록을 거부합니다.
- 라이트 클라이언트와 state proof를 검증하는 모든 사람은 슬롯 하나만큼의 지연을 겪습니다. 블록 `n`의 결과에 대한 증명에는 블록 `n+1`의 헤더가 필요합니다.
- 클라이언트는 블록 `n`의 실행 전 상태를 그 루트가 다음 블록에 포함될 때까지 보관해야 하며, 리오그 중에는 새 체인을 따라 `last_computed_state_root`를 다시 계산해야 합니다.
- ePBS 페이로드 엔벨로프에 있는 합의 계층의 state root는 영향을 받지 않습니다. 바뀌는 것은 실행 헤더뿐입니다.
- [EIP-7886](/eip-7886/)(Delayed execution)은 블록 검증과 실행을 분리하는 관련 아이디어를 탐구합니다.


---

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