From 0f2ad67e4d683eaf8f2646440c197cdc2f4ef964 Mon Sep 17 00:00:00 2001 From: iuwqyir Date: Tue, 22 Jul 2025 21:13:05 +0300 Subject: [PATCH] fix misleading error message --- internal/orchestrator/committer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/orchestrator/committer.go b/internal/orchestrator/committer.go index 5d59931..599ea9a 100644 --- a/internal/orchestrator/committer.go +++ b/internal/orchestrator/committer.go @@ -113,7 +113,7 @@ func (c *Committer) getBlockNumbersToCommit(ctx context.Context) ([]*big.Int, er }() latestCommittedBlockNumber, err := c.storage.MainStorage.GetMaxBlockNumber(c.rpc.GetChainID()) - log.Info().Msgf("Committer found this max block number in main storage: %s", latestCommittedBlockNumber.String()) + log.Debug().Msgf("Committer found this max block number in main storage: %s", latestCommittedBlockNumber.String()) if err != nil { return nil, err } @@ -135,9 +135,12 @@ func (c *Committer) getBlockNumbersToCommit(ctx context.Context) ([]*big.Int, er } blockCount := new(big.Int).Sub(endBlock, startBlock).Int64() + 1 - if blockCount < 1 { + if blockCount < 0 { return []*big.Int{}, fmt.Errorf("more blocks have been committed than the RPC has available - possible chain reset") } + if blockCount == 0 { + return []*big.Int{}, nil + } blockNumbers := make([]*big.Int, blockCount) for i := int64(0); i < blockCount; i++ { blockNumber := new(big.Int).Add(startBlock, big.NewInt(i))