Skip to content

Commit

Permalink
Add HistoricalRootsBlockProof for merge till capella blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme committed Apr 17, 2024
1 parent 04cc360 commit 1e08625
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions history-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,25 @@ each receipt/transaction and re-rlp-encode it, but only if it is a legacy transa

#### Block Header


```
# Content types
AccumulatorProof = Vector[Bytes32, 15]
BlockHeaderProof = Union[None, AccumulatorProof]
BeaconBlockBodyProof = Vector[Bytes32, 8] # Proof that EL block_hash in ExecutionPayload is part of BeaconBlockBody
BeaconBlockHeaderProof = Vector[Bytes32, 3] # Proof that BeaconBlockBody root is part of BeaconBlockHeader
HistoricalRootsProof = Vector[Bytes32, 14] # Proof that BeaconBlockHeader root is part of HistoricalRoots
HistoricalRootsBlockProof = Container[
beaconBlockBodyProof: BeaconBlockBodyProof,
beaconBlockBodyRoot: Bytes32,
beaconBlockHeaderProof: BeaconBlockHeaderProof,
beaconBlockHeaderRoot: Bytes32,
historicalRootsProof: HistoricalRootsProof,
slot: Slot
]
BlockHeaderProof = Union[None, AccumulatorProof, HistoricalRootsBlockProof]
BlockHeaderWithProof = Container[
header: ByteList, # RLP encoded header in SSZ ByteList
Expand Down Expand Up @@ -333,5 +345,14 @@ Merkle proof with the `BlockHeader`'s block hash as leave and the
`EpochAccumulator` digest as root. This digest is available in the
`MasterAccumulator`.

As the `MasterAccumulator` only accounts for blocks pre-merge, this proof can
only be used to verify blocks pre-merge.
As the `MasterAccumulator` only accounts for blocks pre-merge, this proof MUST
be used to verify blocks pre-merge (pre Paris fork).

#### HistoricalRootsBlockProof

The `HistoricalRootsBlockProof` is an SSZ container which holds three Merkle proofs as specified in the [SSZ Merke proofs specification](https://github.com/ethereum/consensus-specs/blob/dev/ssz/merkle-proofs.md#merkle-multiproofs).

The container holds a chain of proofs. This chain of proofs allows for verifying that an EL `BlockHeader` is part of the canonical chain. The only requirement is having access to the beacon chain `historical_roots`.
The `historical_roots` is a [`BeaconState` field](https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconstate) that is frozen since the Capella fork. The `HistoricalRootsBlockProof` MUST be used to verify blocks from The Merge until the Capella fork.

The Portal network does not provide a mechanism to acquire the `historical_roots` over the network. Clients are encouraged to solve this however they choose, with the suggestion that they can include a frozen copy of the `historical_roots` within their client code, and provide a mechanism for users to override this value if they so choose.

0 comments on commit 1e08625

Please sign in to comment.