core/state: fix storage counters in binary trie IntermediateRoot (#34110)

Add missing `StorageUpdated` and `StorageDeleted` counter increments
in the binary trie fast path of `IntermediateRoot()`.
This commit is contained in:
CPerezz 2026-03-31 15:47:07 +02:00 committed by GitHub
parent dc3794e3dc
commit 3da517e239
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -879,10 +879,12 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
if err := s.trie.UpdateStorage(addr, key[:], common.TrimLeftZeroes(value[:])); err != nil {
s.setError(err)
}
s.StorageUpdated.Add(1)
} else {
if err := s.trie.DeleteStorage(addr, key[:]); err != nil {
s.setError(err)
}
s.StorageDeleted.Add(1)
}
}
}