mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 05:11:37 +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.
|
// 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 {
|
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
|
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.
|
// 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) {
|
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)
|
log.Crit("Failed to store BAL", "err", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteAccessList removes a block access list from the active KV store.
|
// DeleteAccessList removes a block access list from the active KV store.
|
||||||
func DeleteAccessList(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
|
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)
|
log.Crit("Failed to delete BAL", "err", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ var (
|
||||||
|
|
||||||
blockBodyPrefix = []byte("b") // blockBodyPrefix + num (uint64 big endian) + hash -> block body
|
blockBodyPrefix = []byte("b") // blockBodyPrefix + num (uint64 big endian) + hash -> block body
|
||||||
blockReceiptsPrefix = []byte("r") // blockReceiptsPrefix + num (uint64 big endian) + hash -> block receipts
|
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
|
txLookupPrefix = []byte("l") // txLookupPrefix + hash -> transaction/receipt lookup metadata
|
||||||
bloomBitsPrefix = []byte("B") // bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash -> bloom bits
|
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()...)
|
return append(append(blockReceiptsPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// balKey = balPrefix + num (uint64 big endian) + hash
|
// accessListKey = accessListPrefix + num (uint64 big endian) + hash
|
||||||
func balKey(number uint64, hash common.Hash) []byte {
|
func accessListKey(number uint64, hash common.Hash) []byte {
|
||||||
return append(append(balPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
|
return append(append(accessListPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// txLookupKey = txLookupPrefix + hash
|
// txLookupKey = txLookupPrefix + hash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue