From 921acc300b0c2e5e716bf266d7975fa5e5f68d0e Mon Sep 17 00:00:00 2001 From: terence tsao Date: Mon, 30 Aug 2021 15:50:51 -0700 Subject: [PATCH] Clean up `ProcessInactivityScores` (#9483) --- beacon-chain/core/altair/epoch_precompute.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/beacon-chain/core/altair/epoch_precompute.go b/beacon-chain/core/altair/epoch_precompute.go index 682fd65b7..25e8f0fca 100644 --- a/beacon-chain/core/altair/epoch_precompute.go +++ b/beacon-chain/core/altair/epoch_precompute.go @@ -98,12 +98,7 @@ func ProcessInactivityScores( if v.IsPrevEpochTargetAttester && !v.IsSlashed { // Decrease inactivity score when validator gets target correct. if v.InactivityScore > 0 { - score := uint64(1) - // Prevents underflow below 0. - if score > v.InactivityScore { - score = v.InactivityScore - } - v.InactivityScore -= score + v.InactivityScore -= 1 } } else { v.InactivityScore += bias