NitroExecutionApiServer

Trait NitroExecutionApiServer 

Source
pub trait NitroExecutionApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn digest_message<'life0, 'async_trait>(
        &'life0 self,
        msg_idx: u64,
        message: RpcMessageWithMetadata,
        message_for_prefetch: Option<RpcMessageWithMetadata>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<RpcMessageResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reorg<'life0, 'async_trait>(
        &'life0 self,
        msg_idx_of_first_msg_to_add: u64,
        new_messages: Vec<RpcMessageWithMetadataAndBlockInfo>,
        old_messages: Vec<RpcMessageWithMetadata>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<RpcMessageResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn head_message_index<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn result_at_message_index<'life0, 'async_trait>(
        &'life0 self,
        msg_idx: u64,
    ) -> Pin<Box<dyn Future<Output = RpcResult<RpcMessageResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_finality_data(
        &self,
        safe: Option<RpcFinalityData>,
        finalized: Option<RpcFinalityData>,
        validated: Option<RpcFinalityData>,
    ) -> RpcResult<()>;
    fn set_consensus_sync_data(
        &self,
        sync_data: RpcConsensusSyncData,
    ) -> RpcResult<()>;
    fn mark_feed_start(&self, to: u64) -> RpcResult<()>;
    fn trigger_maintenance<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn should_trigger_maintenance<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn maintenance_status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<RpcMaintenanceStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn arbos_version_for_message_index<'life0, 'async_trait>(
        &'life0 self,
        msg_idx: u64,
    ) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the NitroExecutionApi RPC API.

Required Methods§

Source

fn digest_message<'life0, 'async_trait>( &'life0 self, msg_idx: u64, message: RpcMessageWithMetadata, message_for_prefetch: Option<RpcMessageWithMetadata>, ) -> Pin<Box<dyn Future<Output = RpcResult<RpcMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process a message and produce a block.

Source

fn reorg<'life0, 'async_trait>( &'life0 self, msg_idx_of_first_msg_to_add: u64, new_messages: Vec<RpcMessageWithMetadataAndBlockInfo>, old_messages: Vec<RpcMessageWithMetadata>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<RpcMessageResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a chain reorg by rolling back and replaying messages.

Source

fn head_message_index<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the current head message index.

Source

fn result_at_message_index<'life0, 'async_trait>( &'life0 self, msg_idx: u64, ) -> Pin<Box<dyn Future<Output = RpcResult<RpcMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the block hash and send root for a given message index.

Source

fn set_finality_data( &self, safe: Option<RpcFinalityData>, finalized: Option<RpcFinalityData>, validated: Option<RpcFinalityData>, ) -> RpcResult<()>

Updates finality information.

Source

fn set_consensus_sync_data( &self, sync_data: RpcConsensusSyncData, ) -> RpcResult<()>

Updates consensus sync data.

Source

fn mark_feed_start(&self, to: u64) -> RpcResult<()>

Marks the feed start position.

Source

fn trigger_maintenance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Triggers maintenance operations.

Source

fn should_trigger_maintenance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks if maintenance should be triggered.

Source

fn maintenance_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<RpcMaintenanceStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns current maintenance status.

Source

fn arbos_version_for_message_index<'life0, 'async_trait>( &'life0 self, msg_idx: u64, ) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the ArbOS version for a given message index.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Provider, BP> NitroExecutionApiServer for NitroExecutionHandler<Provider, BP>
where Provider: BlockNumReader + BlockReaderIdExt + HeaderProvider + 'static, BP: BlockProducer,