This commit is contained in:
Justin Drake 2019-04-24 15:29:46 +10:00
parent c37789dc5d
commit b361fdb385
1 changed files with 6 additions and 5 deletions

View File

@ -1603,11 +1603,12 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[List[Gwei], List[Gwei]]:
penalties[index] += get_base_reward(state, index) penalties[index] += get_base_reward(state, index)
# Proposer and inclusion delay micro-rewards # Proposer and inclusion delay micro-rewards
if index in get_unslashed_attesting_indices(state, matching_source_attestations): for index in eligible_validator_indices:
earliest_attestation = get_earliest_attestation(state, matching_source_attestations, index) if index in get_unslashed_attesting_indices(state, matching_source_attestations):
rewards[earliest_attestation.proposer_index] += get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT earliest_attestation = get_earliest_attestation(state, matching_source_attestations, index)
inclusion_delay = earliest_attestation.inclusion_slot - earliest_attestation.data.slot rewards[earliest_attestation.proposer_index] += get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT
rewards[index] += get_base_reward(state, index) * MIN_ATTESTATION_INCLUSION_DELAY // inclusion_delay inclusion_delay = earliest_attestation.inclusion_slot - earliest_attestation.data.slot
rewards[index] += get_base_reward(state, index) * MIN_ATTESTATION_INCLUSION_DELAY // inclusion_delay
# Inactivity penalty # Inactivity penalty
finality_delay = previous_epoch - state.finalized_epoch finality_delay = previous_epoch - state.finalized_epoch