chore: relax PayloadBuilderService bound (#13456)

This commit is contained in:
Arsenii Kulikov
2024-12-19 16:58:07 +02:00
committed by GitHub
parent b271f0cc6d
commit 058cfe2f98
5 changed files with 15 additions and 9 deletions

View File

@ -14,6 +14,7 @@ workspace = true
[dependencies]
# reth
reth-primitives = { workspace = true, optional = true }
reth-primitives-traits.workspace = true
reth-chain-state.workspace = true
reth-payload-builder-primitives.workspace = true
reth-payload-primitives.workspace = true
@ -44,8 +45,9 @@ alloy-consensus.workspace = true
[features]
test-utils = [
"alloy-primitives",
"reth-chain-state/test-utils",
"reth-primitives/test-utils",
"revm/test-utils",
"alloy-primitives",
"reth-chain-state/test-utils",
"reth-primitives/test-utils",
"revm/test-utils",
"reth-primitives-traits/test-utils"
]

View File

@ -14,6 +14,7 @@ use reth_payload_builder_primitives::{
Events, PayloadBuilder, PayloadBuilderError, PayloadEvents, PayloadStoreExt,
};
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes, PayloadKind, PayloadTypes};
use reth_primitives_traits::NodePrimitives;
use std::{
fmt,
future::Future,
@ -352,12 +353,13 @@ where
}
}
impl<Gen, St, T> Future for PayloadBuilderService<Gen, St, T>
impl<Gen, St, T, N> Future for PayloadBuilderService<Gen, St, T>
where
T: PayloadTypes,
N: NodePrimitives,
Gen: PayloadJobGenerator + Unpin + 'static,
<Gen as PayloadJobGenerator>::Job: Unpin + 'static,
St: Stream<Item = CanonStateNotification> + Send + Unpin + 'static,
St: Stream<Item = CanonStateNotification<N>> + Send + Unpin + 'static,
Gen::Job: PayloadJob<PayloadAttributes = T::PayloadBuilderAttributes>,
<Gen::Job as PayloadJob>::BuiltPayload: Into<T::BuiltPayload>,
{

View File

@ -3,6 +3,7 @@
use reth_chain_state::CanonStateNotification;
use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes, PayloadKind};
use reth_primitives_traits::NodePrimitives;
use std::future::Future;
/// A type that can build a payload.
@ -105,7 +106,7 @@ pub trait PayloadJobGenerator: Send + Sync {
///
/// This is intended for any logic that needs to be run when the chain state changes or used to
/// use the in memory state for the head block.
fn on_new_state(&mut self, new_state: CanonStateNotification) {
fn on_new_state<N: NodePrimitives>(&mut self, new_state: CanonStateNotification<N>) {
let _ = new_state;
}
}