diff --git a/crates/evm/execution-types/src/chain.rs b/crates/evm/execution-types/src/chain.rs index 4ac820f1377a..7b0ac73d4036 100644 --- a/crates/evm/execution-types/src/chain.rs +++ b/crates/evm/execution-types/src/chain.rs @@ -1,7 +1,7 @@ //! Contains [Chain], a chain of blocks and their final state. use crate::ExecutionOutcome; -use alloc::{borrow::Cow, collections::BTreeMap}; +use alloc::{borrow::Cow, boxed::Box, collections::BTreeMap, vec::Vec}; use alloy_consensus::BlockHeader; use alloy_eips::{eip1898::ForkBlock, eip2718::Encodable2718, BlockNumHash}; use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash}; @@ -345,7 +345,7 @@ impl Chain { let split_at = block_number + 1; let higher_number_blocks = self.blocks.split_off(&split_at); - let execution_outcome = std::mem::take(&mut self.execution_outcome); + let execution_outcome = core::mem::take(&mut self.execution_outcome); let (canonical_block_exec_outcome, pending_block_exec_outcome) = execution_outcome.split_at(split_at); @@ -463,7 +463,7 @@ impl>> ChainBlocks<'_, impl IntoIterator for ChainBlocks<'_, B> { type Item = (BlockNumber, RecoveredBlock); - type IntoIter = std::collections::btree_map::IntoIter>; + type IntoIter = alloc::collections::btree_map::IntoIter>; fn into_iter(self) -> Self::IntoIter { #[allow(clippy::unnecessary_to_owned)] diff --git a/crates/evm/execution-types/src/execute.rs b/crates/evm/execution-types/src/execute.rs index 6d2a4c035ca9..6928cc993642 100644 --- a/crates/evm/execution-types/src/execute.rs +++ b/crates/evm/execution-types/src/execute.rs @@ -1,3 +1,4 @@ +use alloc::vec::Vec; use alloy_eips::eip7685::Requests; use revm::db::BundleState; diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index 0f225a9c5963..bba8387d5256 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -1,4 +1,5 @@ use crate::BlockExecutionOutput; +use alloc::{vec, vec::Vec}; use alloy_eips::eip7685::Requests; use alloy_primitives::{logs_bloom, map::HashMap, Address, BlockNumber, Bloom, Log, B256, U256}; use reth_primitives::Receipts; @@ -314,13 +315,13 @@ impl ExecutionOutcome { pub fn prepend_state(&mut self, mut other: BundleState) { let other_len = other.reverts.len(); // take this bundle - let this_bundle = std::mem::take(&mut self.bundle); + let this_bundle = core::mem::take(&mut self.bundle); // extend other bundle with this other.extend(this_bundle); // discard other reverts other.take_n_reverts(other_len); // swap bundles - std::mem::swap(&mut self.bundle, &mut other) + core::mem::swap(&mut self.bundle, &mut other) } /// Create a new instance with updated receipts. diff --git a/crates/evm/execution-types/src/lib.rs b/crates/evm/execution-types/src/lib.rs index fb872cd596e4..15e6d3097e03 100644 --- a/crates/evm/execution-types/src/lib.rs +++ b/crates/evm/execution-types/src/lib.rs @@ -7,6 +7,7 @@ )] #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(not(feature = "std"), no_std)] extern crate alloc;