From c3adc497cfc06b261f1417fb8eab2cd80b84c90b Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 26 Jun 2024 00:05:04 -0400 Subject: [PATCH] Make caches respect pruning --- store/store.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/store/store.go b/store/store.go index 893781fc109..56cc69f5cd3 100644 --- a/store/store.go +++ b/store/store.go @@ -365,13 +365,16 @@ func (bs *BlockStore) PruneBlocks(height int64) (uint64, error) { if err := batch.Delete(calcBlockCommitKey(h)); err != nil { return 0, err } + bs.blockCommitCache.Remove(h) if err := batch.Delete(calcSeenCommitKey(h)); err != nil { return 0, err } + bs.seenCommitCache.Remove(h) for p := 0; p < int(meta.BlockID.PartSetHeader.Total); p++ { if err := batch.Delete(calcBlockPartKey(h, p)); err != nil { return 0, err } + bs.blockPartCache.Remove(blockPartIndex{h, p}) } pruned++