diff --git a/Cargo.lock b/Cargo.lock index 9a7a436f97..aedcdb0bfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3343,8 +3343,6 @@ dependencies = [ name = "revm-context" version = "1.0.0-alpha.1" dependencies = [ - "alloy-eip2930", - "alloy-eip7702", "auto_impl", "cfg-if", "derive-where", @@ -3537,8 +3535,6 @@ dependencies = [ name = "revm-statetest-types" version = "1.0.0-alpha.1" dependencies = [ - "alloy-eip2930", - "alloy-eip7702", "revm", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 1b316dc926..660655a3fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,14 +54,14 @@ context = { path = "crates/context", package = "revm-context", version = "1.0.0- context-interface = { path = "crates/context/interface", package = "revm-context-interface", version = "1.0.0-alpha.1", default-features = false } handler = { path = "crates/handler", package = "revm-handler", version = "1.0.0-alpha.1", default-features = false } -# alloy -alloy-rlp = { version = "0.3", default-features = false } -alloy-primitives = { version = "0.8", default-features = false } -alloy-sol-types = { version = "0.8.2", default-features = false } - +# alloy alloy-eip2930 = { version = "0.1.0", default-features = false } alloy-eip7702 = { version = "0.5.0", default-features = false } +alloy-primitives = { version = "0.8", default-features = false } +# alloy in examples, revme or feature flagged. +alloy-rlp = { version = "0.3", default-features = false } +alloy-sol-types = { version = "0.8.2", default-features = false } alloy-consensus = { version = "0.11.1", default-features = false } alloy-eips = { version = "0.11.1", default-features = false } alloy-provider = { version = "0.11.1", default-features = false } diff --git a/crates/context/Cargo.toml b/crates/context/Cargo.toml index c89af67642..acde464078 100644 --- a/crates/context/Cargo.toml +++ b/crates/context/Cargo.toml @@ -32,10 +32,6 @@ specification.workspace = true bytecode.workspace = true auto_impl.workspace = true -# alloy -alloy-eip2930.workspace = true -alloy-eip7702 = { workspace = true, features = ["k256"] } - # misc derive-where.workspace = true cfg-if.workspace = true @@ -47,9 +43,15 @@ serde = { workspace = true, features = ["derive", "rc"], optional = true } database.workspace = true [features] -# Implementation-specific features default = ["std"] -std = [] +std = ["serde?/std"] +serde = [ + "dep:serde", + "primitives/serde", + "specification/serde", + "state/serde", + "context-interface/serde", +] dev = [ "memory_limit", "optional_balance_check", diff --git a/crates/context/interface/Cargo.toml b/crates/context/interface/Cargo.toml index d20da9fe05..de9312ba50 100644 --- a/crates/context/interface/Cargo.toml +++ b/crates/context/interface/Cargo.toml @@ -41,6 +41,13 @@ serde = { version = "1.0", default-features = false, features = [ [features] default = ["std"] -std = ["serde?/std"] -serde = ["dep:serde", "primitives/serde", "specification/serde", "state/serde"] +std = ["serde?/std", "alloy-eip7702/std", "alloy-eip2930/std"] +serde = [ + "dep:serde", + "primitives/serde", + "specification/serde", + "state/serde", + "alloy-eip7702/serde", + "alloy-eip2930/serde", +] serde-json = ["serde"] diff --git a/crates/context/interface/src/transaction.rs b/crates/context/interface/src/transaction.rs index 8ee1820dff..8398ee9802 100644 --- a/crates/context/interface/src/transaction.rs +++ b/crates/context/interface/src/transaction.rs @@ -3,6 +3,10 @@ pub mod eip2930; pub mod eip7702; pub mod transaction_type; +pub use alloy_types::{ + AccessList, AccessListItem, Authorization, RecoveredAuthority, RecoveredAuthorization, + SignedAuthorization, +}; pub use eip2930::AccessListTr; pub use eip7702::AuthorizationTr; use specification::eip4844::GAS_PER_BLOB; diff --git a/crates/context/interface/src/transaction/alloy_types.rs b/crates/context/interface/src/transaction/alloy_types.rs index 87c4c13a35..ab4754d795 100644 --- a/crates/context/interface/src/transaction/alloy_types.rs +++ b/crates/context/interface/src/transaction/alloy_types.rs @@ -1,8 +1,10 @@ use super::{AccessListTr, AuthorizationTr}; use primitives::{Address, B256, U256}; -use alloy_eip2930::AccessList; -use alloy_eip7702::{RecoveredAuthorization, SignedAuthorization}; +pub use alloy_eip2930::{AccessList, AccessListItem}; +pub use alloy_eip7702::{ + Authorization, RecoveredAuthority, RecoveredAuthorization, SignedAuthorization, +}; impl AccessListTr for AccessList { fn access_list(&self) -> impl Iterator)> { diff --git a/crates/context/src/lib.rs b/crates/context/src/lib.rs index 1ffb0fc8b7..22072f55f4 100644 --- a/crates/context/src/lib.rs +++ b/crates/context/src/lib.rs @@ -20,6 +20,6 @@ pub use cfg::{Cfg, CfgEnv}; pub use context::*; pub use journal_init::JournalInit; pub use journaled_state::*; -pub use tx::{AccessList, SignedAuthorization, TxEnv}; +pub use tx::TxEnv; pub mod setters; pub use evm::{Evm, EvmData}; diff --git a/crates/context/src/tx.rs b/crates/context/src/tx.rs index e3967868dc..e0acec0970 100644 --- a/crates/context/src/tx.rs +++ b/crates/context/src/tx.rs @@ -1,6 +1,4 @@ -pub use alloy_eip2930::AccessList; -pub use alloy_eip7702::SignedAuthorization; -use context_interface::Transaction; +use context_interface::transaction::{AccessList, SignedAuthorization, Transaction}; use core::fmt::Debug; use primitives::{Address, Bytes, TxKind, B256, U256}; use std::vec::Vec; diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index 6b4b0b17c3..1e25739b2f 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -118,3 +118,4 @@ blst = ["dep:blst"] name = "bench" path = "benches/bench.rs" harness = false +required-features = ["secp256k1"] diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 411c094cc1..c3142658f8 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -59,7 +59,12 @@ std = [ "context-interface/std", ] hashbrown = ["interpreter/hashbrown", "precompile/hashbrown"] -serde = ["interpreter/serde", "database-interface/serde", "primitives/serde"] +serde = [ + "interpreter/serde", + "database-interface/serde", + "primitives/serde", + "context-interface/serde", +] arbitrary = ["primitives/arbitrary"] asm-keccak = ["primitives/asm-keccak"] portable = ["precompile/portable"] diff --git a/crates/revm/src/mainnet_builder.rs b/crates/revm/src/mainnet_builder.rs index 439c28069d..72108dad43 100644 --- a/crates/revm/src/mainnet_builder.rs +++ b/crates/revm/src/mainnet_builder.rs @@ -70,7 +70,6 @@ impl MainContext for Context