From 90ca7d05cca1a960f893489e20a54592b73b3ad6 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Tue, 19 Nov 2024 10:15:50 +0800 Subject: [PATCH] core/rawdb: track deprecated td data --- core/rawdb/database.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 2b9f5d08ed..ae1e7c0bdc 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -363,6 +363,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { headers stat bodies stat receipts stat + tds stat numHashPairings stat hashNumPairings stat legacyTries stat @@ -408,8 +409,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { case bytes.HasPrefix(key, blockReceiptsPrefix) && len(key) == (len(blockReceiptsPrefix)+8+common.HashLength): receipts.Add(size) case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerTDSuffix): - // The TD has been removed, but we still count it here - // to avoid overusing the unknown data counter. + tds.Add(size) case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerHashSuffix): numHashPairings.Add(size) case bytes.HasPrefix(key, headerNumberPrefix) && len(key) == (len(headerNumberPrefix)+common.HashLength): @@ -500,6 +500,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { {"Key-Value store", "Headers", headers.Size(), headers.Count()}, {"Key-Value store", "Bodies", bodies.Size(), bodies.Count()}, {"Key-Value store", "Receipt lists", receipts.Size(), receipts.Count()}, + {"Key-Value store", "Difficulties (deprecated)", tds.Size(), tds.Count()}, {"Key-Value store", "Block number->hash", numHashPairings.Size(), numHashPairings.Count()}, {"Key-Value store", "Block hash->number", hashNumPairings.Size(), hashNumPairings.Count()}, {"Key-Value store", "Transaction index", txLookups.Size(), txLookups.Count()},