core/state: pull the verkle trie from prefetcher for empty storage root

This commit is contained in:
Gary Rong 2024-08-29 15:27:34 +08:00
parent ea3b5095f4
commit 9bc29b37f4

View file

@ -143,7 +143,7 @@ func (s *stateObject) getTrie() (Trie, error) {
func (s *stateObject) getPrefetchedTrie() Trie { func (s *stateObject) getPrefetchedTrie() Trie {
// If there's nothing to meaningfully return, let the user figure it out by // If there's nothing to meaningfully return, let the user figure it out by
// pulling the trie from disk. // pulling the trie from disk.
if s.data.Root == types.EmptyRootHash || s.db.prefetcher == nil { if (s.data.Root == types.EmptyRootHash && !s.db.db.TrieDB().IsVerkle()) || s.db.prefetcher == nil {
return nil return nil
} }
// Attempt to retrieve the trie from the prefetcher // Attempt to retrieve the trie from the prefetcher