Skip to content

Commit

Permalink
History: Remove SSZ Union from BlockHeaderWithProof data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme committed Jan 24, 2025
1 parent 5b879ec commit 140f4f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions history/history-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ SHANGHAI_TIMESTAMP = 1681338455
MAX_EPHEMERAL_HEADER_PAYLOAD = 256
# The maximum number of ephemeral headers that can be requested or transferred
# in a single request.

MAX_HEADER_PROOF_LENGTH = 1024
# Maximum length for header proof. This maximum works for the current 3 types of proof.
```

#### Encoding Content Values for Validation
Expand Down Expand Up @@ -191,14 +194,14 @@ BlockProofHistoricalSummaries = Container[
slot: Slot # Slot of BeaconBlock, used to calculate the historical_summaries index
]

BlockHeaderProof = Union[BlockProofHistoricalHashesAccumulator, BlockProofHistoricalRoots, BlockProofHistoricalSummaries]

BlockHeaderWithProof = Container(
header: ByteList[MAX_HEADER_LENGTH], # RLP encoded header in SSZ ByteList
proof: BlockHeaderProof
proof: ByteList[MAX_HEADER_PROOF_LENGTH], # SSZ encoded proof
)
```

The `BlockHeaderWithProof` contains the RLP encoded block header and an SSZ encoded proof for that header. The proof MUST be of the type `BlockProofHistoricalHashesAccumulator` `BlockProofHistoricalRoots`, `BlockProofHistoricalSummaries` depending on the hardfork, see the definitions above. The block header `timestamp` field can be used to select to which type to decode the proof.

* For pre-merge headers, clients SHOULD only accept headers with `BlockProofHistoricalHashesAccumulator` proofs.
* For post-merge until Capella headers, clients SHOULD only accept headers with `BlockProofHistoricalRoots` proofs.
* For Capella and onwards headers, clients SHOULD only accept headers with `BlockProofHistoricalSummaries` proofs.
Expand Down

0 comments on commit 140f4f3

Please sign in to comment.