Expand description
Key encoding helpers for RocksDB keys (hash, height, epoch, metadata).
Normative
KEY-001— hash keysKEY-002— height keysKEY-003— epoch keysKEY-004— metadata UTF-8 keys- Crate-root re-exports:
STR-003
Rationale: Big-endian u64 keys (height_key, epoch_key) preserve lexicographic order
equal to numeric order, enabling efficient range scans. Hash keys are raw Bytes32 with no prefix
(chia_protocol::Bytes32).
Functions§
- decode_
epoch_ key - Decode an epoch key produced by
epoch_key(KEY-003). - decode_
height_ key - Decode a height key produced by
height_key(KEY-002). - epoch_
key - Encode an epoch number as an 8-byte big-endian key for
crate::constants::CF_CHECKPOINTS(KEY-003,NORMATIVE§KEY-003). - hash_
key - Raw 32-byte RocksDB key for
CF_BLOCKS,CF_HEADERS, andCF_ATTESTED(KEY-001). - height_
key - Encode a chain height as an 8-byte big-endian key for
crate::constants::CF_CANONICAL(KEY-002). - metadata_
key - UTF-8 bytes for a metadata key name in
crate::constants::CF_METADATA(KEY-004,NORMATIVE§KEY-004).