massa_consensus_exports/
settings.rs

1use massa_signature::KeyPair;
2use massa_time::MassaTime;
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Deserialize, Serialize)]
6pub struct ConsensusConfig {
7    /// Genesis timestamp
8    pub genesis_timestamp: MassaTime,
9    /// Delta time between two period
10    pub t0: MassaTime,
11    /// Number of threads
12    pub thread_count: u8,
13    /// Keypair to sign genesis blocks.
14    pub genesis_key: KeyPair,
15    /// Maximum number of blocks allowed in discarded blocks.
16    pub max_discarded_blocks: usize,
17    /// Maximum number of blocks allowed in `FutureIncomingBlocks`.
18    pub max_future_processing_blocks: usize,
19    /// Maximum number of blocks allowed in `DependencyWaitingBlocks`.
20    pub max_dependency_blocks: usize,
21    /// old blocks are pruned every `block_db_prune_interval`
22    pub block_db_prune_interval: MassaTime,
23    /// Max gas per block for the execution configuration
24    pub max_gas_per_block: u64,
25    /// Threshold for fitness.
26    pub delta_f0: u64,
27    /// Maximum operation validity period count
28    pub operation_validity_periods: u64,
29    /// cycle duration in periods
30    pub periods_per_cycle: u64,
31    /// force keep at least this number of final periods in RAM for each thread
32    pub force_keep_final_periods: u64,
33    /// force keep at least this number of final blocks without ops in RAM for each thread
34    pub force_keep_final_periods_without_ops: u64,
35    /// target number of endorsement per block
36    pub endorsement_count: u32,
37    /// TESTNET: time when the blockclique is ended.
38    pub end_timestamp: Option<MassaTime>,
39    /// stats time span
40    pub stats_timespan: MassaTime,
41    /// channel size
42    pub channel_size: usize,
43    /// size of a consensus bootstrap streaming part
44    pub bootstrap_part_size: u64,
45    /// whether broadcast is enabled
46    pub broadcast_enabled: bool,
47    /// blocks headers channel capacity
48    pub broadcast_blocks_headers_channel_capacity: usize,
49    /// blocks channel capacity
50    pub broadcast_blocks_channel_capacity: usize,
51    /// filled blocks channel capacity
52    pub broadcast_filled_blocks_channel_capacity: usize,
53    /// last start period
54    pub last_start_period: u64,
55    /// chain id
56    pub chain_id: u64,
57}