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

This commit is contained in:
Matthias Seitz
2024-06-18 18:15:02 +02:00
committed by GitHub
parent 0f88965fdc
commit 63248bc4ec
4 changed files with 15 additions and 0 deletions

View File

@ -33,3 +33,6 @@ reth-revm = { workspace = true, features = ["test-utils"] }
secp256k1.workspace = true secp256k1.workspace = true
serde_json.workspace = true serde_json.workspace = true
[features]
default = ["std"]
std = []

View File

@ -6,6 +6,9 @@ use reth_evm::execute::BlockValidationError;
use reth_primitives::{Receipt, Request}; use reth_primitives::{Receipt, Request};
use revm_primitives::Log; use revm_primitives::Log;
#[cfg(not(feature = "std"))]
use alloc::{string::ToString, vec::Vec};
sol! { sol! {
#[allow(missing_docs)] #[allow(missing_docs)]
event DepositEvent( event DepositEvent(

View File

@ -31,6 +31,11 @@ use revm_primitives::{
db::{Database, DatabaseCommit}, db::{Database, DatabaseCommit},
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState, BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState,
}; };
#[cfg(not(feature = "std"))]
use alloc::{sync::Arc, vec, vec::Vec};
#[cfg(feature = "std")]
use std::sync::Arc; use std::sync::Arc;
/// Provides executors to execute regular ethereum blocks /// Provides executors to execute regular ethereum blocks

View File

@ -7,6 +7,10 @@
)] )]
#![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![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_chainspec::ChainSpec;
use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; use reth_evm::{ConfigureEvm, ConfigureEvmEnv};