diff --git a/Cargo.lock b/Cargo.lock index 94b6e403ce..be109cadbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb865df835f851b367ae439d6c82b117ded971628c8888b24fed411a290e38a" +checksum = "0f778fe4183cecaec41361e65869e81e748c44a77fa3e6ba20219ca92be33a19" dependencies = [ "alloy-rlp", "arbitrary", @@ -192,15 +192,20 @@ dependencies = [ "derive_arbitrary", "derive_more 1.0.0", "getrandom", + "hashbrown", "hex-literal", + "indexmap", "itoa", "k256", "keccak-asm", + "paste", "proptest", "proptest-derive", "rand", "ruint", + "rustc-hash", "serde", + "sha3", "tiny-keccak", ] @@ -1943,12 +1948,14 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ + "arbitrary", "equivalent", "hashbrown", + "serde", ] [[package]] @@ -2741,6 +2748,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -3032,9 +3040,6 @@ name = "revm-primitives" version = "9.0.1" dependencies = [ "alloy-primitives", - "cfg-if", - "hashbrown", - "hex", ] [[package]] @@ -3086,7 +3091,6 @@ dependencies = [ "clap", "hash-db", "hashbrown", - "hex", "indicatif", "k256", "microbench", @@ -3225,6 +3229,15 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +dependencies = [ + "rand", +] + [[package]] name = "rustc-hex" version = "2.1.0" diff --git a/bins/revme/Cargo.toml b/bins/revme/Cargo.toml index 072996142f..0f708d7bec 100644 --- a/bins/revme/Cargo.toml +++ b/bins/revme/Cargo.toml @@ -17,7 +17,6 @@ inspector = { workspace = true, features = ["std", "serde-json"] } bytecode = { workspace = true, features = ["std", "parse"] } hash-db = "0.15" -hex = "0.4" hashbrown = "0.14" indicatif = "0.17" microbench = "0.5" diff --git a/bins/revme/src/cmd/bench/analysis.rs b/bins/revme/src/cmd/bench/analysis.rs index c0bd96dc87..8fc494f7d6 100644 --- a/bins/revme/src/cmd/bench/analysis.rs +++ b/bins/revme/src/cmd/bench/analysis.rs @@ -1,7 +1,7 @@ use database::{BenchmarkDB, EthereumBenchmarkWiring}; use revm::{ bytecode::Bytecode, - primitives::{address, bytes, Bytes, TxKind}, + primitives::{address, bytes, hex, Bytes, TxKind}, Evm, }; use std::time::Instant; diff --git a/bins/revme/src/cmd/bytecode.rs b/bins/revme/src/cmd/bytecode.rs index ada0fead98..a90551b289 100644 --- a/bins/revme/src/cmd/bytecode.rs +++ b/bins/revme/src/cmd/bytecode.rs @@ -1,7 +1,7 @@ use clap::Parser; use revm::{ bytecode::eof::{self, validate_eof_inner, CodeType, Eof, EofError}, - primitives::{Bytes, MAX_INITCODE_SIZE}, + primitives::{hex, Bytes, MAX_INITCODE_SIZE}, }; use std::io; diff --git a/bins/revme/src/cmd/evmrunner.rs b/bins/revme/src/cmd/evmrunner.rs index 780f0a0039..cd95ca39cf 100644 --- a/bins/revme/src/cmd/evmrunner.rs +++ b/bins/revme/src/cmd/evmrunner.rs @@ -3,7 +3,7 @@ use database::BenchmarkDB; use inspector::{inspector_handle_register, inspectors::TracerEip3155}; use revm::{ bytecode::{Bytecode, BytecodeDecodeError}, - primitives::{address, Address, TxKind}, + primitives::{address, hex, Address, TxKind}, wiring::EthereumWiring, Database, Evm, }; diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 7ba394f7dd..c643bbd16b 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -22,22 +22,16 @@ rust_2018_idioms = "deny" all = "warn" [dependencies] -alloy-primitives = { version = "0.8.2", default-features = false, features = [ +alloy-primitives = { version = "0.8.4", default-features = false, features = [ "rlp", + "map", ] } -hashbrown = "0.14" - -# utils -cfg-if = { version = "1.0", default-features = false } - -[build-dependencies] -hex = { version = "0.4", default-features = false } [features] -default = ["std"] -std = ["alloy-primitives/std", "hex/std"] -hashbrown = [] -serde = ["alloy-primitives/serde", "hex/serde", "hashbrown/serde"] +default = ["std", "alloy-primitives/default"] +std = ["alloy-primitives/std"] +hashbrown = ["alloy-primitives/map-hashbrown"] +serde = ["alloy-primitives/serde"] arbitrary = ["std", "alloy-primitives/arbitrary"] asm-keccak = ["alloy-primitives/asm-keccak"] rand = ["alloy-primitives/rand"] diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index bc8366c6b3..797323e21a 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -5,21 +5,14 @@ #![cfg_attr(not(feature = "std"), no_std)] mod constants; +pub use constants::*; + pub use alloy_primitives::{ self, address, b256, bytes, fixed_bytes, hex, hex_literal, keccak256, ruint, uint, Address, Bytes, FixedBytes, Log, LogData, TxKind, B256, I256, U256, }; -pub use constants::*; - -cfg_if::cfg_if! { - if #[cfg(all(not(feature = "hashbrown"), feature = "std"))] { - pub use std::collections::{hash_map, hash_set, HashMap, HashSet}; - use hashbrown as _; - } else { - pub use hashbrown::{hash_map, hash_set, HashMap, HashSet}; - } -} +pub use alloy_primitives::map::{self, hash_map, hash_set, HashMap, HashSet}; /// The Keccak-256 hash of the empty string `""`. pub const KECCAK_EMPTY: B256 =