From b8e94b8bf770a0678f2c7fa9c74c3372601137e9 Mon Sep 17 00:00:00 2001 From: Tuyen Nguyen Date: Fri, 17 Dec 2021 09:14:32 +0700 Subject: [PATCH] Don't precompute epoch transition at pre genesis --- packages/lodestar/src/chain/precomputeNextEpochTransition.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/lodestar/src/chain/precomputeNextEpochTransition.ts b/packages/lodestar/src/chain/precomputeNextEpochTransition.ts index 43da104549e..c4507ecd94a 100644 --- a/packages/lodestar/src/chain/precomputeNextEpochTransition.ts +++ b/packages/lodestar/src/chain/precomputeNextEpochTransition.ts @@ -49,6 +49,8 @@ export class PrecomputeNextEpochTransitionScheduler { const {slot: headSlot, blockRoot} = this.chain.forkChoice.getHead(); const nextEpoch = computeEpochAtSlot(clockSlot) + 1; + // Don't want to pre compute epoch transition at pre genesis + if (nextEpoch <= 0) return; // node may be syncing or out of synced if (headSlot < clockSlot) { this.metrics?.precomputeNextEpochTransition.count.inc({result: "skip"}, 1);