Skip to content

Commit b06658e

Browse files
core/rawdb: account for skeleton data
1 parent 8cabfbf commit b06658e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/rawdb/database.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
322322
preimages stat
323323
bloomBits stat
324324
cliqueSnaps stat
325+
skeleton stat
325326

326327
// Ancient store statistics
327328
ancientHeadersSize common.StorageSize
@@ -379,6 +380,8 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
379380
bloomBits.Add(size)
380381
case bytes.HasPrefix(key, BloomBitsIndexPrefix):
381382
bloomBits.Add(size)
383+
case bytes.HasPrefix(key, skeletonHeaderPrefix) && len(key) == (len(skeletonHeaderPrefix)+8):
384+
skeleton.Add(size)
382385
case bytes.HasPrefix(key, []byte("clique-")) && len(key) == 7+common.HashLength:
383386
cliqueSnaps.Add(size)
384387
case bytes.HasPrefix(key, []byte("cht-")) ||
@@ -395,7 +398,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
395398
databaseVersionKey, headHeaderKey, headBlockKey, headFastBlockKey, lastPivotKey,
396399
fastTrieProgressKey, snapshotDisabledKey, SnapshotRootKey, snapshotJournalKey,
397400
snapshotGeneratorKey, snapshotRecoveryKey, txIndexTailKey, fastTxLookupLimitKey,
398-
uncleanShutdownKey, badBlockKey, transitionStatusKey,
401+
uncleanShutdownKey, badBlockKey, transitionStatusKey, snapshotSyncStatusKey, skeletonSyncStatusKey,
399402
} {
400403
if bytes.Equal(key, meta) {
401404
metadata.Add(size)
@@ -432,6 +435,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
432435
{"Key-Value store", "Bodies", bodies.Size(), bodies.Count()},
433436
{"Key-Value store", "Receipt lists", receipts.Size(), receipts.Count()},
434437
{"Key-Value store", "Difficulties", tds.Size(), tds.Count()},
438+
{"Key-Value store", "Skeleton", skeleton.Size(), skeleton.Count()},
435439
{"Key-Value store", "Block number->hash", numHashPairings.Size(), numHashPairings.Count()},
436440
{"Key-Value store", "Block hash->number", hashNumPairings.Size(), hashNumPairings.Count()},
437441
{"Key-Value store", "Transaction index", txLookups.Size(), txLookups.Count()},

core/rawdb/schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var (
9595
SnapshotAccountPrefix = []byte("a") // SnapshotAccountPrefix + account hash -> account trie value
9696
SnapshotStoragePrefix = []byte("o") // SnapshotStoragePrefix + account hash + storage hash -> storage trie value
9797
CodePrefix = []byte("c") // CodePrefix + code hash -> account code
98-
skeletonHeaderPrefix = []byte("S") // skeletonHeaderPrefox + num (uint64 big endian) -> header
98+
skeletonHeaderPrefix = []byte("S") // skeletonHeaderPrefix + num (uint64 big endian) -> header
9999

100100
PreimagePrefix = []byte("secure-key-") // PreimagePrefix + hash -> preimage
101101
configPrefix = []byte("ethereum-config-") // config prefix for the db

0 commit comments

Comments
 (0)