remove timely_head penalty

This commit is contained in:
Danny Ryan 2021-05-11 11:48:26 -06:00
parent a6b8574962
commit a9cc036184
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 4 additions and 2 deletions

View File

@ -372,7 +372,7 @@ def get_flag_index_deltas(state: BeaconState, flag_index: int) -> Tuple[Sequence
if not is_in_inactivity_leak(state): if not is_in_inactivity_leak(state):
reward_numerator = base_reward * weight * unslashed_participating_increments reward_numerator = base_reward * weight * unslashed_participating_increments
rewards[index] += Gwei(reward_numerator // (active_increments * WEIGHT_DENOMINATOR)) rewards[index] += Gwei(reward_numerator // (active_increments * WEIGHT_DENOMINATOR))
else: elif not flag_index == TIMELY_HEAD_FLAG_INDEX:
penalties[index] += Gwei(base_reward * weight // WEIGHT_DENOMINATOR) penalties[index] += Gwei(base_reward * weight // WEIGHT_DENOMINATOR)
return rewards, penalties return rewards, penalties
``` ```

View File

@ -147,7 +147,9 @@ def run_attestation_component_deltas(spec, state, component_delta_fn, matching_a
assert penalties[index] == 0 assert penalties[index] == 0
else: else:
assert rewards[index] == 0 assert rewards[index] == 0
if enough_for_reward: if is_post_altair(spec) and 'head' in deltas_name:
assert penalties[index] == 0
elif enough_for_reward:
assert penalties[index] > 0 assert penalties[index] > 0
else: else:
assert penalties[index] == 0 assert penalties[index] == 0