Expand description
Ordered delivery of erasure-coded blocks.
§Overview
The coding marshal couples the consensus pipeline with erasure-coded block broadcast.
Blocks are produced by an application, encoded into types::Shards, fanned out to peers, and
later reconstructed when a notarization or finalization proves that the data is needed.
Compared to super::standard, this variant makes more efficient usage of the network’s bandwidth
by spreading the load of block dissemination across all participants.
§Components
crate::marshal::core::Actor: The unified marshal actor that orders finalized blocks, handles acknowledgements from the application, and requests repairs when gaps are detected. Used withCodingas the variant type parameter.crate::marshal::core::Mailbox: Accepts requests from other local subsystems and forwards them to the actor. Used withCodingas the variant type parameter.shards::Engine: Broadcasts shards, verifies locally held fragments, and reconstructs entiretypes::CodedBlocks on demand.crate::marshal::resolver: Issues outbound fetches to remote peers when marshal is missing a block, notarization, or finalization referenced by consensus.types: Defines commitments, distribution shards, and helper builders used across the module.Marshaled: Wraps ancrate::Applicationimplementation so it automatically enforces epoch boundaries and performs erasure encoding before a proposal leaves the application.
§Data Flow
- The application produces a block through
Marshaled, which encodes the payload and obtains acrate::types::coding::Commitmentdescribing the shard layout. - The block is broadcast via
shards::Engine; each participant receives exactly one shard and reshares it to everyone else once it verifies the fragment. - The actor ingests notarizations/finalizations from
simplex, pulls reconstructed blocks from the shard engine or backfills them throughcrate::marshal::resolver, and durably persists the ordered data. - The actor reports finalized blocks to the node’s
crate::Reporterat-least-once and drives repair loops whenever notarizations reference yet-to-be-delivered payloads.
§Storage and Repair
Notarized data and certificates live in prunable archives managed internally, while finalized blocks are migrated into immutable archives. Any gaps are filled by asking peers for specific commitments through the resolver pipeline. The shard engine keeps only ephemeral, in-memory caches; once a block is finalized it is evicted from the reconstruction map, reducing memory pressure.
§When to Use
Choose this module when the consensus deployment wants erasure-coded dissemination with the
same ordering guarantees provided by super::standard. The API is a breaking change from
the standard marshal: applications must adapt to the coding-specific variant type and buffer
implementation required by this module.
Modules§
- shards
- Shard engine for erasure-coded block distribution and reconstruction.
- types
- Types for erasure coding.
Structs§
- Coding
- The coding variant of Marshal, which uses erasure coding for block dissemination.
- Marshaled
- An
Applicationadapter that handles epoch transitions and erasure coded broadcast. - Marshaled
Config - Configuration for initializing
Marshaled.