From 666dbc19c613cac30947bf36dea8687da63925c6 Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Tue, 18 Mar 2025 22:12:59 +0100 Subject: [PATCH] core/filtermaps: allow log search while syncing / head indexing --- core/filtermaps/filtermaps.go | 10 ++++++---- core/filtermaps/indexer.go | 14 +++++++++----- core/filtermaps/map_renderer.go | 6 ++++-- core/filtermaps/matcher_backend.go | 2 +- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/core/filtermaps/filtermaps.go b/core/filtermaps/filtermaps.go index fe75c1ea7d..dfc20521f6 100644 --- a/core/filtermaps/filtermaps.go +++ b/core/filtermaps/filtermaps.go @@ -70,6 +70,7 @@ type FilterMaps struct { indexLock sync.RWMutex indexedRange filterMapsRange indexedView *ChainView // always consistent with the log index + hasTempRange bool // also accessed by indexer and matcher backend but no locking needed. filterMapCache *lru.Cache[uint32, filterMap] @@ -94,7 +95,7 @@ type FilterMaps struct { ptrTailUnindexMap uint32 targetView *ChainView - matcherSyncRequest *FilterMapsMatcherBackend + matcherSyncRequests []*FilterMapsMatcherBackend historyCutoff uint64 finalBlock, lastFinal uint64 lastFinalEpoch uint32 @@ -330,7 +331,7 @@ func (f *FilterMaps) init() error { fmr.blocks = common.NewRange(cp.BlockNumber+1, 0) fmr.maps = common.NewRange(uint32(bestLen)<