Skip to content

Commit e6c559f

Browse files
authored
fix: do not report negative sync time and slots/s (#6918)
1 parent 48e6bac commit e6c559f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/beacon-node/src/node/notifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export async function runNodeNotifier(modules: NodeNotifierModules): Promise<voi
9292
switch (sync.state) {
9393
case SyncState.SyncingFinalized:
9494
case SyncState.SyncingHead: {
95-
const slotsPerSecond = headSlotTimeSeries.computeLinearSpeed();
95+
const slotsPerSecond = Math.max(headSlotTimeSeries.computeLinearSpeed(), 0);
9696
const distance = Math.max(clockSlot - headSlot, 0);
9797
const secondsLeft = distance / slotsPerSecond;
9898
const timeLeft = isFinite(secondsLeft) ? prettyTimeDiffSec(secondsLeft) : "?";

0 commit comments

Comments
 (0)