mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
1c8ac6658e
* include new getter for block * create block filters from indices * give every block index a unique bucket * construct block indices by bucket mmap * almost done save for the block filters * include block filters, need a few more small touches for fetching the proper indices by bucket * full functionality to filter by parent root * tests pass when using the same logic as attestations * todo * proper todo formatting * first minimum slot range filter * slot range filters pass * more filter criteria passing * tests passing * add todos * all block tests pass and work * rem fmt * range retrieval test * fixed test conditions * instantiate the other buckets * simplify bucket lookups * deprecate non map code * revamp to remove old index prefixes * create indices from data * create indices from data * fetch block roots by slot range * better abstractions * simpler abstractions * roots rename * comment * preston feedback * allow blocks without parent root
26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
package kv
|
|
|
|
// The schema will define how to store and retrieve data from the db.
|
|
// we can prefix or suffix certain values such as `block` with attributes
|
|
// for prefix-wide scans across the underlying BoltDB buckets when filtering data.
|
|
// For example, we might store attestations as shard + attestation_root -> attestation, making
|
|
// it easy to scan for keys that have a certain shard number as a prefix and return those
|
|
// corresponding attestations.
|
|
var (
|
|
attestationsBucket = []byte("attestations")
|
|
blocksBucket = []byte("blocks")
|
|
validatorsBucket = []byte("validators")
|
|
stateBucket = []byte("state")
|
|
|
|
// Key indices buckets.
|
|
blockParentRootIndicesBucket = []byte("block-parent-root-indices")
|
|
blockSlotIndicesBucket = []byte("block-slot-indices")
|
|
attestationParentRootIndicesBucket = []byte("attestation-parent-root-indices")
|
|
attestationShardIndicesBucket = []byte("attestation-shard-indices")
|
|
attestationStartEpochIndicesBucket = []byte("attestation-start-epoch-indices")
|
|
attestationEndEpochIndicesBucket = []byte("attestation-end-epoch-indices")
|
|
|
|
// Block keys.
|
|
headBlockRootKey = []byte("head-root")
|
|
)
|