Merge pull request #1682 from ethereum/reward-acc-bug

Attestation reward bug
This commit is contained in:
Danny Ryan 2020-03-24 19:36:23 -06:00 committed by GitHub
commit b8d25dc5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1372,7 +1372,7 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[Sequence[Gwei], Sequence
if index in unslashed_attesting_indices: if index in unslashed_attesting_indices:
increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from balance totals to avoid uint64 overflow increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from balance totals to avoid uint64 overflow
reward_numerator = get_base_reward(state, index) * (attesting_balance // increment) reward_numerator = get_base_reward(state, index) * (attesting_balance // increment)
rewards[index] = reward_numerator // (total_balance // increment) rewards[index] += reward_numerator // (total_balance // increment)
else: else:
penalties[index] += get_base_reward(state, index) penalties[index] += get_base_reward(state, index)