mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
core/rawdb: address comments
This commit is contained in:
parent
9b0989454d
commit
8ec14d7e66
1 changed files with 5 additions and 5 deletions
|
|
@ -122,7 +122,7 @@ var (
|
||||||
stateIDPrefix = []byte("L") // stateIDPrefix + state root -> state id
|
stateIDPrefix = []byte("L") // stateIDPrefix + state root -> state id
|
||||||
|
|
||||||
// State history indexing within path-based storage scheme
|
// 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
|
StateHistoryAccountMetadataPrefix = []byte("ma") // StateHistoryAccountMetadataPrefix + account address hash => account metadata
|
||||||
StateHistoryStorageMetadataPrefix = []byte("ms") // StateHistoryStorageMetadataPrefix + account address hash + storage slot hash => slot metadata
|
StateHistoryStorageMetadataPrefix = []byte("ms") // StateHistoryStorageMetadataPrefix + account address hash + storage slot hash => slot metadata
|
||||||
StateHistoryAccountBlockPrefix = []byte("mba") // StateHistoryAccountBlockPrefix + account address hash + block_number => account block
|
StateHistoryAccountBlockPrefix = []byte("mba") // StateHistoryAccountBlockPrefix + account address hash + block_number => account block
|
||||||
|
|
@ -374,24 +374,24 @@ func filterMapBlockLVKey(number uint64) []byte {
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
|
|
||||||
// accountHistoryIndexKey = StateHistoryIndexPrefix + addressHash
|
// accountHistoryIndexKey = StateHistoryAccountMetadataPrefix + addressHash
|
||||||
func accountHistoryIndexKey(addressHash common.Hash) []byte {
|
func accountHistoryIndexKey(addressHash common.Hash) []byte {
|
||||||
return append(StateHistoryAccountMetadataPrefix, addressHash.Bytes()...)
|
return append(StateHistoryAccountMetadataPrefix, addressHash.Bytes()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// storageHistoryIndexKey = StateHistoryIndexPrefix + addressHash + storageHash
|
// storageHistoryIndexKey = StateHistoryStorageMetadataPrefix + addressHash + storageHash
|
||||||
func storageHistoryIndexKey(addressHash common.Hash, storageHash common.Hash) []byte {
|
func storageHistoryIndexKey(addressHash common.Hash, storageHash common.Hash) []byte {
|
||||||
return append(append(StateHistoryStorageMetadataPrefix, addressHash.Bytes()...), storageHash.Bytes()...)
|
return append(append(StateHistoryStorageMetadataPrefix, addressHash.Bytes()...), storageHash.Bytes()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// accountHistoryIndexBlockKey = StateHistoryIndexPrefix + addressHash + blockID
|
// accountHistoryIndexBlockKey = StateHistoryAccountBlockPrefix + addressHash + blockID
|
||||||
func accountHistoryIndexBlockKey(addressHash common.Hash, blockID uint32) []byte {
|
func accountHistoryIndexBlockKey(addressHash common.Hash, blockID uint32) []byte {
|
||||||
var buf [4]byte
|
var buf [4]byte
|
||||||
binary.BigEndian.PutUint32(buf[:], blockID)
|
binary.BigEndian.PutUint32(buf[:], blockID)
|
||||||
return append(append(StateHistoryAccountBlockPrefix, addressHash.Bytes()...), buf[:]...)
|
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 {
|
func storageHistoryIndexBlockKey(addressHash common.Hash, storageHash common.Hash, blockID uint32) []byte {
|
||||||
var buf [4]byte
|
var buf [4]byte
|
||||||
binary.BigEndian.PutUint32(buf[:], blockID)
|
binary.BigEndian.PutUint32(buf[:], blockID)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue