chore: no_std for reth-execution-types (#14465)

This commit is contained in:
Arsenii Kulikov
2025-02-13 13:47:40 +04:00
committed by GitHub
parent a699ee5405
commit cfb91e94dd
25 changed files with 93 additions and 62 deletions

View File

@ -37,6 +37,14 @@ test-fuzz.workspace = true
toml.workspace = true
[features]
default = ["std"]
std = [
"alloy-primitives/std",
"derive_more/std",
"serde?/std",
"serde_json/std",
"thiserror/std",
]
test-utils = [
"dep:arbitrary",
"reth-codecs?/test-utils",

View File

@ -1,6 +1,7 @@
use crate::PrunedSegmentInfo;
use alloc::vec::Vec;
use alloy_primitives::BlockNumber;
use std::time::Duration;
use core::time::Duration;
/// An event emitted by a pruner.
#[derive(Debug, PartialEq, Eq, Clone)]

View File

@ -7,6 +7,9 @@
)]
#![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;
mod checkpoint;
mod event;
@ -15,7 +18,10 @@ mod pruner;
mod segment;
mod target;
use alloc::{collections::BTreeMap, vec::Vec};
use alloy_primitives::{Address, BlockNumber};
pub use checkpoint::PruneCheckpoint;
use core::ops::Deref;
pub use event::PrunerEvent;
pub use mode::PruneMode;
pub use pruner::{
@ -23,12 +29,8 @@ pub use pruner::{
SegmentOutputCheckpoint,
};
pub use segment::{PrunePurpose, PruneSegment, PruneSegmentError};
use std::collections::BTreeMap;
pub use target::{PruneModes, MINIMUM_PRUNING_DISTANCE};
use alloy_primitives::{Address, BlockNumber};
use std::ops::Deref;
/// Configuration for pruning receipts not associated with logs emitted by the specified contracts.
#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[cfg_attr(any(test, feature = "serde"), derive(serde::Serialize, serde::Deserialize))]

View File

@ -1,4 +1,5 @@
use crate::{PruneCheckpoint, PruneMode, PruneSegment};
use alloc::vec::Vec;
use alloy_primitives::{BlockNumber, TxNumber};
use derive_more::Display;

View File

@ -99,6 +99,7 @@ fn deserialize_opt_prune_mode_with_min_blocks<
>(
deserializer: D,
) -> Result<Option<PruneMode>, D::Error> {
use alloc::format;
use serde::Deserialize;
let prune_mode = Option::<PruneMode>::deserialize(deserializer)?;