From 7302c5bd408b28481d76241565698cb7ad8711c8 Mon Sep 17 00:00:00 2001 From: lx <92799281+brilliant-lx@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:32:31 +0800 Subject: [PATCH] trie: keep trie prefetch during validation phase (#1954) --- core/state/state_object.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/state/state_object.go b/core/state/state_object.go index 1478e434ab..935620584b 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -149,17 +149,17 @@ func (s *stateObject) touch() { func (s *stateObject) getTrie() (Trie, error) { if s.trie == nil { // Try fetching from prefetcher first - if s.data.Root != types.EmptyRootHash && s.db.prefetcher != nil { - // When the miner is creating the pending state, there is no prefetcher - s.trie = s.db.prefetcher.trie(s.addrHash, s.data.Root) - } - if s.trie == nil { - tr, err := s.db.db.OpenStorageTrie(s.db.originalRoot, s.address, s.data.Root) - if err != nil { - return nil, err - } - s.trie = tr + // if s.data.Root != types.EmptyRootHash && s.db.prefetcher != nil { + // When the miner is creating the pending state, there is no prefetcher + // s.trie = s.db.prefetcher.trie(s.addrHash, s.data.Root) + // } + // if s.trie == nil { + tr, err := s.db.db.OpenStorageTrie(s.db.originalRoot, s.address, s.data.Root) + if err != nil { + return nil, err } + s.trie = tr + // } } return s.trie, nil }