From d0657c7b8933cf47646f1bacd69c6add581f6726 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Tue, 31 Mar 2026 11:02:59 +0800 Subject: [PATCH] core: fix broken test and add db inspection --- core/rawdb/database.go | 5 +++++ core/types/bal/bal_test.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/rawdb/database.go b/core/rawdb/database.go index a13afb9c0e..7254fcffc3 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -413,6 +413,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { tds stat numHashPairings stat hashNumPairings stat + blockAccessList stat legacyTries stat stateLookups stat accountTries stat @@ -484,6 +485,9 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { numHashPairings.add(size) case bytes.HasPrefix(key, headerNumberPrefix) && len(key) == (len(headerNumberPrefix)+common.HashLength): hashNumPairings.add(size) + case bytes.HasPrefix(key, accessListPrefix) && len(key) == len(accessListPrefix)+8+common.HashLength: + blockAccessList.add(size) + case IsLegacyTrieNode(key, it.Value()): legacyTries.add(size) case bytes.HasPrefix(key, stateIDPrefix) && len(key) == len(stateIDPrefix)+common.HashLength: @@ -625,6 +629,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { {"Key-Value store", "Difficulties (deprecated)", tds.sizeString(), tds.countString()}, {"Key-Value store", "Block number->hash", numHashPairings.sizeString(), numHashPairings.countString()}, {"Key-Value store", "Block hash->number", hashNumPairings.sizeString(), hashNumPairings.countString()}, + {"Key-Value store", "Block accessList", blockAccessList.sizeString(), blockAccessList.countString()}, {"Key-Value store", "Transaction index", txLookups.sizeString(), txLookups.countString()}, {"Key-Value store", "Log index filter-map rows", filterMapRows.sizeString(), filterMapRows.countString()}, {"Key-Value store", "Log index last-block-of-map", filterMapLastBlock.sizeString(), filterMapLastBlock.countString()}, diff --git a/core/types/bal/bal_test.go b/core/types/bal/bal_test.go index 52c0de825e..58ba639ff0 100644 --- a/core/types/bal/bal_test.go +++ b/core/types/bal/bal_test.go @@ -190,8 +190,8 @@ func makeTestAccountAccess(sort bool) AccountAccess { } } -func makeTestBAL(sort bool) BlockAccessList { - list := BlockAccessList{} +func makeTestBAL(sort bool) *BlockAccessList { + list := &BlockAccessList{} for i := 0; i < 5; i++ { list.Accesses = append(list.Accesses, makeTestAccountAccess(sort)) }