Fix `is_valid_light_client_header`

This commit is contained in:
Etan Kissling 2022-12-12 13:39:14 +01:00
parent dc05a3f19e
commit 700bef7a45
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
2 changed files with 8 additions and 10 deletions

View File

@ -167,11 +167,10 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool:
epoch = compute_epoch_at_slot(get_lc_beacon_slot(header)) epoch = compute_epoch_at_slot(get_lc_beacon_slot(header))
if epoch < CAPELLA_FORK_EPOCH: if epoch < CAPELLA_FORK_EPOCH:
if header.execution != ExecutionPayloadHeader(): return (
return False header.execution == ExecutionPayloadHeader()
and header.execution_branch == [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))]
if header.execution_branch != [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))]: )
return False
return is_valid_merkle_branch( return is_valid_merkle_branch(
leaf=get_lc_execution_root(header), leaf=get_lc_execution_root(header),

View File

@ -72,11 +72,10 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool:
return False return False
if epoch < CAPELLA_FORK_EPOCH: if epoch < CAPELLA_FORK_EPOCH:
if header.execution != ExecutionPayloadHeader(): return (
return False header.execution == ExecutionPayloadHeader()
and header.execution_branch == [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))]
if header.execution_branch != [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))]: )
return False
return is_valid_merkle_branch( return is_valid_merkle_branch(
leaf=get_lc_execution_root(header), leaf=get_lc_execution_root(header),