-
Notifications
You must be signed in to change notification settings - Fork 1.1k
EIP-7917: Deterministic proposer lookahead #4190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jtraglia
merged 39 commits into
ethereum:dev
from
linoscope:stabalize-next-epoch-lookahead
Jun 3, 2025
Merged
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
e73b5d8
EIP-XXXX Stabilize next epoch proposer lookahead
linoscope fb3cd63
EIP-XXXX add simple happy case tests
linoscope 3fbe39c
fixup: Code clean up
linoscope 0a37fe7
fixup: Target correct fork
linoscope a4dd9eb
Merge branch 'dev' into stabalize-next-epoch-lookahead
jtraglia 9b82cb4
Clean up comment
linoscope 7485399
refactor based on review comments
linoscope 6a1d923
fix fork check in genesis helper
linoscope 8fb1a58
improve comments
linoscope 208f368
fix off-by-one error
linoscope af1892b
fix bug in seed calculation
linoscope 53df021
add proper EIP number (EIP7917)
linoscope 94d9dde
fix lint errors
linoscope 83daa1e
add test to check lookahead consistency before/after Fulu fork
linoscope b1b0144
add tests for lookahead changes due to EB changes
linoscope 9610b02
fix test folder
linoscope 898432d
fix import
linoscope 0414e6c
fix imports
linoscope 78b3810
add generator EIP-7917 tests
linoscope 291bed7
Merge branch 'dev' into stabalize-next-epoch-lookahead
jtraglia a54040e
Run make lint
jtraglia cede1ae
better yielding of vectors
linoscope 3c9cf75
move helper and fix type
linoscope ec0243d
Merge branch 'dev' into stabalize-next-epoch-lookahead
jtraglia 835df3d
Run make lint
jtraglia 1860d06
move state accessors outside of function
linoscope faaf52b
use helper in test
linoscope dfce6e4
Move some tests to the `sanity` format to generate vectors for EIP-7917
leolara 016b45d
Merge remote-tracking branch 'origin/dev' into stabalize-next-epoch-l…
linoscope 98adbee
Merge branch 'dev' into stabalize-next-epoch-lookahead
jtraglia a53408e
Run make lint
jtraglia ef950a6
Make test less reliant on specific RANDAO
linoscope 9d5a6be
Break up two long lines
jtraglia c17c9dd
Use double backticks in docstrings
jtraglia ac6b213
fix yield statement in test
linoscope c8811a0
Change proposer_lookahead type from List to Vector
linoscope e9266b2
Compute seed and indicies inside compute_proposer_indicies
linoscope 79bf80d
refactor and introduce get_beacon_proposer_indices
linoscope 5874370
remove trailing whitespaces
linoscope File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_proposer_lookahead.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from eth2spec.test.context import spec_state_test, with_electra_and_later | ||
from eth2spec.test.helpers.epoch_processing import run_epoch_processing_with | ||
from eth2spec.test.helpers.state import next_epoch | ||
|
||
|
||
@with_electra_and_later | ||
@spec_state_test | ||
def test_next_epoch_proposer_lookahead_shifted_to_front(spec, state): | ||
"""Test that the next epoch proposer lookahead is "shifted" to the front at epoch transition.""" | ||
# Transition few epochs to pass the MIN_SEED_LOOKAHEAD | ||
next_epoch(spec, state) | ||
next_epoch(spec, state) | ||
# Get initial lookahead | ||
initial_lookahead = state.proposer_lookahead.copy() | ||
|
||
# Run epoch processing | ||
yield from run_epoch_processing_with(spec, state, 'process_proposer_lookahead') | ||
|
||
# Verify lookahead was shifted correctly | ||
assert state.proposer_lookahead[:spec.SLOTS_PER_EPOCH] == initial_lookahead[spec.SLOTS_PER_EPOCH:] | ||
|
||
|
||
@with_electra_and_later | ||
@spec_state_test | ||
def test_proposer_lookahead_in_state_matches_computed_lookahead(spec, state): | ||
"""Test that the proposer lookahead in the state matches the lookahead computed on the fly.""" | ||
# Transition few epochs to pass the MIN_SEED_LOOKAHEAD | ||
next_epoch(spec, state) | ||
next_epoch(spec, state) | ||
|
||
# Run epoch processing | ||
yield from run_epoch_processing_with(spec, state, 'process_proposer_lookahead') | ||
|
||
# Verify lookahead in state matches the lookahead computed on the fly | ||
computed_lookahead = spec.compute_proposer_lookahead(state) | ||
assert state.proposer_lookahead == computed_lookahead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.