Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1,349 changes: 749 additions & 600 deletions Cargo.lock

Large diffs are not rendered by default.

158 changes: 81 additions & 77 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,99 +20,103 @@ repository = "https://github.com/evstack/ev-reth"
authors = ["Evolve Stack Contributors"]

[workspace.dependencies]
# Reth dependencies - Using v1.8.4 stable
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4" }
# Reth dependencies - Using v1.10.1 stable
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1" }

ev-revm = { path = "crates/ev-revm" }


# Consensus dependencies
reth-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4", default-features = false }
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4", default-features = false }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4", default-features = false }
reth-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1", default-features = false }
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1", default-features = false }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1", default-features = false }

# Test dependencies
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4", default-features = false }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4", default-features = false }
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.8.4", default-features = false }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1", default-features = false }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1", default-features = false }
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.10.1", default-features = false }

revm = { version = "29.0.1", default-features = false }
revm-context-interface = { version = "10.2.0", default-features = false }
revm = { version = "34.0.0", default-features = false }
revm-context-interface = { version = "14.0.0", default-features = false }

# Alloy dependencies
alloy = { version = "1.0.37", features = [
# Alloy dependencies (aligned to reth v1.10.1)
alloy = { version = "1.4.3", features = [
"contract",
"providers",
"provider-http",
"signers",
"reqwest-rustls-tls",
], default-features = false }
# Alloy family versions aligned to 1.0.37 compatibility (reth v1.8.4)
alloy-evm = { version = "0.21.3", default-features = false }
alloy-eips = { version = "1.0.37", default-features = false }
alloy-network = { version = "1.0.37", default-features = false }
alloy-provider = { version = "1.0.37", default-features = false }
alloy-rpc-client = { version = "1.0.37", default-features = false }
alloy-rpc-types = { version = "1.0.37", default-features = false }
alloy-json-rpc = { version = "1.0.37", default-features = false }
alloy-rpc-types-eth = { version = "1.0.37", default-features = false }
alloy-rpc-types-engine = { version = "1.0.37", default-features = false }
alloy-signer = { version = "1.0.37", default-features = false }
alloy-signer-local = { version = "1.0.37", features = ["mnemonic"] }
alloy-primitives = { version = "1.3.1", default-features = false }
alloy-consensus = { version = "1.0.37", default-features = false }
alloy-genesis = { version = "1.0.37", default-features = false }
alloy-rpc-types-txpool = { version = "1.0.37", default-features = false }
alloy-sol-types = { version = "1.3.1", default-features = false }
alloy-evm = { version = "0.26.3", default-features = false }
alloy-eips = { version = "1.4.3", default-features = false }
alloy-network = { version = "1.4.3", default-features = false }
alloy-provider = { version = "1.4.3", default-features = false }
alloy-rpc-client = { version = "1.4.3", default-features = false }
alloy-rpc-types = { version = "1.4.3", default-features = false }
alloy-json-rpc = { version = "1.4.3", default-features = false }
alloy-rpc-types-eth = { version = "1.4.3", default-features = false }
alloy-rpc-types-engine = { version = "1.4.3", default-features = false }
alloy-signer = { version = "1.4.3", default-features = false }
alloy-signer-local = { version = "1.4.3", features = ["mnemonic"] }
alloy-primitives = { version = "1.5.0", default-features = false }
alloy-consensus = { version = "1.4.3", default-features = false }
alloy-genesis = { version = "1.4.3", default-features = false }
alloy-rpc-types-txpool = { version = "1.4.3", default-features = false }
alloy-sol-types = { version = "1.5.0", default-features = false }

revm-inspector = "15.0.0"
revm-inspectors = "0.34.0"

# force newer nybbles for const push_unchecked (needed for Rust 1.92+)
nybbles = "0.4.7"

revm-inspector = { version = "10.0.1" }
# Core dependencies
eyre = "0.6"
tracing = "0.1"
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ run: build-dev
run-dev: build-dev
RUST_LOG=debug ./$(TARGET_DIR)/debug/$(BINARY_NAME) node

## fmt: Format code using rustfmt
## fmt: Format code using rustfmt (nightly)
fmt:
$(CARGO) fmt --all
$(CARGO) +nightly fmt --all

## fmt-check: Check if code is formatted correctly
## fmt-check: Check if code is formatted correctly (nightly)
fmt-check:
$(CARGO) fmt --all -- --check
$(CARGO) +nightly fmt --all --check

## lint: Run clippy linter
lint:
Expand Down
52 changes: 39 additions & 13 deletions bin/ev-reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,53 @@ use evolve_ev_reth::{
rpc::txpool::{EvolveTxpoolApiImpl, EvolveTxpoolApiServer},
};
use reth_ethereum_cli::Cli;
use reth_tracing_otlp::layer as otlp_layer;
use reth_tracing_otlp::{OtlpConfig, OtlpProtocol};
use tracing::info;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use url::Url;

use ev_node::{log_startup, EvolveArgs, EvolveChainSpecParser, EvolveNode};

#[global_allocator]
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();

/// Initialize reth OTLP tracing
fn init_otlp_tracing() {
// Set up tracing subscriber with reth OTLP layer
tracing_subscriber::registry()
/// Builds OTLP config from environment variables.
/// Returns None if OTLP is disabled or endpoint is not configured.
fn otlp_config_from_env() -> Option<OtlpConfig> {
// disabled if OTEL_SDK_DISABLED is set to "true" (case-insensitive) per OpenTelemetry spec
if std::env::var("OTEL_SDK_DISABLED").is_ok_and(|v| v.eq_ignore_ascii_case("true")) {
return None;
}

let endpoint = std::env::var("OTEL_EXPORTER_OTLP_ENDPOINT").ok()?;
let endpoint_url = Url::parse(&endpoint).ok()?;

let protocol = match std::env::var("OTEL_EXPORTER_OTLP_PROTOCOL")
.unwrap_or_else(|_| "http".to_string())
.as_str()
{
"grpc" => OtlpProtocol::Grpc,
_ => OtlpProtocol::Http,
};

OtlpConfig::new("ev-reth", endpoint_url, protocol, None).ok()
}

/// Initialize tracing with optional OTLP support.
fn init_tracing() {
let registry = tracing_subscriber::registry()
.with(EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()))
.with(tracing_subscriber::fmt::layer().with_target(false))
.with(otlp_layer("ev-reth"))
.init();
.with(tracing_subscriber::fmt::layer().with_target(false));

info!("Reth OTLP tracing initialized for service: ev-reth");
if let Some(config) = otlp_config_from_env() {
if let Ok(otlp_layer) = reth_tracing_otlp::span_layer(config) {
registry.with(otlp_layer).init();
info!("OTLP tracing initialized for service: ev-reth");
return;
}
}

registry.init();
}

fn main() {
Expand All @@ -42,10 +70,8 @@ fn main() {
std::env::set_var("RUST_BACKTRACE", "1");
}

// Initialize OTLP tracing
if std::env::var("OTEL_SDK_DISABLED").as_deref() == Ok("false") {
init_otlp_tracing();
}
// initialize tracing (with optional OTLP support based on env vars)
init_tracing();

if let Err(err) =
Cli::<EvolveChainSpecParser, EvolveArgs>::parse().run(|builder, _evolve_args| async move {
Expand Down
Loading