massa_pool_exports/config.rs
1//! Copyright (c) 2022 MASSA LABS <info@massa.net>
2
3use massa_models::amount::Amount;
4use massa_time::MassaTime;
5use serde::{Deserialize, Serialize};
6
7/// Pool configuration
8#[derive(Debug, Deserialize, Serialize, Clone, Copy)]
9pub struct PoolConfig {
10 /// thread count
11 pub thread_count: u8,
12 /// maximal total block operations size
13 pub max_block_size: u32,
14 /// maximal gas per block
15 pub max_block_gas: u64,
16 /// Gas used by any operation
17 pub base_operation_gas_cost: u64,
18 /// Amount required for a SinglePass compilation (ExecuteSC operation)
19 pub sp_compilation_cost: u64,
20 /// cost (in coins) of a single roll
21 pub roll_price: Amount,
22 /// operation validity periods
23 pub operation_validity_periods: u64,
24 /// operation pool refresh interval
25 pub operation_pool_refresh_interval: MassaTime,
26 /// operation pool buffer swap interval
27 pub operation_pool_swap_interval: MassaTime,
28 /// endorsement pool buffer swap interval
29 pub endorsement_pool_swap_interval: MassaTime,
30 /// denunciation pool refresh interval
31 pub denunciation_pool_refresh_interval: MassaTime,
32 /// denunciation pool buffer swap interval
33 pub denunciation_pool_swap_interval: MassaTime,
34 /// max delay in the future for operation validity start
35 pub operation_max_future_start_delay: MassaTime,
36 /// max operations per block
37 pub max_operations_per_block: u32,
38 /// max operation pool size per thread (in number of operations)
39 pub max_operation_pool_size: usize,
40 /// max excess on pool size (in-between refreshes)
41 pub max_operation_pool_excess_items: usize,
42 /// max endorsement pool size per thread (in number of endorsements)
43 pub max_endorsements_pool_size_per_thread: usize,
44 /// max number of endorsements per block
45 pub max_block_endorsement_count: u32,
46 /// operations channel capacity
47 pub operations_channel_size: usize,
48 /// endorsements channel capacity
49 pub endorsements_channel_size: usize,
50 /// denunciations channel capacity
51 pub denunciations_channel_size: usize,
52 /// whether operations broadcast is enabled
53 pub broadcast_enabled: bool,
54 /// broadcast endorsements channel capacity
55 pub broadcast_endorsements_channel_capacity: usize,
56 /// broadcast operations channel capacity
57 pub broadcast_operations_channel_capacity: usize,
58 /// genesis timestamp
59 pub genesis_timestamp: MassaTime,
60 /// period duration
61 pub t0: MassaTime,
62 /// cycle duration in periods
63 pub periods_per_cycle: u64,
64 /// denunciation expiration (in periods)
65 pub denunciation_expire_periods: u64,
66 /// max number of denunciations that can be included in a block header
67 pub max_denunciations_per_block_header: u32,
68 /// Minimum acceptable fees to include an operation in a block
69 pub minimal_fees: Amount,
70 /// last_start_period
71 /// * If start all new network: set to 0
72 /// * If from snapshot: retrieve from args
73 /// * If from bootstrap: set during bootstrap
74 pub last_start_period: u64,
75}