Expand description
BlockStore error surface (BlockStoreError).
Requirements
ERR-001— thirteen variants,thiserror::Error+Debug.ERR-002—From<rocksdb::Error>(via#[from]),From<bincode::Error>forSerialization, and explicit zstd /std::io::Error→Compressionmapping (BlockStoreError::compression_from_io).ERR-003— every variant’sstd::fmt::Display(via thiserror#[error]) must embed actionable context: hashes as hex (Bytes32implementsDisplay), numeric fields inlined, and static messages for unit variants (NORMATIVEERR-003).- Normative:
ERR domain NORMATIVE. - SPEC:
SPEC.md§12 (error taxonomy; ERR-001 addsEmptyReorgChainandPipelineClosedbeyond the SPEC snippet).
§Operational errors without a first-class variant
ERR-001 caps the enum at
thirteen cases. Some STR-004 guards
(missing read-only path, read-only mutation, double genesis) therefore map to BlockStoreError::Serialization
with stable string payloads documented below so integration tests and future refactors can match
deterministically. If the taxonomy gains dedicated variants later, these constants become the migration
anchor.
Enums§
- Block
Store Error - Crate-level error for persistence, chain, and I/O boundaries (
ERR-001).
Constants§
- ERR_
ASYNC_ JOIN_ PREFIX - Stable
BlockStoreError::Serializationpayload prefix when atokio::task::spawn_blockingtask panics or is cancelled andtokio::task::JoinErrorsurfaces on.await(BLK-007AC §6). - ERR_
INIT_ GENESIS_ ALREADY_ INITIALIZED - Stable
BlockStoreError::Serializationpayload when genesis metadata is already present. - ERR_
INIT_ GENESIS_ READ_ ONLY - Stable
BlockStoreError::Serializationpayload whencrate::store::BlockStore::init_genesisruns on a read-only handle. - ERR_
MUTATION_ READ_ ONLY - Stable
BlockStoreError::Serializationpayload for other mutating APIs (crate::store::BlockStore::put) on a read-only handle (BLK-001precursor). - ERR_
OPEN_ READONLY_ PATH_ MISSING_ PREFIX - Stable
BlockStoreError::Serializationpayload prefix whencrate::store::BlockStore::open_readonlyis called with a path that does not exist on disk. - ERR_
UPDATE_ STATUS_ RECORD_ NOT_ CACHED_ PREFIX - Stable
BlockStoreError::Serializationpayload prefix whencrate::store::BlockStore::update_statusruns but the in-memory record cache has no entry for the hash (BLK-010AC §3).