pub trait EventTransformerState<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions>
where Self: Debug + Send + Sync + 'static,
{ // Required methods fn recv_handler<'life0, 'life1, 'async_trait>( &'life0 mut self, event: &'life1 HotShotEvent<TYPES> ) -> Pin<Box<dyn Future<Output = Vec<HotShotEvent<TYPES>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_handler<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, event: &'life1 HotShotEvent<TYPES>, public_key: &'life2 TYPES::SignatureKey, private_key: &'life3 <TYPES::SignatureKey as SignatureKey>::PrivateKey, upgrade_lock: &'life4 UpgradeLock<TYPES, V>, consensus: Arc<RwLock<Consensus<TYPES>>> ) -> Pin<Box<dyn Future<Output = Vec<HotShotEvent<TYPES>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; // Provided methods fn spawn_handle<'async_trait>( &'static mut self, public_key: TYPES::SignatureKey, private_key: <TYPES::SignatureKey as SignatureKey>::PrivateKey, nonce: u64, config: HotShotConfig<TYPES::SignatureKey>, memberships: Memberships<TYPES>, network: Arc<I::Network>, initializer: HotShotInitializer<TYPES>, metrics: ConsensusMetricsValue, storage: I::Storage, marketplace_config: MarketplaceConfig<TYPES, I> ) -> Pin<Box<dyn Future<Output = SystemContextHandle<TYPES, I, V>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn add_network_tasks<'life0, 'async_trait>( &'static mut self, handle: &'life0 mut SystemContextHandle<TYPES, I, V> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn add_network_event_tasks( &self, handle: &mut SystemContextHandle<TYPES, I, V> ) { ... } fn add_network_event_task( &self, handle: &mut SystemContextHandle<TYPES, I, V>, channel: Arc<<I as NodeImplementation<TYPES>>::Network>, membership: TYPES::Membership, filter: fn(_: &Arc<HotShotEvent<TYPES>>) -> bool ) { ... } }
Expand description

Trait for intercepting and modifying messages between the network and consensus layers.

Consensus <-> [Byzantine logic layer] <-> Network

Required Methods§

source

fn recv_handler<'life0, 'life1, 'async_trait>( &'life0 mut self, event: &'life1 HotShotEvent<TYPES> ) -> Pin<Box<dyn Future<Output = Vec<HotShotEvent<TYPES>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

modify incoming messages from the network

source

fn send_handler<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, event: &'life1 HotShotEvent<TYPES>, public_key: &'life2 TYPES::SignatureKey, private_key: &'life3 <TYPES::SignatureKey as SignatureKey>::PrivateKey, upgrade_lock: &'life4 UpgradeLock<TYPES, V>, consensus: Arc<RwLock<Consensus<TYPES>>> ) -> Pin<Box<dyn Future<Output = Vec<HotShotEvent<TYPES>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

modify outgoing messages from the network

Provided Methods§

source

fn spawn_handle<'async_trait>( &'static mut self, public_key: TYPES::SignatureKey, private_key: <TYPES::SignatureKey as SignatureKey>::PrivateKey, nonce: u64, config: HotShotConfig<TYPES::SignatureKey>, memberships: Memberships<TYPES>, network: Arc<I::Network>, initializer: HotShotInitializer<TYPES>, metrics: ConsensusMetricsValue, storage: I::Storage, marketplace_config: MarketplaceConfig<TYPES, I> ) -> Pin<Box<dyn Future<Output = SystemContextHandle<TYPES, I, V>> + Send + 'async_trait>>
where Self: Send + 'async_trait,

Creates a SystemContextHandle with the given even transformer

source

fn add_network_tasks<'life0, 'async_trait>( &'static mut self, handle: &'life0 mut SystemContextHandle<TYPES, I, V> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Add byzantine network tasks with the trait

source

fn add_network_event_tasks(&self, handle: &mut SystemContextHandle<TYPES, I, V>)

Adds the NetworkEventTaskState tasks possibly modifying them as well.

source

fn add_network_event_task( &self, handle: &mut SystemContextHandle<TYPES, I, V>, channel: Arc<<I as NodeImplementation<TYPES>>::Network>, membership: TYPES::Membership, filter: fn(_: &Arc<HotShotEvent<TYPES>>) -> bool )

Adds a NetworkEventTaskState task. Can be reimplemented to modify its behaviour.

Implementors§