@@ -52,11 +52,17 @@ impl ForkCheckpoints {
5252
5353// ============ Metadata Keys ============
5454
55+ /// Key for "time" field of the Store. Its value has type [`u64`] and it's SSZ-encoded.
5556const KEY_TIME : & [ u8 ] = b"time" ;
57+ /// Key for "config" field of the Store. Its value has type [`ChainConfig`] and it's SSZ-encoded.
5658const KEY_CONFIG : & [ u8 ] = b"config" ;
59+ /// Key for "head" field of the Store. Its value has type [`H256`] and it's SSZ-encoded.
5760const KEY_HEAD : & [ u8 ] = b"head" ;
61+ /// Key for "safe_target" field of the Store. Its value has type [`H256`] and it's SSZ-encoded.
5862const KEY_SAFE_TARGET : & [ u8 ] = b"safe_target" ;
63+ /// Key for "latest_justified" field of the Store. Its value has type [`Checkpoint`] and it's SSZ-encoded.
5964const KEY_LATEST_JUSTIFIED : & [ u8 ] = b"latest_justified" ;
65+ /// Key for "latest_finalized" field of the Store. Its value has type [`Checkpoint`] and it's SSZ-encoded.
6066const KEY_LATEST_FINALIZED : & [ u8 ] = b"latest_finalized" ;
6167
6268// ============ Key Encoding Helpers ============
@@ -76,20 +82,8 @@ fn decode_signature_key(bytes: &[u8]) -> SignatureKey {
7682 ( validator_id, root)
7783}
7884
79- /// Forkchoice store tracking chain state and validator attestations.
80- ///
81- /// This is the "local view" that a node uses to run LMD GHOST. It contains:
82- ///
83- /// - which blocks and states are known,
84- /// - which checkpoints are justified and finalized,
85- /// - which block is currently considered the head,
86- /// - and, for each validator, their latest attestation that should influence fork choice.
87- ///
88- /// The `Store` is updated whenever:
89- /// - a new block is processed,
90- /// - an attestation is received (via a block or gossip),
91- /// - an interval tick occurs (activating new attestations),
92- /// - or when the head is recomputed.
85+ /// Underlying storage of the node.
86+ /// Similar to the spec's `Store`, but backed by a pluggable storage backend.
9387///
9488/// All data is stored in the backend. Metadata fields (time, config, head, etc.)
9589/// are stored in the Metadata table with their field name as the key.
0 commit comments