Use `Custom types` section instead of `Helper types` for consistency

This commit is contained in:
Etan Kissling 2024-01-09 14:55:22 +01:00
parent 02d47f1554
commit c41c128c76
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
2 changed files with 16 additions and 39 deletions

View File

@ -9,13 +9,10 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [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`

View File

@ -9,9 +9,8 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [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`