From cf724daa7a07092a02522879a0b1cb088db7c3b5 Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Thu, 6 May 2021 12:42:05 +0100 Subject: [PATCH] No inactivity penalty for untimely head --- specs/altair/beacon-chain.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specs/altair/beacon-chain.md b/specs/altair/beacon-chain.md index 9ad2c0089..e90c587be 100644 --- a/specs/altair/beacon-chain.md +++ b/specs/altair/beacon-chain.md @@ -354,13 +354,14 @@ def get_flag_index_deltas(state: BeaconState, flag_index: int) -> Tuple[Sequence weight = PARTICIPATION_FLAG_WEIGHTS[flag_index] unslashed_participating_increments = get_total_balance(state, unslashed_participating_indices) // EFFECTIVE_BALANCE_INCREMENT active_increments = get_total_active_balance(state) // EFFECTIVE_BALANCE_INCREMENT + in_inactivity_leak = is_in_inactivity_leak(state) for index in get_eligible_validator_indices(state): base_reward = get_base_reward(state, index) if index in unslashed_participating_indices: - if not is_in_inactivity_leak(state): + if not in_inactivity_leak: reward_numerator = base_reward * weight * unslashed_participating_increments rewards[index] += Gwei(reward_numerator // (active_increments * WEIGHT_DENOMINATOR)) - else: + elif not (in_inactivity_leak and flag_index == TIMELY_HEAD_FLAG_INDEX): penalties[index] += Gwei(base_reward * weight // WEIGHT_DENOMINATOR) return rewards, penalties ```