Skip to content
Draft
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,294 changes: 620 additions & 674 deletions Cargo.lock

Large diffs are not rendered by default.

147 changes: 72 additions & 75 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,110 +16,107 @@ members = [
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.82"
rust-version = "1.93"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/evstack/ev-reth"
repository = "https://github.com/evstack/ev-reth"
authors = ["Evolve Stack Contributors"]

[workspace.dependencies]
# Reth dependencies - Using v1.11.3 stable
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3", default-features = false }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3", features = ["serde", "serde-bincode-compat", "reth-codec"] }
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3", default-features = false }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v1.11.3" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v1.11.3" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v1.11.3" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v1.11.3" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-rpc-convert = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
reth-codecs = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.11.3" }
# Reth dependencies - Using v2.0.0 stable
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-primitives-traits = { version = "0.1.0", default-features = false }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0", default-features = false }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0", features = ["serde", "reth-codec"] }
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0", default-features = false }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v2.0.0" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v2.0.0" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", default-features = false, tag = "v2.0.0" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-rpc-convert = { git = "https://github.com/paradigmxyz/reth.git", tag = "v2.0.0" }
reth-codecs = { version = "0.1.0", default-features = false }

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


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

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

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

# Alloy dependencies (aligned to reth v1.11.3)
alloy = { version = "1.8.3", features = [
# Alloy dependencies (aligned to reth v2.0.0)
alloy = { version = "1.8.2", features = [
"contract",
"providers",
"provider-http",
"signers",
"reqwest-rustls-tls",
], default-features = false }
alloy-evm = { version = "0.27.2", default-features = false }
alloy-eips = { version = "1.8.3", default-features = false }
alloy-network = { version = "1.8.3", default-features = false }
alloy-provider = { version = "1.8.3", default-features = false }
alloy-rpc-client = { version = "1.8.3", default-features = false }
alloy-rpc-types = { version = "1.8.3", default-features = false }
alloy-json-rpc = { version = "1.8.3", default-features = false }
alloy-rpc-types-eth = { version = "1.8.3", default-features = false }
alloy-rpc-types-engine = { version = "1.8.3", default-features = false }
alloy-signer = { version = "1.8.3", default-features = false }
alloy-signer-local = { version = "1.8.3", features = ["mnemonic"] }
alloy-serde = { version = "1.8.3", default-features = false }
alloy-evm = { version = "0.30.0", default-features = false }
alloy-eips = { version = "1.8.2", default-features = false }
alloy-network = { version = "1.8.2", default-features = false }
alloy-provider = { version = "1.8.2", default-features = false }
alloy-rpc-client = { version = "1.8.2", default-features = false }
alloy-rpc-types = { version = "1.8.2", default-features = false }
alloy-json-rpc = { version = "1.8.2", default-features = false }
alloy-rpc-types-eth = { version = "1.8.2", default-features = false }
alloy-rpc-types-engine = { version = "1.8.2", default-features = false }
alloy-signer = { version = "1.8.2", default-features = false }
alloy-signer-local = { version = "1.8.2", features = ["mnemonic"] }
alloy-serde = { version = "1.8.2", default-features = false }
alloy-primitives = { version = "1.5.6", default-features = false }
alloy-consensus = { version = "1.8.3", default-features = false }
alloy-consensus-any = { version = "1.8.3", default-features = false }
alloy-consensus = { version = "1.8.2", default-features = false }
alloy-consensus-any = { version = "1.8.2", default-features = false }
alloy-rlp = { version = "0.3.13", default-features = false }
alloy-genesis = { version = "1.8.3", default-features = false }
alloy-rpc-types-txpool = { version = "1.8.3", default-features = false }
alloy-genesis = { version = "1.8.2", default-features = false }
alloy-rpc-types-txpool = { version = "1.8.2", default-features = false }
alloy-sol-types = { version = "1.5.6", default-features = false }

# Utility dependencies
bytes = "1.10.1"

revm-inspector = "15.0.0"
revm-inspectors = "0.34.2"
revm-inspectors = "0.36.0"

# force newer nybbles for const push_unchecked (needed for Rust 1.92+)
nybbles = "0.4.8"
Expand Down
1 change: 0 additions & 1 deletion crates/ev-precompiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "MIT"

[dependencies]
# Reth
reth-primitives = { workspace = true }
reth-ethereum = { workspace = true }
reth-revm = { workspace = true }

Expand Down
3 changes: 0 additions & 3 deletions crates/ev-precompiles/src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ impl Precompile for MintPrecompile {
}
}

fn is_pure(&self) -> bool {
false
}
}

#[cfg(test)]
Expand Down
5 changes: 1 addition & 4 deletions crates/ev-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ bytes = { workspace = true }
reth-codecs = { workspace = true }
reth-db-api = { workspace = true }
reth-ethereum-primitives = { workspace = true }
reth-primitives-traits = { workspace = true, features = ["serde-bincode-compat"] }
reth-primitives-traits = { workspace = true }
serde = { workspace = true, features = ["derive"] }

[features]
serde-bincode-compat = ["reth-primitives-traits/serde-bincode-compat"]
4 changes: 1 addition & 3 deletions crates/ev-primitives/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
//! - [`InMemorySize`]: Memory accounting for pool size limits
//! - [`SignerRecoverable`]: Sender address recovery for validation
//! - [`TxHashRef`]: Transaction hash access for deduplication
//! - [`SignedTransaction`]: Marker trait for signed transaction types

use alloy_consensus::{
error::ValueError,
transaction::{SignerRecoverable, TxHashRef},
TransactionEnvelope,
};
use alloy_primitives::{Address, B256};
use reth_primitives_traits::{InMemorySize, SignedTransaction};
use reth_primitives_traits::InMemorySize;

use crate::tx::{EvNodeSignedTx, EvTxEnvelope};

Expand Down Expand Up @@ -86,4 +85,3 @@ impl From<EvPooledTxEnvelope> for EvTxEnvelope {
}
}

impl SignedTransaction for EvPooledTxEnvelope {}
14 changes: 4 additions & 10 deletions crates/ev-primitives/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ use reth_codecs::{
txtype::COMPACT_EXTENDED_IDENTIFIER_FLAG,
Compact,
};
use reth_db_api::{
table::{Compress, Decompress},
DatabaseError,
};
use reth_primitives_traits::{InMemorySize, SignedTransaction};
use reth_codecs::DecompressError;
use reth_db_api::table::{Compress, Decompress};
use reth_primitives_traits::InMemorySize;
use std::vec::Vec;

/// EIP-2718 transaction type for EvNode batch + sponsorship.
Expand Down Expand Up @@ -523,10 +521,6 @@ impl Compact for EvTxEnvelope {
}
}

impl SignedTransaction for EvTxEnvelope {}

impl reth_primitives_traits::serde_bincode_compat::RlpBincode for EvTxEnvelope {}

impl Compress for EvTxEnvelope {
type Compressed = Vec<u8>;

Expand All @@ -536,7 +530,7 @@ impl Compress for EvTxEnvelope {
}

impl Decompress for EvTxEnvelope {
fn decompress(value: &[u8]) -> Result<Self, DatabaseError> {
fn decompress(value: &[u8]) -> Result<Self, DecompressError> {
let (obj, _) = Compact::from_compact(value, value.len());
Ok(obj)
}
Expand Down
3 changes: 0 additions & 3 deletions crates/ev-revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ alloy-evm.workspace = true
alloy-primitives.workspace = true
reth-revm.workspace = true
reth-evm.workspace = true
reth-primitives.workspace = true
reth-evm-ethereum.workspace = true
revm-inspector.workspace = true
revm-inspectors.workspace = true
revm-context-interface.workspace = true
thiserror.workspace = true
ev-precompiles = { path = "../ev-precompiles" }
ev-primitives = { path = "../ev-primitives" }
Expand Down
26 changes: 2 additions & 24 deletions crates/ev-revm/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use reth_revm::{
},
Context,
};
use revm_inspector::JournalExt;
use reth_revm::revm::inspector::JournalExt;
use std::ops::{Deref, DerefMut};

/// Convenience alias matching the stock mainnet EVM signature.
Expand All @@ -37,28 +37,6 @@ pub struct EvEvm<CTX, INSP, PRECOMP = EthPrecompiles> {
inspect: bool,
}

impl<CTX, INSP, P> EvEvm<CTX, INSP, P>
where
CTX: ContextTr + ContextSetters,
P: Default,
{
/// Creates a new wrapper configured with the provided redirect policy.
pub fn new(ctx: CTX, inspector: INSP, redirect: Option<BaseFeeRedirect>) -> Self {
Self {
inner: Evm {
ctx,
inspector,
instruction: EthInstructions::new_mainnet(),
precompiles: P::default(),
frame_stack: FrameStack::new(),
},
redirect,
deploy_allowlist: None,
inspect: false,
}
}
}

impl<CTX, INSP, P> EvEvm<CTX, INSP, P> {
/// Wraps an existing EVM instance with the redirect policy.
pub fn from_inner<T>(
Expand Down Expand Up @@ -116,7 +94,7 @@ impl<CTX, INSP, P> EvEvm<CTX, INSP, P> {
}

/// Exposes a mutable reference to the wrapped `Evm`.
pub(crate) fn inner_mut(
pub(crate) const fn inner_mut(
&mut self,
) -> &mut Evm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, P, EthFrame<EthInterpreter>>
{
Expand Down
10 changes: 6 additions & 4 deletions crates/ev-revm/src/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,13 @@ impl EvTxEvmFactory {
env: EvmEnv<SpecId>,
inspector: I,
) -> EvRevmEvm<DB, I> {
let spec = env.cfg_env.spec;
let precompiles = PrecompilesMap::from_static(Precompiles::new(
PrecompileSpecId::from_spec_id(env.cfg_env.spec),
PrecompileSpecId::from_spec_id(spec),
));

let mut journaled_state = reth_revm::revm::Journal::new(db);
journaled_state.set_spec_id(env.cfg_env.spec);
journaled_state.set_spec_id(spec);

let ctx = Context {
block: env.block_env,
Expand All @@ -339,7 +340,7 @@ impl EvTxEvmFactory {
RevmEvm {
ctx,
inspector,
instruction: EthInstructions::new_mainnet(),
instruction: EthInstructions::new_mainnet_with_spec(spec),
precompiles,
frame_stack: FrameStack::new(),
}
Expand Down Expand Up @@ -531,9 +532,10 @@ mod tests {
.transact_raw(tx)
.expect("transaction executes without error");

let ExecutionResult::Success { gas_used, .. } = result_and_state.result else {
let ExecutionResult::Success { gas, .. } = result_and_state.result else {
panic!("expected successful execution");
};
let gas_used = gas.used();

let state: EvmState = result_and_state.state;
let sink_account = state
Expand Down
Loading
Loading