From 9423c95d871e22dc715b6b328fd65b8dfe28cf0b Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Sat, 4 Nov 2023 13:03:31 +0100 Subject: [PATCH] wip: splitting bins --- Cargo.lock | 20 ----------- Cargo.toml | 2 -- bin/ethereum/Cargo.toml | 34 ------------------- bin/optimism/Cargo.toml | 34 ------------------- bin/reth/Cargo.toml | 9 +++++ .../src/main.rs => reth/src/ethereum.rs} | 4 +++ .../src/main.rs => reth/src/optimism.rs} | 0 7 files changed, 13 insertions(+), 90 deletions(-) delete mode 100644 bin/ethereum/Cargo.toml delete mode 100644 bin/optimism/Cargo.toml rename bin/{optimism/src/main.rs => reth/src/ethereum.rs} (72%) rename bin/{ethereum/src/main.rs => reth/src/optimism.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index 037e6d808fcc..53eacc0bb4ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6014,16 +6014,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "reth-ethereum" -version = "0.1.0-alpha.10" -dependencies = [ - "jemalloc-ctl", - "jemallocator", - "reth", - "vergen", -] - [[package]] name = "reth-interfaces" version = "0.1.0-alpha.10" @@ -6231,16 +6221,6 @@ dependencies = [ "zstd 0.12.4", ] -[[package]] -name = "reth-optimism" -version = "0.1.0-alpha.10" -dependencies = [ - "jemalloc-ctl", - "jemallocator", - "reth", - "vergen", -] - [[package]] name = "reth-payload-builder" version = "0.1.0-alpha.10" diff --git a/Cargo.toml b/Cargo.toml index 01d7c8a46881..04108abd1eb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,6 @@ [workspace] members = [ "bin/reth", - "bin/ethereum", - "bin/optimism", "crates/config", "crates/consensus/auto-seal", "crates/consensus/beacon", diff --git a/bin/ethereum/Cargo.toml b/bin/ethereum/Cargo.toml deleted file mode 100644 index 44d3387f5fe5..000000000000 --- a/bin/ethereum/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "reth-ethereum" -version.workspace = true -edition.workspace = true -rust-version.workspace = true -license.workspace = true -homepage.workspace = true -repository.workspace = true -description = """ -Reth node implementation (Ethereum binary) -""" - -[dependencies] -reth = { path = "../reth" } - -[target.'cfg(not(windows))'.dependencies] -jemallocator = { version = "0.5.0", optional = true } -jemalloc-ctl = { version = "0.5.0", optional = true } - -[features] -jemalloc = ["dep:jemallocator", "dep:jemalloc-ctl", "reth/jemalloc"] -jemalloc-prof = ["jemalloc", "jemallocator?/profiling"] -min-error-logs = ["reth/min-error-logs"] -min-warn-logs = ["reth/min-warn-logs"] -min-info-logs = ["reth/min-info-logs"] -min-debug-logs = ["reth/min-debug-logs"] -min-trace-logs = ["reth/min-trace-logs"] - -[build-dependencies] -vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] } - -[[bin]] -name = "reth" -path = "src/main.rs" diff --git a/bin/optimism/Cargo.toml b/bin/optimism/Cargo.toml deleted file mode 100644 index f5649da8757e..000000000000 --- a/bin/optimism/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "reth-optimism" -version.workspace = true -edition.workspace = true -rust-version.workspace = true -license.workspace = true -homepage.workspace = true -repository.workspace = true -description = """ -Reth node implementation (Ethereum binary) -""" - -[dependencies] -reth = { path = "../reth", features = ["optimism"] } - -[target.'cfg(not(windows))'.dependencies] -jemallocator = { version = "0.5.0", optional = true } -jemalloc-ctl = { version = "0.5.0", optional = true } - -[features] -jemalloc = ["dep:jemallocator", "dep:jemalloc-ctl", "reth/jemalloc"] -jemalloc-prof = ["jemalloc", "jemallocator?/profiling"] -min-error-logs = ["reth/min-error-logs"] -min-warn-logs = ["reth/min-warn-logs"] -min-info-logs = ["reth/min-info-logs"] -min-debug-logs = ["reth/min-debug-logs"] -min-trace-logs = ["reth/min-trace-logs"] - -[build-dependencies] -vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] } - -[[bin]] -name = "op-reth" -path = "src/main.rs" diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 0d38aecb9464..cc70f7b57dd9 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -135,3 +135,12 @@ optimism = [ [build-dependencies] vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] } + +[[bin]] +name = "reth" +path = "src/ethereum.rs" + +[[bin]] +name = "op-reth" +path = "src/optimism.rs" +required-features = ["optimism"] diff --git a/bin/optimism/src/main.rs b/bin/reth/src/ethereum.rs similarity index 72% rename from bin/optimism/src/main.rs rename to bin/reth/src/ethereum.rs index 220b04d9d0e7..afb46a3222fc 100644 --- a/bin/optimism/src/main.rs +++ b/bin/reth/src/ethereum.rs @@ -3,6 +3,10 @@ #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +#[cfg(feature = "optimism")] +compile_error!("run --bin op-reth for Optimism"); + +#[cfg(not(feature = "optimism"))] fn main() { if let Err(err) = reth::cli::run() { eprintln!("Error: {err:?}"); diff --git a/bin/ethereum/src/main.rs b/bin/reth/src/optimism.rs similarity index 100% rename from bin/ethereum/src/main.rs rename to bin/reth/src/optimism.rs