Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make reth-ethereum-evm compile with no-std #8935

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions crates/ethereum/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ reth-revm = { workspace = true, features = ["test-utils"] }
secp256k1.workspace = true
serde_json.workspace = true

[features]
default = ["std"]
std = []
3 changes: 3 additions & 0 deletions crates/ethereum/evm/src/eip6110.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use reth_evm::execute::BlockValidationError;
use reth_primitives::{Receipt, Request};
use revm_primitives::Log;

#[cfg(not(feature = "std"))]
use alloc::{string::ToString, vec::Vec};

sol! {
#[allow(missing_docs)]
event DepositEvent(
Expand Down
5 changes: 5 additions & 0 deletions crates/ethereum/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ use revm_primitives::{
db::{Database, DatabaseCommit},
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState,
};

#[cfg(not(feature = "std"))]
use alloc::{sync::Arc, vec, vec::Vec};

#[cfg(feature = "std")]
use std::sync::Arc;

/// Provides executors to execute regular ethereum blocks
Expand Down
4 changes: 4 additions & 0 deletions crates/ethereum/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
extern crate alloc;

use reth_chainspec::ChainSpec;
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
Expand Down
Loading