mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
core/rawdb: rename BAL to AccessList
This commit is contained in:
parent
1c66320f42
commit
295ac26087
2 changed files with 7 additions and 7 deletions
|
|
@ -613,7 +613,7 @@ func HasAccessList(db ethdb.Reader, hash common.Hash, number uint64) bool {
|
|||
|
||||
// ReadAccessListRLP retrieves the RLP-encoded block access list for a block from KV.
|
||||
func ReadAccessListRLP(db ethdb.Reader, hash common.Hash, number uint64) rlp.RawValue {
|
||||
data, _ := db.Get(balKey(number, hash))
|
||||
data, _ := db.Get(accessListKey(number, hash))
|
||||
return data
|
||||
}
|
||||
|
||||
|
|
@ -642,14 +642,14 @@ func WriteAccessList(db ethdb.KeyValueWriter, hash common.Hash, number uint64, b
|
|||
|
||||
// WriteAccessListRLP stores a pre-encoded block access list in the active KV store.
|
||||
func WriteAccessListRLP(db ethdb.KeyValueWriter, hash common.Hash, number uint64, encoded rlp.RawValue) {
|
||||
if err := db.Put(balKey(number, hash), encoded); err != nil {
|
||||
if err := db.Put(accessListKey(number, hash), encoded); err != nil {
|
||||
log.Crit("Failed to store BAL", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteAccessList removes a block access list from the active KV store.
|
||||
func DeleteAccessList(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
|
||||
if err := db.Delete(balKey(number, hash)); err != nil {
|
||||
if err := db.Delete(accessListKey(number, hash)); err != nil {
|
||||
log.Crit("Failed to delete BAL", "err", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ var (
|
|||
|
||||
blockBodyPrefix = []byte("b") // blockBodyPrefix + num (uint64 big endian) + hash -> block body
|
||||
blockReceiptsPrefix = []byte("r") // blockReceiptsPrefix + num (uint64 big endian) + hash -> block receipts
|
||||
balPrefix = []byte("j") // balPrefix + num (uint64 big endian) + hash -> block access list
|
||||
accessListPrefix = []byte("j") // accessListPrefix + num (uint64 big endian) + hash -> block access list
|
||||
|
||||
txLookupPrefix = []byte("l") // txLookupPrefix + hash -> transaction/receipt lookup metadata
|
||||
bloomBitsPrefix = []byte("B") // bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash -> bloom bits
|
||||
|
|
@ -215,9 +215,9 @@ func blockReceiptsKey(number uint64, hash common.Hash) []byte {
|
|||
return append(append(blockReceiptsPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
|
||||
}
|
||||
|
||||
// balKey = balPrefix + num (uint64 big endian) + hash
|
||||
func balKey(number uint64, hash common.Hash) []byte {
|
||||
return append(append(balPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
|
||||
// accessListKey = accessListPrefix + num (uint64 big endian) + hash
|
||||
func accessListKey(number uint64, hash common.Hash) []byte {
|
||||
return append(append(accessListPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
|
||||
}
|
||||
|
||||
// txLookupKey = txLookupPrefix + hash
|
||||
|
|
|
|||
Loading…
Reference in a new issue