Minor style fixes
This commit is contained in:
parent
257c2413a5
commit
de892382db
|
@ -121,7 +121,7 @@ def get_active_header(update: LightClientUpdate) -> BeaconBlockHeader:
|
|||
def get_safety_threshold(store: LightClientStore) -> uint64:
|
||||
return max(
|
||||
store.previous_max_active_participants,
|
||||
store.current_max_active_participants
|
||||
store.current_max_active_participants,
|
||||
) // 2
|
||||
```
|
||||
|
||||
|
@ -152,7 +152,6 @@ def validate_light_client_update(store: LightClientStore,
|
|||
update: LightClientUpdate,
|
||||
current_slot: Slot,
|
||||
genesis_validators_root: Root) -> None:
|
||||
|
||||
# Verify update slot is larger than slot of current best finalized header
|
||||
active_header = get_active_header(update)
|
||||
assert current_slot >= active_header.slot > store.finalized_header.slot
|
||||
|
@ -224,7 +223,6 @@ def process_light_client_update(store: LightClientStore,
|
|||
update: LightClientUpdate,
|
||||
current_slot: Slot,
|
||||
genesis_validators_root: Root) -> None:
|
||||
|
||||
validate_light_client_update(store, update, current_slot, genesis_validators_root)
|
||||
|
||||
sync_committee_bits = update.sync_committee_aggregate.sync_committee_bits
|
||||
|
@ -244,8 +242,8 @@ def process_light_client_update(store: LightClientStore,
|
|||
|
||||
# Update the optimistic header
|
||||
if (
|
||||
sum(sync_committee_bits) > get_safety_threshold(store) and
|
||||
update.attested_header.slot > store.optimistic_header.slot
|
||||
sum(sync_committee_bits) > get_safety_threshold(store)
|
||||
and update.attested_header.slot > store.optimistic_header.slot
|
||||
):
|
||||
store.optimistic_header = update.attested_header
|
||||
|
||||
|
|
Loading…
Reference in New Issue