Skip to main content

commonware_consensus/marshal/coding/shards/
mod.rs

1//! Shard engine for erasure-coded block distribution and reconstruction.
2//!
3//! # Overview
4//!
5//! The shards subsystem distributes erasure-coded blocks, validates shard authenticity, and
6//! reconstructs blocks on demand. It ensures every validator contributes bandwidth proportional
7//! to a single shard while allowing any node to recover the entire [`super::types::CodedBlock`]
8//! once enough shards are available.
9//!
10//! # Responsibilities
11//!
12//! - [`Engine`] accepts commands over [`Mailbox`] to broadcast proposer shards, validate and
13//!   reshare received shards, and serve reconstruction requests.
14//! - Maintains an ephemeral cache of reconstructed blocks, evicted when marshal signals
15//!   durability.
16//! - Tracks subscriptions for shard arrival and block reconstruction, notifying waiters when
17//!   data becomes available.
18
19mod mailbox;
20pub use mailbox::{Mailbox, Message};
21
22mod metrics;
23
24mod engine;
25pub use engine::{Config, Engine, Error};