mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(no_std): Add no_std support for reth-engine-primitives (#13924)
This commit is contained in:
@ -32,3 +32,17 @@ futures.workspace = true
|
|||||||
# misc
|
# misc
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["std"]
|
||||||
|
std = [
|
||||||
|
"reth-execution-types/std",
|
||||||
|
"reth-primitives/std",
|
||||||
|
"reth-primitives-traits/std",
|
||||||
|
"alloy-primitives/std",
|
||||||
|
"alloy-consensus/std",
|
||||||
|
"alloy-rpc-types-engine/std",
|
||||||
|
"futures/std",
|
||||||
|
"serde/std",
|
||||||
|
"thiserror/std",
|
||||||
|
]
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
use alloc::boxed::Box;
|
||||||
use alloy_rpc_types_engine::ForkchoiceUpdateError;
|
use alloy_rpc_types_engine::ForkchoiceUpdateError;
|
||||||
|
|
||||||
/// Represents all error cases when handling a new payload.
|
/// Represents all error cases when handling a new payload.
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
//! Events emitted by the beacon consensus engine.
|
//! Events emitted by the beacon consensus engine.
|
||||||
|
|
||||||
use crate::ForkchoiceStatus;
|
use crate::ForkchoiceStatus;
|
||||||
|
use alloc::{boxed::Box, sync::Arc};
|
||||||
use alloy_consensus::BlockHeader;
|
use alloy_consensus::BlockHeader;
|
||||||
use alloy_primitives::B256;
|
use alloy_primitives::B256;
|
||||||
use alloy_rpc_types_engine::ForkchoiceState;
|
use alloy_rpc_types_engine::ForkchoiceState;
|
||||||
use reth_primitives::{EthPrimitives, SealedBlock};
|
use core::{
|
||||||
use reth_primitives_traits::{NodePrimitives, SealedHeader};
|
|
||||||
use std::{
|
|
||||||
fmt::{Display, Formatter, Result},
|
fmt::{Display, Formatter, Result},
|
||||||
sync::Arc,
|
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
use reth_primitives::{EthPrimitives, SealedBlock};
|
||||||
|
use reth_primitives_traits::{NodePrimitives, SealedHeader};
|
||||||
|
|
||||||
/// Events emitted by the consensus engine.
|
/// Events emitted by the consensus engine.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
|||||||
@ -7,6 +7,9 @@
|
|||||||
)]
|
)]
|
||||||
#![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)]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
mod error;
|
mod error;
|
||||||
|
|
||||||
|
|||||||
@ -6,15 +6,15 @@ use alloy_rpc_types_engine::{
|
|||||||
ExecutionPayload, ExecutionPayloadSidecar, ForkChoiceUpdateResult, ForkchoiceState,
|
ExecutionPayload, ExecutionPayloadSidecar, ForkChoiceUpdateResult, ForkchoiceState,
|
||||||
ForkchoiceUpdateError, ForkchoiceUpdated, PayloadId, PayloadStatus, PayloadStatusEnum,
|
ForkchoiceUpdateError, ForkchoiceUpdated, PayloadId, PayloadStatus, PayloadStatusEnum,
|
||||||
};
|
};
|
||||||
use futures::{future::Either, FutureExt, TryFutureExt};
|
use core::{
|
||||||
use reth_errors::RethResult;
|
fmt::{self, Display},
|
||||||
use reth_payload_builder_primitives::PayloadBuilderError;
|
|
||||||
use std::{
|
|
||||||
fmt::Display,
|
|
||||||
future::Future,
|
future::Future,
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
task::{ready, Context, Poll},
|
task::{ready, Context, Poll},
|
||||||
};
|
};
|
||||||
|
use futures::{future::Either, FutureExt, TryFutureExt};
|
||||||
|
use reth_errors::RethResult;
|
||||||
|
use reth_payload_builder_primitives::PayloadBuilderError;
|
||||||
use tokio::sync::{mpsc::UnboundedSender, oneshot};
|
use tokio::sync::{mpsc::UnboundedSender, oneshot};
|
||||||
|
|
||||||
/// Represents the outcome of forkchoice update.
|
/// Represents the outcome of forkchoice update.
|
||||||
@ -168,7 +168,7 @@ pub enum BeaconEngineMessage<Engine: EngineTypes> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<Engine: EngineTypes> Display for BeaconEngineMessage<Engine> {
|
impl<Engine: EngineTypes> Display for BeaconEngineMessage<Engine> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::NewPayload { payload, .. } => {
|
Self::NewPayload { payload, .. } => {
|
||||||
write!(
|
write!(
|
||||||
|
|||||||
Reference in New Issue
Block a user