mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: extract engine type defs to dedicated crate (#7589)
This commit is contained in:
42
Cargo.lock
generated
42
Cargo.lock
generated
@ -6443,6 +6443,16 @@ dependencies = [
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-engine-primitives"
|
||||
version = "0.2.0-beta.5"
|
||||
dependencies = [
|
||||
"reth-primitives",
|
||||
"reth-rpc-types",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-eth-wire"
|
||||
version = "0.2.0-beta.5"
|
||||
@ -6500,6 +6510,21 @@ dependencies = [
|
||||
"tokio-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-ethereum-engine-primitives"
|
||||
version = "0.2.0-beta.5"
|
||||
dependencies = [
|
||||
"alloy-rlp",
|
||||
"reth-engine-primitives",
|
||||
"reth-primitives",
|
||||
"reth-rpc-types",
|
||||
"reth-rpc-types-compat",
|
||||
"revm-primitives",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-ethereum-forks"
|
||||
version = "0.2.0-beta.5"
|
||||
@ -6788,12 +6813,9 @@ name = "reth-node-api"
|
||||
version = "0.2.0-beta.5"
|
||||
dependencies = [
|
||||
"reth-db",
|
||||
"reth-engine-primitives",
|
||||
"reth-evm",
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-rpc-types",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -6902,19 +6924,16 @@ dependencies = [
|
||||
"futures",
|
||||
"reth-basic-payload-builder",
|
||||
"reth-db",
|
||||
"reth-ethereum-engine-primitives",
|
||||
"reth-ethereum-payload-builder",
|
||||
"reth-evm-ethereum",
|
||||
"reth-exex",
|
||||
"reth-network",
|
||||
"reth-node-api",
|
||||
"reth-node-builder",
|
||||
"reth-payload-builder",
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-rpc-types",
|
||||
"reth-tracing",
|
||||
"reth-transaction-pool",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -6975,21 +6994,18 @@ dependencies = [
|
||||
name = "reth-payload-builder"
|
||||
version = "0.2.0-beta.5"
|
||||
dependencies = [
|
||||
"alloy-rlp",
|
||||
"futures-util",
|
||||
"metrics",
|
||||
"reth-engine-primitives",
|
||||
"reth-ethereum-engine-primitives",
|
||||
"reth-interfaces",
|
||||
"reth-metrics",
|
||||
"reth-node-api",
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-rpc-types",
|
||||
"reth-rpc-types-compat",
|
||||
"reth-transaction-pool",
|
||||
"revm",
|
||||
"revm-primitives",
|
||||
"serde_json",
|
||||
"sha2 0.10.8",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
|
||||
@ -42,6 +42,8 @@ members = [
|
||||
"crates/rpc/rpc-testing-util/",
|
||||
"crates/rpc/rpc-types/",
|
||||
"crates/rpc/rpc-types-compat/",
|
||||
"crates/engine-primitives/",
|
||||
"crates/ethereum-engine-primitives/",
|
||||
"crates/node-ethereum/",
|
||||
"crates/node-builder/",
|
||||
"crates/node-optimism/",
|
||||
@ -206,6 +208,8 @@ reth-db = { path = "crates/storage/db" }
|
||||
reth-discv4 = { path = "crates/net/discv4" }
|
||||
reth-discv5 = { path = "crates/net/discv5" }
|
||||
reth-dns-discovery = { path = "crates/net/dns" }
|
||||
reth-engine-primitives = { path = "crates/engine-primitives" }
|
||||
reth-ethereum-engine-primitives = { path = "crates/ethereum-engine-primitives" }
|
||||
reth-node-builder = { path = "crates/node-builder" }
|
||||
reth-node-ethereum = { path = "crates/node-ethereum" }
|
||||
reth-node-optimism = { path = "crates/node-optimism" }
|
||||
|
||||
20
crates/engine-primitives/Cargo.toml
Normal file
20
crates/engine-primitives/Cargo.toml
Normal file
@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "reth-engine-primitives"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-primitives.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
|
||||
# misc
|
||||
serde.workspace = true
|
||||
thiserror.workspace = true
|
||||
@ -1,4 +1,12 @@
|
||||
//! This contains the [EngineTypes] trait and implementations for ethereum mainnet types.
|
||||
//! Traits, validation methods, and helper types used to abstract over engine types.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||
)]
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use core::fmt;
|
||||
use reth_primitives::ChainSpec;
|
||||
27
crates/ethereum-engine-primitives/Cargo.toml
Normal file
27
crates/ethereum-engine-primitives/Cargo.toml
Normal file
@ -0,0 +1,27 @@
|
||||
[package]
|
||||
name = "reth-ethereum-engine-primitives"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-primitives.workspace = true
|
||||
reth-engine-primitives.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth-rpc-types-compat.workspace = true
|
||||
revm-primitives.workspace = true
|
||||
alloy-rlp.workspace = true
|
||||
|
||||
# misc
|
||||
serde.workspace = true
|
||||
sha2.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json.workspace = true
|
||||
@ -1,8 +1,20 @@
|
||||
use reth_node_api::{
|
||||
//! Ethereum specifc
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||
)]
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod payload;
|
||||
pub use payload::{EthBuiltPayload, EthPayloadBuilderAttributes};
|
||||
|
||||
use reth_engine_primitives::{
|
||||
validate_version_specific_fields, EngineApiMessageVersion, EngineObjectValidationError,
|
||||
EngineTypes, PayloadOrAttributes,
|
||||
};
|
||||
use reth_payload_builder::{EthBuiltPayload, EthPayloadBuilderAttributes};
|
||||
use reth_primitives::ChainSpec;
|
||||
use reth_rpc_types::{
|
||||
engine::{
|
||||
@ -1,7 +1,7 @@
|
||||
//! Contains types required for building a payload.
|
||||
|
||||
use alloy_rlp::Encodable;
|
||||
use reth_node_api::{BuiltPayload, PayloadBuilderAttributes};
|
||||
use reth_engine_primitives::{BuiltPayload, PayloadBuilderAttributes};
|
||||
use reth_primitives::{
|
||||
constants::EIP1559_INITIAL_BASE_FEE, revm::config::revm_spec_by_timestamp_after_merge, Address,
|
||||
BlobTransactionSidecar, ChainSpec, Hardfork, Header, SealedBlock, Withdrawals, B256, U256,
|
||||
@ -12,12 +12,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-primitives.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth-evm.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-db.workspace = true
|
||||
|
||||
# misc
|
||||
serde.workspace = true
|
||||
thiserror.workspace = true
|
||||
reth-engine-primitives.workspace = true
|
||||
|
||||
@ -9,15 +9,8 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
/// Traits, validation methods, and helper types used to abstract over engine types.
|
||||
///
|
||||
/// Notably contains the [EngineTypes] trait and implementations for ethereum mainnet types.
|
||||
pub mod engine;
|
||||
pub use engine::{
|
||||
validate_payload_timestamp, validate_version_specific_fields, validate_withdrawals_presence,
|
||||
BuiltPayload, EngineApiMessageVersion, EngineObjectValidationError, EngineTypes,
|
||||
MessageValidationKind, PayloadAttributes, PayloadBuilderAttributes, PayloadOrAttributes,
|
||||
VersionSpecificValidationError,
|
||||
};
|
||||
pub use reth_engine_primitives as engine;
|
||||
pub use reth_engine_primitives::*;
|
||||
|
||||
/// Traits and helper types used to abstract over EVM methods and types.
|
||||
pub use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
|
||||
|
||||
@ -12,12 +12,10 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-primitives.workspace = true
|
||||
reth-payload-builder.workspace = true
|
||||
reth-ethereum-engine-primitives.workspace = true
|
||||
reth-basic-payload-builder.workspace = true
|
||||
reth-ethereum-payload-builder.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth-node-api.workspace = true
|
||||
reth-node-builder.workspace = true
|
||||
reth-tracing.workspace = true
|
||||
reth-provider.workspace = true
|
||||
@ -27,7 +25,6 @@ reth-evm-ethereum.workspace = true
|
||||
|
||||
# misc
|
||||
eyre.workspace = true
|
||||
serde.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
reth-db.workspace = true
|
||||
|
||||
@ -8,14 +8,10 @@
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
/// Exports commonly used concrete instances of the [EngineTypes](reth_node_api::EngineTypes)
|
||||
/// trait.
|
||||
pub mod engine;
|
||||
pub use engine::EthEngineTypes;
|
||||
pub use reth_ethereum_engine_primitives::EthEngineTypes;
|
||||
|
||||
/// Exports commonly used concrete instances of the
|
||||
/// [ConfigureEvmEnv](reth_node_api::ConfigureEvmEnv) trait.
|
||||
pub mod evm;
|
||||
pub use evm::EthEvmConfig;
|
||||
|
||||
pub mod node;
|
||||
pub use node::EthereumNode;
|
||||
|
||||
@ -17,13 +17,9 @@ reth-primitives.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth-transaction-pool.workspace = true
|
||||
reth-interfaces.workspace = true
|
||||
reth-rpc-types-compat.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-node-api.workspace = true
|
||||
|
||||
# ethereum
|
||||
alloy-rlp.workspace = true
|
||||
revm-primitives.workspace = true
|
||||
reth-engine-primitives.workspace = true
|
||||
reth-ethereum-engine-primitives.workspace = true
|
||||
|
||||
# async
|
||||
tokio = { workspace = true, features = ["sync"] }
|
||||
@ -36,7 +32,6 @@ metrics.workspace = true
|
||||
|
||||
# misc
|
||||
thiserror.workspace = true
|
||||
sha2.workspace = true
|
||||
tracing.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use futures_util::Stream;
|
||||
use reth_node_api::EngineTypes;
|
||||
use reth_engine_primitives::EngineTypes;
|
||||
use tokio::sync::broadcast;
|
||||
use tokio_stream::{
|
||||
wrappers::{errors::BroadcastStreamRecvError, BroadcastStream},
|
||||
|
||||
@ -105,7 +105,6 @@ pub mod database;
|
||||
pub mod error;
|
||||
mod events;
|
||||
mod metrics;
|
||||
mod payload;
|
||||
mod service;
|
||||
mod traits;
|
||||
|
||||
@ -115,7 +114,10 @@ pub mod noop;
|
||||
pub mod test_utils;
|
||||
|
||||
pub use events::Events;
|
||||
pub use payload::{EthBuiltPayload, EthPayloadBuilderAttributes};
|
||||
pub use reth_rpc_types::engine::PayloadId;
|
||||
pub use service::{PayloadBuilderHandle, PayloadBuilderService, PayloadStore};
|
||||
pub use traits::{KeepPayloadJobAlive, PayloadJob, PayloadJobGenerator};
|
||||
|
||||
// re-export the Ethereum engine primitives for convenience
|
||||
#[doc(inline)]
|
||||
pub use reth_ethereum_engine_primitives::{EthBuiltPayload, EthPayloadBuilderAttributes};
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
use crate::{service::PayloadServiceCommand, PayloadBuilderHandle};
|
||||
use futures_util::{ready, StreamExt};
|
||||
use reth_node_api::{EngineTypes, PayloadBuilderAttributes};
|
||||
use reth_engine_primitives::{EngineTypes, PayloadBuilderAttributes};
|
||||
use std::{
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
|
||||
@ -11,7 +11,7 @@ use crate::{
|
||||
KeepPayloadJobAlive, PayloadJob,
|
||||
};
|
||||
use futures_util::{future::FutureExt, Stream, StreamExt};
|
||||
use reth_node_api::{BuiltPayload, EngineTypes, PayloadBuilderAttributes};
|
||||
use reth_engine_primitives::{BuiltPayload, EngineTypes, PayloadBuilderAttributes};
|
||||
use reth_provider::CanonStateNotification;
|
||||
use reth_rpc_types::engine::PayloadId;
|
||||
use std::{
|
||||
|
||||
@ -5,7 +5,7 @@ use crate::{
|
||||
EthPayloadBuilderAttributes, PayloadBuilderHandle, PayloadBuilderService, PayloadJob,
|
||||
PayloadJobGenerator,
|
||||
};
|
||||
use reth_node_api::EngineTypes;
|
||||
use reth_engine_primitives::EngineTypes;
|
||||
use reth_primitives::{Block, U256};
|
||||
use reth_provider::CanonStateNotification;
|
||||
use std::{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//! Trait abstractions used by the payload crate.
|
||||
|
||||
use crate::error::PayloadBuilderError;
|
||||
use reth_node_api::{BuiltPayload, PayloadBuilderAttributes};
|
||||
use reth_engine_primitives::{BuiltPayload, PayloadBuilderAttributes};
|
||||
use reth_provider::CanonStateNotification;
|
||||
use std::future::Future;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user