scale inclusion reward properly

This commit is contained in:
Danny Ryan 2019-06-30 22:34:35 -05:00
parent d14c1503e5
commit 126591b2f9
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A

View File

@ -1395,7 +1395,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