massa_execution_exports/
channels.rs

1// Copyright (c) 2023 MASSA LABS <info@massa.net>
2
3use crate::types::SlotExecutionOutput;
4
5#[cfg(feature = "execution-trace")]
6use crate::types_trace_info::{SlotAbiCallStack, Transfer};
7
8#[cfg(feature = "execution-info")]
9use crate::execution_info::ExecutionInfoForSlot;
10
11/// channels used by the execution worker
12#[derive(Clone)]
13pub struct ExecutionChannels {
14    /// Broadcast channel for new slot execution outputs
15    pub slot_execution_output_sender: tokio::sync::broadcast::Sender<SlotExecutionOutput>,
16    /// Broadcast channel for execution traces (abi call stacks, the slot's transfers, boolean true if the slot is finalized, false otherwise).
17    /// The transfers are bound to the same execution instance as the abi call stacks so subscribers never need a separate slot-keyed lookup (which could be overwritten by a re-execution of the same slot).
18    #[cfg(feature = "execution-trace")]
19    pub slot_execution_traces_sender:
20        tokio::sync::broadcast::Sender<(SlotAbiCallStack, Vec<Transfer>, bool)>,
21    /// Broadcast channel for execution info
22    #[cfg(feature = "execution-info")]
23    pub slot_execution_info_sender: tokio::sync::broadcast::Sender<ExecutionInfoForSlot>,
24}