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:
- 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.
- 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
Required Associated Types§
Sourcetype DataAvailabilityWatcher: NodeActor<Error: Display, OutboundData = L1WatcherRpcContext, InboundData = L1WatcherRpcInboundChannels>
type DataAvailabilityWatcher: NodeActor<Error: Display, OutboundData = L1WatcherRpcContext, InboundData = L1WatcherRpcInboundChannels>
The type of NodeActor to use for the DA watcher service.
Sourcetype DerivationPipeline: Pipeline + SignalReceiver + Send + Sync + 'static
type DerivationPipeline: Pipeline + SignalReceiver + Send + Sync + 'static
The type of derivation pipeline to use for the service.
Sourcetype DerivationActor: NodeActor<Error: Display, Builder: PipelineBuilder<Pipeline = Self::DerivationPipeline>, OutboundData = DerivationContext, InboundData = DerivationInboundChannels>
type DerivationActor: NodeActor<Error: Display, Builder: PipelineBuilder<Pipeline = Self::DerivationPipeline>, OutboundData = DerivationContext, InboundData = DerivationInboundChannels>
The type of derivation actor to use for the service.
Sourcetype EngineActor: NodeActor<Error: Display, OutboundData = EngineContext, InboundData = EngineInboundData>
type EngineActor: NodeActor<Error: Display, OutboundData = EngineContext, InboundData = EngineInboundData>
The type of engine actor to use for the service.
Sourcetype NetworkActor: NodeActor<Error: Display, OutboundData = NetworkContext, InboundData = NetworkInboundData>
type NetworkActor: NodeActor<Error: Display, OutboundData = NetworkContext, InboundData = NetworkInboundData>
The type of network actor to use for the service.
Sourcetype AttributesBuilder: AttributesBuilder + Send + Sync + 'static
type AttributesBuilder: AttributesBuilder + Send + Sync + 'static
The type of attributes builder to use for the sequener.
Sourcetype SequencerActor: NodeActor<Error: Display, OutboundData = SequencerContext, Builder: AttributesBuilderConfig<AB = Self::AttributesBuilder>, InboundData = SequencerInboundData>
type SequencerActor: NodeActor<Error: Display, OutboundData = SequencerContext, Builder: AttributesBuilderConfig<AB = Self::AttributesBuilder>, InboundData = SequencerInboundData>
The type of sequencer actor to use for the service.
Required Methods§
Sourcefn da_watcher_builder(
&self,
) -> <Self::DataAvailabilityWatcher as NodeActor>::Builder
fn da_watcher_builder( &self, ) -> <Self::DataAvailabilityWatcher as NodeActor>::Builder
Returns a DA watcher builder for the node.
Sourcefn derivation_builder(&self) -> <Self::DerivationActor as NodeActor>::Builder
fn derivation_builder(&self) -> <Self::DerivationActor as NodeActor>::Builder
Returns a derivation builder for the node.
Sourcefn network_builder(&self) -> <Self::NetworkActor as NodeActor>::Builder
fn network_builder(&self) -> <Self::NetworkActor as NodeActor>::Builder
Creates a network builder for the node.
Sourcefn engine_builder(&self) -> <Self::EngineActor as NodeActor>::Builder
fn engine_builder(&self) -> <Self::EngineActor as NodeActor>::Builder
Returns an engine builder for the node.
Sourcefn rpc_builder(&self) -> Option<<Self::RpcActor as NodeActor>::Builder>
fn rpc_builder(&self) -> Option<<Self::RpcActor as NodeActor>::Builder>
Returns an rpc builder for the node.
Sourcefn sequencer_builder(&self) -> <Self::SequencerActor as NodeActor>::Builder
fn sequencer_builder(&self) -> <Self::SequencerActor as NodeActor>::Builder
Returns the sequencer builder for the node.