Skip to content

Commit 29f4ca2

Browse files
authored
feat: no_std for reth-evm (paradigmxyz#14561)
1 parent 67a9886 commit 29f4ca2

File tree

14 files changed

+20
-12
lines changed

14 files changed

+20
-12
lines changed

.github/assets/check_rv32imac.sh

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ crates_to_check=(
1616
reth-execution-errors
1717
reth-execution-types
1818
reth-db-models
19+
reth-evm
1920

2021
## ethereum
2122
reth-ethereum-forks

.github/assets/check_wasm.sh

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ exclude_crates=(
2828
reth-ethereum-cli
2929
reth-ethereum-payload-builder
3030
reth-etl
31-
reth-evm
3231
reth-exex
3332
reth-exex-test-utils
3433
reth-ipc

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ reth-ethereum-payload-builder = { path = "crates/ethereum/payload" }
346346
reth-ethereum-primitives = { path = "crates/ethereum/primitives", default-features = false }
347347
reth-ethereum = { path = "crates/ethereum/reth" }
348348
reth-etl = { path = "crates/etl" }
349-
reth-evm = { path = "crates/evm" }
349+
reth-evm = { path = "crates/evm", default-features = false }
350350
reth-evm-ethereum = { path = "crates/ethereum/evm" }
351351
reth-optimism-evm = { path = "crates/optimism/evm", default-features = false }
352352
reth-execution-errors = { path = "crates/evm/execution-errors", default-features = false }
@@ -559,7 +559,7 @@ async-stream = "0.3"
559559
async-trait = "0.1.68"
560560
futures = "0.3"
561561
futures-core = "0.3"
562-
futures-util = "0.3"
562+
futures-util = { version = "0.3", default-features = false }
563563
hyper = "1.3"
564564
hyper-util = "0.1.5"
565565
pin-project = "1.0.12"

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ rustdocs: ## Runs `cargo docs` to generate the Rust documents in the `target/doc
432432
cargo +nightly docs \
433433
--document-private-items
434434

435-
test:
435+
cargo-test:
436436
cargo test \
437437
--workspace \
438438
--bin "op-reth" \
@@ -445,7 +445,7 @@ test-doc:
445445
cargo test --doc --workspace --all-features
446446

447447
test:
448-
make test && \
448+
make cargo-test && \
449449
make test-doc
450450

451451
pr:

crates/engine/tree/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ reth-consensus.workspace = true
1818
reth-db.workspace = true
1919
reth-engine-primitives.workspace = true
2020
reth-errors.workspace = true
21-
reth-evm.workspace = true
21+
reth-evm = { workspace = true, features = ["metrics"] }
2222
reth-network-p2p.workspace = true
2323
reth-payload-builder.workspace = true
2424
reth-payload-primitives.workspace = true

crates/ethereum/evm/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ std = [
5757
"reth-chainspec/std",
5858
"alloy-evm/std",
5959
"reth-execution-types/std",
60+
"reth-evm/std",
6061
]

crates/ethereum/reth/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ std = [
4949
"reth-consensus-common?/std",
5050
"alloy-rpc-types-eth?/std",
5151
"reth-storage-api?/std",
52+
"reth-evm?/std",
5253
]
5354
arbitrary = [
5455
"std",

crates/evm/Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ metrics-util = { workspace = true, features = ["debugging"] }
4747
[features]
4848
default = ["std"]
4949
std = [
50-
"dep:metrics",
51-
"dep:reth-metrics",
5250
"reth-consensus/std",
5351
"reth-primitives/std",
5452
"reth-primitives-traits/std",
@@ -66,6 +64,12 @@ std = [
6664
"reth-execution-errors/std",
6765
"reth-execution-types/std",
6866
"reth-storage-errors/std",
67+
"futures-util/std",
68+
]
69+
metrics = [
70+
"std",
71+
"dep:metrics",
72+
"dep:reth-metrics",
6973
]
7074
test-utils = [
7175
"dep:parking_lot",

crates/evm/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub mod execute;
3636
mod aliases;
3737
pub use aliases::*;
3838

39-
#[cfg(feature = "std")]
39+
#[cfg(feature = "metrics")]
4040
pub mod metrics;
4141
pub mod noop;
4242
pub mod state_change;

crates/evm/src/test_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ use crate::{
88
system_calls::OnStateHook,
99
Database,
1010
};
11+
use alloc::{sync::Arc, vec::Vec};
1112
use alloy_eips::eip7685::Requests;
1213
use parking_lot::Mutex;
1314
use reth_execution_errors::BlockExecutionError;
1415
use reth_execution_types::{BlockExecutionResult, ExecutionOutcome};
1516
use reth_primitives::{EthPrimitives, NodePrimitives, RecoveredBlock};
1617
use revm_database::State;
17-
use std::sync::Arc;
1818

1919
/// A [`BlockExecutorProvider`] that returns mocked execution results.
2020
#[derive(Clone, Debug, Default)]

crates/optimism/evm/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,5 @@ std = [
8282
"alloy-op-evm/std",
8383
"revm-database/std",
8484
"revm-optimism/std",
85+
"reth-evm/std",
8586
]

crates/optimism/reth/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ std = [
4848
"reth-optimism-primitives/std",
4949
"reth-primitives-traits/std",
5050
"reth-storage-api?/std",
51+
"reth-evm?/std",
5152
]
5253
arbitrary = [
5354
"std",

crates/stages/stages/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ reth-consensus.workspace = true
2020
reth-db.workspace = true
2121
reth-db-api.workspace = true
2222
reth-etl.workspace = true
23-
reth-evm.workspace = true
23+
reth-evm = { workspace = true, features = ["metrics"] }
2424
reth-exex.workspace = true
2525
reth-fs-util.workspace = true
2626
reth-network-p2p.workspace = true

crates/tasks/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ workspace = true
1515
# async
1616
tokio = { workspace = true, features = ["sync", "rt"] }
1717
tracing-futures.workspace = true
18-
futures-util.workspace = true
18+
futures-util = { workspace = true, features = ["std"] }
1919

2020
# metrics
2121
reth-metrics.workspace = true

0 commit comments

Comments
 (0)