From 8f3f0ab650964bb26ef6fe4944ad3394e412b5eb Mon Sep 17 00:00:00 2001 From: yyhrnk Date: Thu, 11 Dec 2025 08:32:03 +0200 Subject: [PATCH] fix --- core/stateless/stats.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/stateless/stats.go b/core/stateless/stats.go index c6be1f6520..73ce031bff 100644 --- a/core/stateless/stats.go +++ b/core/stateless/stats.go @@ -63,12 +63,15 @@ func (s *WitnessStats) Add(nodes map[string][]byte, owner common.Hash) { // The last path is always a leaf. if i == len(paths)-1 || !strings.HasPrefix(paths[i+1], paths[i]) { depth := len(path) - if depth >= len(s.accountTrieLeaves) { - depth = len(s.accountTrieLeaves) - 1 - } if owner == (common.Hash{}) { + if depth >= len(s.accountTrieLeaves) { + depth = len(s.accountTrieLeaves) - 1 + } s.accountTrieLeaves[depth] += 1 } else { + if depth >= len(s.storageTrieLeaves) { + depth = len(s.storageTrieLeaves) - 1 + } s.storageTrieLeaves[depth] += 1 } }