From 70b181fe320d72c9e681d7bb59fee9490e7a35c9 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 23 Nov 2018 12:57:17 -0600 Subject: [PATCH] Small fixes * pick out committee when getting proposer * avoid unsigned underflow when chain is starting (since we're using uint) --- specs/core/0_beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index d674823a6..034f8123f 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -515,7 +515,7 @@ The following is a function that determines the proposer of a beacon block: ```python def get_beacon_proposer(state:BeaconState, slot: int) -> ValidatorRecord: - first_committee = get_shards_and_committees_for_slot(state, slot)[0] + first_committee = get_shards_and_committees_for_slot(state, slot)[0].committee index = first_committee[slot % len(first_committee)] return state.validators[index] ``` @@ -686,7 +686,7 @@ First, a helper function: ```python def min_empty_validator(validators: List[ValidatorRecord], current_slot: int): for i, v in enumerate(validators): - if v.status == WITHDRAWN and v.exit_slot <= current_slot - DELETION_PERIOD: + if v.status == WITHDRAWN and v.exit_slot + DELETION_PERIOD <= current_slot: return i return None ```