-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3165 from arnetheduck/block-root-accumulator-4
Historical batches
- Loading branch information
Showing
11 changed files
with
176 additions
and
15 deletions.
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_summary_root == state.block_roots.hash_tree_root() | ||
assert summary.state_summary_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