2019-08-12 19:33:07 +00:00
|
|
|
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 (
|
2019-09-18 18:41:47 +00:00
|
|
|
attestationsBucket = []byte("attestations")
|
|
|
|
blocksBucket = []byte("blocks")
|
|
|
|
validatorsBucket = []byte("validators")
|
|
|
|
stateBucket = []byte("state")
|
|
|
|
proposerSlashingsBucket = []byte("proposer-slashings")
|
|
|
|
attesterSlashingsBucket = []byte("attester-slashings")
|
|
|
|
voluntaryExitsBucket = []byte("voluntary-exits")
|
|
|
|
chainMetadataBucket = []byte("chain-metadata")
|
|
|
|
checkpointBucket = []byte("check-point")
|
|
|
|
archivedValidatorSetChangesBucket = []byte("archived-active-changes")
|
|
|
|
archivedCommitteeInfoBucket = []byte("archived-committee-info")
|
|
|
|
archivedBalancesBucket = []byte("archived-balances")
|
|
|
|
archivedValidatorParticipationBucket = []byte("archived-validator-participation")
|
2019-08-13 16:49:27 +00:00
|
|
|
|
2019-08-20 00:34:53 +00:00
|
|
|
// Key indices buckets.
|
2019-09-19 01:14:26 +00:00
|
|
|
blockParentRootIndicesBucket = []byte("block-parent-root-indices")
|
|
|
|
blockSlotIndicesBucket = []byte("block-slot-indices")
|
|
|
|
attestationHeadBlockRootBucket = []byte("attestation-head-block-root-indices")
|
|
|
|
attestationSourceRootIndicesBucket = []byte("attestation-source-root-indices")
|
|
|
|
attestationSourceEpochIndicesBucket = []byte("attestation-source-epoch-indices")
|
|
|
|
attestationTargetRootIndicesBucket = []byte("attestation-target-root-indices")
|
|
|
|
attestationTargetEpochIndicesBucket = []byte("attestation-target-epoch-indices")
|
2019-08-16 00:57:43 +00:00
|
|
|
|
2019-08-21 21:11:50 +00:00
|
|
|
// Specific item keys.
|
|
|
|
headBlockRootKey = []byte("head-root")
|
2019-08-29 22:32:35 +00:00
|
|
|
genesisBlockRootKey = []byte("genesis-root")
|
2019-08-21 21:11:50 +00:00
|
|
|
depositContractAddressKey = []byte("deposit-contract")
|
2019-08-30 13:58:02 +00:00
|
|
|
justifiedCheckpointKey = []byte("justified-checkpoint")
|
|
|
|
finalizedCheckpointKey = []byte("finalized-checkpoint")
|
2019-08-12 19:33:07 +00:00
|
|
|
)
|