massa_pool_exports/channels.rs
1use massa_execution_exports::ExecutionController;
2use massa_models::{endorsement::SecureShareEndorsement, operation::SecureShareOperation};
3use massa_pos_exports::SelectorController;
4use massa_versioning::versioning::MipStore;
5
6/// channels used by the pool worker
7#[derive(Clone)]
8pub struct PoolChannels {
9 /// Communication with the execution module
10 pub execution_controller: Box<dyn ExecutionController>,
11 /// Selector to get draws
12 pub selector: Box<dyn SelectorController>,
13 /// Broadcasts used by the pool worker to send new operations and endorsements
14 pub broadcasts: PoolBroadcasts,
15 /// MIP store, used to decide the consensus signature layout (chain-scoped
16 /// vs legacy) when creating denunciations (F90 / PDF #11).
17 pub mip_store: MipStore,
18 /// Local chain id, folded into the signed hash of endorsements / block headers
19 /// once MIP-0002 `Execution` v2 is active.
20 pub chain_id: u64,
21}
22
23/// Broadcasts used by the pool worker to send new operations and endorsements
24#[derive(Clone)]
25pub struct PoolBroadcasts {
26 /// Broadcast channel for new endorsements
27 pub endorsement_sender: tokio::sync::broadcast::Sender<SecureShareEndorsement>,
28 /// Broadcast channel for new operations
29 pub operation_sender: tokio::sync::broadcast::Sender<SecureShareOperation>,
30}