Trait RollupNodeService

Source
pub trait RollupNodeService {
    type DataAvailabilityWatcher: NodeActor<Error: Display, OutboundData = L1WatcherRpcContext, InboundData = L1WatcherRpcInboundChannels>;
    type DerivationPipeline: Pipeline + SignalReceiver + Send + Sync + 'static;
    type DerivationActor: NodeActor<Error: Display, Builder: PipelineBuilder<Pipeline = Self::DerivationPipeline>, OutboundData = DerivationContext, InboundData = DerivationInboundChannels>;
    type EngineActor: NodeActor<Error: Display, OutboundData = EngineContext, InboundData = EngineInboundData>;
    type NetworkActor: NodeActor<Error: Display, OutboundData = NetworkContext, InboundData = NetworkInboundData>;
    type AttributesBuilder: AttributesBuilder + Send + Sync + 'static;
    type SequencerActor: NodeActor<Error: Display, OutboundData = SequencerContext, Builder: AttributesBuilderConfig<AB = Self::AttributesBuilder>, InboundData = SequencerInboundData>;
    type RpcActor: NodeActor<Error: Display, OutboundData = RpcContext, InboundData = ()>;

    // Required methods
    fn mode(&self) -> NodeMode;
    fn da_watcher_builder(
        &self,
    ) -> <Self::DataAvailabilityWatcher as NodeActor>::Builder;
    fn derivation_builder(
        &self,
    ) -> <Self::DerivationActor as NodeActor>::Builder;
    fn network_builder(&self) -> <Self::NetworkActor as NodeActor>::Builder;
    fn engine_builder(&self) -> <Self::EngineActor as NodeActor>::Builder;
    fn rpc_builder(&self) -> Option<<Self::RpcActor as NodeActor>::Builder>;
    fn sequencer_builder(&self) -> <Self::SequencerActor as NodeActor>::Builder;

    // Provided method
    fn start<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

The RollupNodeService trait defines the common interface for running a rollup node.

§Validator Mode

The rollup node, in validator mode, listens to two sources of information to sync the L2 chain:

  1. The data availability layer, with a watcher that listens for new updates. L2 inputs (L2 transaction batches + deposits) are then derived from the DA layer.
  2. The L2 sequencer, which produces unsafe L2 blocks and sends them to the network over p2p gossip.

From these two sources, the node imports unsafe blocks from the L2 sequencer, safe blocks from the L2 derivation pipeline into the L2 execution layer via the Engine API, and finalizes safe blocks that it has derived when L1 finalized block updates are received.

§Sequencer Mode

Unimplemented - coming soon.

§Types

  • DataAvailabilityWatcher: The type of NodeActor to use for the DA watcher service.
  • DerivationPipeline: The type of Pipeline to use for the service. Can be swapped out from the default implementation for the sake of plugins like Alt DA.
  • Error: The type of error for the service’s entrypoint.

Required Associated Types§

Source

type DataAvailabilityWatcher: NodeActor<Error: Display, OutboundData = L1WatcherRpcContext, InboundData = L1WatcherRpcInboundChannels>

The type of NodeActor to use for the DA watcher service.

Source

type DerivationPipeline: Pipeline + SignalReceiver + Send + Sync + 'static

The type of derivation pipeline to use for the service.

Source

type DerivationActor: NodeActor<Error: Display, Builder: PipelineBuilder<Pipeline = Self::DerivationPipeline>, OutboundData = DerivationContext, InboundData = DerivationInboundChannels>

The type of derivation actor to use for the service.

Source

type EngineActor: NodeActor<Error: Display, OutboundData = EngineContext, InboundData = EngineInboundData>

The type of engine actor to use for the service.

Source

type NetworkActor: NodeActor<Error: Display, OutboundData = NetworkContext, InboundData = NetworkInboundData>

The type of network actor to use for the service.

Source

type AttributesBuilder: AttributesBuilder + Send + Sync + 'static

The type of attributes builder to use for the sequener.

Source

type SequencerActor: NodeActor<Error: Display, OutboundData = SequencerContext, Builder: AttributesBuilderConfig<AB = Self::AttributesBuilder>, InboundData = SequencerInboundData>

The type of sequencer actor to use for the service.

Source

type RpcActor: NodeActor<Error: Display, OutboundData = RpcContext, InboundData = ()>

The type of rpc actor to use for the service.

Required Methods§

Source

fn mode(&self) -> NodeMode

The mode of operation for the node.

Source

fn da_watcher_builder( &self, ) -> <Self::DataAvailabilityWatcher as NodeActor>::Builder

Returns a DA watcher builder for the node.

Source

fn derivation_builder(&self) -> <Self::DerivationActor as NodeActor>::Builder

Returns a derivation builder for the node.

Source

fn network_builder(&self) -> <Self::NetworkActor as NodeActor>::Builder

Creates a network builder for the node.

Source

fn engine_builder(&self) -> <Self::EngineActor as NodeActor>::Builder

Returns an engine builder for the node.

Source

fn rpc_builder(&self) -> Option<<Self::RpcActor as NodeActor>::Builder>

Returns an rpc builder for the node.

Source

fn sequencer_builder(&self) -> <Self::SequencerActor as NodeActor>::Builder

Returns the sequencer builder for the node.

Provided Methods§

Source

fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Starts the rollup node service.

Implementors§