Skip to content

Commit

Permalink
refactor: Update variable name for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Dec 6, 2024
1 parent 8bae0b0 commit b18b12d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/cannon/iterator/backfilling_checkpoint_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,18 @@ func (c *BackfillingCheckpoint) Next(ctx context.Context) (rsp *BackFillingCheck
}
}

forkEpoch, errr := c.beaconNode.Metadata().Spec.ForkEpochs.GetByName(c.activationFork.String())
if errr != nil {
return nil, errors.Wrap(errr, fmt.Sprintf("failed to get epoch for fork: %s", c.activationFork))
targetEpoch := phase0.Epoch(0)

if c.activationFork != spec.DataVersionPhase0 {
forkEpoch, errr := c.beaconNode.Metadata().Spec.ForkEpochs.GetByName(c.activationFork.String())
if errr != nil {
return nil, errors.Wrap(errr, fmt.Sprintf("failed to get epoch for fork: %s", c.activationFork))
}

targetEpoch = forkEpoch.Epoch
}

if checkpoint.Epoch < forkEpoch.Epoch {
if checkpoint.Epoch < targetEpoch {
// The current finalized checkpoint is before the activation of this cannon, so we should sleep until the next epoch.
epoch := c.wallclock.Epochs().Current()

Expand Down

0 comments on commit b18b12d

Please sign in to comment.