Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
30 changes: 19 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,27 @@ repository = "https://github.com/bluealloy/revm"
version = "2.0.3"

[dependencies]
revm-primitives = { path = "../primitives", version="1.1.2", default-features = false }
revm-primitives = { path = "../primitives", version = "1.1.2", default-features = false }
bn = { package = "substrate-bn", version = "0.6", default-features = false }
k256 = { version = "0.13", default-features = false, features = ["ecdsa"] }
num = { version = "0.4.0", default-features = false, features = ["alloc"] }
once_cell = "1.17"
once_cell = { version = "1.17", default-features = false }
ripemd = { version = "0.1", default-features = false }
secp256k1 = { version = "0.27.0", default-features = false, features = ["alloc", "recovery"], optional = true }
secp256k1 = { version = "0.27.0", default-features = false, features = [
"alloc",
"recovery",
], optional = true }
sha2 = { version = "0.10.5", default-features = false }
sha3 = { version = "0.10.7", default-features = false }

[dev-dependencies]
hex = "0.4"

[features]
default = ["secp256k1"]
default = ["std", "secp256k1"]
std = ["once_cell/std"]
critical-section = ["once_cell/critical-section"]
# secp256k1 is used as faster alternative to k256 lib. And in most cases should be default.
# Only problem that it has, it fails to build for wasm target on windows and mac as it is c lib.
# If you dont require wasm on win/mac, i would recommend its usage.
secp256k1 = ["dep:secp256k1"]

3 changes: 3 additions & 0 deletions crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ mod identity;
mod modexp;
mod secp256k1;

#[cfg(not(any(feature = "std", feature = "critical-section")))]
compile_error!("Either feature \"std\" or \"critical-section\" must be enabled, otherwise OnceCell is unavailable.");

use once_cell::sync::OnceCell;
pub use primitives::{
precompile::{PrecompileError as Error, *},
Expand Down
17 changes: 13 additions & 4 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ bytes = { version = "1.4", default-features = false }
hashbrown = "0.14"
primitive-types = { version = "0.12", default-features = false }
rlp = { version = "0.5", default-features = false } # used for create2 address calculation
ruint = { version = "1.8.0", features = ["primitive-types", "rlp"] }
ruint = { version = "1.8.0", default-features = false, features = [
"primitive-types",
"rlp",
] }
auto_impl = "1.1"
bitvec = { version = "1", default-features = false, features = ["alloc"] }
bitflags = { version = "2.4.0", default-features = false }

# bits B256 B160 crate
fixed-hash = { version = "0.8", default-features = false, features = ["rustc-hex"] }
fixed-hash = { version = "0.8", default-features = false, features = [
"rustc-hex",
] }

#utility
hex-literal = "0.4"
hex = { version = "0.4", default-features = false, features = ["alloc"] }
to-binary = "0.4"
derive_more = "0.99"
enumn = "0.1"

Expand All @@ -42,7 +46,12 @@ proptest-derive = { version = "0.4", optional = true }
arbitrary = { version = "1.3", features = ["derive"] }
proptest = "1.1"
proptest-derive = "0.4"
ruint = { version = "1.10.1", features = ["primitive-types", "rlp", "proptest", "arbitrary"] }
ruint = { version = "1.10.1", features = [
"primitive-types",
"rlp",
"proptest",
"arbitrary",
] }

[features]
default = ["std"]
Expand Down
3 changes: 1 addition & 2 deletions crates/primitives/src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use bitvec::prelude::{bitvec, Lsb0};
use bitvec::vec::BitVec;
use bytes::Bytes;
use core::fmt::Debug;
use to_binary::BinaryString;

/// A map of valid `jump` destinations.
#[derive(Clone, Eq, PartialEq, Default)]
Expand All @@ -14,7 +13,7 @@ pub struct JumpMap(pub Arc<BitVec<u8>>);
impl Debug for JumpMap {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("JumpMap")
.field("map", &BinaryString::from(self.0.as_raw_slice()))
.field("map", &hex::encode(&self.0.as_raw_slice()))
.finish()
}
}
Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub use bytes;
pub use bytes::Bytes;
pub use hex;
pub use hex_literal;
pub use to_binary;
/// Address type is last 20 bytes of hash of ethereum account
pub type Address = B160;
/// Hash, in Ethereum usually keccak256.
Expand Down
11 changes: 8 additions & 3 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ revm-interpreter = { path = "../interpreter", version = "1.1.2", default-feature

#misc
auto_impl = { version = "1.1", default-features = false }
once_cell = { version = "1.17", default-features = false }

# Optional
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
serde_json = { version = "1.0", features = ["preserve_order"], optional = true }

# ethersdb
tokio = { version = "1.32", features = ["rt-multi-thread", "macros"], optional = true }
tokio = { version = "1.32", features = [
"rt-multi-thread",
"macros",
], optional = true }
ethers-providers = { version = "2.0", optional = true }
ethers-core = { version = "2.0", optional = true }
futures = { version = "0.3.27", optional = true }
Expand All @@ -40,6 +42,9 @@ criterion = "0.5"

[features]
default = ["std", "secp256k1"]
# Without std, critical-section must be enabled and a critical section
# implementation must be provided. See crate "critical_section".
critical-section = ["revm-precompile/critical-section"]
dev = [
"memory_limit",
"optional_balance_check",
Expand All @@ -56,7 +61,7 @@ optional_block_gas_limit = ["revm-interpreter/optional_block_gas_limit"]
optional_eip3607 = ["revm-interpreter/optional_eip3607"]
optional_gas_refund = ["revm-interpreter/optional_gas_refund"]
optional_no_base_fee = ["revm-interpreter/optional_no_base_fee"]
std = ["revm-interpreter/std", "once_cell/std", "rayon"]
std = ["revm-interpreter/std", "revm-precompile/std", "rayon"]
ethersdb = ["std", "tokio", "futures", "ethers-providers", "ethers-core"]
serde = ["dep:serde", "dep:serde_json", "revm-interpreter/serde"]
arbitrary = ["revm-interpreter/arbitrary"]
Expand Down