pub struct EngineClient { /* private fields */ }Expand description
An external engine api client
Implementations§
Source§impl EngineClient
impl EngineClient
Sourcepub fn new_http(
engine: Url,
l2_rpc: Url,
l1_rpc: Url,
cfg: Arc<RollupConfig>,
jwt: JwtSecret,
) -> Self
pub fn new_http( engine: Url, l2_rpc: Url, l1_rpc: Url, cfg: Arc<RollupConfig>, jwt: JwtSecret, ) -> Self
Creates a new EngineClient from the provided Url and JwtSecret.
Sourcepub const fn l2_provider(&self) -> &RootProvider<Optimism>
pub const fn l2_provider(&self) -> &RootProvider<Optimism>
Returns a reference to the inner L2 RootProvider.
Sourcepub const fn l1_provider(&self) -> &RootProvider
pub const fn l1_provider(&self) -> &RootProvider
Returns a reference to the inner L1 RootProvider.
Sourcepub fn cfg(&self) -> &RollupConfig
pub fn cfg(&self) -> &RollupConfig
Returns a reference to the inner RollupConfig.
Sourcepub async fn l2_block_by_label(
&self,
numtag: BlockNumberOrTag,
) -> Result<Option<Block<Transaction>>, EngineClientError>
pub async fn l2_block_by_label( &self, numtag: BlockNumberOrTag, ) -> Result<Option<Block<Transaction>>, EngineClientError>
Fetches the Block<T> for the given BlockNumberOrTag.
Sourcepub async fn l2_block_info_by_label(
&self,
numtag: BlockNumberOrTag,
) -> Result<Option<L2BlockInfo>, EngineClientError>
pub async fn l2_block_info_by_label( &self, numtag: BlockNumberOrTag, ) -> Result<Option<L2BlockInfo>, EngineClientError>
Fetches the L2BlockInfo by BlockNumberOrTag.
Methods from Deref<Target = RootProvider<AnyNetwork>>§
Sourcepub async fn get_subscription<R>(
&self,
id: FixedBytes<32>,
) -> Result<Subscription<R>, RpcError<TransportErrorKind>>where
R: RpcRecv,
pub async fn get_subscription<R>(
&self,
id: FixedBytes<32>,
) -> Result<Subscription<R>, RpcError<TransportErrorKind>>where
R: RpcRecv,
Gets the subscription corresponding to the given RPC subscription ID.
Sourcepub fn unsubscribe(
&self,
id: FixedBytes<32>,
) -> Result<(), RpcError<TransportErrorKind>>
pub fn unsubscribe( &self, id: FixedBytes<32>, ) -> Result<(), RpcError<TransportErrorKind>>
Unsubscribes from the subscription corresponding to the given RPC subscription ID.
Trait Implementations§
Source§impl Clone for EngineClient
impl Clone for EngineClient
Source§fn clone(&self) -> EngineClient
fn clone(&self) -> EngineClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EngineClient
impl Debug for EngineClient
Source§impl Deref for EngineClient
impl Deref for EngineClient
Source§type Target = RootProvider<AnyNetwork>
type Target = RootProvider<AnyNetwork>
The resulting type after dereferencing.
Source§impl OpEngineApi<AnyNetwork, Http<HyperClient<Full<Bytes>, AuthService<Client<HttpConnector, Full<Bytes>>>>>> for EngineClient
impl OpEngineApi<AnyNetwork, Http<HyperClient<Full<Bytes>, AuthService<Client<HttpConnector, Full<Bytes>>>>>> for EngineClient
Source§fn new_payload_v2<'life0, 'async_trait>(
&'life0 self,
payload: ExecutionPayloadInputV2,
) -> Pin<Box<dyn Future<Output = TransportResult<PayloadStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_payload_v2<'life0, 'async_trait>(
&'life0 self,
payload: ExecutionPayloadInputV2,
) -> Pin<Box<dyn Future<Output = TransportResult<PayloadStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends the given payload to the execution layer client, as specified for the Shanghai fork. Read more
Source§fn new_payload_v3<'life0, 'async_trait>(
&'life0 self,
payload: ExecutionPayloadV3,
parent_beacon_block_root: B256,
) -> Pin<Box<dyn Future<Output = TransportResult<PayloadStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_payload_v3<'life0, 'async_trait>(
&'life0 self,
payload: ExecutionPayloadV3,
parent_beacon_block_root: B256,
) -> Pin<Box<dyn Future<Output = TransportResult<PayloadStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends the given payload to the execution layer client, as specified for the Cancun fork. Read more
Source§fn new_payload_v4<'life0, 'async_trait>(
&'life0 self,
payload: OpExecutionPayloadV4,
parent_beacon_block_root: B256,
) -> Pin<Box<dyn Future<Output = TransportResult<PayloadStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_payload_v4<'life0, 'async_trait>(
&'life0 self,
payload: OpExecutionPayloadV4,
parent_beacon_block_root: B256,
) -> Pin<Box<dyn Future<Output = TransportResult<PayloadStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends the given payload to the execution layer client, as specified for the Prague fork. Read more
Source§fn fork_choice_updated_v2<'life0, 'async_trait>(
&'life0 self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<OpPayloadAttributes>,
) -> Pin<Box<dyn Future<Output = TransportResult<ForkchoiceUpdated>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fork_choice_updated_v2<'life0, 'async_trait>(
&'life0 self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<OpPayloadAttributes>,
) -> Pin<Box<dyn Future<Output = TransportResult<ForkchoiceUpdated>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates the execution layer client with the given fork choice, as specified for the Shanghai
fork. Read more
Source§fn fork_choice_updated_v3<'life0, 'async_trait>(
&'life0 self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<OpPayloadAttributes>,
) -> Pin<Box<dyn Future<Output = TransportResult<ForkchoiceUpdated>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fork_choice_updated_v3<'life0, 'async_trait>(
&'life0 self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<OpPayloadAttributes>,
) -> Pin<Box<dyn Future<Output = TransportResult<ForkchoiceUpdated>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates the execution layer client with the given fork choice, as specified for the Cancun
fork. Read more
Source§fn get_payload_v2<'life0, 'async_trait>(
&'life0 self,
payload_id: PayloadId,
) -> Pin<Box<dyn Future<Output = TransportResult<ExecutionPayloadEnvelopeV2>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_payload_v2<'life0, 'async_trait>(
&'life0 self,
payload_id: PayloadId,
) -> Pin<Box<dyn Future<Output = TransportResult<ExecutionPayloadEnvelopeV2>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves an execution payload from a previously started build process, as specified for the
Shanghai fork. Read more
Source§fn get_payload_v3<'life0, 'async_trait>(
&'life0 self,
payload_id: PayloadId,
) -> Pin<Box<dyn Future<Output = TransportResult<OpExecutionPayloadEnvelopeV3>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_payload_v3<'life0, 'async_trait>(
&'life0 self,
payload_id: PayloadId,
) -> Pin<Box<dyn Future<Output = TransportResult<OpExecutionPayloadEnvelopeV3>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves an execution payload from a previously started build process, as specified for the
Cancun fork. Read more
Source§fn get_payload_v4<'life0, 'async_trait>(
&'life0 self,
payload_id: PayloadId,
) -> Pin<Box<dyn Future<Output = TransportResult<OpExecutionPayloadEnvelopeV4>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_payload_v4<'life0, 'async_trait>(
&'life0 self,
payload_id: PayloadId,
) -> Pin<Box<dyn Future<Output = TransportResult<OpExecutionPayloadEnvelopeV4>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the most recent version of the payload that is available in the corresponding
payload build process at the time of receiving this call. Read more
Source§fn get_payload_bodies_by_hash_v1<'life0, 'async_trait>(
&'life0 self,
block_hashes: Vec<BlockHash>,
) -> Pin<Box<dyn Future<Output = TransportResult<ExecutionPayloadBodiesV1>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_payload_bodies_by_hash_v1<'life0, 'async_trait>(
&'life0 self,
block_hashes: Vec<BlockHash>,
) -> Pin<Box<dyn Future<Output = TransportResult<ExecutionPayloadBodiesV1>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the execution payload bodies by the given hash. Read more
Source§fn get_payload_bodies_by_range_v1<'life0, 'async_trait>(
&'life0 self,
start: u64,
count: u64,
) -> Pin<Box<dyn Future<Output = TransportResult<ExecutionPayloadBodiesV1>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_payload_bodies_by_range_v1<'life0, 'async_trait>(
&'life0 self,
start: u64,
count: u64,
) -> Pin<Box<dyn Future<Output = TransportResult<ExecutionPayloadBodiesV1>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the execution payload bodies by the range starting at
start, containing count
blocks. Read moreSource§fn get_client_version_v1<'life0, 'async_trait>(
&'life0 self,
client_version: ClientVersionV1,
) -> Pin<Box<dyn Future<Output = TransportResult<Vec<ClientVersionV1>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_client_version_v1<'life0, 'async_trait>(
&'life0 self,
client_version: ClientVersionV1,
) -> Pin<Box<dyn Future<Output = TransportResult<Vec<ClientVersionV1>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the execution client version information. Read more
Source§fn signal_superchain_v1<'life0, 'async_trait>(
&'life0 self,
recommended: ProtocolVersion,
required: ProtocolVersion,
) -> Pin<Box<dyn Future<Output = TransportResult<ProtocolVersion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn signal_superchain_v1<'life0, 'async_trait>(
&'life0 self,
recommended: ProtocolVersion,
required: ProtocolVersion,
) -> Pin<Box<dyn Future<Output = TransportResult<ProtocolVersion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Optional extension to the Engine API. Read more
Source§fn exchange_capabilities<'life0, 'async_trait>(
&'life0 self,
capabilities: Vec<String>,
) -> Pin<Box<dyn Future<Output = TransportResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn exchange_capabilities<'life0, 'async_trait>(
&'life0 self,
capabilities: Vec<String>,
) -> Pin<Box<dyn Future<Output = TransportResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the list of Engine API methods supported by the execution layer client software. Read more
Auto Trait Implementations§
impl Freeze for EngineClient
impl !RefUnwindSafe for EngineClient
impl Send for EngineClient
impl Sync for EngineClient
impl Unpin for EngineClient
impl !UnwindSafe for EngineClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more