From 0c0d299c52c84141ad1f8ee5ea56df0003739afb Mon Sep 17 00:00:00 2001 From: cui Date: Tue, 28 Apr 2026 20:33:40 +0800 Subject: [PATCH] core/state: opt stateObject.GetState (#34825) --- core/state/state_object.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/state/state_object.go b/core/state/state_object.go index 264dfd920d..8e72486825 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -162,8 +162,11 @@ 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 + } + return s.GetCommittedState(key) } // getState retrieves a value associated with the given storage key, along with