Skip to content

Commit

Permalink
fix: do not report negative sync time and slots/s (#6918)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jun 29, 2024
1 parent 48e6bac commit e6c559f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/beacon-node/src/node/notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export async function runNodeNotifier(modules: NodeNotifierModules): Promise<voi
switch (sync.state) {
case SyncState.SyncingFinalized:
case SyncState.SyncingHead: {
const slotsPerSecond = headSlotTimeSeries.computeLinearSpeed();
const slotsPerSecond = Math.max(headSlotTimeSeries.computeLinearSpeed(), 0);
const distance = Math.max(clockSlot - headSlot, 0);
const secondsLeft = distance / slotsPerSecond;
const timeLeft = isFinite(secondsLeft) ? prettyTimeDiffSec(secondsLeft) : "?";
Expand Down

0 comments on commit e6c559f

Please sign in to comment.