exocore_chain/engine/pending_sync/config.rs
1use crate::{block::BlockHeight, engine::request_tracker};
2
3/// Pending synchronizer configuration
4#[derive(Copy, Clone, Debug)]
5pub struct PendingSyncConfig {
6 pub max_operations_per_range: u32,
7
8 pub request_tracker_config: request_tracker::RequestTrackerConfig,
9
10 /// Related to `CommitManagerConfig`.`operations_cleanup_after_block_depth`.
11 /// This indicates how many blocks after the last cleaned up block we should
12 /// include by default when doing sync requests, so that we don't
13 /// request for operations that may have been cleaned up on other nodes.
14
15 /// The `CommitManager` does cleanup at interval, and sets the last block
16 /// that got cleaned in the `SyncState` up from the `PendingStore`
17 /// because it was committed for more than `CommitManagerConfig`.
18 /// `operations_cleanup_after_block_depth` of depth.
19
20 /// This value is added to the `SyncState` last cleanup block depth to make
21 /// sure we don't ask or include operations that got cleaned up.
22 pub operations_depth_after_cleanup: BlockHeight,
23}
24
25impl Default for PendingSyncConfig {
26 fn default() -> Self {
27 PendingSyncConfig {
28 max_operations_per_range: 30,
29 request_tracker_config: request_tracker::RequestTrackerConfig::default(),
30 operations_depth_after_cleanup: 2,
31 }
32 }
33}