From 23f5a99117226fba70fea235c421f1d7b6f26745 Mon Sep 17 00:00:00 2001 From: Peter Rabbitson Date: Sat, 10 Oct 2020 15:36:32 +0200 Subject: [PATCH] Add comment clarifying current codepath --- chain/store/store.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chain/store/store.go b/chain/store/store.go index 6fb689b3e..c6fc0cbef 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -454,7 +454,17 @@ func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet) func (cs *ChainStore) FlushValidationCache() error { log.Infof("clearing block validation cache...") - dsWalk, err := cs.ds.Query(query.Query{KeysOnly: true}) + dsWalk, err := cs.ds.Query(query.Query{ + // Potential TODO: the validation cache is not a namespace on its own + // but is rather constructed as prefixed-key `foo:bar` via .Instance(), which + // in turn does not work with the filter, which can match only on `foo/bar` + // + // If this is addressed (blockcache goes into its own sub-namespace) then + // strings.HasPrefix(...) below can be skipped + // + //Prefix: blockValidationCacheKeyPrefix.String() + KeysOnly: true, + }) if err != nil { return xerrors.Errorf("failed to initialize key listing query: %w", err) }