Merge pull request #2178 from ethereum/ralexstokes-patch-1

Bugfix in sync committee proposer rewards
This commit is contained in:
Danny Ryan 2021-01-06 10:47:28 -06:00 committed by GitHub
commit ca35773d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -193,7 +193,7 @@ def process_sync_committee(state: BeaconState, body: BeaconBlockBody) -> None:
assert eth2_fast_aggregate_verify(participant_pubkeys, signing_root, body.sync_committee_signature) assert eth2_fast_aggregate_verify(participant_pubkeys, signing_root, body.sync_committee_signature)
# Reward sync committee participants # Reward sync committee participants
proposer_reward = Gwei(0) total_proposer_reward = Gwei(0)
active_validator_count = uint64(len(get_active_validator_indices(state, get_current_epoch(state)))) active_validator_count = uint64(len(get_active_validator_indices(state, get_current_epoch(state))))
for participant_index in participant_indices: for participant_index in participant_indices:
base_reward = get_base_reward(state, participant_index) base_reward = get_base_reward(state, participant_index)
@ -201,10 +201,10 @@ def process_sync_committee(state: BeaconState, body: BeaconBlockBody) -> None:
max_participant_reward = base_reward - proposer_reward max_participant_reward = base_reward - proposer_reward
reward = Gwei(max_participant_reward * active_validator_count // len(committee_indices) // SLOTS_PER_EPOCH) reward = Gwei(max_participant_reward * active_validator_count // len(committee_indices) // SLOTS_PER_EPOCH)
increase_balance(state, participant_index, reward) increase_balance(state, participant_index, reward)
proposer_reward += proposer_reward total_proposer_reward += proposer_reward
# Reward beacon proposer # Reward beacon proposer
increase_balance(state, get_beacon_proposer_index(state), proposer_reward) increase_balance(state, get_beacon_proposer_index(state), total_proposer_reward)
``` ```
### Epoch processing ### Epoch processing