Skip to content

Commit

Permalink
Fix epoch process effective balance by increment (#3083)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored Sep 6, 2021
1 parent 43972fb commit 4fee784
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ export function beforeProcessEpoch<T extends allForks.BeaconState>(state: Cached
}

const active = isActiveValidator(validator, currentEpoch);
// We track effectiveBalanceByIncrement as ETH to fit total network balance in a JS number (53 bits)
const effectiveBalanceByIncrement = Math.floor(validator.effectiveBalance / EFFECTIVE_BALANCE_INCREMENT);
effectiveBalancesByIncrements[i] = effectiveBalanceByIncrement;
if (active) {
status.active = true;
// We track effectiveBalanceByIncrement as ETH to fit total network balance in a JS number (53 bits)
const effectiveBalanceByIncrement = Math.floor(validator.effectiveBalance / EFFECTIVE_BALANCE_INCREMENT);
effectiveBalancesByIncrements[i] = effectiveBalanceByIncrement;
totalActiveStakeByIncrement += effectiveBalanceByIncrement;
}

Expand Down

0 comments on commit 4fee784

Please sign in to comment.