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

@ -23,4 +23,11 @@ strum = { workspace = true, features = ["derive"] }
reth-nippy-jar.workspace = true
[features]
default = ["std"]
std = [
"alloy-primitives/std",
"derive_more/std",
"serde/std",
"strum/std",
]
clap = ["dep:clap"]

View File

@ -1,5 +1,5 @@
use crate::StaticFileTargets;
use std::time::Duration;
use core::time::Duration;
/// An event emitted by the static file producer.
#[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 compression;
mod event;
@ -14,9 +17,9 @@ mod segment;
use alloy_primitives::BlockNumber;
pub use compression::Compression;
use core::ops::RangeInclusive;
pub use event::StaticFileProducerEvent;
pub use segment::{SegmentConfig, SegmentHeader, SegmentRangeInclusive, StaticFileSegment};
use std::ops::RangeInclusive;
/// Default static file block count.
pub const DEFAULT_BLOCKS_PER_STATIC_FILE: u64 = 500_000;

View File

@ -1,8 +1,12 @@
use crate::{BlockNumber, Compression};
use alloc::{
format,
string::{String, ToString},
};
use alloy_primitives::TxNumber;
use core::{ops::RangeInclusive, str::FromStr};
use derive_more::Display;
use serde::{Deserialize, Serialize};
use std::{ops::RangeInclusive, str::FromStr};
use strum::{AsRefStr, EnumString};
#[derive(
@ -338,8 +342,8 @@ impl SegmentRangeInclusive {
}
}
impl std::fmt::Display for SegmentRangeInclusive {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl core::fmt::Display for SegmentRangeInclusive {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}..={}", self.start, self.end)
}
}