feat: implement clientVersionV1 in engine API (#8016)

This commit is contained in:
guha-rahul
2024-05-24 23:08:06 +05:30
committed by GitHub
parent 59622dbd48
commit a8e5eb6186
7 changed files with 96 additions and 7 deletions

View File

@ -39,7 +39,7 @@ reth-config.workspace = true
reth-downloaders.workspace = true
reth-node-events.workspace = true
reth-consensus.workspace = true
reth-rpc-types.workspace = true
## async
futures.workspace = true
tokio = { workspace = true, features = [

View File

@ -25,11 +25,13 @@ use reth_node_core::{
dirs::{ChainPath, DataDirPath},
engine::EngineMessageStreamExt,
exit::NodeExitFuture,
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
};
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_primitives::format_ether;
use reth_provider::{providers::BlockchainProvider, CanonStateSubscriptions};
use reth_rpc_engine_api::EngineApi;
use reth_rpc_types::engine::ClientVersionV1;
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::TransactionPool;
@ -407,12 +409,19 @@ where
),
);
let client = ClientVersionV1 {
code: CLIENT_CODE,
name: NAME_CLIENT.to_string(),
version: CARGO_PKG_VERSION.to_string(),
commit: VERGEN_GIT_SHA.to_string(),
};
let engine_api = EngineApi::new(
blockchain_db.clone(),
ctx.chain_spec(),
beacon_engine_handle,
node_adapter.components.payload_builder().clone().into(),
Box::new(ctx.task_executor().clone()),
client,
);
info!(target: "reth::cli", "Engine API handler initialized");