Skip to content
Merged
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
756 changes: 393 additions & 363 deletions Cargo.lock

Large diffs are not rendered by default.

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

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

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


# Consensus dependencies
reth-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
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 }

# Test dependencies
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
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 }

revm = { version = "31.0.1", default-features = false }
revm-context-interface = { version = "=12.0.1", default-features = false }
revm = { version = "29.0.1", default-features = false }
revm-context-interface = { version = "10.2.0", default-features = false }

# Alloy dependencies
alloy = { version = "1.0.41", features = [
alloy = { version = "1.0.37", features = [
"contract",
"providers",
"provider-http",
"signers",
"reqwest-rustls-tls",
], default-features = false }
# Alloy family versions aligned to 1.0.41 compatibility
alloy-evm = { version = "0.23.3", default-features = false }
alloy-eips = { version = "1.0.41", default-features = false }
alloy-network = { version = "1.0.41", default-features = false }
alloy-provider = { version = "1.0.41", default-features = false }
alloy-rpc-client = { version = "1.0.41", default-features = false }
alloy-rpc-types = { version = "1.0.41", default-features = false }
alloy-json-rpc = { version = "1.0.41", default-features = false }
alloy-rpc-types-eth = { version = "1.0.41", default-features = false }
alloy-rpc-types-engine = { version = "1.0.41", default-features = false }
alloy-signer = { version = "1.0.41", default-features = false }
alloy-signer-local = { version = "1.0.41", features = ["mnemonic"] }
alloy-primitives = { version = "1.4.1", default-features = false }
alloy-consensus = { version = "1.0.41", default-features = false }
alloy-genesis = { version = "1.0.41", default-features = false }
alloy-rpc-types-txpool = { version = "1.0.41", default-features = false }
alloy-sol-types = { version = "1.4.1", 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 }

revm-inspector = { version = "12.0.1" }
revm-inspector = { version = "10.0.1" }
# Core dependencies
eyre = "0.6"
tracing = "0.1"
Expand Down
31 changes: 4 additions & 27 deletions bin/ev-reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,25 @@ use evolve_ev_reth::{
rpc::txpool::{EvolveTxpoolApiImpl, EvolveTxpoolApiServer},
};
use reth_ethereum_cli::{chainspec::EthereumChainSpecParser, Cli};
use reth_tracing_otlp::{span_layer, OtlpProtocol};
use reth_tracing_otlp::layer as otlp_layer;
use tracing::info;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use url::Url;

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

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

/// Initialize reth OTLP tracing
fn init_otlp_tracing() -> eyre::Result<()> {
const DEFAULT_ENDPOINT: &str = "http://127.0.0.1:4318/v1/traces";

let endpoint = std::env::var("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
.or_else(|_| std::env::var("OTEL_EXPORTER_OTLP_ENDPOINT"))
.unwrap_or_else(|_| DEFAULT_ENDPOINT.to_owned());
let mut endpoint = Url::parse(&endpoint).or_else(|_| Url::parse(DEFAULT_ENDPOINT))?;

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

protocol.validate_endpoint(&mut endpoint)?;

let span_layer = span_layer("ev-reth", &endpoint, protocol)?;
fn init_otlp_tracing() {
// Set up tracing subscriber with reth OTLP layer
tracing_subscriber::registry()
.with(EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()))
.with(tracing_subscriber::fmt::layer().with_target(false))
.with(span_layer)
.with(otlp_layer("ev-reth"))
.init();

info!("Reth OTLP tracing initialized for service: ev-reth");
Ok(())
}

fn main() {
Expand All @@ -64,10 +44,7 @@ fn main() {

// Initialize OTLP tracing
if std::env::var("OTEL_SDK_DISABLED").as_deref() == Ok("false") {
if let Err(e) = init_otlp_tracing() {
eprintln!("Failed to initialize OTLP tracing: {:?}", e);
eprintln!("Continuing without OTLP tracing...");
}
init_otlp_tracing();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The error handling for OTLP tracing initialization has been removed. The previous implementation gracefully handled failures by catching the Result and logging an error, allowing the node to start even if tracing setup failed. The new implementation calls init_otlp_tracing() unconditionally, and its signature was changed to not return a Result.

This is a regression in robustness, as a misconfiguration (e.g., an invalid endpoint URL in environment variables) could now cause init_otlp_tracing to panic, crashing the entire node on startup.

It would be best to restore the error handling. If the new otlp_layer function can panic, consider using std::panic::catch_unwind to catch the panic and log an error, allowing the node to continue running without OTLP tracing, similar to the previous behavior.

}

if let Err(err) = Cli::<EthereumChainSpecParser, EvolveArgs>::parse().run(
Expand Down
25 changes: 13 additions & 12 deletions crates/ev-precompiles/src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ impl MintPrecompile {
internals: &mut EvmInternals<'_>,
addr: Address,
) -> Result<(), PrecompileError> {
let account = internals
let mut account = internals
.load_account(addr)
.map_err(Self::map_internals_error)?;

if account.is_loaded_as_not_existing() {
if addr == MINT_PRECOMPILE_ADDR {
// Ensure the mint precompile account is treated as non-empty so state pruning
// does not wipe out its storage between blocks.
internals.set_code(addr, Self::bytecode().clone());
internals.nonce_bump_journal_entry(addr);
account.info.set_code(Self::bytecode().clone());
account.info.set_nonce(1);
}
account.mark_created();
internals.touch_account(addr);
}

Expand All @@ -77,17 +78,15 @@ impl MintPrecompile {
addr: Address,
amount: U256,
) -> Result<(), PrecompileError> {
let account = internals
let mut account = internals
.load_account(addr)
.map_err(Self::map_internals_error)?;
account
let new_balance = account
.info
.balance
.checked_add(amount)
.ok_or_else(|| PrecompileError::Other("balance overflow".to_string()))?;
internals
.balance_incr(addr, amount)
.map_err(Self::map_internals_error)?;
account.info.set_balance(new_balance);
Ok(())
}

Expand All @@ -96,17 +95,15 @@ impl MintPrecompile {
addr: Address,
amount: U256,
) -> Result<(), PrecompileError> {
let account = internals
let mut account = internals
.load_account(addr)
.map_err(Self::map_internals_error)?;
let new_balance = account
.info
.balance
.checked_sub(amount)
.ok_or_else(|| PrecompileError::Other("insufficient balance".to_string()))?;
internals
.set_balance(addr, new_balance)
.map_err(Self::map_internals_error)?;
account.info.set_balance(new_balance);
Ok(())
}

Expand Down Expand Up @@ -333,6 +330,10 @@ mod tests {
account.is_touched(),
"recipient account should be marked touched"
);
assert!(
account.is_created(),
"recipient account should be marked created"
);
}

#[test]
Expand Down
49 changes: 1 addition & 48 deletions crates/ev-revm/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,30 +176,6 @@ where
{
type Inspector = INSP;

fn all_inspector(
&self,
) -> (
&Self::Context,
&Self::Instructions,
&Self::Precompiles,
&FrameStack<Self::Frame>,
&Self::Inspector,
) {
self.inner.all_inspector()
}

fn all_mut_inspector(
&mut self,
) -> (
&mut Self::Context,
&mut Self::Instructions,
&mut Self::Precompiles,
&mut FrameStack<Self::Frame>,
&mut Self::Inspector,
) {
self.inner.all_mut_inspector()
}

fn inspector(&mut self) -> &mut Self::Inspector {
&mut self.inner.inspector
}
Expand Down Expand Up @@ -246,28 +222,6 @@ where
type Precompiles = PRECOMP;
type Frame = EthFrame<EthInterpreter>;

fn all(
&self,
) -> (
&Self::Context,
&Self::Instructions,
&Self::Precompiles,
&FrameStack<Self::Frame>,
) {
self.inner.all()
}

fn all_mut(
&mut self,
) -> (
&mut Self::Context,
&mut Self::Instructions,
&mut Self::Precompiles,
&mut FrameStack<Self::Frame>,
) {
self.inner.all_mut()
}

fn ctx(&mut self) -> &mut Self::Context {
&mut self.inner.ctx
}
Expand Down Expand Up @@ -333,7 +287,6 @@ where
type Error = EVMError<DB::Error, InvalidTransaction>;
type HaltReason = HaltReason;
type Spec = SpecId;
type BlockEnv = BlockEnv;
type Precompiles = PRECOMP;
type Inspector = INSP;

Expand Down Expand Up @@ -371,7 +324,7 @@ where
.map(|res| ResultAndState::new(res.result, res.state))
}

fn finish(self) -> (Self::DB, EvmEnv<Self::Spec, Self::BlockEnv>) {
fn finish(self) -> (Self::DB, EvmEnv<Self::Spec>) {
let Self { inner, .. } = self;
let Context {
block,
Expand Down
Loading