Skip to content

Commit 93cf37c

Browse files
authored
Organize Helpers and Handlers sections (#4819)
1 parent 5d0296b commit 93cf37c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+385
-408
lines changed

specs/_features/eip6800/p2p-interface.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- [Introduction](#introduction)
88
- [Modification in EIP-6800](#modification-in-eip-6800)
9-
- [Helper functions](#helper-functions)
9+
- [Helpers](#helpers)
1010
- [Modified `compute_fork_version`](#modified-compute_fork_version)
1111

1212
<!-- mdformat-toc end -->
@@ -21,7 +21,7 @@ specifications of previous upgrades, and assumes them as pre-requisite.
2121

2222
## Modification in EIP-6800
2323

24-
### Helper functions
24+
### Helpers
2525

2626
#### Modified `compute_fork_version`
2727

specs/_features/eip6914/beacon-chain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [Introduction](#introduction)
88
- [Preset](#preset)
99
- [Time parameters](#time-parameters)
10-
- [Helper functions](#helper-functions)
10+
- [Helpers](#helpers)
1111
- [Predicates](#predicates)
1212
- [`is_reusable_validator`](#is_reusable_validator)
1313
- [Beacon chain state transition function](#beacon-chain-state-transition-function)
@@ -33,7 +33,7 @@ validator records. Refers to
3333
| ---------------------------- | -------------------------- | ------ | --------- |
3434
| `SAFE_EPOCHS_TO_REUSE_INDEX` | `uint64(2**16)` (= 65,536) | epochs | ~0.8 year |
3535

36-
## Helper functions
36+
## Helpers
3737

3838
### Predicates
3939

specs/_features/eip7805/beacon-chain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [New containers](#new-containers)
1212
- [`InclusionList`](#inclusionlist)
1313
- [`SignedInclusionList`](#signedinclusionlist)
14-
- [Helper functions](#helper-functions)
14+
- [Helpers](#helpers)
1515
- [Predicates](#predicates)
1616
- [New `is_valid_inclusion_list_signature`](#new-is_valid_inclusion_list_signature)
1717
- [Beacon State accessors](#beacon-state-accessors)
@@ -68,7 +68,7 @@ class SignedInclusionList(Container):
6868
signature: BLSSignature
6969
```
7070

71-
## Helper functions
71+
## Helpers
7272

7373
### Predicates
7474

specs/_features/eip7805/fork-choice.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
- [New `validate_inclusion_lists`](#new-validate_inclusion_lists)
1717
- [New `get_attester_head`](#new-get_attester_head)
1818
- [Modified `get_proposer_head`](#modified-get_proposer_head)
19-
- [Updated fork-choice helpers](#updated-fork-choice-helpers)
2019
- [Modified `update_proposer_boost_root`](#modified-update_proposer_boost_root)
21-
- [New fork-choice helpers](#new-fork-choice-helpers)
20+
- [New `record_block_inclusion_list_satisfaction`](#new-record_block_inclusion_list_satisfaction)
2221
- [New `get_view_freeze_cutoff_ms`](#new-get_view_freeze_cutoff_ms)
2322
- [New `get_inclusion_list_submission_due_ms`](#new-get_inclusion_list_submission_due_ms)
2423
- [New `get_proposer_inclusion_list_cutoff_ms`](#new-get_proposer_inclusion_list_cutoff_ms)
25-
- [New `record_block_inclusion_list_satisfaction`](#new-record_block_inclusion_list_satisfaction)
26-
- [Updated fork-choice handlers](#updated-fork-choice-handlers)
24+
- [Handlers](#handlers)
2725
- [New `on_inclusion_list`](#new-on_inclusion_list)
2826
- [Modified `on_block`](#modified-on_block)
2927

@@ -264,8 +262,6 @@ def get_proposer_head(store: Store, head_root: Root, slot: Slot) -> Root:
264262
return head_root
265263
```
266264

267-
## Updated fork-choice helpers
268-
269265
### Modified `update_proposer_boost_root`
270266

271267
```python
@@ -289,7 +285,16 @@ def update_proposer_boost_root(store: Store, root: Root) -> None:
289285
store.proposer_boost_root = root
290286
```
291287

292-
## New fork-choice helpers
288+
### New `record_block_inclusion_list_satisfaction`
289+
290+
```python
291+
def record_block_inclusion_list_satisfaction(store: Store, root: Root) -> None:
292+
# Check if block satisfies the inclusion list constraints
293+
# If not, add this block to the store as inclusion list constraints unsatisfied
294+
is_inclusion_list_satisfied = validate_inclusion_lists(store, root, EXECUTION_ENGINE)
295+
if not is_inclusion_list_satisfied:
296+
store.unsatisfied_inclusion_list_blocks.add(root)
297+
```
293298

294299
### New `get_view_freeze_cutoff_ms`
295300

@@ -312,18 +317,7 @@ def get_proposer_inclusion_list_cutoff_ms(epoch: Epoch) -> uint64:
312317
return get_slot_component_duration_ms(PROPOSER_INCLUSION_LIST_CUTOFF_BPS)
313318
```
314319

315-
### New `record_block_inclusion_list_satisfaction`
316-
317-
```python
318-
def record_block_inclusion_list_satisfaction(store: Store, root: Root) -> None:
319-
# Check if block satisfies the inclusion list constraints
320-
# If not, add this block to the store as inclusion list constraints unsatisfied
321-
is_inclusion_list_satisfied = validate_inclusion_lists(store, root, EXECUTION_ENGINE)
322-
if not is_inclusion_list_satisfied:
323-
store.unsatisfied_inclusion_list_blocks.add(root)
324-
```
325-
326-
## Updated fork-choice handlers
320+
## Handlers
327321

328322
### New `on_inclusion_list`
329323

specs/_features/eip7805/p2p-interface.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ EIP-7805.
66
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 -->
77

88
- [Modifications in EIP-7805](#modifications-in-eip-7805)
9-
- [Helper functions](#helper-functions)
10-
- [Modified `compute_fork_version`](#modified-compute_fork_version)
119
- [Configuration](#configuration)
10+
- [Helpers](#helpers)
11+
- [Modified `compute_fork_version`](#modified-compute_fork_version)
1212
- [The gossip domain: gossipsub](#the-gossip-domain-gossipsub)
1313
- [Topics and messages](#topics-and-messages)
1414
- [Global topics](#global-topics)
@@ -21,7 +21,14 @@ EIP-7805.
2121

2222
## Modifications in EIP-7805
2323

24-
### Helper functions
24+
### Configuration
25+
26+
| Name | Value | Description |
27+
| ------------------------------ | ---------------- | ---------------------------------------------------------- |
28+
| `MAX_REQUEST_INCLUSION_LIST` | `2**4` (= 16) | Maximum number of inclusion list in a single request |
29+
| `MAX_BYTES_PER_INCLUSION_LIST` | `2**13` (= 8192) | Maximum size of the inclusion list's transactions in bytes |
30+
31+
### Helpers
2532

2633
#### Modified `compute_fork_version`
2734

@@ -47,13 +54,6 @@ def compute_fork_version(epoch: Epoch) -> Version:
4754
return GENESIS_FORK_VERSION
4855
```
4956

50-
### Configuration
51-
52-
| Name | Value | Description |
53-
| ------------------------------ | ---------------- | ---------------------------------------------------------- |
54-
| `MAX_REQUEST_INCLUSION_LIST` | `2**4` (= 16) | Maximum number of inclusion list in a single request |
55-
| `MAX_BYTES_PER_INCLUSION_LIST` | `2**13` (= 8192) | Maximum size of the inclusion list's transactions in bytes |
56-
5757
### The gossip domain: gossipsub
5858

5959
#### Topics and messages

specs/_features/eip7928/p2p-interface.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ EIP-7928.
66
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 -->
77

88
- [Modifications in EIP-7928](#modifications-in-eip-7928)
9-
- [Helper functions](#helper-functions)
9+
- [Helpers](#helpers)
1010
- [Modified `compute_fork_version`](#modified-compute_fork_version)
1111

1212
<!-- mdformat-toc end -->
1313

1414
## Modifications in EIP-7928
1515

16-
### Helper functions
16+
### Helpers
1717

1818
#### Modified `compute_fork_version`
1919

specs/_features/eip8025/beacon-chain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- [`ExecutionProof`](#executionproof)
1818
- [`SignedExecutionProof`](#signedexecutionproof)
1919
- [Extended Containers](#extended-containers)
20-
- [Helper functions](#helper-functions)
20+
- [Helpers](#helpers)
2121
- [Execution proof functions](#execution-proof-functions)
2222
- [`verify_execution_proof`](#verify_execution_proof)
2323
- [`verify_execution_proofs`](#verify_execution_proofs)
@@ -86,7 +86,7 @@ class SignedExecutionProof(Container):
8686
*Note*: `BeaconState` and `BeaconBlockBody` remain the same. No modifications
8787
are required for execution proofs since they are handled externally.
8888

89-
## Helper functions
89+
## Helpers
9090

9191
### Execution proof functions
9292

specs/_features/eip8025/zkevm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- [`ZKEVMProof`](#zkevmproof)
1313
- [`PrivateInput`](#privateinput)
1414
- [`PublicInput`](#publicinput)
15-
- [Helper functions](#helper-functions)
15+
- [Helpers](#helpers)
1616
- [Preprocessing](#preprocessing)
1717
- [`generate_keys`](#generate_keys)
1818
- [Proof verification](#proof-verification)
@@ -96,7 +96,7 @@ class PublicInput(Container):
9696
parent_hash: Hash32
9797
```
9898

99-
## Helper functions
99+
## Helpers
100100

101101
### Preprocessing
102102

specs/altair/beacon-chain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- [New containers](#new-containers)
2222
- [`SyncAggregate`](#syncaggregate)
2323
- [`SyncCommittee`](#synccommittee)
24-
- [Helper functions](#helper-functions)
24+
- [Helpers](#helpers)
2525
- [Crypto](#crypto)
2626
- [Misc](#misc-1)
2727
- [`add_flag`](#add_flag)
@@ -209,7 +209,7 @@ class SyncCommittee(Container):
209209
aggregate_pubkey: BLSPubkey
210210
```
211211

212-
## Helper functions
212+
## Helpers
213213

214214
### Crypto
215215

specs/altair/fork-choice.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 -->
44

55
- [Introduction](#introduction)
6-
- [New fork-choice helpers](#new-fork-choice-helpers)
6+
- [Helpers](#helpers)
77
- [New `get_sync_message_due_ms`](#new-get_sync_message_due_ms)
88
- [New `get_contribution_due_ms`](#new-get_contribution_due_ms)
99

@@ -16,7 +16,7 @@ This is the modification of the fork choice according to the Altair upgrade.
1616
Unless stated explicitly, all prior functionality from
1717
[Phase0](../phase0/fork-choice.md) is inherited.
1818

19-
## New fork-choice helpers
19+
## Helpers
2020

2121
### New `get_sync_message_due_ms`
2222

0 commit comments

Comments
 (0)