Merge pull request #1257 from ethereum/scale-inclusion-reward

scale inclusion reward properly
This commit is contained in:
Danny Ryan 2019-06-30 23:08:05 -05:00 committed by GitHub
commit 4ea79ee13b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1394,7 +1394,11 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[Sequence[Gwei], Sequence
proposer_reward = Gwei(get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT)
rewards[attestation.proposer_index] += proposer_reward
max_attester_reward = get_base_reward(state, index) - proposer_reward
rewards[index] += Gwei(max_attester_reward * MIN_ATTESTATION_INCLUSION_DELAY // attestation.inclusion_delay)
rewards[index] += Gwei(
max_attester_reward
* (SLOTS_PER_EPOCH + MIN_ATTESTATION_INCLUSION_DELAY - attestation.inclusion_delay)
// SLOTS_PER_EPOCH
)
# Inactivity penalty
finality_delay = previous_epoch - state.finalized_checkpoint.epoch