From b29d0329de7cdfd591827b12b8d5e97ee9a2a51b Mon Sep 17 00:00:00 2001 From: joeylichang Date: Mon, 15 Apr 2024 10:21:42 +0800 Subject: [PATCH] fix: miner root hash check --- core/state/statedb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 81e1cedbb9..f6e6fac1bb 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1237,7 +1237,7 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er if metrics.EnabledExpensive { defer func(start time.Time) { s.TrieAllCommits += time.Since(start) }(time.Now()) } - if s.stateRoot = s.StateIntermediateRoot(); s.expectedRoot != s.stateRoot { + if s.stateRoot = s.IntermediateRoot(deleteEmptyObjects); s.expectedRoot != s.stateRoot { log.Error("Invalid merkle root", "remote", s.expectedRoot, "local", s.stateRoot) return fmt.Errorf("invalid merkle root (remote: %x local: %x)", s.expectedRoot, s.stateRoot) }