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 (
|
2020-07-22 00:04:46 +00:00
|
|
|
attestationsBucket = []byte("attestations")
|
|
|
|
blocksBucket = []byte("blocks")
|
|
|
|
stateBucket = []byte("state")
|
|
|
|
stateSummaryBucket = []byte("state-summary")
|
|
|
|
proposerSlashingsBucket = []byte("proposer-slashings")
|
|
|
|
attesterSlashingsBucket = []byte("attester-slashings")
|
|
|
|
voluntaryExitsBucket = []byte("voluntary-exits")
|
|
|
|
chainMetadataBucket = []byte("chain-metadata")
|
|
|
|
checkpointBucket = []byte("check-point")
|
|
|
|
powchainBucket = []byte("powchain")
|
2021-07-27 20:02:53 +00:00
|
|
|
stateValidatorsBucket = []byte("state-validators")
|
2022-03-10 15:05:10 +00:00
|
|
|
feeRecipientBucket = []byte("fee-recipient")
|
2020-07-18 18:05:04 +00:00
|
|
|
|
|
|
|
// Deprecated: This bucket was migrated in PR 6461. Do not use, except for migrations.
|
|
|
|
slotsHasObjectBucket = []byte("slots-has-objects")
|
|
|
|
// Deprecated: This bucket was migrated in PR 6461. Do not use, except for migrations.
|
|
|
|
archivedRootBucket = []byte("archived-index-root")
|
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")
|
2020-07-18 18:05:04 +00:00
|
|
|
stateSlotIndicesBucket = []byte("state-slot-indices")
|
2019-09-19 01:14:26 +00:00
|
|
|
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-10-29 15:14:17 +00:00
|
|
|
finalizedBlockRootsIndexBucket = []byte("finalized-block-roots-index")
|
2021-07-27 20:02:53 +00:00
|
|
|
blockRootValidatorHashesBucket = []byte("block-root-validator-hashes")
|
2019-08-16 00:57:43 +00:00
|
|
|
|
2019-08-21 21:11:50 +00:00
|
|
|
// Specific item keys.
|
2022-03-15 20:52:59 +00:00
|
|
|
headBlockRootKey = []byte("head-root")
|
|
|
|
genesisBlockRootKey = []byte("genesis-root")
|
|
|
|
depositContractAddressKey = []byte("deposit-contract")
|
|
|
|
justifiedCheckpointKey = []byte("justified-checkpoint")
|
|
|
|
finalizedCheckpointKey = []byte("finalized-checkpoint")
|
|
|
|
powchainDataKey = []byte("powchain-data")
|
|
|
|
lastValidatedCheckpointKey = []byte("last-validated-checkpoint")
|
2021-12-07 18:51:05 +00:00
|
|
|
|
|
|
|
// Below keys are used to identify objects are to be fork compatible.
|
|
|
|
// Objects that are only compatible with specific forks should be prefixed with such keys.
|
2022-01-10 16:47:30 +00:00
|
|
|
altairKey = []byte("altair")
|
|
|
|
bellatrixKey = []byte("merge")
|
2021-12-09 22:23:00 +00:00
|
|
|
// block root included in the beacon state used by weak subjectivity initial sync
|
2022-03-28 21:01:55 +00:00
|
|
|
originCheckpointBlockRootKey = []byte("origin-checkpoint-block-root")
|
|
|
|
// block root tracking the progress of backfill, or pointing at genesis if backfill has not been initiated
|
|
|
|
backfillBlockRootKey = []byte("backfill-block-root")
|
2020-07-18 18:05:04 +00:00
|
|
|
|
|
|
|
// Deprecated: This index key was migrated in PR 6461. Do not use, except for migrations.
|
|
|
|
lastArchivedIndexKey = []byte("last-archived")
|
|
|
|
// Deprecated: This index key was migrated in PR 6461. Do not use, except for migrations.
|
|
|
|
savedStateSlotsKey = []byte("saved-state-slots")
|
2019-11-27 06:32:56 +00:00
|
|
|
|
2020-03-29 01:07:51 +00:00
|
|
|
// New state management service compatibility bucket.
|
|
|
|
newStateServiceCompatibleBucket = []byte("new-state-compatible")
|
2020-07-18 18:05:04 +00:00
|
|
|
|
|
|
|
// Migrations
|
|
|
|
migrationsBucket = []byte("migrations")
|
2019-08-12 19:33:07 +00:00
|
|
|
)
|