From 3e5427e31e9466a70e0e510aee42ddd86589b655 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Wed, 27 Dec 2023 12:54:36 +0100 Subject: [PATCH] Align formatting --- specs/altair/light-client/sync-protocol.md | 38 +++++++++++++++------ specs/capella/light-client/sync-protocol.md | 7 ++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/specs/altair/light-client/sync-protocol.md b/specs/altair/light-client/sync-protocol.md index 7d46541d6..6a1fc75d8 100644 --- a/specs/altair/light-client/sync-protocol.md +++ b/specs/altair/light-client/sync-protocol.md @@ -12,6 +12,10 @@ - [Constants](#constants) - [Preset](#preset) - [Misc](#misc) +- [Helper types](#helper-types) + - [`FinalityBranch`](#finalitybranch) + - [`CurrentSyncCommitteeBranch`](#currentsynccommitteebranch) + - [`NextSyncCommitteeBranch`](#nextsynccommitteebranch) - [Containers](#containers) - [`LightClientHeader`](#lightclientheader) - [`LightClientBootstrap`](#lightclientbootstrap) @@ -64,17 +68,6 @@ Additional documents describe how the light client sync protocol can be used: | `CURRENT_SYNC_COMMITTEE_INDEX` | `get_generalized_index(BeaconState, 'current_sync_committee')` (= 54) | | `NEXT_SYNC_COMMITTEE_INDEX` | `get_generalized_index(BeaconState, 'next_sync_committee')` (= 55) | -```python -class FinalityBranch(Vector[Bytes32, floorlog2(FINALIZED_ROOT_INDEX)]): - pass - -class CurrentSyncCommitteeBranch(Vector[Bytes32, floorlog2(CURRENT_SYNC_COMMITTEE_INDEX)]): - pass - -class NextSyncCommitteeBranch(Vector[Bytes32, floorlog2(NEXT_SYNC_COMMITTEE_INDEX)]): - pass -``` - ## Preset ### Misc @@ -84,6 +77,29 @@ class NextSyncCommitteeBranch(Vector[Bytes32, floorlog2(NEXT_SYNC_COMMITTEE_INDE | `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 6a741a1de..c1281c459 100644 --- a/specs/capella/light-client/sync-protocol.md +++ b/specs/capella/light-client/sync-protocol.md @@ -10,6 +10,8 @@ - [Introduction](#introduction) - [Constants](#constants) +- [Helper types](#helper-types) + - [`ExecutionBranch`](#executionbranch) - [Containers](#containers) - [Modified `LightClientHeader`](#modified-lightclientheader) - [Helper functions](#helper-functions) @@ -33,6 +35,11 @@ Additional documents describes the impact of the upgrade on certain roles: | - | - | | `EXECUTION_PAYLOAD_INDEX` | `get_generalized_index(BeaconBlockBody, 'execution_payload')` (= 25) | + +## Helper types + +### `ExecutionBranch` + ```python class ExecutionBranch(Vector[Bytes32, floorlog2(EXECUTION_PAYLOAD_INDEX)]): pass