From 700bef7a45eb479002096383337c7d3c386e8feb Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 12 Dec 2022 13:39:14 +0100 Subject: [PATCH] Fix `is_valid_light_client_header` --- specs/capella/light-client/sync-protocol.md | 9 ++++----- specs/eip4844/light-client/sync-protocol.md | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/specs/capella/light-client/sync-protocol.md b/specs/capella/light-client/sync-protocol.md index 060dea1b9..41204331e 100644 --- a/specs/capella/light-client/sync-protocol.md +++ b/specs/capella/light-client/sync-protocol.md @@ -167,11 +167,10 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool: epoch = compute_epoch_at_slot(get_lc_beacon_slot(header)) if epoch < CAPELLA_FORK_EPOCH: - if header.execution != ExecutionPayloadHeader(): - return False - - if header.execution_branch != [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))]: - return False + return ( + header.execution == ExecutionPayloadHeader() + and header.execution_branch == [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))] + ) return is_valid_merkle_branch( leaf=get_lc_execution_root(header), diff --git a/specs/eip4844/light-client/sync-protocol.md b/specs/eip4844/light-client/sync-protocol.md index e66b81ea1..61881bd38 100644 --- a/specs/eip4844/light-client/sync-protocol.md +++ b/specs/eip4844/light-client/sync-protocol.md @@ -72,11 +72,10 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool: return False if epoch < CAPELLA_FORK_EPOCH: - if header.execution != ExecutionPayloadHeader(): - return False - - if header.execution_branch != [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))]: - return False + return ( + header.execution == ExecutionPayloadHeader() + and header.execution_branch == [Bytes32() for _ in range(floorlog2(EXECUTION_PAYLOAD_INDEX))] + ) return is_valid_merkle_branch( leaf=get_lc_execution_root(header),