From fb0c6d54f87eba3d9454484cd4ae14e5397d0bb2 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 19 Jan 2021 20:12:36 +0800 Subject: [PATCH] Add @ralexstokes's fix --- specs/lightclient/sync-protocol.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/specs/lightclient/sync-protocol.md b/specs/lightclient/sync-protocol.md index 562b7b5bb..b8d443fb2 100644 --- a/specs/lightclient/sync-protocol.md +++ b/specs/lightclient/sync-protocol.md @@ -185,10 +185,12 @@ def process_light_client_update(store: LightClientStore, update: LightClientUpda store.valid_updates.append(update) if ( - sum(update.sync_committee_bits) * 3 >= len(update.sync_committee_bits) * 2 - and update.header != update.finality_header + sum(update.sync_committee_bits) * 3 > len(update.sync_committee_bits) * 2 + and update.finality_header != BeaconBlockHeader() ): - # Apply update if 2/3 quorum is reached and we have a finality proof + # Apply update if (1) 2/3 quorum is reached and (2) we have a finality proof. + # Note that (2) means that the current light client design needs finality. + # It may be changed to re-organizable light client design. See the on-going issue eth2.0-specs#2182. apply_light_client_update(store, update) store.valid_updates = [] elif current_slot > store.snapshot.header.slot + LIGHT_CLIENT_UPDATE_TIMEOUT: