From 1876c9591b3f39524f4d4aaad1312196fa7cb0a3 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Tue, 30 Jun 2020 08:16:28 -0700 Subject: [PATCH 1/3] Update light committee for next slot --- specs/phase1/beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index c3ae4102e..ec3a5ce0f 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -1084,7 +1084,7 @@ def process_light_client_committee_updates(state: BeaconState) -> None: """ Update light client committees. """ - if get_current_epoch(state) % LIGHT_CLIENT_COMMITTEE_PERIOD == 0: + if compute_epoch_at_slot(state.slot + 1) % LIGHT_CLIENT_COMMITTEE_PERIOD == 0: state.current_light_committee = state.next_light_committee new_committee = get_light_client_committee(state, get_current_epoch(state) + LIGHT_CLIENT_COMMITTEE_PERIOD) state.next_light_committee = committee_to_compact_committee(state, new_committee) From c8752956ed79dbe84c1d8efe0675086f09210313 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Tue, 30 Jun 2020 08:44:09 -0700 Subject: [PATCH 2/3] use next epoch for new_committee? --- specs/phase1/beacon-chain.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index ec3a5ce0f..e782573c3 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -1084,8 +1084,9 @@ def process_light_client_committee_updates(state: BeaconState) -> None: """ Update light client committees. """ - if compute_epoch_at_slot(state.slot + 1) % LIGHT_CLIENT_COMMITTEE_PERIOD == 0: + next_epoch = compute_epoch_at_slot(state.slot + 1) + if next_epoch % LIGHT_CLIENT_COMMITTEE_PERIOD == 0: state.current_light_committee = state.next_light_committee - new_committee = get_light_client_committee(state, get_current_epoch(state) + LIGHT_CLIENT_COMMITTEE_PERIOD) + new_committee = get_light_client_committee(state, next_epoch + LIGHT_CLIENT_COMMITTEE_PERIOD) state.next_light_committee = committee_to_compact_committee(state, new_committee) ``` From 36339de5110075d0ff4b392bab57927e9c9f3c9a Mon Sep 17 00:00:00 2001 From: terence tsao Date: Tue, 30 Jun 2020 09:11:13 -0700 Subject: [PATCH 3/3] Lint --- specs/phase1/beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index e782573c3..e04c22f42 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -1084,7 +1084,7 @@ def process_light_client_committee_updates(state: BeaconState) -> None: """ Update light client committees. """ - next_epoch = compute_epoch_at_slot(state.slot + 1) + next_epoch = compute_epoch_at_slot(Slot(state.slot + 1)) if next_epoch % LIGHT_CLIENT_COMMITTEE_PERIOD == 0: state.current_light_committee = state.next_light_committee new_committee = get_light_client_committee(state, next_epoch + LIGHT_CLIENT_COMMITTEE_PERIOD)