EIP-7643 Pre-Merge block history accumulator (History accumulator for pre-PoS data)

No call decision · Scaling & data · EIP status Stagnant · created 2024-02-29

Compresses the hashes and difficulties of every pre-Merge (PoW-era) block into a single accumulator root, making it possible to verify past block data without re-executing the entire header chain.

Why it is needed

Blocks from before Ethereum's transition from proof-of-work (PoW) to proof-of-stake (PoS) have no separate compressed structure on chain, so verifying any single past block required chaining and re-checking every block header in order starting from genesis. This approach is inefficient, and there was no lightweight way to confirm pre-Merge data was correct without downloading that data and executing each block directly. This EIP groups the hashes and total difficulties of all pre-Merge blocks into units of 8192 blocks (epochs) and combines them into a single published accumulator root. As a result, users can verify that the entire body of past data is correct simply by comparing a locally computed accumulator root against this value, and can verify whether a specific block is included using a proof of only O(log n) size.

What changes

Today

After EIP-7643

Who is affected

In depth

HeaderRecord and EpochRecord structure

A HeaderRecord is a Container[block_hash: bytes32, total_difficulty: uint256] that holds a single block's hash and its total difficulty at that point. An EpochRecord is a List holding up to EPOCH_SIZE (8192) such HeaderRecords. That is, one EpochRecord is created for every 8192 blocks, and the hash tree roots of these EpochRecords are stacked into the historical_epochs list.

The HistoricalHashesAccumulator container

The top-level object, HistoricalHashesAccumulator, consists of two fields: historical_epochs (List[bytes32, max_length=2048]) and current_epoch (the EpochRecord currently in progress). Multiplying MAX_HISTORICAL_EPOCHS=2048 by EPOCH_SIZE=8192 gives a sense of the maximum number of blocks this structure can represent.

The fixed pre-PoS root value

The hash tree root of the HistoricalHashesAccumulator for all data before block 15537394 (the point at which the Merge occurred) is hard-coded in the specification as 0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701. Anyone can accumulate their data the same way and compare it against this value to confirm their pre-Merge data is correct.

Why total_difficulty is included

The HeaderRecord includes total_difficulty alongside the block hash so that clients can respond to certain JSON-RPC methods that require this value. This field is also used to verify whether the total difficulty (TTD, Terminal Total Difficulty) of the last proof-of-work (PoW) block met the Merge transition condition.

Two use cases for this accumulator

First, for users who want to download and verify pre-Merge execution chain data: compute each block hash, accumulate it into epoch records, and compare the local accumulator root against the published value. Second, for generating a proof of O(log n) size for any single pre-Merge block, which is far lighter than the traditional method of recursively chaining and verifying the header chain from the start.

Current status

This EIP's status is Stagnant, meaning it is not an actively discussed matter. The Backwards Compatibility section is also explicitly marked "n/a", meaning no compatibility issues with existing behavior are specified separately.

Original EIP · ← EIPs