kona_interop/
control.rs

1//! Contains the `ControlEvent`.
2
3use alloy_primitives::B256;
4use kona_protocol::BlockInfo;
5
6/// Control Event
7///
8/// The `ControlEvent` is an action performed by the supervisor
9/// on the L2 consensus node, in this case the `kona-node`.
10#[derive(Debug, Clone, PartialEq, Eq)]
11#[allow(clippy::large_enum_variant)]
12pub enum ControlEvent {
13    /// Invalidates a specified block.
14    ///
15    /// Based on some dependency or L1 changes, the supervisor
16    /// can instruct the L2 to invalidate a specific block.
17    InvalidateBlock(B256),
18
19    /// The supervisor sends the next L1 block to the node.
20    /// Ideally sent after the node emits exhausted-l1.
21    ProviderL1(BlockInfo),
22
23    /// Forces a reset to a specific local-unsafe/local-safe/finalized
24    /// starting point only if the blocks did exist. Resets may override
25    /// local-unsafe, to reset the very end of the chain. Resets may
26    /// override local-safe, since post-interop we need the local-safe
27    /// block derivation to continue.
28    Reset {
29        /// The local-unsafe block to reset to.
30        local_unsafe: Option<BlockInfo>,
31        /// The cross-unsafe block to reset to.
32        cross_unsafe: Option<BlockInfo>,
33        /// The local-safe block to reset to.
34        local_safe: Option<BlockInfo>,
35        /// The cross-safe block to reset to.
36        cross_safe: Option<BlockInfo>,
37        /// The finalized block to reset to.
38        finalized: Option<BlockInfo>,
39    },
40
41    /// Signal that a block can be promoted to cross-safe.
42    UpdateCrossSafe(BlockInfo),
43
44    /// Signal that a block can be promoted to cross-unsafe.
45    UpdateCrossUnsafe(BlockInfo),
46
47    /// Signal that a block can be marked as finalized.
48    UpdateFinalized(BlockInfo),
49}