sigil-state · roots
Source declarations, signatures and documentation for roots.
Source: sigil/node/sigil-state/src/roots/mod.rs. SHA-256: 45ba1b6261b08605c843470c43532975a750f10c35a03318764ae78fdbc13807.
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.
roots::StateRootComputer
Computes the global state root from all partition roots.
Only recomputes partition roots that have been marked dirty since the last
computation. The global root is BLAKE3(sorted partition roots concatenated).
Incremental computation
When only a few partitions change per block, compute_root avoids
re-hashing unchanged partition trees. It caches the last-known root for
each partition and only re-reads dirty ones.
#[derive(Debug, Clone)]
pub struct StateRootComputer {
}Source line: 16.
roots::StateRootComputer::new
Create a new state root computer.
pub fn new() -> Self;Source line: 27.
roots::StateRootComputer::mark_dirty
Mark a partition as dirty (needs its root re-read next computation).
pub fn mark_dirty(&mut self, partition: &str);Source line: 36.
roots::StateRootComputer::compute_root
Compute the global state root from all partition roots.
On first call, reads all partition roots. On subsequent calls, only
re-reads partitions that have been marked dirty via [mark_dirty].
Also detects new partitions that were not present in the previous
computation.
After computation, the dirty set is cleared and partition dirty flags are reset.
pub fn compute_root(&mut self, state: &PartitionedState) -> [u8; 32];Source line: 49.
roots::StateRootComputer::reset
Reset dirty tracking without computing a root.
pub fn reset(&mut self);Source line: 101.
roots::StateRootComputer::dirty_count
Number of partitions currently dirty.
pub fn dirty_count(&self) -> usize;Source line: 108.