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 9, 2024
1 parent eb6b386 commit b4e2114
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 b4e2114

Please sign in to comment.