cfg: replace std feature gate alloc imports with extern crate alloc (#10861)

This commit is contained in:
Thomas Coratger
2024-09-13 18:01:12 +02:00
committed by GitHub
parent 6fc81f2b70
commit 47d188cb8e
54 changed files with 39 additions and 163 deletions

View File

@ -9,7 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
/// Chain specific constants

View File

@ -1,9 +1,5 @@
pub use alloy_eips::eip1559::BaseFeeParams;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, sync::Arc, vec::Vec};
#[cfg(feature = "std")]
use std::sync::Arc;
pub use alloy_eips::eip1559::BaseFeeParams;
use alloy_chains::{Chain, ChainKind, NamedChain};
use alloy_genesis::Genesis;

View File

@ -9,20 +9,15 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
use alloc::{fmt::Debug, vec::Vec};
use alloy_primitives::{BlockHash, BlockNumber, Bloom, B256, U256};
use reth_primitives::{
constants::MINIMUM_GAS_LIMIT, BlockWithSenders, GotExpected, GotExpectedBoxed, Header,
InvalidTransactionError, Receipt, Request, SealedBlock, SealedHeader,
};
#[cfg(feature = "std")]
use std::fmt::Debug;
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::{fmt::Debug, vec::Vec};
/// A consensus implementation that does nothing.
pub mod noop;

View File

@ -1,12 +1,10 @@
#[cfg(not(feature = "std"))]
use crate::{hardforks::Hardforks, ForkCondition};
use alloc::{
format,
string::{String, ToString},
vec::Vec,
};
use crate::{hardforks::Hardforks, ForkCondition};
/// A container to pretty-print a hardfork.
///
/// The fork is formatted depending on its fork condition:

View File

@ -3,7 +3,6 @@
//! Previously version of Apache licenced [`ethereum-forkid`](https://crates.io/crates/ethereum-forkid).
use crate::Head;
#[cfg(not(feature = "std"))]
use alloc::{
collections::{BTreeMap, BTreeSet},
vec::Vec,
@ -22,8 +21,6 @@ use crc::*;
use proptest_derive::Arbitrary as PropTestArbitrary;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "std")]
use std::collections::{BTreeMap, BTreeSet};
const CRC_32_IEEE: Crc<u32> = Crc::<u32>::new(&CRC_32_ISO_HDLC);
const TIMESTAMP_BEFORE_ETHEREUM_MAINNET: u64 = 1_300_000_000;

View File

@ -1,10 +1,8 @@
use crate::{ChainHardforks, EthereumHardfork, ForkCondition};
use alloc::vec;
use alloy_primitives::U256;
use once_cell::sync::Lazy;
#[cfg(not(feature = "std"))]
use alloc::vec;
/// Dev hardforks
pub static DEV_HARDFORKS: Lazy<ChainHardforks> = Lazy::new(|| {
ChainHardforks::new(vec![

View File

@ -1,4 +1,5 @@
use crate::{hardfork, ChainHardforks, ForkCondition, Hardfork};
use alloc::{boxed::Box, format, string::String};
use alloy_chains::Chain;
use alloy_primitives::{uint, U256};
use core::{
@ -9,9 +10,6 @@ use core::{
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, format, string::String};
hardfork!(
/// The name of an Ethereum hardfork.
EthereumHardfork {

View File

@ -1,4 +1,3 @@
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, format, string::String, vec};
use core::{
any::Any,

View File

@ -15,7 +15,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
mod display;

View File

@ -1,4 +1,5 @@
//! EIP-6110 deposit requests parsing
use alloc::{string::ToString, vec::Vec};
use alloy_eips::eip6110::{DepositRequest, MAINNET_DEPOSIT_CONTRACT_ADDRESS};
use alloy_sol_types::{sol, SolEvent};
use reth_chainspec::ChainSpec;
@ -6,9 +7,6 @@ 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(

View File

@ -4,6 +4,7 @@ use crate::{
dao_fork::{DAO_HARDFORK_BENEFICIARY, DAO_HARDKFORK_ACCOUNTS},
EthEvmConfig,
};
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
use core::fmt::Display;
use reth_chainspec::{ChainSpec, EthereumHardforks, MAINNET};
use reth_ethereum_consensus::validate_block_post_execution;
@ -32,11 +33,6 @@ use revm_primitives::{
BlockEnv, CfgEnvWithHandlerCfg, EVMError, EnvWithHandlerCfg, ResultAndState,
};
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
#[cfg(feature = "std")]
use std::sync::Arc;
/// Provides executors to execute regular ethereum blocks
#[derive(Debug, Clone)]
pub struct EthExecutorProvider<EvmConfig = EthEvmConfig> {

View File

@ -9,18 +9,14 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
use std::sync::Arc;
use alloc::vec::Vec;
use reth_chainspec::{ChainSpec, Head};
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
use reth_primitives::{transaction::FillTxEnv, Address, Header, TransactionSigned, U256};
use revm_primitives::{AnalysisKind, Bytes, CfgEnvWithHandlerCfg, Env, TxEnv, TxKind};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::sync::Arc;
mod config;
pub use config::{revm_spec, revm_spec_by_timestamp_after_merge};

View File

@ -9,11 +9,9 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::String};
use alloc::{boxed::Box, string::String};
use alloy_eips::BlockNumHash;
use alloy_primitives::B256;
use derive_more::Display;

View File

@ -1,13 +1,11 @@
//! Errors when computing the state root.
use alloc::string::ToString;
use alloy_primitives::B256;
use derive_more::Display;
use nybbles::Nibbles;
use reth_storage_errors::{db::DatabaseError, provider::ProviderError};
#[cfg(not(feature = "std"))]
use alloc::string::ToString;
/// State root errors.
#[derive(Display, Debug, PartialEq, Eq, Clone)]
pub enum StateRootError {

View File

@ -1,12 +1,8 @@
//! Contains [Chain], a chain of blocks and their final state.
#[cfg(not(feature = "std"))]
use crate::ExecutionOutcome;
use alloc::{borrow::Cow, collections::BTreeMap};
use core::{fmt, ops::RangeInclusive};
#[cfg(feature = "std")]
use std::{borrow::Cow, collections::BTreeMap};
use crate::ExecutionOutcome;
use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError};
use reth_primitives::{
Address, BlockHash, BlockNumHash, BlockNumber, ForkBlock, Receipt, SealedBlock,

View File

@ -8,7 +8,6 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#[cfg(not(feature = "std"))]
extern crate alloc;
mod chain;

View File

@ -1,8 +1,6 @@
//! Builder for creating an EVM with a database and environment.
#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
use revm::{inspector_handle_register, Database, Evm, EvmBuilder, GetInspector};
use revm_primitives::EnvWithHandlerCfg;

View File

@ -9,7 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
use core::ops::Deref;

View File

@ -1,12 +1,7 @@
//! System contract call functions.
#[cfg(feature = "std")]
use std::fmt::Display;
#[cfg(not(feature = "std"))]
use {
alloc::{boxed::Box, format, string::ToString, vec::Vec},
core::fmt::Display,
};
use alloc::{boxed::Box, format, string::ToString, vec::Vec};
use core::fmt::Display;
use crate::ConfigureEvm;
use alloy_eips::{

View File

@ -1,9 +1,6 @@
//! Chain specification for the Base Mainnet network.
#[cfg(not(feature = "std"))]
use alloc::sync::Arc;
#[cfg(feature = "std")]
use std::sync::Arc;
use alloy_chains::Chain;
use alloy_primitives::{b256, U256};

View File

@ -1,9 +1,6 @@
//! Chain specification for the Base Sepolia testnet network.
#[cfg(not(feature = "std"))]
use alloc::sync::Arc;
#[cfg(feature = "std")]
use std::sync::Arc;
use alloy_chains::Chain;
use alloy_primitives::{b256, U256};

View File

@ -1,9 +1,6 @@
//! Chain specification in dev mode for custom chain.
#[cfg(not(feature = "std"))]
use alloc::sync::Arc;
#[cfg(feature = "std")]
use std::sync::Arc;
use alloy_chains::Chain;
use alloy_primitives::U256;

View File

@ -7,7 +7,6 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#[cfg(not(feature = "std"))]
extern crate alloc;
pub mod constants;

View File

@ -1,9 +1,6 @@
//! Chain specification for the Optimism Mainnet network.
#[cfg(not(feature = "std"))]
use alloc::sync::Arc;
#[cfg(feature = "std")]
use std::sync::Arc;
use alloy_chains::Chain;
use alloy_primitives::{b256, U256};

View File

@ -1,9 +1,6 @@
//! Chain specification for the Optimism Sepolia testnet network.
#[cfg(not(feature = "std"))]
use alloc::sync::Arc;
#[cfg(feature = "std")]
use std::sync::Arc;
use alloy_chains::{Chain, NamedChain};
use alloy_primitives::{b256, U256};

View File

@ -1,7 +1,5 @@
use core::time::Duration;
#[cfg(not(feature = "std"))]
use alloc::string::String;
use core::time::Duration;
/// Represents one Kilogas, or `1_000` gas.
pub const KILOGAS: u64 = 1_000;

View File

@ -1,13 +1,9 @@
use alloc::boxed::Box;
use core::{
fmt,
ops::{Deref, DerefMut},
};
#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
extern crate alloc;
/// A pair of values, one of which is expected and one of which is actual.
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct GotExpected<T> {

View File

@ -1,3 +1,4 @@
use alloc::vec::Vec;
use bytes::BufMut;
use core::fmt;
use derive_more::Deref;
@ -8,9 +9,6 @@ use serde::{
Deserialize, Deserializer, Serialize, Serializer,
};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Uses Roaring Bitmaps to hold a list of integers. It provides really good compression with the
/// capability to access its elements without decoding it.
#[derive(Clone, PartialEq, Default, Deref)]

View File

@ -9,7 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;

View File

@ -1,5 +1,6 @@
//! EIP-7685 requests.
use alloc::vec::Vec;
pub use alloy_consensus::Request;
use alloy_eips::eip7685::{Decodable7685, Encodable7685};
use alloy_rlp::{Decodable, Encodable};
@ -8,9 +9,6 @@ use reth_codecs::{add_arbitrary_tests, Compact};
use revm_primitives::Bytes;
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// A list of EIP-7685 requests.
#[derive(
Debug,

View File

@ -1,12 +1,10 @@
//! [EIP-4895](https://eips.ethereum.org/EIPS/eip-4895) Withdrawal types.
use alloc::vec::Vec;
use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};
use derive_more::{AsRef, Deref, DerefMut, From, IntoIterator};
use reth_codecs::{add_arbitrary_tests, Compact};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Re-export from `alloy_eips`.
#[doc(inline)]
pub use alloy_eips::eip4895::Withdrawal;

View File

@ -5,14 +5,12 @@ use crate::{
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxEip1559, TxEip2930,
TxEip4844, TxLegacy, TxType,
};
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::TxKind;
use alloy_rlp::Error as RlpError;
use alloy_serde::WithOtherFields;
use op_alloy_rpc_types as _;
#[cfg(not(feature = "std"))]
use alloc::{string::ToString, vec::Vec};
impl TryFrom<alloy_rpc_types::Block<WithOtherFields<alloy_rpc_types::Transaction>>> for Block {
type Error = alloy_rpc_types::ConversionError;

View File

@ -2,6 +2,7 @@ use crate::{
Address, Bytes, GotExpected, Header, SealedHeader, TransactionSigned,
TransactionSignedEcRecovered, Withdrawals, B256,
};
use alloc::vec::Vec;
pub use alloy_eips::eip1898::{
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash,
};
@ -14,9 +15,6 @@ pub use reth_primitives_traits::test_utils::{generate_valid_header, valid_header
use reth_primitives_traits::Requests;
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
// HACK(onbjerg): we need this to always set `requests` to `None` since we might otherwise generate
// a block with `None` withdrawals and `Some` requests, in which case we end up trying to decode the
// requests as withdrawals

View File

@ -1,8 +1,7 @@
use std::{cell::RefCell, thread_local};
use zstd::bulk::{Compressor, Decompressor};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::cell::RefCell;
use std::thread_local;
use zstd::bulk::{Compressor, Decompressor};
/// Compression/Decompression dictionary for `Receipt`.
pub static RECEIPT_DICTIONARY: &[u8] = include_bytes!("./receipt_dictionary.bin");

View File

@ -19,7 +19,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(feature = "alloy-compat")]

View File

@ -4,12 +4,10 @@ use crate::{
constants::EMPTY_OMMER_ROOT_HASH, keccak256, Header, Receipt, ReceiptWithBloom,
ReceiptWithBloomRef, Request, TransactionSigned, Withdrawal, B256,
};
use alloc::vec::Vec;
use alloy_eips::eip7685::Encodable7685;
use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Calculate a transaction root.
///
/// `(rlp(index), encoded(tx))` pairs.

View File

@ -4,6 +4,7 @@ use crate::{
logs_bloom, Bloom, Bytes, TxType, B256, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
};
use alloc::{vec, vec::Vec};
use alloy_primitives::Log;
use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable};
use bytes::{Buf, BufMut};
@ -13,9 +14,6 @@ use derive_more::{DerefMut, From, IntoIterator};
use reth_codecs::{Compact, CompactZstd};
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::{vec, vec::Vec};
/// Receipt containing result of transaction execution.
#[derive(
Clone, Debug, PartialEq, Eq, Default, RlpEncodable, RlpDecodable, Serialize, Deserialize,

View File

@ -58,7 +58,6 @@ pub use tx_type::DEPOSIT_TX_TYPE_ID;
#[cfg(test)]
use reth_codecs::Compact;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Either a transaction hash or number.

View File

@ -7,15 +7,13 @@ use crate::{
TransactionSigned, TransactionSignedEcRecovered, TxEip1559, TxEip2930, TxEip4844, TxHash,
TxLegacy, B256, EIP4844_TX_TYPE_ID,
};
use alloc::vec::Vec;
use alloy_consensus::{SignableTransaction, TxEip4844WithSidecar};
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE};
use bytes::Buf;
use derive_more::{AsRef, Deref};
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// A response to `GetPooledTransactions`. This can include either a blob transaction, or a
/// non-4844 signed transaction.
#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::add_arbitrary_tests)]

View File

@ -13,7 +13,6 @@ pub use alloy_eips::eip4844::BlobTransactionSidecar;
#[cfg(feature = "c-kzg")]
pub use alloy_eips::eip4844::BlobTransactionValidationError;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// A response to `GetPooledTransactions` that includes blob data, their commitments, and their

View File

@ -4,14 +4,12 @@ use crate::{
precompile::{Address, HashSet},
primitives::alloy_primitives::BlockNumber,
};
use alloc::vec::Vec;
use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError};
use reth_primitives::{Receipt, Receipts, Request, Requests};
use reth_prune_types::{PruneMode, PruneModes, PruneSegmentError, MINIMUM_PRUNING_DISTANCE};
use revm::db::states::bundle_state::BundleRetention;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Takes care of:
/// - recording receipts during execution of multiple blocks.
/// - pruning receipts according to the pruning configuration.
@ -183,14 +181,9 @@ impl BlockBatchRecord {
#[cfg(test)]
mod tests {
use super::*;
use alloc::collections::BTreeMap;
use reth_primitives::{Address, Log, Receipt};
use reth_prune_types::{PruneMode, ReceiptsLogPruneConfig};
#[cfg(feature = "std")]
use std::collections::BTreeMap;
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::collections::BTreeMap;
#[test]
fn test_save_receipts_empty() {

View File

@ -9,7 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
/// Contains glue code for integrating reth database into revm's [Database].

View File

@ -1,4 +1,5 @@
use crate::precompile::HashMap;
use alloc::vec::Vec;
use reth_primitives::{
keccak256, Account, Address, BlockNumber, Bytecode, Bytes, StorageKey, B256, U256,
};
@ -12,9 +13,6 @@ use reth_trie::{
HashedStorage,
};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Mock state for testing
#[derive(Debug, Default, Clone, Eq, PartialEq)]
pub struct StateProviderTest {

View File

@ -1,10 +1,8 @@
use crate::Compact;
use alloc::vec::Vec;
use alloy_eips::eip2930::{AccessList, AccessListItem};
use alloy_primitives::Address;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Implement `Compact` for `AccessListItem` and `AccessList`.
impl Compact for AccessListItem {
fn to_compact<B>(&self, buf: &mut B) -> usize

View File

@ -1,12 +1,10 @@
use crate::Compact;
use alloc::vec::Vec;
use alloy_genesis::GenesisAccount as AlloyGenesisAccount;
use alloy_primitives::{Bytes, B256, U256};
use reth_codecs_derive::add_arbitrary_tests;
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// `GenesisAccount` acts as bridge which simplifies Compact implementation for
/// `AlloyGenesisAccount`.
///

View File

@ -1,12 +1,10 @@
//! Native Compact codec impl for primitive alloy log types.
use crate::Compact;
use alloc::vec::Vec;
use alloy_primitives::{Address, Bytes, Log, LogData};
use bytes::BufMut;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Implement `Compact` for `LogData` and `Log`.
impl Compact for LogData {
fn to_compact<B>(&self, buf: &mut B) -> usize

View File

@ -1,13 +1,11 @@
use crate::{Compact, CompactPlaceholder};
use alloc::vec::Vec;
use alloy_consensus::transaction::TxEip4844 as AlloyTxEip4844;
use alloy_eips::eip2930::AccessList;
use alloy_primitives::{Address, Bytes, ChainId, B256, U256};
use reth_codecs_derive::add_arbitrary_tests;
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// [EIP-4844 Blob Transaction](https://eips.ethereum.org/EIPS/eip-4844#blob-transaction)
///
/// This is a helper type to use derive on it instead of manually managing `bitfield`.

View File

@ -1,13 +1,11 @@
use crate::Compact;
use alloc::vec::Vec;
use alloy_consensus::transaction::TxEip7702 as AlloyTxEip7702;
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
use alloy_primitives::{Address, Bytes, ChainId, U256};
use reth_codecs_derive::add_arbitrary_tests;
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// [EIP-7702 Set Code Transaction](https://eips.ethereum.org/EIPS/eip-7702)
///
/// This is a helper type to use derive on it instead of manually managing `bitfield`.

View File

@ -1,13 +1,11 @@
//! Native Compact codec impl for EIP-7685 requests.
use crate::Compact;
use alloc::vec::Vec;
use alloy_primitives::B256;
use alloy_trie::{hash_builder::HashBuilderValue, BranchNodeCompact, TrieMask};
use bytes::{Buf, BufMut};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Identifier for [`HashBuilderValue::Hash`]
const HASH_BUILDER_TYPE_HASH: u8 = 0;

View File

@ -22,9 +22,7 @@ pub use reth_codecs_derive::*;
use alloy_primitives::{Address, Bloom, Bytes, FixedBytes, U256};
use bytes::{Buf, BufMut};
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
#[cfg(any(test, feature = "alloy"))]

View File

@ -1,14 +1,9 @@
#[cfg(feature = "std")]
use std::{fmt, fmt::Display, str::FromStr, string::String};
#[cfg(not(feature = "std"))]
use alloc::{
boxed::Box,
format,
string::{String, ToString},
vec::Vec,
};
#[cfg(not(feature = "std"))]
use core::{
fmt,
fmt::{Debug, Display},

View File

@ -9,7 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
/// Database error

View File

@ -1,7 +1,5 @@
use reth_fs_util::FsPathError;
#[cfg(not(feature = "std"))]
use alloc::string::{String, ToString};
use reth_fs_util::FsPathError;
/// Storage lock error.
#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]

View File

@ -6,7 +6,6 @@ use reth_primitives::{BlockHashOrNumber, GotExpected, StaticFileSegment, TxHashO
#[cfg(feature = "std")]
use std::path::PathBuf;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::String};
/// Provider result type.