From 5f38e9ac146b7acb8952dace3a0c60ca5eee93c0 Mon Sep 17 00:00:00 2001 From: Chris Li <271678682li@gmail.com> Date: Fri, 22 Nov 2024 10:15:16 +0800 Subject: [PATCH] fix: add blobSidecars in db inspect --- core/rawdb/database.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 5049ade332..152c7e5af4 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -930,6 +930,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { receipts stat tds stat numHashPairings stat + blobSidecars stat hashNumPairings stat legacyTries stat stateLookups stat @@ -973,6 +974,8 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { legacyTries.Add(size) case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerTDSuffix): tds.Add(size) + case bytes.HasPrefix(key, BlockBlobSidecarsPrefix) && bytes.HasSuffix(key, BlockBlobSidecarsPrefix): + blobSidecars.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): @@ -1103,6 +1106,8 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { receipts.Add(size) case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerTDSuffix): tds.Add(size) + case bytes.HasPrefix(key, BlockBlobSidecarsPrefix) && bytes.HasSuffix(key, BlockBlobSidecarsPrefix): + blobSidecars.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): @@ -1134,6 +1139,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { {"Key-Value store", "Bodies", bodies.Size(), bodies.Count()}, {"Key-Value store", "Receipt lists", receipts.Size(), receipts.Count()}, {"Key-Value store", "Difficulties", tds.Size(), tds.Count()}, + {"Key-Value store", "BlobSidecars", blobSidecars.Size(), blobSidecars.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()},