mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add version to PayloadBuilderAttributes::try_new (#12137)
This commit is contained in:
@ -22,7 +22,9 @@ use reth_errors::RethResult;
|
||||
use reth_evm::execute::{BlockExecutorProvider, Executor};
|
||||
use reth_execution_types::ExecutionOutcome;
|
||||
use reth_fs_util as fs;
|
||||
use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine, PayloadBuilderAttributes};
|
||||
use reth_node_api::{
|
||||
EngineApiMessageVersion, NodeTypesWithDB, NodeTypesWithEngine, PayloadBuilderAttributes,
|
||||
};
|
||||
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
|
||||
use reth_payload_builder::database::CachedReads;
|
||||
use reth_primitives::{
|
||||
@ -227,6 +229,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||
reth_payload_builder::EthPayloadBuilderAttributes::try_new(
|
||||
best_block.hash(),
|
||||
payload_attrs,
|
||||
EngineApiMessageVersion::default() as u8,
|
||||
)?,
|
||||
);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -110,7 +110,11 @@ impl PayloadBuilderAttributes for CustomPayloadBuilderAttributes {
|
||||
type RpcPayloadAttributes = CustomPayloadAttributes;
|
||||
type Error = Infallible;
|
||||
|
||||
fn try_new(parent: B256, attributes: CustomPayloadAttributes) -> Result<Self, Infallible> {
|
||||
fn try_new(
|
||||
parent: B256,
|
||||
attributes: CustomPayloadAttributes,
|
||||
_version: u8,
|
||||
) -> Result<Self, Infallible> {
|
||||
Ok(Self(EthPayloadBuilderAttributes::new(parent, attributes.inner)))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user