From 2987aaaee1062c9c782d0a102beae111876932ad Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 20 Aug 2024 23:54:46 +0800 Subject: [PATCH] Revert "Fix: contention issue of Trie for PEVM (#41)" This reverts commit d3fc63a4bcc3c092d0f3d45691f21240fa8f00bf. --- core/state/state_object.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/state/state_object.go b/core/state/state_object.go index ca66937919..e6f6569f75 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -410,14 +410,14 @@ func (s *stateObject) GetCommittedState(key common.Hash) common.Hash { // If the snapshot is unavailable or reading from it fails, load from the database. if s.db.snap == nil || err != nil { start := time.Now() - s.db.trieParallelLock.Lock() - defer s.db.trieParallelLock.Unlock() tr, err := s.getTrie() if err != nil { s.db.setError(err) return common.Hash{} } + s.db.trieParallelLock.Lock() val, err := tr.GetStorage(s.address, key.Bytes()) + s.db.trieParallelLock.Unlock() if metrics.EnabledExpensive { s.db.StorageReads += time.Since(start) } @@ -976,14 +976,14 @@ func (s *stateObject) GetCommittedStateNoUpdate(key common.Hash) common.Hash { // If the snapshot is unavailable or reading from it fails, load from the database. if s.db.snap == nil || err != nil { start := time.Now() - s.db.trieParallelLock.Lock() - defer s.db.trieParallelLock.Unlock() tr, err := s.getTrie() if err != nil { s.db.setError(err) return common.Hash{} } + s.db.trieParallelLock.Lock() val, err := tr.GetStorage(s.address, key.Bytes()) + s.db.trieParallelLock.Unlock() if metrics.EnabledExpensive { s.db.StorageReads += time.Since(start) }