mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-04 12:05:12 -05:00
55 lines
2.8 KiB
Rust
55 lines
2.8 KiB
Rust
use jsonrpsee::{core::RpcResult as Result, proc_macros::rpc};
|
|
use reth_primitives::H64;
|
|
use reth_rpc_types::engine::{
|
|
ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadAttributes, PayloadStatus,
|
|
TransitionConfiguration,
|
|
};
|
|
|
|
#[cfg_attr(not(feature = "client"), rpc(server))]
|
|
#[cfg_attr(feature = "client", rpc(server, client))]
|
|
pub trait EngineApi {
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/paris.md#engine_newpayloadv1>
|
|
/// Caution: This should not accept the `withdrawals` field
|
|
#[method(name = "engine_newPayloadV1")]
|
|
async fn new_payload_v1(&self, payload: ExecutionPayload) -> Result<PayloadStatus>;
|
|
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/shanghai.md#engine_newpayloadv2>
|
|
#[method(name = "engine_newPayloadV2")]
|
|
async fn new_payload_v2(&self, payload: ExecutionPayload) -> Result<PayloadStatus>;
|
|
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/paris.md#engine_forkchoiceupdatedv1>
|
|
///
|
|
/// Caution: This should not accept the `withdrawals` field
|
|
#[method(name = "engine_forkchoiceUpdatedV1")]
|
|
async fn fork_choice_updated_v1(
|
|
&self,
|
|
fork_choice_state: ForkchoiceState,
|
|
payload_attributes: Option<PayloadAttributes>,
|
|
) -> Result<ForkchoiceUpdated>;
|
|
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/shanghai.md#engine_forkchoiceupdatedv2>
|
|
#[method(name = "engine_forkchoiceUpdatedV2")]
|
|
async fn fork_choice_updated_v2(
|
|
&self,
|
|
fork_choice_state: ForkchoiceState,
|
|
payload_attributes: Option<PayloadAttributes>,
|
|
) -> Result<ForkchoiceUpdated>;
|
|
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/paris.md#engine_getpayloadv1>
|
|
///
|
|
/// Caution: This should not return the `withdrawals` field
|
|
#[method(name = "engine_getPayloadV1")]
|
|
async fn get_payload_v1(&self, payload_id: H64) -> Result<ExecutionPayload>;
|
|
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/shanghai.md#engine_getpayloadv2>
|
|
#[method(name = "engine_getPayloadV2")]
|
|
async fn get_payload_v2(&self, payload_id: H64) -> Result<ExecutionPayload>;
|
|
|
|
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/paris.md#engine_exchangetransitionconfigurationv1>
|
|
#[method(name = "engine_exchangeTransitionConfigurationV1")]
|
|
async fn exchange_transition_configuration(
|
|
&self,
|
|
transition_configuration: TransitionConfiguration,
|
|
) -> Result<TransitionConfiguration>;
|
|
}
|