Skip to content

Commit

Permalink
core/rawdb: db inspect move 'config' and 'shutdown' into 'meta data' (e…
Browse files Browse the repository at this point in the history
…thereum#22978)

* core/rawdb: db inspect move 'config' and 'shutdown' into 'meta data'

* gofmt
  • Loading branch information
Evolution404 authored Jun 8, 2021
1 parent ddeeb89 commit 248572e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/rawdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,8 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
bloomTrieNodes stat

// Meta- and unaccounted data
metadata stat
unaccounted stat
shutdownInfo stat
metadata stat
unaccounted stat

// Totals
total common.StorageSize
Expand Down Expand Up @@ -355,6 +354,8 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
storageSnaps.Add(size)
case bytes.HasPrefix(key, preimagePrefix) && len(key) == (len(preimagePrefix)+common.HashLength):
preimages.Add(size)
case bytes.HasPrefix(key, configPrefix) && len(key) == (len(configPrefix)+common.HashLength):
metadata.Add(size)
case bytes.HasPrefix(key, bloomBitsPrefix) && len(key) == (len(bloomBitsPrefix)+10+common.HashLength):
bloomBits.Add(size)
case bytes.HasPrefix(key, BloomBitsIndexPrefix):
Expand All @@ -369,8 +370,6 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
bytes.HasPrefix(key, []byte("bltIndex-")) ||
bytes.HasPrefix(key, []byte("bltRoot-")): // Bloomtrie sub
bloomTrieNodes.Add(size)
case bytes.Equal(key, uncleanShutdownKey):
shutdownInfo.Add(size)
default:
var accounted bool
for _, meta := range [][]byte{
Expand Down Expand Up @@ -425,7 +424,6 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
{"Key-Value store", "Storage snapshot", storageSnaps.Size(), storageSnaps.Count()},
{"Key-Value store", "Clique snapshots", cliqueSnaps.Size(), cliqueSnaps.Count()},
{"Key-Value store", "Singleton metadata", metadata.Size(), metadata.Count()},
{"Key-Value store", "Shutdown metadata", shutdownInfo.Size(), shutdownInfo.Count()},
{"Ancient store", "Headers", ancientHeadersSize.String(), ancients.String()},
{"Ancient store", "Bodies", ancientBodiesSize.String(), ancients.String()},
{"Ancient store", "Receipt lists", ancientReceiptsSize.String(), ancients.String()},
Expand Down

0 comments on commit 248572e

Please sign in to comment.