mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
remove recording of read storage slots in statedb
This commit is contained in:
parent
1e81f97554
commit
168245aa7e
1 changed files with 0 additions and 12 deletions
|
|
@ -74,7 +74,6 @@ type stateObject struct {
|
|||
originStorage Storage // Storage cache of original entries to dedup rewrites
|
||||
pendingStorage Storage // Storage entries that need to be flushed to disk, at the end of an entire block
|
||||
dirtyStorage Storage // Storage entries that have been modified in the current transaction execution, reset for every transaction
|
||||
readStorage []common.Hash
|
||||
|
||||
// Cache flags.
|
||||
dirtyCode bool // true if the code was updated
|
||||
|
|
@ -112,7 +111,6 @@ func newObject(db *StateDB, address common.Address, acct *types.StateAccount) *s
|
|||
originStorage: make(Storage),
|
||||
pendingStorage: make(Storage),
|
||||
dirtyStorage: make(Storage),
|
||||
readStorage: []common.Hash{},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -259,22 +257,12 @@ func (s *stateObject) finalise(prefetch bool) {
|
|||
}
|
||||
}
|
||||
|
||||
// prefetch slots that are read so that they will appear in witness
|
||||
for _, value := range s.readStorage {
|
||||
if _, ok := s.dirtyStorage[value]; !ok {
|
||||
slotsToPrefetch = append(slotsToPrefetch, common.CopyBytes(value[:]))
|
||||
}
|
||||
}
|
||||
|
||||
if s.db.prefetcher != nil && prefetch && len(slotsToPrefetch) > 0 && s.data.Root != types.EmptyRootHash {
|
||||
s.db.prefetcher.prefetch(s.addrHash, s.data.Root, s.address, slotsToPrefetch)
|
||||
}
|
||||
if len(s.dirtyStorage) > 0 {
|
||||
s.dirtyStorage = make(Storage)
|
||||
}
|
||||
if len(s.readStorage) > 0 {
|
||||
s.readStorage = []common.Hash{}
|
||||
}
|
||||
}
|
||||
|
||||
// updateTrie is responsible for persisting cached storage changes into the
|
||||
|
|
|
|||
Loading…
Reference in a new issue