From 8d1074fc3757e549948cc6a683a01d1c9a0bbaa9 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Tue, 27 Feb 2024 14:23:31 -0800 Subject: [PATCH] address feedback --- core/state/trie_prefetcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/state/trie_prefetcher.go b/core/state/trie_prefetcher.go index d5a8a3f53a..a81e528e6c 100644 --- a/core/state/trie_prefetcher.go +++ b/core/state/trie_prefetcher.go @@ -103,7 +103,7 @@ func (p *triePrefetcher) close() { p.closed = true } -// prefetch schedules a batch of trie items to prefetch. +// prefetch schedules a batch of trie items to prefetch. After the prefetcher is closed, all the following tasks scheduled will not be executed. // // prefetch is called from two locations: // 1. Finalize of the state-objects storage roots. This happens at the end @@ -126,7 +126,7 @@ func (p *triePrefetcher) prefetch(owner common.Hash, root common.Hash, addr comm func (p *triePrefetcher) trie(owner common.Hash, root common.Hash) Trie { // Bail if no trie was prefetched for this root fetcher := p.fetchers[p.trieID(owner, root)] - if fetcher == nil { + if fetcher == nil || fetcher.trie == nil { p.deliveryMissMeter.Mark(1) return nil }