commonware_consensus/marshal/config.rs
1use crate::{
2 types::{Epoch, Epocher, ViewDelta},
3 Block,
4};
5use commonware_cryptography::certificate::Provider;
6use commonware_runtime::buffer::PoolRef;
7use std::num::{NonZeroU64, NonZeroUsize};
8
9/// Marshal configuration.
10pub struct Config<B, P, ES>
11where
12 B: Block,
13 P: Provider<Scope = Epoch>,
14 ES: Epocher,
15{
16 /// Provider for epoch-specific signing schemes.
17 pub provider: P,
18
19 /// Configuration for epoch lengths across block height ranges.
20 pub epocher: ES,
21
22 /// The prefix to use for all partitions.
23 pub partition_prefix: String,
24
25 /// Size of backfill request/response mailbox.
26 pub mailbox_size: usize,
27
28 /// Minimum number of views to retain temporary data after the application processes a block.
29 ///
30 /// Useful for keeping around information that peers may desire to have.
31 pub view_retention_timeout: ViewDelta,
32
33 /// Namespace for proofs.
34 pub namespace: Vec<u8>,
35
36 /// Prunable archive partition prefix.
37 pub prunable_items_per_section: NonZeroU64,
38
39 /// The buffer pool to use for the freezer journal.
40 pub buffer_pool: PoolRef,
41
42 /// The size of the replay buffer for storage archives.
43 pub replay_buffer: NonZeroUsize,
44
45 /// The size of the write buffer for storage archives.
46 pub write_buffer: NonZeroUsize,
47
48 /// Codec configuration for block type.
49 pub block_codec_config: B::Cfg,
50
51 /// Maximum number of blocks to repair at once.
52 pub max_repair: NonZeroUsize,
53}