1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Unified marshal core implementation.
//!
//! # Overview
//!
//! This module provides the core marshal actor and mailbox that work with both
//! the [`crate::marshal::standard`] and [`crate::marshal::coding`] variants through
//! the [`Variant`] and [`Buffer`] trait abstractions.
//!
//! # Components
//!
//! - [`Actor`]: The main marshal actor that orders finalized blocks, manages caching,
//! handles backfill requests, and reports blocks to the application.
//! - [`Mailbox`]: A clonable handle for interacting with the actor from other subsystems.
//! - [`Variant`]: A marker trait describing the types used by different marshal variants
//! (block types, commitment types, etc.).
//! - [`Buffer`]: An abstraction over block dissemination strategies (whole blocks
//! vs erasure-coded shards).
//!
//! # Usage
//!
//! The actor is initialized with storage archives and started with a buffer implementation:
//!
//! ```rust,ignore
//! // Initialize with storage
//! let (actor, mailbox, last_height) = Actor::<S, Standard<B>>::init(
//! context,
//! finalizations_archive,
//! blocks_archive,
//! config,
//! ).await;
//!
//! // Start with application and buffer
//! actor.start(application, buffer, resolver);
//! ```
//!
//! For standard mode, use [`crate::marshal::standard::Standard`] as the variant and
//! [`commonware_broadcast::buffered::Mailbox`] as the buffer. For coding mode, use
//! [`crate::marshal::coding::Coding`] as the variant and
//! [`crate::marshal::coding::shards::Mailbox`] as the buffer.
pub use Actor;
pub
pub use Mailbox;
pub use ;