github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/db/kv/schema.go (about)

     1  package kv
     2  
     3  // The schema will define how to store and retrieve data from the db.
     4  // we can prefix or suffix certain values such as `block` with attributes
     5  // for prefix-wide scans across the underlying BoltDB buckets when filtering data.
     6  // For example, we might store attestations as shard + attestation_root -> attestation, making
     7  // it easy to scan for keys that have a certain shard number as a prefix and return those
     8  // corresponding attestations.
     9  var (
    10  	attestationsBucket      = []byte("attestations")
    11  	blocksBucket            = []byte("blocks")
    12  	stateBucket             = []byte("state")
    13  	stateSummaryBucket      = []byte("state-summary")
    14  	proposerSlashingsBucket = []byte("proposer-slashings")
    15  	attesterSlashingsBucket = []byte("attester-slashings")
    16  	voluntaryExitsBucket    = []byte("voluntary-exits")
    17  	chainMetadataBucket     = []byte("chain-metadata")
    18  	checkpointBucket        = []byte("check-point")
    19  	powchainBucket          = []byte("powchain")
    20  
    21  	// Deprecated: This bucket was migrated in PR 6461. Do not use, except for migrations.
    22  	slotsHasObjectBucket = []byte("slots-has-objects")
    23  	// Deprecated: This bucket was migrated in PR 6461. Do not use, except for migrations.
    24  	archivedRootBucket = []byte("archived-index-root")
    25  
    26  	// Key indices buckets.
    27  	blockParentRootIndicesBucket        = []byte("block-parent-root-indices")
    28  	blockSlotIndicesBucket              = []byte("block-slot-indices")
    29  	stateSlotIndicesBucket              = []byte("state-slot-indices")
    30  	attestationHeadBlockRootBucket      = []byte("attestation-head-block-root-indices")
    31  	attestationSourceRootIndicesBucket  = []byte("attestation-source-root-indices")
    32  	attestationSourceEpochIndicesBucket = []byte("attestation-source-epoch-indices")
    33  	attestationTargetRootIndicesBucket  = []byte("attestation-target-root-indices")
    34  	attestationTargetEpochIndicesBucket = []byte("attestation-target-epoch-indices")
    35  	finalizedBlockRootsIndexBucket      = []byte("finalized-block-roots-index")
    36  
    37  	// Specific item keys.
    38  	headBlockRootKey          = []byte("head-root")
    39  	genesisBlockRootKey       = []byte("genesis-root")
    40  	depositContractAddressKey = []byte("deposit-contract")
    41  	justifiedCheckpointKey    = []byte("justified-checkpoint")
    42  	finalizedCheckpointKey    = []byte("finalized-checkpoint")
    43  	powchainDataKey           = []byte("powchain-data")
    44  
    45  	// Deprecated: This index key was migrated in PR 6461. Do not use, except for migrations.
    46  	lastArchivedIndexKey = []byte("last-archived")
    47  	// Deprecated: This index key was migrated in PR 6461. Do not use, except for migrations.
    48  	savedStateSlotsKey = []byte("saved-state-slots")
    49  
    50  	// New state management service compatibility bucket.
    51  	newStateServiceCompatibleBucket = []byte("new-state-compatible")
    52  
    53  	// Migrations
    54  	migrationsBucket = []byte("migrations")
    55  )