pub trait OpEngineApiClient<Engine: EngineTypes>: ClientT{
Show 14 methods
// Provided methods
fn new_payload_v2(
&self,
payload: ExecutionPayloadInputV2,
) -> impl Future<Output = Result<PayloadStatus, Error>> + Send { ... }
fn new_payload_v3(
&self,
payload: ExecutionPayloadV3,
versioned_hashes: Vec<B256>,
parent_beacon_block_root: B256,
) -> impl Future<Output = Result<PayloadStatus, Error>> + Send { ... }
fn new_payload_v4(
&self,
payload: OpExecutionPayloadV4,
versioned_hashes: Vec<B256>,
parent_beacon_block_root: B256,
execution_requests: Requests,
) -> impl Future<Output = Result<PayloadStatus, Error>> + Send { ... }
fn fork_choice_updated_v1(
&self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<Engine::PayloadAttributes>,
) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send { ... }
fn fork_choice_updated_v2(
&self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<Engine::PayloadAttributes>,
) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send { ... }
fn fork_choice_updated_v3(
&self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<Engine::PayloadAttributes>,
) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send { ... }
fn get_payload_v2(
&self,
payload_id: PayloadId,
) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV2, Error>> + Send { ... }
fn get_payload_v3(
&self,
payload_id: PayloadId,
) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV3, Error>> + Send { ... }
fn get_payload_v4(
&self,
payload_id: PayloadId,
) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV4, Error>> + Send { ... }
fn get_payload_bodies_by_hash_v1(
&self,
block_hashes: Vec<BlockHash>,
) -> impl Future<Output = Result<ExecutionPayloadBodiesV1, Error>> + Send { ... }
fn get_payload_bodies_by_range_v1(
&self,
start: U64,
count: U64,
) -> impl Future<Output = Result<ExecutionPayloadBodiesV1, Error>> + Send { ... }
fn signal_superchain_v1(
&self,
_signal: SuperchainSignal,
) -> impl Future<Output = Result<ProtocolVersion, Error>> + Send { ... }
fn get_client_version_v1(
&self,
client_version: ClientVersionV1,
) -> impl Future<Output = Result<Vec<ClientVersionV1>, Error>> + Send { ... }
fn exchange_capabilities(
&self,
capabilities: Vec<String>,
) -> impl Future<Output = Result<Vec<String>, Error>> + Send { ... }
}
Expand description
Client implementation for the OpEngineApi
RPC API.
Provided Methods§
Sourcefn new_payload_v2(
&self,
payload: ExecutionPayloadInputV2,
) -> impl Future<Output = Result<PayloadStatus, Error>> + Send
fn new_payload_v2( &self, payload: ExecutionPayloadInputV2, ) -> impl Future<Output = Result<PayloadStatus, Error>> + Send
Sends the given payload to the execution layer client, as specified for the Shanghai fork.
No modifications needed for OP compatibility.
Sourcefn new_payload_v3(
&self,
payload: ExecutionPayloadV3,
versioned_hashes: Vec<B256>,
parent_beacon_block_root: B256,
) -> impl Future<Output = Result<PayloadStatus, Error>> + Send
fn new_payload_v3( &self, payload: ExecutionPayloadV3, versioned_hashes: Vec<B256>, parent_beacon_block_root: B256, ) -> impl Future<Output = Result<PayloadStatus, Error>> + Send
Sends the given payload to the execution layer client, as specified for the Cancun fork.
See also https://github.com/ethereum/execution-apis/blob/main/src/engine/cancun.md#engine_newpayloadv3
OP modifications:
- expected versioned hashes MUST be an empty array: therefore the
versioned_hashes
parameter is removed. - parent beacon block root MUST be the parent beacon block root from the L1 origin block of the L2 block.
- blob versioned hashes MUST be empty list.
Sourcefn new_payload_v4(
&self,
payload: OpExecutionPayloadV4,
versioned_hashes: Vec<B256>,
parent_beacon_block_root: B256,
execution_requests: Requests,
) -> impl Future<Output = Result<PayloadStatus, Error>> + Send
fn new_payload_v4( &self, payload: OpExecutionPayloadV4, versioned_hashes: Vec<B256>, parent_beacon_block_root: B256, execution_requests: Requests, ) -> impl Future<Output = Result<PayloadStatus, Error>> + Send
Sends the given payload to the execution layer client, as specified for the Prague fork.
- blob versioned hashes MUST be empty list.
- execution layer requests MUST be empty list.
Sourcefn fork_choice_updated_v1(
&self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<Engine::PayloadAttributes>,
) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send
fn fork_choice_updated_v1( &self, fork_choice_state: ForkchoiceState, payload_attributes: Option<Engine::PayloadAttributes>, ) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send
This exists because it is used by op-node: https://github.com/ethereum-optimism/optimism/blob/0bc5fe8d16155dc68bcdf1fa5733abc58689a618/op-node/rollup/types.go#L615-L617
Caution: This should not accept the withdrawals
field in the payload attributes.
Sourcefn fork_choice_updated_v2(
&self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<Engine::PayloadAttributes>,
) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send
fn fork_choice_updated_v2( &self, fork_choice_state: ForkchoiceState, payload_attributes: Option<Engine::PayloadAttributes>, ) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send
Updates the execution layer client with the given fork choice, as specified for the Shanghai fork.
Caution: This should not accept the parentBeaconBlockRoot
field in the payload attributes.
OP modifications:
- The
payload_attributes
parameter is extended with theEngineTypes::PayloadAttributes
type as described in https://specs.optimism.io/protocol/exec-engine.html#extended-payloadattributesv2
Sourcefn fork_choice_updated_v3(
&self,
fork_choice_state: ForkchoiceState,
payload_attributes: Option<Engine::PayloadAttributes>,
) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send
fn fork_choice_updated_v3( &self, fork_choice_state: ForkchoiceState, payload_attributes: Option<Engine::PayloadAttributes>, ) -> impl Future<Output = Result<ForkchoiceUpdated, Error>> + Send
Updates the execution layer client with the given fork choice, as specified for the Cancun fork.
See also https://github.com/ethereum/execution-apis/blob/main/src/engine/cancun.md#engine_forkchoiceupdatedv3
OP modifications:
- Must be called with an Ecotone payload
- Attributes must contain the parent beacon block root field
- The
payload_attributes
parameter is extended with theEngineTypes::PayloadAttributes
type as described in https://specs.optimism.io/protocol/exec-engine.html#extended-payloadattributesv2
Sourcefn get_payload_v2(
&self,
payload_id: PayloadId,
) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV2, Error>> + Send
fn get_payload_v2( &self, payload_id: PayloadId, ) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV2, Error>> + Send
Retrieves an execution payload from a previously started build process, as specified for the Shanghai fork.
Note:
Provider software MAY stop the corresponding build process after serving this call.
No modifications needed for OP compatibility.
Sourcefn get_payload_v3(
&self,
payload_id: PayloadId,
) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV3, Error>> + Send
fn get_payload_v3( &self, payload_id: PayloadId, ) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV3, Error>> + Send
Retrieves an execution payload from a previously started build process, as specified for the Cancun fork.
See also https://github.com/ethereum/execution-apis/blob/main/src/engine/cancun.md#engine_getpayloadv3
Note:
Provider software MAY stop the corresponding build process after serving this call.
OP modifications:
- the response type is extended to [
EngineTypes::ExecutionPayloadEnvelopeV3
].
Sourcefn get_payload_v4(
&self,
payload_id: PayloadId,
) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV4, Error>> + Send
fn get_payload_v4( &self, payload_id: PayloadId, ) -> impl Future<Output = Result<Engine::ExecutionPayloadEnvelopeV4, Error>> + Send
Returns the most recent version of the payload that is available in the corresponding payload build process at the time of receiving this call.
See also https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#engine_getpayloadv4
Note:
Provider software MAY stop the corresponding build process after serving this call.
OP modifications:
- the response type is extended to [
EngineTypes::ExecutionPayloadEnvelopeV4
].
Sourcefn get_payload_bodies_by_hash_v1(
&self,
block_hashes: Vec<BlockHash>,
) -> impl Future<Output = Result<ExecutionPayloadBodiesV1, Error>> + Send
fn get_payload_bodies_by_hash_v1( &self, block_hashes: Vec<BlockHash>, ) -> impl Future<Output = Result<ExecutionPayloadBodiesV1, Error>> + Send
Returns the execution payload bodies by the given hash.
Sourcefn get_payload_bodies_by_range_v1(
&self,
start: U64,
count: U64,
) -> impl Future<Output = Result<ExecutionPayloadBodiesV1, Error>> + Send
fn get_payload_bodies_by_range_v1( &self, start: U64, count: U64, ) -> impl Future<Output = Result<ExecutionPayloadBodiesV1, Error>> + Send
Returns the execution payload bodies by the range starting at start
, containing count
blocks.
WARNING: This method is associated with the BeaconBlocksByRange
message in the consensus
layer p2p specification, meaning the input should be treated as untrusted or potentially
adversarial.
Implementers should take care when acting on the input to this method, specifically ensuring that the range is limited properly, and that the range boundaries are computed correctly and without panics.
Sourcefn signal_superchain_v1(
&self,
_signal: SuperchainSignal,
) -> impl Future<Output = Result<ProtocolVersion, Error>> + Send
fn signal_superchain_v1( &self, _signal: SuperchainSignal, ) -> impl Future<Output = Result<ProtocolVersion, Error>> + Send
Signals superchain information to the Engine. Returns the latest supported OP-Stack protocol version of the execution engine. See also https://specs.optimism.io/protocol/exec-engine.html#engine_signalsuperchainv1
Sourcefn get_client_version_v1(
&self,
client_version: ClientVersionV1,
) -> impl Future<Output = Result<Vec<ClientVersionV1>, Error>> + Send
fn get_client_version_v1( &self, client_version: ClientVersionV1, ) -> impl Future<Output = Result<Vec<ClientVersionV1>, Error>> + Send
Returns the execution client version information.
Note:
The
client_version
parameter identifies the consensus client.
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.