-
Notifications
You must be signed in to change notification settings - Fork 985
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
Historical batches #3165
Merged
Merged
Historical batches #3165
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1c8d57e
Historical batches
arnetheduck 4d1b487
move field last
arnetheduck c185f91
Merge branch 'dev' into pr2649-tests
hwwhww 84592f1
Add tests for `process_historical_batches_update`
hwwhww b6ac1fa
Update specs/capella/beacon-chain.md
arnetheduck 1cfabcb
Rename `HistoricalBatchSummary` -> `HistoricalSummary` and `historica…
hwwhww dcacb71
Rename `block_batch_root` to `block_summary_root` and `state_batch_ro…
hwwhww 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 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 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
Empty file.
27 changes: 27 additions & 0 deletions
27
...e/pyspec/eth2spec/test/capella/epoch_processing/test_process_historical_batches_update.py
This file contains 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,27 @@ | ||
from eth2spec.test.context import ( | ||
CAPELLA, | ||
spec_state_test, | ||
with_phases, | ||
) | ||
from eth2spec.test.helpers.epoch_processing import ( | ||
run_epoch_processing_with | ||
) | ||
|
||
|
||
def run_process_historical_summaries_update(spec, state): | ||
yield from run_epoch_processing_with(spec, state, 'process_historical_summaries_update') | ||
|
||
|
||
@with_phases([CAPELLA]) | ||
@spec_state_test | ||
def test_historical_summaries_accumulator(spec, state): | ||
# skip ahead to near the end of the historical batch period (excl block before epoch processing) | ||
state.slot = spec.SLOTS_PER_HISTORICAL_ROOT - 1 | ||
pre_historical_summaries = state.historical_summaries.copy() | ||
|
||
yield from run_process_historical_summaries_update(spec, state) | ||
|
||
assert len(state.historical_summaries) == len(pre_historical_summaries) + 1 | ||
summary = state.historical_summaries[len(state.historical_summaries) - 1] | ||
assert summary.block_batch_root == state.block_roots.hash_tree_root() | ||
assert summary.state_batch_root == state.state_roots.hash_tree_root() |
Empty file.
23 changes: 23 additions & 0 deletions
23
...e/pyspec/eth2spec/test/eip4844/epoch_processing/test_process_historical_batches_update.py
This file contains 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,23 @@ | ||
from eth2spec.test.context import ( | ||
spec_state_test, | ||
with_eip4844_and_later, | ||
) | ||
from eth2spec.test.helpers.epoch_processing import ( | ||
run_epoch_processing_with | ||
) | ||
|
||
|
||
def run_process_historical_summaries_update(spec, state): | ||
yield from run_epoch_processing_with(spec, state, 'process_historical_summaries_update') | ||
|
||
|
||
@with_eip4844_and_later | ||
@spec_state_test | ||
def test_no_op(spec, state): | ||
# skip ahead to near the end of the historical batch period (excl block before epoch processing) | ||
state.slot = spec.SLOTS_PER_HISTORICAL_ROOT - 1 | ||
historical_summaries_len = len(state.historical_summaries) | ||
|
||
yield from run_process_historical_summaries_update(spec, state) | ||
|
||
assert len(state.historical_summaries) == historical_summaries_len |
This file contains 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 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 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djrtwo @arnetheduck
Should we also rename
block_batch_root
toblock_summary_root
andstate_batch_root
tostate_summary_root
? The docstring hints it has a connection toHistoricalBatch
, so I didn't change it. I'm okay with either way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree on changing the name to block/state_summary_root. although don't feel too strongly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no objections :)