Skip to content

Commit 31d923f

Browse files
committed
Revert "Fix backfill missing blocks in staging"
This reverts commit 6233232.
1 parent 6233232 commit 31d923f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/orchestrator/committer.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,18 @@ func (c *Committer) handleGap(ctx context.Context, expectedStartBlockNumber *big
631631
}
632632

633633
func (c *Committer) handleMissingStagingData(ctx context.Context, blocksToCommit []*big.Int) {
634+
// Checks if there are any blocks in staging after the current range end
635+
lastStagedBlockNumber, err := c.storage.StagingStorage.GetLastStagedBlockNumber(c.rpc.GetChainID(), blocksToCommit[len(blocksToCommit)-1], big.NewInt(0))
636+
if err != nil {
637+
log.Error().Err(err).Msg("Error checking staged data for missing range")
638+
return
639+
}
640+
if lastStagedBlockNumber == nil || lastStagedBlockNumber.Sign() <= 0 {
641+
log.Debug().Msgf("Committer is caught up with staging. No need to poll for missing blocks.")
642+
return
643+
}
634644
log.Debug().Msgf("Detected missing blocks in staging data starting from %s.", blocksToCommit[0].String())
645+
635646
blocksToPoll := blocksToCommit
636647
if len(blocksToCommit) > int(c.poller.blocksPerPoll) {
637648
blocksToPoll = blocksToCommit[:int(c.poller.blocksPerPoll)]

0 commit comments

Comments
 (0)