exocore_chain/engine/commit_manager/
config.rs

1use std::time::Duration;
2
3use crate::block::BlockHeight;
4
5/// CommitManager's configuration
6#[derive(Copy, Clone, Debug)]
7pub struct CommitManagerConfig {
8    /// How deep a block need to be before we cleanup its operations from
9    /// pending store
10    pub operations_cleanup_after_block_depth: BlockHeight,
11
12    /// After how many new operations in pending store do we force a commit,
13    /// even if we aren't past the commit interval
14    pub commit_maximum_pending_store_count: usize,
15
16    /// Interval at which commits are made, unless we hit
17    /// `commit_maximum_pending_count`
18    pub commit_maximum_interval: Duration,
19
20    /// For how long a block proposal is considered valid after its creation
21    /// This is used to prevent
22    pub block_proposal_timeout: Duration,
23}
24
25impl Default for CommitManagerConfig {
26    fn default() -> Self {
27        CommitManagerConfig {
28            operations_cleanup_after_block_depth: 6,
29            commit_maximum_pending_store_count: 10,
30            commit_maximum_interval: Duration::from_secs(3),
31            block_proposal_timeout: Duration::from_secs(7),
32        }
33    }
34}