mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-02 19:15:12 -05:00
chore: add version to PayloadBuilderAttributes::try_new (#12137)
This commit is contained in:
@@ -1165,7 +1165,7 @@ where
|
||||
attrs: <N::Engine as PayloadTypes>::PayloadAttributes,
|
||||
head: Header,
|
||||
state: ForkchoiceState,
|
||||
_version: EngineApiMessageVersion,
|
||||
version: EngineApiMessageVersion,
|
||||
) -> OnForkChoiceUpdated {
|
||||
// 7. Client software MUST ensure that payloadAttributes.timestamp is greater than timestamp
|
||||
// of a block referenced by forkchoiceState.headBlockHash. If this condition isn't held
|
||||
@@ -1183,6 +1183,7 @@ where
|
||||
match <<N:: Engine as PayloadTypes>::PayloadBuilderAttributes as PayloadBuilderAttributes>::try_new(
|
||||
state.head_block_hash,
|
||||
attrs,
|
||||
version as u8
|
||||
) {
|
||||
Ok(attributes) => {
|
||||
// send the payload to the builder and return the receiver for the pending payload
|
||||
|
||||
@@ -2492,7 +2492,7 @@ where
|
||||
attrs: T::PayloadAttributes,
|
||||
head: &Header,
|
||||
state: ForkchoiceState,
|
||||
_version: EngineApiMessageVersion,
|
||||
version: EngineApiMessageVersion,
|
||||
) -> OnForkChoiceUpdated {
|
||||
// 7. Client software MUST ensure that payloadAttributes.timestamp is greater than timestamp
|
||||
// of a block referenced by forkchoiceState.headBlockHash. If this condition isn't held
|
||||
@@ -2510,6 +2510,7 @@ where
|
||||
match <T::PayloadBuilderAttributes as PayloadBuilderAttributes>::try_new(
|
||||
state.head_block_hash,
|
||||
attrs,
|
||||
version as u8,
|
||||
) {
|
||||
Ok(attributes) => {
|
||||
// send the payload to the builder and return the receiver for the pending payload
|
||||
|
||||
@@ -237,7 +237,11 @@ impl PayloadBuilderAttributes for EthPayloadBuilderAttributes {
|
||||
/// Creates a new payload builder for the given parent block and the attributes.
|
||||
///
|
||||
/// Derives the unique [`PayloadId`] for the given parent and attributes
|
||||
fn try_new(parent: B256, attributes: PayloadAttributes) -> Result<Self, Infallible> {
|
||||
fn try_new(
|
||||
parent: B256,
|
||||
attributes: PayloadAttributes,
|
||||
_version: u8,
|
||||
) -> Result<Self, Infallible> {
|
||||
Ok(Self::new(parent, attributes))
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,11 @@ impl PayloadBuilderAttributes for OptimismPayloadBuilderAttributes {
|
||||
/// Creates a new payload builder for the given parent block and the attributes.
|
||||
///
|
||||
/// Derives the unique [`PayloadId`] for the given parent and attributes
|
||||
fn try_new(parent: B256, attributes: OpPayloadAttributes) -> Result<Self, Self::Error> {
|
||||
fn try_new(
|
||||
parent: B256,
|
||||
attributes: OpPayloadAttributes,
|
||||
_version: u8,
|
||||
) -> Result<Self, Self::Error> {
|
||||
let id = payload_id_optimism(&parent, &attributes);
|
||||
|
||||
let transactions = attributes
|
||||
|
||||
@@ -88,6 +88,7 @@ pub trait PayloadBuilderAttributes: Send + Sync + std::fmt::Debug {
|
||||
fn try_new(
|
||||
parent: B256,
|
||||
rpc_payload_attributes: Self::RpcPayloadAttributes,
|
||||
version: u8,
|
||||
) -> Result<Self, Self::Error>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
Reference in New Issue
Block a user