Skip to main content

RethEngineApiServer

Trait RethEngineApiServer 

Source
pub trait RethEngineApiServer<ExecutionData>:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn reth_new_payload(
        &self,
        payload: RethNewPayloadInput<ExecutionData>,
        wait_for_persistence: Option<bool>,
        wait_for_caches: Option<bool>,
    ) -> impl Future<Output = Result<RethPayloadStatus, ErrorObject<'static>>> + Send;
    fn reth_forkchoice_updated(
        &self,
        forkchoice_state: ForkchoiceState,
    ) -> impl Future<Output = Result<ForkchoiceUpdated, ErrorObject<'static>>> + Send;

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

Server trait implementation for the RethEngineApi RPC API.

Required Methods§

Source

fn reth_new_payload( &self, payload: RethNewPayloadInput<ExecutionData>, wait_for_persistence: Option<bool>, wait_for_caches: Option<bool>, ) -> impl Future<Output = Result<RethPayloadStatus, ErrorObject<'static>>> + Send

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

wait_for_persistence (default true): waits for in-flight persistence to complete. wait_for_caches (default true): waits for execution cache and sparse trie locks.

Source

fn reth_forkchoice_updated( &self, forkchoice_state: ForkchoiceState, ) -> impl Future<Output = Result<ForkchoiceUpdated, ErrorObject<'static>>> + Send

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".

Implementations on Foreign Types§

Source§

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

Source§

async fn reth_new_payload( &self, input: RethNewPayloadInput<<Payload as PayloadTypes>::ExecutionData>, wait_for_persistence: Option<bool>, wait_for_caches: Option<bool>, ) -> Result<RethPayloadStatus, ErrorObject<'static>>

Source§

async fn reth_forkchoice_updated( &self, forkchoice_state: ForkchoiceState, ) -> Result<ForkchoiceUpdated, ErrorObject<'static>>

Implementors§