commonware_consensus/marshal/
config.rs

1use crate::Block;
2use commonware_cryptography::{bls12381::primitives::variant::Variant, PublicKey};
3use commonware_resolver::p2p::Coordinator;
4use governor::Quota;
5
6/// Marshal configuration.
7#[derive(Debug)]
8pub struct Config<V: Variant, P: PublicKey, Z: Coordinator<PublicKey = P>, B: Block> {
9    /// The public key of the validator.
10    pub public_key: P,
11
12    /// The identity of the network.
13    pub identity: V::Public,
14
15    /// The coordinator for the resolvers.
16    pub coordinator: Z,
17
18    /// The prefix to use for all partitions.
19    pub partition_prefix: String,
20
21    /// Size of backfill request/response mailbox.
22    pub mailbox_size: usize,
23
24    /// Backfill rate limit.
25    pub backfill_quota: Quota,
26
27    /// Minimum number of views to retain temporary data after the application processes a block.
28    ///
29    /// Useful for keeping around information that peers may desire to have.
30    pub view_retention_timeout: u64,
31
32    /// Namespace for proofs.
33    pub namespace: Vec<u8>,
34
35    /// Prunable archive partition prefix.
36    pub prunable_items_per_section: u64,
37
38    /// The number of items to store per section in immutable archives.
39    pub immutable_items_per_section: u64,
40
41    /// The initial size of the freezer table.
42    pub freezer_table_initial_size: u32,
43
44    /// The frequency (in number of resizes) at which to check if the freezer table
45    /// should be resized.
46    pub freezer_table_resize_frequency: u8,
47
48    /// The number of items to add to the freezer table when resizing.
49    pub freezer_table_resize_chunk_size: u32,
50
51    /// The target size of the freezer journal.
52    pub freezer_journal_target_size: u64,
53
54    /// The compression level to use for the freezer journal.
55    pub freezer_journal_compression: Option<u8>,
56
57    /// The size of the replay buffer for storage archives.
58    pub replay_buffer: usize,
59
60    /// The size of the write buffer for storage archives.
61    pub write_buffer: usize,
62
63    /// Codec configuration for block type.
64    pub codec_config: B::Cfg,
65
66    /// Maximum number of blocks to repair at once
67    pub max_repair: u64,
68}