Skip to content

Commit 31b6da8

Browse files
authored
eip7805: rebase spec onto fulu (#4502)
This PR sets EIP7805's previous fork to Fulu & makes other necessary changes. PS: It also makes the `is_data_available` comment consistent across all specs.
1 parent b9dfb45 commit 31b6da8

File tree

11 files changed

+27
-25
lines changed

11 files changed

+27
-25
lines changed

pysetup/md_doc_paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
EIP6800: DENEB,
2626
EIP7441: CAPELLA,
2727
EIP7732: ELECTRA,
28-
EIP7805: ELECTRA,
28+
EIP7805: FULU,
2929
}
3030

3131
ALL_FORKS = list(PREVIOUS_FORK_OF.keys())

pysetup/spec_builders/eip7805.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class EIP7805SpecBuilder(BaseSpecBuilder):
88
@classmethod
99
def imports(cls, preset_name: str):
1010
return f"""
11-
from eth2spec.electra import {preset_name} as electra
11+
from eth2spec.fulu import {preset_name} as fulu
1212
"""
1313

1414
@classmethod

specs/_features/eip7805/beacon-chain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ inclusion. Refers to the following posts:
2727

2828
- [Fork-Choice enforced Inclusion Lists (FOCIL): A simple committee-based inclusion list proposal](https://ethresear.ch/t/fork-choice-enforced-inclusion-lists-focil-a-simple-committee-based-inclusion-list-proposal/19870/1)
2929
- [FOCIL CL & EL workflow](https://ethresear.ch/t/focil-cl-el-workflow/20526)
30-
*Note*: This specification is built upon
31-
[Electra](../../electra/beacon-chain.md) and is under active development.
30+
*Note*: This specification is built upon [Fulu](../../fulu/beacon-chain.md)
31+
and is under active development.
3232

3333
## Constants
3434

specs/_features/eip7805/fork-choice.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
307307
assert store.finalized_checkpoint.root == finalized_checkpoint_block
308308

309309
# Check if blob data is available
310-
# If not, this block MAY be queued and subsequently considered when blob data becomes available
311-
# *Note*: Extraneous or invalid Blobs (in addition to the expected/referenced valid blobs)
312-
# received on the p2p network MUST NOT invalidate a block that is otherwise valid and available
313-
assert is_data_available(hash_tree_root(block), block.body.blob_kzg_commitments)
310+
# If not, this payload MAY be queued and subsequently considered when blob data becomes available
311+
assert is_data_available(hash_tree_root(block))
314312

315313
# Check the block is valid and compute the post-state
316314
# Make a copy of the state to avoid mutability issues

specs/_features/eip7805/fork.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def compute_fork_version(epoch: Epoch) -> Version:
4040
"""
4141
if epoch >= EIP7805_FORK_EPOCH:
4242
return EIP7805_FORK_VERSION
43+
if epoch >= FULU_FORK_EPOCH:
44+
return FULU_FORK_VERSION
4345
if epoch >= ELECTRA_FORK_EPOCH:
4446
return ELECTRA_FORK_VERSION
4547
if epoch >= DENEB_FORK_EPOCH:
@@ -62,8 +64,8 @@ If `state.slot % SLOTS_PER_EPOCH == 0` and
6264
change is made to upgrade to EIP-7805.
6365

6466
```python
65-
def upgrade_to_eip7805(pre: electra.BeaconState) -> BeaconState:
66-
epoch = electra.get_current_epoch(pre)
67+
def upgrade_to_eip7805(pre: fulu.BeaconState) -> BeaconState:
68+
epoch = fulu.get_current_epoch(pre)
6769

6870
post = BeaconState(
6971
genesis_time=pre.genesis_time,
@@ -108,6 +110,7 @@ def upgrade_to_eip7805(pre: electra.BeaconState) -> BeaconState:
108110
pending_deposits=pre.pending_deposits,
109111
pending_partial_withdrawals=pre.pending_partial_withdrawals,
110112
pending_consolidations=pre.pending_consolidations,
113+
proposer_lookahead=pre.proposer_lookahead,
111114
)
112115

113116
return post

specs/_features/eip7805/validator.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ validator" to implement EIP-7805.
3737
## Prerequisites
3838

3939
This document is an extension of the
40-
[Electra -- Honest Validator](../../electra/validator.md) guide. All behaviors
41-
and definitions defined in this document, and documents it extends, carry over
40+
[Fulu -- Honest Validator](../../fulu/validator.md) guide. All behaviors and
41+
definitions defined in this document, and documents it extends, carry over
4242
unless explicitly noted or overridden.
4343

4444
All terminology, constants, functions, and protocol mechanics defined in the
@@ -137,8 +137,6 @@ committee slot.
137137

138138
##### ExecutionPayload
139139

140-
`prepare_execution_payload` is updated from the Electra specs.
141-
142140
*Note*: In this section, `state` is the state of the slot for the block proposal
143141
_without_ the block yet applied. That is, `state` is the `previous_state`
144142
processed through any empty slots up to the assigned slot using

specs/deneb/fork-choice.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
9494

9595
# [New in Deneb:EIP4844]
9696
# Check if blob data is available
97-
# If not, this block MAY be queued and subsequently considered when blob data becomes available
98-
# *Note*: Extraneous or invalid Blobs (in addition to the expected/referenced valid blobs)
99-
# received on the p2p network MUST NOT invalidate a block that is otherwise valid and available
97+
# If not, this payload MAY be queued and subsequently considered when blob data becomes available
10098
assert is_data_available(hash_tree_root(block), block.body.blob_kzg_commitments)
10199

102100
# Check the block is valid and compute the post-state

specs/fulu/fork-choice.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
6767
assert store.finalized_checkpoint.root == finalized_checkpoint_block
6868

6969
# [Modified in Fulu:EIP7594]
70+
# Check if blob data is available
71+
# If not, this payload MAY be queued and subsequently considered when blob data becomes available
7072
assert is_data_available(hash_tree_root(block))
7173

7274
# Check the block is valid and compute the post-state

tests/core/pyspec/eth2spec/test/context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ def decorator(fn):
512512
]
513513
)(fn)
514514

515+
return decorator
516+
515517

516518
def with_all_phases_except(exclusion_phases):
517519
"""

tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py

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

33
from eth2spec.test.context import (
44
spec_state_test,
5-
with_all_phases_from_except,
5+
with_all_phases_from_to_except,
66
)
77
from eth2spec.test.helpers.blob import get_block_with_blob
88
from eth2spec.test.helpers.constants import (
@@ -21,11 +21,12 @@
2121
)
2222

2323

24-
# TODO(jtraglia): Use with_all_phases_from_to_except after EIP7732 is based on Fulu.
24+
# TODO(jtraglia): Use with_all_phases_from_to after EIP7732 is rebased on Fulu.
2525
# This applies to every other test in this file too.
26-
@with_all_phases_from_except(DENEB, [FULU, EIP7732])
26+
@with_all_phases_from_to_except(DENEB, FULU, [EIP7732])
2727
@spec_state_test
2828
def test_simple_blob_data(spec, state):
29+
print(spec)
2930
rng = Random(1234)
3031

3132
test_steps = []
@@ -58,7 +59,7 @@ def test_simple_blob_data(spec, state):
5859
yield "steps", test_steps
5960

6061

61-
@with_all_phases_from_except(DENEB, [FULU, EIP7732])
62+
@with_all_phases_from_to_except(DENEB, FULU, [EIP7732])
6263
@spec_state_test
6364
def test_invalid_incorrect_proof(spec, state):
6465
rng = Random(1234)
@@ -88,7 +89,7 @@ def test_invalid_incorrect_proof(spec, state):
8889
yield "steps", test_steps
8990

9091

91-
@with_all_phases_from_except(DENEB, [FULU, EIP7732])
92+
@with_all_phases_from_to_except(DENEB, FULU, [EIP7732])
9293
@spec_state_test
9394
def test_invalid_data_unavailable(spec, state):
9495
rng = Random(1234)
@@ -118,7 +119,7 @@ def test_invalid_data_unavailable(spec, state):
118119
yield "steps", test_steps
119120

120121

121-
@with_all_phases_from_except(DENEB, [FULU, EIP7732])
122+
@with_all_phases_from_to_except(DENEB, FULU, [EIP7732])
122123
@spec_state_test
123124
def test_invalid_wrong_proofs_length(spec, state):
124125
rng = Random(1234)
@@ -148,7 +149,7 @@ def test_invalid_wrong_proofs_length(spec, state):
148149
yield "steps", test_steps
149150

150151

151-
@with_all_phases_from_except(DENEB, [FULU, EIP7732])
152+
@with_all_phases_from_to_except(DENEB, FULU, [EIP7732])
152153
@spec_state_test
153154
def test_invalid_wrong_blobs_length(spec, state):
154155
rng = Random(1234)

0 commit comments

Comments
 (0)