Use a new hasher for each account access

There seems to be an issue when hasher is used concurrently in parallel
execution. This change will ensure no hasher is used by multiple
executors at the same time.
This commit is contained in:
Jerry 2022-11-14 15:22:57 -08:00
parent 2060b4f61c
commit da74f8c7e4

View file

@ -867,7 +867,7 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
var data *types.StateAccount
if s.snap != nil { // nolint
start := time.Now()
acc, err := s.snap.Account(crypto.HashData(s.hasher, addr.Bytes()))
acc, err := s.snap.Account(crypto.HashData(crypto.NewKeccakState(), addr.Bytes()))
if metrics.EnabledExpensive {
s.SnapshotAccountReads += time.Since(start)
}