make linter happy

This commit is contained in:
Hsiao-Wei Wang 2023-04-05 11:38:20 +08:00
parent cdcf45855a
commit 4cac761818
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
3 changed files with 20 additions and 4 deletions

View File

@ -170,7 +170,11 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
finalized_slot = compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)
assert block.slot > finalized_slot
# Check block is a descendant of the finalized block at the checkpoint finalized slot
assert get_ancestor_at_epoch_boundary(store, block.parent_root, store.finalized_checkpoint.epoch) == store.finalized_checkpoint.root
assert store.finalized_checkpoint.root == get_ancestor_at_epoch_boundary(
store,
block.parent_root,
store.finalized_checkpoint.epoch,
)
# Check the block is valid and compute the post-state
state = pre_state.copy()

View File

@ -82,7 +82,11 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
finalized_slot = compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)
assert block.slot > finalized_slot
# Check block is a descendant of the finalized block at the checkpoint finalized slot
assert get_ancestor_at_epoch_boundary(store, block.parent_root, store.finalized_checkpoint.epoch) == store.finalized_checkpoint.root
assert store.finalized_checkpoint.root == get_ancestor_at_epoch_boundary(
store,
block.parent_root,
store.finalized_checkpoint.epoch,
)
# [New in Deneb]
# Check if blob data is available

View File

@ -292,7 +292,11 @@ def filter_block_tree(store: Store, block_root: Root, blocks: Dict[Root, BeaconB
correct_finalized = (
store.finalized_checkpoint.epoch == GENESIS_EPOCH
or store.finalized_checkpoint.root == get_ancestor_at_epoch_boundary(store, block_root, store.finalized_checkpoint.epoch)
or store.finalized_checkpoint.root == get_ancestor_at_epoch_boundary(
store,
block_root,
store.finalized_checkpoint.epoch,
)
)
# If expected finalized/justified, add to viable block-tree and signal viability to parent.
@ -516,7 +520,11 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
finalized_slot = compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)
assert block.slot > finalized_slot
# Check block is a descendant of the finalized block at the checkpoint finalized slot
assert get_ancestor_at_epoch_boundary(store, block.parent_root, store.finalized_checkpoint.epoch) == store.finalized_checkpoint.root
assert store.finalized_checkpoint.root == get_ancestor_at_epoch_boundary(
store,
block.parent_root,
store.finalized_checkpoint.epoch,
)
# Check the block is valid and compute the post-state
state = pre_state.copy()