mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ensure non-mutated storage slots are included in witness when snapshot is enabled
This commit is contained in:
parent
4943bd8bbb
commit
494ba791a1
2 changed files with 10 additions and 3 deletions
|
|
@ -921,14 +921,13 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
|
|||
prefetcher := s.prefetcher
|
||||
if s.prefetcher != nil {
|
||||
defer func() {
|
||||
// TODO: need to wait for read accounts to be resolved in prefetcher main trie?
|
||||
s.prefetcher.close()
|
||||
|
||||
s.prefetcher.wait()
|
||||
if s.witness != nil {
|
||||
// TODO: move read prefetcher logic into Commit?
|
||||
s.collectReadStorageAccessLists()
|
||||
s.collectReadAccountsAccessLists()
|
||||
}
|
||||
s.prefetcher.close()
|
||||
s.prefetcher = nil
|
||||
}()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,6 +210,14 @@ func (sf *subfetcher) schedule(keys [][]byte) {
|
|||
}
|
||||
}
|
||||
|
||||
// wait instructs all subfetchers to finish their tasks
|
||||
// and stop receiving new requests.
|
||||
func (p *triePrefetcher) wait() {
|
||||
for _, fetcher := range p.fetchers {
|
||||
fetcher.wait()
|
||||
}
|
||||
}
|
||||
|
||||
// wait waits for the subfetcher to finish it's task. It is safe to call wait multiple
|
||||
// times but it is not thread safe.
|
||||
func (sf *subfetcher) wait() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue