Skip to content

Commit

Permalink
Revert "Fix: contention issue of Trie for PEVM (bnb-chain#41)"
Browse files Browse the repository at this point in the history
This reverts commit d3fc63a.
  • Loading branch information
sunny2022da committed Aug 20, 2024
1 parent 4c280d4 commit 2987aaa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 2987aaa

Please sign in to comment.