From 8ec14d7e6687e4d6428aecedbb8efde4581a4f06 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Tue, 24 Jun 2025 19:08:40 +0800 Subject: [PATCH] core/rawdb: address comments --- core/rawdb/schema.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go index 03c48430e5..eec25a8042 100644 --- a/core/rawdb/schema.go +++ b/core/rawdb/schema.go @@ -122,7 +122,7 @@ var ( stateIDPrefix = []byte("L") // stateIDPrefix + state root -> state id // State history indexing within path-based storage scheme - StateHistoryIndexPrefix = []byte("m") // StateHistoryIndexPrefix + account address hash or (account address hash + slotHash) -> index + StateHistoryIndexPrefix = []byte("m") // The global prefix of state history index data StateHistoryAccountMetadataPrefix = []byte("ma") // StateHistoryAccountMetadataPrefix + account address hash => account metadata StateHistoryStorageMetadataPrefix = []byte("ms") // StateHistoryStorageMetadataPrefix + account address hash + storage slot hash => slot metadata StateHistoryAccountBlockPrefix = []byte("mba") // StateHistoryAccountBlockPrefix + account address hash + block_number => account block @@ -374,24 +374,24 @@ func filterMapBlockLVKey(number uint64) []byte { return key } -// accountHistoryIndexKey = StateHistoryIndexPrefix + addressHash +// accountHistoryIndexKey = StateHistoryAccountMetadataPrefix + addressHash func accountHistoryIndexKey(addressHash common.Hash) []byte { return append(StateHistoryAccountMetadataPrefix, addressHash.Bytes()...) } -// storageHistoryIndexKey = StateHistoryIndexPrefix + addressHash + storageHash +// storageHistoryIndexKey = StateHistoryStorageMetadataPrefix + addressHash + storageHash func storageHistoryIndexKey(addressHash common.Hash, storageHash common.Hash) []byte { return append(append(StateHistoryStorageMetadataPrefix, addressHash.Bytes()...), storageHash.Bytes()...) } -// accountHistoryIndexBlockKey = StateHistoryIndexPrefix + addressHash + blockID +// accountHistoryIndexBlockKey = StateHistoryAccountBlockPrefix + addressHash + blockID func accountHistoryIndexBlockKey(addressHash common.Hash, blockID uint32) []byte { var buf [4]byte binary.BigEndian.PutUint32(buf[:], blockID) return append(append(StateHistoryAccountBlockPrefix, addressHash.Bytes()...), buf[:]...) } -// storageHistoryIndexBlockKey = StateHistoryIndexPrefix + addressHash + storageHash + blockID +// storageHistoryIndexBlockKey = StateHistoryStorageBlockPrefix + addressHash + storageHash + blockID func storageHistoryIndexBlockKey(addressHash common.Hash, storageHash common.Hash, blockID uint32) []byte { var buf [4]byte binary.BigEndian.PutUint32(buf[:], blockID)