Skip to content

Commit

Permalink
fix: fix regression in getCurrentSlotAround (#6407)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain authored Feb 7, 2024
1 parent 6a47911 commit d1caa1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/validator/src/util/clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Clock implements IClock {
*/
export function getCurrentSlotAround(config: ChainForkConfig, genesisTime: TimeSeconds): Slot {
const diffInSeconds = Date.now() / 1000 - genesisTime;
const slotsSinceGenesis = Math.floor(diffInSeconds / config.SECONDS_PER_SLOT);
const slotsSinceGenesis = Math.round(diffInSeconds / config.SECONDS_PER_SLOT);
return GENESIS_SLOT + slotsSinceGenesis;
}

Expand Down

0 comments on commit d1caa1f

Please sign in to comment.