diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a00d9d99c..f9d19b12ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,21 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - run: cargo check --no-default-features -p revm --features=${{ matrix.features }} + - run: cargo check --no-default-features -p revm --features=${{ matrix.features }} + + feature-checks: + name: features + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: cargo hack + run: cargo hack check --feature-powerset --depth 1 clippy: name: clippy @@ -96,7 +110,7 @@ jobs: with: components: rustfmt - run: cargo fmt --all --check - + # Check crates correctly propagate features feature-propagation: runs-on: ubuntu-latest diff --git a/crates/inspector/Cargo.toml b/crates/inspector/Cargo.toml index be8b5b8041..93733fae01 100644 --- a/crates/inspector/Cargo.toml +++ b/crates/inspector/Cargo.toml @@ -52,9 +52,10 @@ std = [ "interpreter/std", "primitives/std", "state/std", - "either/std" + "either/std", ] serde = [ + "dep:serde", "database/serde", "context/serde", "database-interface/serde", @@ -62,9 +63,10 @@ serde = [ "interpreter/serde", "primitives/serde", "state/serde", - "either/serde" + "either/serde", ] +tracer = ["std", "serde", "dep:serde_json"] + # deprecated please use [`tracer`] feature instead -serde-json = ["dep:serde", "dep:serde_json", "serde"] -tracer = ["serde-json"] +serde-json = ["tracer"] diff --git a/crates/inspector/src/count_inspector.rs b/crates/inspector/src/count_inspector.rs index 01c7967d4a..dd29efe15f 100644 --- a/crates/inspector/src/count_inspector.rs +++ b/crates/inspector/src/count_inspector.rs @@ -32,7 +32,7 @@ impl CountInspector { /// Create a new CountInspector. pub fn new() -> Self { Self { - opcode_counts: HashMap::new(), + opcode_counts: HashMap::default(), initialize_interp_count: 0, step_count: 0, step_end_count: 0, diff --git a/crates/inspector/src/lib.rs b/crates/inspector/src/lib.rs index aa62edda6f..136422a299 100644 --- a/crates/inspector/src/lib.rs +++ b/crates/inspector/src/lib.rs @@ -6,7 +6,7 @@ #![cfg_attr(not(feature = "std"), no_std)] mod count_inspector; -#[cfg(all(feature = "std", feature = "serde-json"))] +#[cfg(feature = "tracer")] mod eip3155; mod either; mod gas; diff --git a/crates/interpreter/src/instructions/system.rs b/crates/interpreter/src/instructions/system.rs index 8ced44d883..6d3ba86570 100644 --- a/crates/interpreter/src/instructions/system.rs +++ b/crates/interpreter/src/instructions/system.rs @@ -96,7 +96,6 @@ pub fn codecopy(context: InstructionContext<' /// Loads 32 bytes of input data from the specified offset. pub fn calldataload(context: InstructionContext<'_, H, WIRE>) { gas!(context.interpreter, gas::VERYLOW); - //pop_top!(interpreter, offset_ptr); popn_top!([], offset_ptr, context.interpreter); let mut word = B256::ZERO; let offset = as_usize_saturated!(offset_ptr); diff --git a/crates/precompile/src/bn128/substrate.rs b/crates/precompile/src/bn128/substrate.rs index 23938c79c3..ee3b5c162b 100644 --- a/crates/precompile/src/bn128/substrate.rs +++ b/crates/precompile/src/bn128/substrate.rs @@ -1,6 +1,7 @@ use super::{FQ2_LEN, FQ_LEN, G1_LEN, SCALAR_LEN}; use crate::PrecompileError; use bn::{AffineG1, AffineG2, Fq, Fq2, Group, Gt, G1, G2}; +use std::vec::Vec; /// Reads a single `Fq` field element from the input slice. /// diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index 61079a1528..4cbb7eeee6 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -35,7 +35,6 @@ cfg_if::cfg_if! { } } -#[cfg(not(target_feature = "avx2"))] use arrayref as _; #[cfg(all(feature = "c-kzg", feature = "kzg-rs"))] diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index b1046c3c67..a91a0398b4 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -26,15 +26,11 @@ num_enum = { version = "0.7.3", default-features = false } # Optional serde = { workspace = true, features = ["derive", "rc"], optional = true } - [features] default = ["std"] -std = [ - "alloy-primitives/std", - "serde?/std", - "num_enum/std" -] +std = ["alloy-primitives/std", "serde?/std", "num_enum/std"] serde = ["dep:serde", "alloy-primitives/serde"] +map-foldhash = ["alloy-primitives/map-foldhash"] hashbrown = ["alloy-primitives/map-hashbrown"] arbitrary = ["std", "alloy-primitives/arbitrary"] diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 5d6c9bad44..54f552831d 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -52,6 +52,7 @@ std = [ "serde_json/std", ] hashbrown = ["interpreter/hashbrown", "precompile/hashbrown"] +map-foldhash = ["primitives/map-foldhash"] serde = [ "interpreter/serde", "database-interface/serde",