-
Notifications
You must be signed in to change notification settings - Fork 160
/
buckets.go
40 lines (36 loc) · 1.47 KB
/
buckets.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package db
import "slices"
type Bucket byte
// Pebble does not support buckets to differentiate between groups of
// keys like Bolt or MDBX does. We use a global prefix list as a poor
// man's bucket alternative.
const (
StateTrie Bucket = iota // state metadata (e.g., the state root)
Unused // Previously held contract storage roots and is now unused. May be reused in the future.
ContractClassHash // maps contract addresses and class hashes
ContractStorage // contract storages
Class // maps class hashes to classes
ContractNonce // contract nonce
ChainHeight // Latest height of the blockchain
BlockHeaderNumbersByHash
BlockHeadersByNumber
TransactionBlockNumbersAndIndicesByHash // maps transaction hashes to block number and index
TransactionsByBlockNumberAndIndex // maps block number and index to transaction
ReceiptsByBlockNumberAndIndex // maps block number and index to transaction receipt
StateUpdatesByBlockNumber
ClassesTrie
ContractStorageHistory
ContractNonceHistory
ContractClassHashHistory
ContractDeploymentHeight
L1Height
SchemaVersion
Pending
BlockCommitments
Temporary // used temporarily for migrations
SchemaIntermediateState
)
// Key flattens a prefix and series of byte arrays into a single []byte.
func (b Bucket) Key(key ...[]byte) []byte {
return append([]byte{byte(b)}, slices.Concat(key...)...)
}