mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: make payload builder generic over attributes type (#5948)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
21
crates/node-builder/Cargo.toml
Normal file
21
crates/node-builder/Cargo.toml
Normal file
@@ -0,0 +1,21 @@
|
||||
[package]
|
||||
name = "reth-node-builder"
|
||||
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-payload-builder.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth-node-api.workspace = true
|
||||
|
||||
# io
|
||||
serde.workspace = true
|
||||
23
crates/node-builder/src/engine.rs
Normal file
23
crates/node-builder/src/engine.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use reth_node_api::EngineTypes;
|
||||
use reth_payload_builder::{EthPayloadBuilderAttributes, OptimismPayloadBuilderAttributes};
|
||||
use reth_rpc_types::engine::{OptimismPayloadAttributes, PayloadAttributes};
|
||||
|
||||
/// The types used in the default mainnet ethereum beacon consensus engine.
|
||||
#[derive(Debug, Default, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct EthEngineTypes;
|
||||
|
||||
impl EngineTypes for EthEngineTypes {
|
||||
type PayloadAttributes = PayloadAttributes;
|
||||
type PayloadBuilderAttributes = EthPayloadBuilderAttributes;
|
||||
}
|
||||
|
||||
/// The types used in the optimism beacon consensus engine.
|
||||
#[derive(Debug, Default, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct OptimismEngineTypes;
|
||||
|
||||
impl EngineTypes for OptimismEngineTypes {
|
||||
type PayloadAttributes = OptimismPayloadAttributes;
|
||||
type PayloadBuilderAttributes = OptimismPayloadBuilderAttributes;
|
||||
}
|
||||
13
crates/node-builder/src/lib.rs
Normal file
13
crates/node-builder/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
//! Standalone crate for Reth configuration and builder 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(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, OptimismEngineTypes};
|
||||
Reference in New Issue
Block a user