diff --git a/internal/packages/consensus/babylon-checkpoint/indexer/batch_sync.go b/internal/packages/consensus/babylon-checkpoint/indexer/batch_sync.go index 002f484..752eb04 100644 --- a/internal/packages/consensus/babylon-checkpoint/indexer/batch_sync.go +++ b/internal/packages/consensus/babylon-checkpoint/indexer/batch_sync.go @@ -61,7 +61,7 @@ func (idx *CheckpointIndexer) batchSync(lastIndexPointerEpoch int64) ( idx.Infof("last finalized epoch(current_epoch -1) is %d and last index pointer epoch is %d", lastFinalizedEpoch, lastIndexPointerEpoch) idx.Infof("new sync epoch: %d", newIndexerPointerEpoch) - for epoch := range lastFinalizedEpoch + 1 { + for epoch := int64(0); epoch <= lastFinalizedEpoch; epoch++ { if epoch <= 1 { continue } diff --git a/internal/packages/consensus/babylon-checkpoint/indexer/indexer_test.go b/internal/packages/consensus/babylon-checkpoint/indexer/indexer_test.go index 5399da6..44804d8 100644 --- a/internal/packages/consensus/babylon-checkpoint/indexer/indexer_test.go +++ b/internal/packages/consensus/babylon-checkpoint/indexer/indexer_test.go @@ -104,7 +104,7 @@ func TestSyncEpoch(t *testing.T) { assert.NoError(t, err) // for loop until current epoch - for epoch := range currentEpoch { + for epoch := int64(0); epoch < int64(currentEpoch)+1; epoch++ { if epoch == 0 { t.Log("skip the zero epoch") continue