pub trait LocalSyncState {
// Required methods
fn root_hash(&self) -> [u8; 32];
fn entity_count(&self) -> u64;
fn max_depth(&self) -> u32;
fn dag_heads(&self) -> Vec<[u8; 32]>;
// Provided method
fn has_state(&self) -> bool { ... }
}Expand description
Trait for accessing local sync state.
Implement this trait to enable building handshakes and protocol selection.
Both SyncManager (production) and SimNode (simulation) implement this,
ensuring consistent behavior across both environments.
Required Methods§
Sourcefn root_hash(&self) -> [u8; 32]
fn root_hash(&self) -> [u8; 32]
Current Merkle root hash.
Returns [0; 32] for fresh nodes with no state.
Sourcefn entity_count(&self) -> u64
fn entity_count(&self) -> u64
Number of entities in local storage.
Used for divergence calculation in protocol selection.