From 3b4e97f83753ffdb455d53f60f9056c233f84459 Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Fri, 31 Jan 2025 11:44:56 -0500 Subject: [PATCH] Fix chain index compaction offset (#1905) --- chainindex/chain_index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chainindex/chain_index.go b/chainindex/chain_index.go index 078875dece..06e5bed9d8 100644 --- a/chainindex/chain_index.go +++ b/chainindex/chain_index.go @@ -137,7 +137,7 @@ func (c *ChainIndex[T]) UpdateLastAccepted(ctx context.Context, blk T) error { } c.metrics.deletedBlocks.Inc() - if expiryHeight%c.compactionOffset == 0 { + if expiryHeight%c.config.BlockCompactionFrequency == c.compactionOffset { go func() { start := time.Now() if err := c.db.Compact([]byte{blockPrefix}, prefixBlockKey(expiryHeight)); err != nil {