EIPs Explained

EIP-7862 · Draft · Core · 2024-12-23

EIP-7862: Delayed State Root

Makes each block header carry the state root of the previous block instead of its own, taking expensive state-root computation off the critical path for builders and attesters.

What problem does it solve?

Every Ethereum block header contains state_root, the Merkle-Patricia root of all accounts after the block runs. Computing it means hashing every touched trie path, which is one of the slowest steps in producing and validating a block.

That cost lands in the worst place:

  • Builders recompute the root for every candidate block they try during the MEV auction, potentially thousands per slot.
  • Validators cannot attest that a block is valid until they have recomputed and checked its root.

As gas limits rise and timing tightens with ePBS (EIP-7732), this becomes a bottleneck. EIP-7928 block-level access lists help parallelize execution, but not the root of the block currently being built.

How it works

EIP-7862 shifts the root by one block. No header fields are added; only the meaning of state_root changes:

  • The header of block n contains the post-state root of block n-1, which is the pre-state of block n.
  • Clients keep a last_computed_state_root. Header validation checks header.state_root == last_computed_state_root.
  • After executing block n, the client computes its post-state root and stores it, ready to be checked against block n+1.
  • At the fork block F, the header carries the post-state root of F-1; from F+1 on, each block carries its parent's.

Effects:

  1. Builders compute one state root per slot (for the previous block), not one per candidate.
  2. Validators can attest after executing a block without waiting on its root.
  3. Root computation for block n can start as soon as it arrives, using block n's access list to parallelize, and finish in time for block n+1.

Sample code

The core change in execution-spec style pseudocode:

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)

Things to know

  • Status: Draft. It requires a hard fork; non-upgraded clients will reject the new blocks.
  • Light clients and anyone verifying state proofs see one extra slot of latency: proofs about block n's result need block n+1's header.
  • Clients must keep block n's pre-state until its root has been included in the next block, and recompute last_computed_state_root along the new chain during reorgs.
  • The consensus-layer state root in ePBS payload envelopes is unaffected; only the execution header changes.
  • EIP-7886 (Delayed execution) explores a related idea of separating block validation from execution.

#consensus #state-root #performance #scaling #core

Details

Authors
Charlie Noyes <[email protected]>, Dan Robinson <[email protected]>, Justin Drake <[email protected]>, Toni Wahrstätter (@nerolation)
Status
Draft
Type
Standards Track / Core
Created
2024-12-23

Machine-readable: Markdown · JSON