From c63d796fbf29c2d06bb1c3d2b8a20db15b654fb0 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 25 Apr 2026 18:30:59 +0800 Subject: [PATCH] core/state: opt stateObject.GetState --- core/state/state_object.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/state/state_object.go b/core/state/state_object.go index 264dfd920d..b9a924fe9a 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -162,8 +162,12 @@ func (s *stateObject) getPrefetchedTrie() Trie { // GetState retrieves a value associated with the given storage key. func (s *stateObject) GetState(key common.Hash) common.Hash { - value, _ := s.getState(key) - return value + value, dirty := s.dirtyStorage[key] + if dirty { + return value + } + origin := s.GetCommittedState(key) + return origin } // getState retrieves a value associated with the given storage key, along with