sigil-state · crate
Source declarations, signatures and documentation for crate.
Source: sigil/node/sigil-state/src/lib.rs. SHA-256: e94fa44c72ccbf3de13427d443b09e54e2255984c347dd3059c32d433abd7956.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
cache
sigil-state
State engine for the Sigil blockchain. Provides BLAKE3-based Merkle commitment trees, organization-partitioned state with zero cross-partition contention, incremental root computation, and a hot LRU cache layer.
Architecture
+-----------+ +-----------------+ +------------------+
| StateCache| --> | PartitionedState| --> | CommitmentTree |
| (LRU hot) | | (DashMap conc.) | | (BLAKE3 Merkle) |
+-----------+ +-----------------+ +------------------+
|
+------------------+
| StateRootComputer|
| (incremental) |
+------------------+- CommitmentTree: Sparse BLAKE3 Merkle tree for cryptographic state commitments.
- PartitionedState: Organization-partitioned state with independent trees per partition.
- StateRootComputer: Incremental global root from dirty partition roots.
- StateCache: LRU cache with hit/miss tracking for hot state reads.
pub mod cache;Source line: 29.
commitment
pub mod commitment;Source line: 30.
partitions
pub mod partitions;Source line: 31.
roots
pub mod roots;Source line: 32.
dao_validators
#[cfg(any(feature = "dao-validators", test))]
pub mod dao_validators;Source line: 35.
pub use cache::{CacheStats, StateCache};
pub use cache::{CacheStats, StateCache};Source line: 37.
pub use commitment::proof::{InclusionProof, Side};
pub use commitment::proof::{InclusionProof, Side};Source line: 38.
pub use commitment::tree::CommitmentTree;
pub use commitment::tree::CommitmentTree;Source line: 39.
pub use partitions::{Partition, PartitionedState};
pub use partitions::{Partition, PartitionedState};Source line: 40.
pub use roots::StateRootComputer;
pub use roots::StateRootComputer;Source line: 41.
::StateError
Errors produced by the state engine.
#[derive(Debug, thiserror::Error)]
pub enum StateError {
#[error("partition not found: {0}")]
PartitionNotFound(String),
#[error("proof verification failed")]
ProofVerificationFailed,
#[error("key not found")]
KeyNotFound,
#[error("serialization error: {0}")]
Serialization(#[from] serde_json::Error),
}Source line: 45.