Skip to content

Commit

Permalink
Fix chain index compaction offset (#1905)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Jan 31, 2025
1 parent a30ea0e commit 3b4e97f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chainindex/chain_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3b4e97f

Please sign in to comment.