forked from scroll-tech/rollup-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.rs
More file actions
40 lines (37 loc) · 1.61 KB
/
command.rs
File metadata and controls
40 lines (37 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use crate::{ChainOrchestratorEvent, ChainOrchestratorStatus};
use reth_network_api::FullNetwork;
use reth_scroll_node::ScrollNetworkPrimitives;
use reth_tokio_util::EventStream;
use rollup_node_primitives::{BlockInfo, L1MessageEnvelope};
use scroll_db::L1MessageKey;
use scroll_network::ScrollNetworkHandle;
use tokio::sync::oneshot;
/// The commands that can be sent to the rollup manager.
#[derive(Debug)]
pub enum ChainOrchestratorCommand<N: FullNetwork<Primitives = ScrollNetworkPrimitives>> {
/// Command to build a new block.
BuildBlock,
/// Returns an event stream for rollup manager events.
EventListener(oneshot::Sender<EventStream<ChainOrchestratorEvent>>),
/// Report the current status of the manager via the oneshot channel.
Status(oneshot::Sender<ChainOrchestratorStatus>),
/// Returns the network handle.
NetworkHandle(oneshot::Sender<ScrollNetworkHandle<N>>),
/// Update the head of the fcs in the engine driver.
UpdateFcsHead((BlockInfo, oneshot::Sender<()>)),
/// Enable automatic sequencing.
EnableAutomaticSequencing(oneshot::Sender<bool>),
/// Disable automatic sequencing.
DisableAutomaticSequencing(oneshot::Sender<bool>),
/// Send a database query to the rollup manager.
DatabaseQuery(DatabaseQuery),
/// Enable gossiping of blocks to peers.
#[cfg(feature = "test-utils")]
SetGossip((bool, oneshot::Sender<()>)),
}
/// The database queries that can be sent to the rollup manager.
#[derive(Debug)]
pub enum DatabaseQuery {
/// Get L1 message by its index.
GetL1MessageByKey(L1MessageKey, oneshot::Sender<Option<L1MessageEnvelope>>),
}