Rename `block_batch_root` to `block_summary_root` and `state_batch_root` to `state_summary_root`

This commit is contained in:
Hsiao-Wei Wang 2023-01-03 21:50:06 +08:00
parent 1cfabcbe54
commit dcacb7164f
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 6 additions and 6 deletions

View File

@ -126,8 +126,8 @@ class HistoricalSummary(Container):
`HistoricalSummary` matches the components of the phase0 `HistoricalBatch` `HistoricalSummary` matches the components of the phase0 `HistoricalBatch`
making the two hash_tree_root-compatible. making the two hash_tree_root-compatible.
""" """
block_batch_root: Root block_summary_root: Root
state_batch_root: Root state_summary_root: Root
``` ```
### Extended Containers ### Extended Containers
@ -315,8 +315,8 @@ def process_historical_summaries_update(state: BeaconState) -> None:
next_epoch = Epoch(get_current_epoch(state) + 1) next_epoch = Epoch(get_current_epoch(state) + 1)
if next_epoch % (SLOTS_PER_HISTORICAL_ROOT // SLOTS_PER_EPOCH) == 0: if next_epoch % (SLOTS_PER_HISTORICAL_ROOT // SLOTS_PER_EPOCH) == 0:
historical_summary = HistoricalSummary( historical_summary = HistoricalSummary(
block_batch_root=hash_tree_root(state.block_roots), block_summary_root=hash_tree_root(state.block_roots),
state_batch_root=hash_tree_root(state.state_roots), state_summary_root=hash_tree_root(state.state_roots),
) )
state.historical_summaries.append(historical_summary) state.historical_summaries.append(historical_summary)
``` ```

View File

@ -23,5 +23,5 @@ def test_historical_summaries_accumulator(spec, state):
assert len(state.historical_summaries) == len(pre_historical_summaries) + 1 assert len(state.historical_summaries) == len(pre_historical_summaries) + 1
summary = state.historical_summaries[len(state.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.block_summary_root == state.block_roots.hash_tree_root()
assert summary.state_batch_root == state.state_roots.hash_tree_root() assert summary.state_summary_root == state.state_roots.hash_tree_root()