From 89f61e2ca537ebeb4879b532db560d6f54aefb63 Mon Sep 17 00:00:00 2001 From: DavidZangNR Date: Wed, 3 Jul 2024 22:36:41 +0800 Subject: [PATCH] Fix: fix incorrectly set origin storage. Fix an issue of incorrectly set the origin storage at parallel stateDB's GetState(). Remove this code because it is already solved by lightCopy PR: #2 --- core/state/parallel_statedb.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/core/state/parallel_statedb.go b/core/state/parallel_statedb.go index 5a01cce366..d72fc7dc5d 100644 --- a/core/state/parallel_statedb.go +++ b/core/state/parallel_statedb.go @@ -660,22 +660,6 @@ func (s *ParallelStateDB) GetState(addr common.Address, hash common.Hash) common val = common.Hash{} if object != nil { val = object.GetState(hash) - // TODO-dav: delete following originStorage change, as lightCopy is copy originStorage now. - // test dirty, there can be a case the object saved in dirty by other changes such as SetBalance. But the - // addrStateChangesInSlot[addr] does not record it. So later load from the dirties would cause flaw because the - // first value loaded from main stateDB is not updated to the object in dirties. - // Moreover, there is also an issue that the other kv in the object get from snap or trie that is accessed from - // previous tx in same block but not touched in current tx, is missed in the dirty. which may cause issues when - // calculate the root. - _, recorded := s.parallel.addrStateChangesInSlot[addr] - obj, isDirty := s.parallel.dirtiedStateObjectsInSlot[addr] - if !recorded && isDirty { - v, ok := obj.originStorage.GetValue(hash) - - if !(ok && v.Cmp(val) == 0) { - obj.originStorage.StoreValue(hash, val) - } - } } value = val }