Skip to content

Commit

Permalink
Document unlikely conflicts with codes stats
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Feb 6, 2025
1 parent 33ac71b commit 02fbb8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/rawdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
case IsStorageTrieNode(key):
storageTries.Add(size)
case bytes.HasPrefix(key, CodePrefix) && len(key) == len(CodePrefix)+common.HashLength:
// This case can conflict, although unlikely, with the following cases below:
// - bytes.HasPrefix(key, ChtIndexTablePrefix): a key "c"+hash could start with "chtIndexV2-"
// - bytes.HasPrefix(key, ChtPrefix): a key "c"+hash could start with "chtRootV2-"
codes.Add(size)
case bytes.HasPrefix(key, txLookupPrefix) && len(key) == (len(txLookupPrefix)+common.HashLength):
txLookups.Add(size)
Expand Down

0 comments on commit 02fbb8b

Please sign in to comment.