From c41c128c760f892e2b4f37d60807e03da06b9e3e Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Tue, 9 Jan 2024 14:55:22 +0100 Subject: [PATCH] Use `Custom types` section instead of `Helper types` for consistency --- specs/altair/light-client/sync-protocol.md | 36 ++++++--------------- specs/capella/light-client/sync-protocol.md | 19 ++++------- 2 files changed, 16 insertions(+), 39 deletions(-) diff --git a/specs/altair/light-client/sync-protocol.md b/specs/altair/light-client/sync-protocol.md index 58a38d150..955fc82f9 100644 --- a/specs/altair/light-client/sync-protocol.md +++ b/specs/altair/light-client/sync-protocol.md @@ -9,13 +9,10 @@ - [Introduction](#introduction) +- [Custom types](#custom-types) - [Constants](#constants) - [Preset](#preset) - [Misc](#misc) -- [Helper types](#helper-types) - - [`FinalityBranch`](#finalitybranch) - - [`CurrentSyncCommitteeBranch`](#currentsynccommitteebranch) - - [`NextSyncCommitteeBranch`](#nextsynccommitteebranch) - [Containers](#containers) - [`LightClientHeader`](#lightclientheader) - [`LightClientBootstrap`](#lightclientbootstrap) @@ -60,6 +57,14 @@ Additional documents describe how the light client sync protocol can be used: - [Light client](./light-client.md) - [Networking](./p2p-interface.md) +## Custom types + +| Name | SSZ equivalent | Description | +| - | - | - | +| `FinalityBranch` | `Vector[Bytes32, floorlog2(FINALIZED_ROOT_INDEX)]` | Merkle branch of `finalized_checkpoint.root` within `BeaconState` | +| `CurrentSyncCommitteeBranch` | `Vector[Bytes32, floorlog2(CURRENT_SYNC_COMMITTEE_INDEX)]` | Merkle branch of `current_sync_committee` within `BeaconState` | +| `NextSyncCommitteeBranch` | `Vector[Bytes32, floorlog2(NEXT_SYNC_COMMITTEE_INDEX)]` | Merkle branch of `next_sync_committee` within `BeaconState` | + ## Constants | Name | Value | @@ -77,29 +82,6 @@ Additional documents describe how the light client sync protocol can be used: | `MIN_SYNC_COMMITTEE_PARTICIPANTS` | `1` | validators | | | `UPDATE_TIMEOUT` | `SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD` | slots | ~27.3 hours | -## Helper types - -### `FinalityBranch` - -```python -class FinalityBranch(Vector[Bytes32, floorlog2(FINALIZED_ROOT_INDEX)]): - pass -``` - -### `CurrentSyncCommitteeBranch` - -```python -class CurrentSyncCommitteeBranch(Vector[Bytes32, floorlog2(CURRENT_SYNC_COMMITTEE_INDEX)]): - pass -``` - -### `NextSyncCommitteeBranch` - -```python -class NextSyncCommitteeBranch(Vector[Bytes32, floorlog2(NEXT_SYNC_COMMITTEE_INDEX)]): - pass -``` - ## Containers ### `LightClientHeader` diff --git a/specs/capella/light-client/sync-protocol.md b/specs/capella/light-client/sync-protocol.md index 057541bd3..2abe5d58c 100644 --- a/specs/capella/light-client/sync-protocol.md +++ b/specs/capella/light-client/sync-protocol.md @@ -9,9 +9,8 @@ - [Introduction](#introduction) +- [Custom types](#custom-types) - [Constants](#constants) -- [Helper types](#helper-types) - - [`ExecutionBranch`](#executionbranch) - [Containers](#containers) - [Modified `LightClientHeader`](#modified-lightclientheader) - [Helper functions](#helper-functions) @@ -29,22 +28,18 @@ Additional documents describes the impact of the upgrade on certain roles: - [Full node](./full-node.md) - [Networking](./p2p-interface.md) +## Custom types + +| Name | SSZ equivalent | Description | +| - | - | - | +| `ExecutionBranch` | `Vector[Bytes32, floorlog2(EXECUTION_PAYLOAD_INDEX)]` | Merkle branch of `execution_payload` within `BeaconBlockBody` | + ## Constants | Name | Value | | - | - | | `EXECUTION_PAYLOAD_INDEX` | `get_generalized_index(BeaconBlockBody, 'execution_payload')` (= 25) | - -## Helper types - -### `ExecutionBranch` - -```python -class ExecutionBranch(Vector[Bytes32, floorlog2(EXECUTION_PAYLOAD_INDEX)]): - pass -``` - ## Containers ### Modified `LightClientHeader`