From 66c7b869d759cffc00de0b7960593da29faaea71 Mon Sep 17 00:00:00 2001 From: alecps Date: Tue, 17 Dec 2024 19:58:48 -0500 Subject: [PATCH] fix minor indexing error in logging --- op-chain-ops/cmd/celo-migrate/ancients.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/op-chain-ops/cmd/celo-migrate/ancients.go b/op-chain-ops/cmd/celo-migrate/ancients.go index 53f01a01d882..e0c27aea4cf2 100644 --- a/op-chain-ops/cmd/celo-migrate/ancients.go +++ b/op-chain-ops/cmd/celo-migrate/ancients.go @@ -149,7 +149,7 @@ func readAncientBlocks(ctx context.Context, freezer *rawdb.Freezer, startBlock, case <-ctx.Done(): return ctx.Err() default: - count := min(batchSize, endBlock-i+1) + count := min(batchSize, endBlock-i) start := i blockRange := RLPBlockRange{ @@ -267,7 +267,7 @@ func writeAncientBlocks(ctx context.Context, freezer *rawdb.Freezer, in <-chan R return fmt.Errorf("failed to write block range: %w", err) } blockRangeEnd := blockRange.start + uint64(len(blockRange.hashes)) - 1 - log.Info("Wrote ancient blocks", "start", blockRange.start, "end", blockRangeEnd, "count", len(blockRange.hashes), "remaining", totalAncientBlocks-blockRangeEnd) + log.Info("Wrote ancient blocks", "start", blockRange.start, "end", blockRangeEnd, "count", len(blockRange.hashes), "remaining", totalAncientBlocks-(blockRangeEnd+1)) } } return nil