Skip to content

Commit

Permalink
Don't precompute epoch transition at pre genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Dec 17, 2021
1 parent f40f42b commit b8e94b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/lodestar/src/chain/precomputeNextEpochTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b8e94b8

Please sign in to comment.