diff --git a/crates/evm/Cargo.toml b/crates/evm/Cargo.toml index bf818bba45..23f7e1b257 100644 --- a/crates/evm/Cargo.toml +++ b/crates/evm/Cargo.toml @@ -30,4 +30,6 @@ parking_lot = { workspace = true, optional = true } parking_lot.workspace = true [features] +default = ["std"] +std = [] test-utils = ["dep:parking_lot"] diff --git a/crates/evm/src/execute.rs b/crates/evm/src/execute.rs index bf479271be..ea8b7abb07 100644 --- a/crates/evm/src/execute.rs +++ b/crates/evm/src/execute.rs @@ -6,6 +6,9 @@ use reth_prune_types::PruneModes; use revm::db::BundleState; use revm_primitives::db::Database; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; + pub use reth_execution_errors::{BlockExecutionError, BlockValidationError}; pub use reth_storage_errors::provider::ProviderError; diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index c25e3ae972..a3e643e88b 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -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_primitives::{revm::env::fill_block_env, Address, Header, TransactionSigned, U256};