From e23b0cbc2254b0af4a5d38e6295621de52689bc0 Mon Sep 17 00:00:00 2001 From: Lessa <230214854+adblesss@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:54:30 -0400 Subject: [PATCH] core/rawdb: fix key length check for num -- hash in db inspect (#34074) Fix incorrect key length calculation for `numHashPairings` in `InspectDatabase`, introduced in #34000. The `headerHashKey` format is `headerPrefix + num + headerHashSuffix` (10 bytes), but the check incorrectly included `common.HashLength`, expecting 42 bytes. This caused all number -- hash entries to be misclassified as unaccounted data. --- core/rawdb/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rawdb/database.go b/core/rawdb/database.go index a13afb9c0e..945fd9097d 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -480,7 +480,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { receipts.add(size) case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerTDSuffix) && len(key) == (len(headerPrefix)+8+common.HashLength+len(headerTDSuffix)): tds.add(size) - case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerHashSuffix) && len(key) == (len(headerPrefix)+8+common.HashLength+len(headerHashSuffix)): + case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerHashSuffix) && len(key) == (len(headerPrefix)+8+len(headerHashSuffix)): numHashPairings.add(size) case bytes.HasPrefix(key, headerNumberPrefix) && len(key) == (len(headerNumberPrefix)+common.HashLength): hashNumPairings.add(size)