Skip to main content

RethEngineApiServer

Trait RethEngineApiServer 

Source
pub trait RethEngineApiServer<ExecutionData>:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn reth_new_payload<'life0, 'async_trait>(
        &'life0 self,
        payload: RethNewPayloadInput<ExecutionData>,
    ) -> Pin<Box<dyn Future<Output = Result<RethPayloadStatus, ErrorObject<'static>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn reth_forkchoice_updated<'life0, 'async_trait>(
        &'life0 self,
        forkchoice_state: ForkchoiceState,
    ) -> Pin<Box<dyn Future<Output = Result<ForkchoiceUpdated, ErrorObject<'static>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where ExecutionData: Send + Sync + 'static + DeserializeOwned { ... }
}
Available on crate feature rpc only.
Expand description

Server trait implementation for the RethEngineApi RPC API.

Required Methods§

Source

fn reth_new_payload<'life0, 'async_trait>( &'life0 self, payload: RethNewPayloadInput<ExecutionData>, ) -> Pin<Box<dyn Future<Output = Result<RethPayloadStatus, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Reth-specific newPayload that accepts either ExecutionData directly or an RLP-encoded block.

Waits for persistence, execution cache, and sparse trie locks before processing.

Source

fn reth_forkchoice_updated<'life0, 'async_trait>( &'life0 self, forkchoice_state: ForkchoiceState, ) -> Pin<Box<dyn Future<Output = Result<ForkchoiceUpdated, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Reth-specific forkchoiceUpdated that sends a regular forkchoice update with no payload attributes.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>
where ExecutionData: Send + Sync + 'static + DeserializeOwned,

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.

Implementations on Foreign Types§

Source§

impl<Payload> RethEngineApiServer<<Payload as PayloadTypes>::ExecutionData> for RethEngineApi<Payload>
where Payload: PayloadTypes,

Source§

fn reth_new_payload<'life0, 'async_trait>( &'life0 self, input: RethNewPayloadInput<<Payload as PayloadTypes>::ExecutionData>, ) -> Pin<Box<dyn Future<Output = Result<RethPayloadStatus, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, RethEngineApi<Payload>: 'async_trait,

Source§

fn reth_forkchoice_updated<'life0, 'async_trait>( &'life0 self, forkchoice_state: ForkchoiceState, ) -> Pin<Box<dyn Future<Output = Result<ForkchoiceUpdated, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, RethEngineApi<Payload>: 'async_trait,

Implementors§