refactor: move node-core/engine to standalone crate (#9120)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-06-26 17:34:35 +02:00
committed by GitHub
parent 8775a93d33
commit 1fde1dca1e
13 changed files with 70 additions and 12 deletions

25
Cargo.lock generated
View File

@ -6265,6 +6265,7 @@ dependencies = [
"reth-discv4",
"reth-discv5",
"reth-downloaders",
"reth-engine-util",
"reth-errors",
"reth-ethereum-payload-builder",
"reth-evm",
@ -6289,6 +6290,7 @@ dependencies = [
"reth-primitives",
"reth-provider",
"reth-prune",
"reth-prune-types",
"reth-revm",
"reth-rpc",
"reth-rpc-api",
@ -6904,6 +6906,24 @@ dependencies = [
"serde",
]
[[package]]
name = "reth-engine-util"
version = "1.0.0"
dependencies = [
"eyre",
"futures",
"pin-project",
"reth-beacon-consensus",
"reth-engine-primitives",
"reth-fs-util",
"reth-rpc",
"reth-rpc-types",
"serde",
"serde_json",
"tokio-util",
"tracing",
]
[[package]]
name = "reth-errors"
version = "1.0.0"
@ -7447,6 +7467,7 @@ dependencies = [
"reth-db-api",
"reth-db-common",
"reth-downloaders",
"reth-engine-util",
"reth-evm",
"reth-exex",
"reth-network",
@ -7494,7 +7515,6 @@ dependencies = [
"metrics-process",
"metrics-util",
"once_cell",
"pin-project",
"procfs",
"proptest",
"rand 0.8.5",
@ -7506,7 +7526,6 @@ dependencies = [
"reth-db-api",
"reth-discv4",
"reth-discv5",
"reth-engine-primitives",
"reth-fs-util",
"reth-metrics",
"reth-net-nat",
@ -7527,13 +7546,11 @@ dependencies = [
"reth-tracing",
"reth-transaction-pool",
"secp256k1",
"serde",
"serde_json",
"shellexpand",
"thiserror",
"tikv-jemalloc-ctl",
"tokio",
"tokio-util",
"tower",
"tracing",
"vergen",

View File

@ -26,6 +26,7 @@ members = [
"crates/ethereum-forks/",
"crates/e2e-test-utils/",
"crates/engine-primitives/",
"crates/engine/util/",
"crates/errors/",
"crates/ethereum-forks/",
"crates/ethereum/consensus/",
@ -279,6 +280,7 @@ reth-downloaders = { path = "crates/net/downloaders" }
reth-e2e-test-utils = { path = "crates/e2e-test-utils" }
reth-ecies = { path = "crates/net/ecies" }
reth-engine-primitives = { path = "crates/engine-primitives" }
reth-engine-util = { path = "crates/engine/util" }
reth-errors = { path = "crates/errors" }
reth-eth-wire = { path = "crates/net/eth-wire" }
reth-eth-wire-types = { path = "crates/net/eth-wire-types" }

View File

@ -66,6 +66,8 @@ reth-node-builder.workspace = true
reth-node-events.workspace = true
reth-consensus.workspace = true
reth-optimism-primitives.workspace = true
reth-prune-types.workspace = true
reth-engine-util.workspace = true
reth-prune.workspace = true
# crypto

View File

@ -14,10 +14,10 @@ use reth_cli_runner::CliContext;
use reth_config::Config;
use reth_consensus::Consensus;
use reth_db::DatabaseEnv;
use reth_engine_util::engine_store::{EngineMessageStore, StoredEngineApiMessage};
use reth_fs_util as fs;
use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_node_core::engine::engine_store::{EngineMessageStore, StoredEngineApiMessage};
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
use reth_provider::{
providers::BlockchainProvider, CanonStateSubscriptions, ChainSpecProvider, ProviderFactory,

View File

@ -0,0 +1,42 @@
[package]
name = "reth-engine-util"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lints]
workspace = true
[dependencies]
# reth
reth-fs-util.workspace = true
reth-rpc.workspace = true
reth-rpc-types.workspace = true
reth-engine-primitives.workspace = true
reth-beacon-consensus.workspace = true
# async
tokio-util.workspace = true
pin-project.workspace = true
# misc
eyre.workspace = true
# io
serde.workspace = true
serde_json.workspace = true
# tracing
tracing.workspace = true
# async
futures.workspace = true
[features]
optimism = [
"reth-rpc/optimism",
"reth-beacon-consensus/optimism",
]

View File

@ -33,7 +33,6 @@ reth-discv4.workspace = true
reth-discv5.workspace = true
reth-net-nat.workspace = true
reth-network-peers.workspace = true
reth-engine-primitives.workspace = true
reth-tasks.workspace = true
reth-consensus-common.workspace = true
reth-beacon-consensus.workspace = true
@ -46,8 +45,6 @@ alloy-rpc-types-engine.workspace = true
# async
tokio.workspace = true
tokio-util.workspace = true
pin-project.workspace = true
# metrics
reth-metrics.workspace = true
@ -69,7 +66,6 @@ once_cell.workspace = true
# io
dirs-next = "2.0.0"
shellexpand = "3.0.0"
serde.workspace = true
serde_json.workspace = true
# http/rpc

View File

@ -11,7 +11,6 @@
pub mod args;
pub mod cli;
pub mod dirs;
pub mod engine;
pub mod exit;
pub mod metrics;
pub mod node_config;

View File

@ -45,6 +45,7 @@ reth-node-events.workspace = true
reth-consensus.workspace = true
reth-consensus-debug-client.workspace = true
reth-rpc-types.workspace = true
reth-engine-util.workspace = true
## async
futures.workspace = true

View File

@ -13,17 +13,16 @@ use reth_beacon_consensus::{
BeaconConsensusEngine,
};
use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, RpcBlockProvider};
use reth_engine_util::EngineMessageStreamExt;
use reth_exex::ExExManagerHandle;
use reth_network::NetworkEvents;
use reth_node_api::FullNodeTypes;
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;
use reth_rpc_engine_api::EngineApi;