From 9313815976803c2e93c8fbb4b2518340c4ce83c7 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 4 Feb 2021 08:47:46 -0700 Subject: [PATCH] put 'validator' in flags methods --- specs/lightclient/beacon-chain.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specs/lightclient/beacon-chain.md b/specs/lightclient/beacon-chain.md index ff69c1312..e11f50076 100644 --- a/specs/lightclient/beacon-chain.md +++ b/specs/lightclient/beacon-chain.md @@ -210,12 +210,12 @@ def get_flags_and_numerators() -> Sequence[Tuple[ValidatorFlag, int]]: ``` ```python -def add_flags(flags: ValidatorFlag, add: ValidatorFlag) -> ValidatorFlag: +def add_validator_flags(flags: ValidatorFlag, add: ValidatorFlag) -> ValidatorFlag: return flags | add ``` ```python -def has_flags(flags: ValidatorFlag, has: ValidatorFlag) -> bool: +def has_validator_flags(flags: ValidatorFlag, has: ValidatorFlag) -> bool: return flags & has == has ``` @@ -288,7 +288,7 @@ def get_unslashed_participating_indices(state: BeaconState, flags: ValidatorFlag epoch_participation = state.previous_epoch_participation participating_indices = [ index for index in get_active_validator_indices(state, epoch) - if has_flags(epoch_participation[index], flags) + if has_validator_flags(epoch_participation[index], flags) ] return set(filter(lambda index: not state.validators[index].slashed, participating_indices)) ``` @@ -410,8 +410,8 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None: proposer_reward_numerator = 0 for index in get_attesting_indices(state, data, attestation.aggregation_bits): for flag, numerator in get_flags_and_numerators(): - if flag in participation_flags and not has_flags(epoch_participation[index], flag): - epoch_participation[index] = add_flags(epoch_participation[index], flag) + if flag in participation_flags and not has_validator_flags(epoch_participation[index], flag): + epoch_participation[index] = add_validator_flags(epoch_participation[index], flag) proposer_reward_numerator += get_base_reward(state, index) * numerator # Reward proposer