Skip to content

Commit

Permalink
Fix rounding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Sep 25, 2024
1 parent 8c498c9 commit d3bec5a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/state-transition/src/epoch/processSlashings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export function processSlashings(
);
const increment = EFFECTIVE_BALANCE_INCREMENT;

const penaltyPerEffectiveBalanceIncrement =
Math.floor(adjustedTotalSlashingBalanceByIncrement / totalBalanceByIncrement) * increment;
const penaltyPerEffectiveBalanceIncrement = Math.floor((adjustedTotalSlashingBalanceByIncrement * increment) / totalBalanceByIncrement);
const penalties: number[] = [];

const penaltiesByEffectiveBalanceIncrement = new Map<number, number>();
Expand Down

0 comments on commit d3bec5a

Please sign in to comment.