Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crates/rpc/rpc-api/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use reth_primitives::{Address, BlockHash, BlockId, BlockNumberOrTag, Bytes, B256
use reth_rpc_types::{
engine::{
ExecutionPayloadBodiesV1, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3,
ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration,
ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration,ClientVersionV1
},
state::StateOverride,
BlockOverrides, Filter, Log, RichBlock, SyncStatus, TransactionRequest,
Expand Down Expand Up @@ -45,6 +45,7 @@ pub trait EngineApi<Engine: EngineTypes> {
parent_beacon_block_root: B256,
) -> RpcResult<PayloadStatus>;


Comment thread
guha-rahul marked this conversation as resolved.
Outdated
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/paris.md#engine_forkchoiceupdatedv1>
///
/// Caution: This should not accept the `withdrawals` field in the payload attributes.
Expand Down Expand Up @@ -154,6 +155,10 @@ pub trait EngineApi<Engine: EngineTypes> {
transition_configuration: TransitionConfiguration,
) -> RpcResult<TransitionConfiguration>;

/// See also <https://github.com/ethereum/execution-apis/blob/main/src/engine/identification.md#engine_getclientversionv1>
Comment thread
guha-rahul marked this conversation as resolved.
Outdated
Comment thread
guha-rahul marked this conversation as resolved.
Outdated
#[method(name = "getClientVersionV1")]
async fn get_client_version_v1(&self, client_version:ClientVersionV1) -> RpcResult<Vec<ClientVersionV1>>;

/// See also <https://github.com/ethereum/execution-apis/blob/6452a6b194d7db269bf1dbd087a267251d3cc7f8/src/engine/common.md#capabilities>
#[method(name = "exchangeCapabilities")]
async fn exchange_capabilities(&self, capabilities: Vec<String>) -> RpcResult<Vec<String>>;
Expand Down
13 changes: 10 additions & 3 deletions crates/rpc/rpc-engine-api/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ use reth_primitives::{BlockHash, BlockHashOrNumber, BlockNumber, ChainSpec, Hard
use reth_provider::{BlockReader, EvmEnvProvider, HeaderProvider, StateProviderFactory};
use reth_rpc_api::EngineApiServer;
use reth_rpc_types::engine::{
CancunPayloadFields, ExecutionPayload, ExecutionPayloadBodiesV1, ExecutionPayloadInputV2,
ExecutionPayloadV1, ExecutionPayloadV3, ForkchoiceUpdated, PayloadId, PayloadStatus,
TransitionConfiguration, CAPABILITIES,
CancunPayloadFields, ClientVersionV1, ExecutionPayload, ExecutionPayloadBodiesV1, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration, CAPABILITIES
};
use reth_rpc_types_compat::engine::payload::{
convert_payload_input_v2_to_payload, convert_to_payload_body_v1,
Expand Down Expand Up @@ -685,6 +683,15 @@ where
self.inner.metrics.exchange_transition_configuration.record(start.elapsed());
Ok(res?)
}
// handler for `engine_getClientVersionV1`
// see also <https://github.com/ethereum/execution-apis/blob/main/src/engine/identification.md>
Comment thread
guha-rahul marked this conversation as resolved.
Outdated
async fn get_client_version_v1(&self, client:ClientVersionV1) -> RpcResult<Vec<ClientVersionV1>> {
trace!(target: "rpc::engine", "Serving engine_getClientVersionV1");
let start = Instant::now();
let res = EngineApi::get_client_version_v1(self, client).await;
// self.inner.metrics.new_payload_v1.record(start.elapsed());
Comment thread
guha-rahul marked this conversation as resolved.
Outdated
Ok(res?)
}

/// Handler for `engine_exchangeCapabilitiesV1`
/// See also <https://github.com/ethereum/execution-apis/blob/6452a6b194d7db269bf1dbd087a267251d3cc7f8/src/engine/common.md#capabilities>
Expand Down