chore(builder): remove extra data from basic payload generator (#13353)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Roman Krasiuk
2024-12-12 20:31:06 +01:00
committed by GitHub
parent c816a3b758
commit 124aae19bf
7 changed files with 10 additions and 30 deletions

2
Cargo.lock generated
View File

@ -6560,7 +6560,6 @@ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-eips", "alloy-eips",
"alloy-primitives", "alloy-primitives",
"alloy-rlp",
"futures-core", "futures-core",
"futures-util", "futures-util",
"metrics", "metrics",
@ -6571,7 +6570,6 @@ dependencies = [
"reth-payload-builder-primitives", "reth-payload-builder-primitives",
"reth-payload-primitives", "reth-payload-primitives",
"reth-primitives", "reth-primitives",
"reth-primitives-traits",
"reth-provider", "reth-provider",
"reth-revm", "reth-revm",
"reth-tasks", "reth-tasks",

View File

@ -262,8 +262,7 @@ impl EthereumPayloadBuilder {
let payload_job_config = BasicPayloadJobGeneratorConfig::default() let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks());
.extradata(conf.extradata_bytes());
let payload_generator = BasicPayloadJobGenerator::with_builder( let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(), ctx.provider().clone(),

View File

@ -545,9 +545,7 @@ where
let payload_job_config = BasicPayloadJobGeneratorConfig::default() let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks());
// no extradata for OP
.extradata(Default::default());
let payload_generator = BasicPayloadJobGenerator::with_builder( let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(), ctx.provider().clone(),

View File

@ -15,7 +15,6 @@ workspace = true
# reth # reth
reth-chainspec.workspace = true reth-chainspec.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-transaction-pool.workspace = true reth-transaction-pool.workspace = true
reth-provider.workspace = true reth-provider.workspace = true
reth-payload-builder.workspace = true reth-payload-builder.workspace = true
@ -25,10 +24,11 @@ reth-tasks.workspace = true
reth-evm.workspace = true reth-evm.workspace = true
reth-revm.workspace=true reth-revm.workspace=true
# ethereum # revm
alloy-rlp.workspace = true
alloy-primitives.workspace = true
revm.workspace = true revm.workspace = true
# ethereum
alloy-primitives.workspace = true
alloy-consensus.workspace = true alloy-consensus.workspace = true
alloy-eips.workspace = true alloy-eips.workspace = true

View File

@ -11,7 +11,7 @@
use crate::metrics::PayloadBuilderMetrics; use crate::metrics::PayloadBuilderMetrics;
use alloy_consensus::constants::EMPTY_WITHDRAWALS; use alloy_consensus::constants::EMPTY_WITHDRAWALS;
use alloy_eips::{eip4895::Withdrawals, merge::SLOT_DURATION}; use alloy_eips::{eip4895::Withdrawals, merge::SLOT_DURATION};
use alloy_primitives::{Bytes, B256, U256}; use alloy_primitives::{B256, U256};
use futures_core::ready; use futures_core::ready;
use futures_util::FutureExt; use futures_util::FutureExt;
use reth_chainspec::EthereumHardforks; use reth_chainspec::EthereumHardforks;
@ -20,7 +20,6 @@ use reth_payload_builder::{KeepPayloadJobAlive, PayloadId, PayloadJob, PayloadJo
use reth_payload_builder_primitives::PayloadBuilderError; use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes, PayloadKind}; use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes, PayloadKind};
use reth_primitives::{proofs, SealedHeader}; use reth_primitives::{proofs, SealedHeader};
use reth_primitives_traits::constants::RETH_CLIENT_VERSION;
use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory}; use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory};
use reth_revm::cached::CachedReads; use reth_revm::cached::CachedReads;
use reth_tasks::TaskSpawner; use reth_tasks::TaskSpawner;
@ -247,8 +246,6 @@ impl PayloadTaskGuard {
/// Settings for the [`BasicPayloadJobGenerator`]. /// Settings for the [`BasicPayloadJobGenerator`].
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct BasicPayloadJobGeneratorConfig { pub struct BasicPayloadJobGeneratorConfig {
/// Data to include in the block's extra data field.
extradata: Bytes,
/// The interval at which the job should build a new payload after the last. /// The interval at which the job should build a new payload after the last.
interval: Duration, interval: Duration,
/// The deadline for when the payload builder job should resolve. /// The deadline for when the payload builder job should resolve.
@ -284,20 +281,11 @@ impl BasicPayloadJobGeneratorConfig {
self.max_payload_tasks = max_payload_tasks; self.max_payload_tasks = max_payload_tasks;
self self
} }
/// Sets the data to include in the block's extra data field.
///
/// Defaults to the current client version: `rlp(RETH_CLIENT_VERSION)`.
pub fn extradata(mut self, extradata: Bytes) -> Self {
self.extradata = extradata;
self
}
} }
impl Default for BasicPayloadJobGeneratorConfig { impl Default for BasicPayloadJobGeneratorConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
extradata: alloy_rlp::encode(RETH_CLIENT_VERSION.as_bytes()).into(),
interval: Duration::from_secs(1), interval: Duration::from_secs(1),
// 12s slot time // 12s slot time
deadline: SLOT_DURATION, deadline: SLOT_DURATION,

View File

@ -363,8 +363,7 @@ where
let payload_job_config = BasicPayloadJobGeneratorConfig::default() let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks());
.extradata(conf.extradata_bytes());
let payload_generator = BasicPayloadJobGenerator::with_builder( let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(), ctx.provider().clone(),

View File

@ -18,7 +18,6 @@ use reth::{
payload::PayloadBuilderHandle, payload::PayloadBuilderHandle,
providers::CanonStateSubscriptions, providers::CanonStateSubscriptions,
transaction_pool::{PoolTransaction, TransactionPool}, transaction_pool::{PoolTransaction, TransactionPool},
version::default_extra_data_bytes,
}; };
use reth_basic_payload_builder::BasicPayloadJobGeneratorConfig; use reth_basic_payload_builder::BasicPayloadJobGeneratorConfig;
use reth_chainspec::ChainSpec; use reth_chainspec::ChainSpec;
@ -59,8 +58,7 @@ where
let payload_job_config = BasicPayloadJobGeneratorConfig::default() let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks());
.extradata(conf.extradata_bytes());
let payload_generator = EmptyBlockPayloadJobGenerator::with_builder( let payload_generator = EmptyBlockPayloadJobGenerator::with_builder(
ctx.provider().clone(), ctx.provider().clone(),
@ -69,7 +67,7 @@ where
payload_job_config, payload_job_config,
reth_ethereum_payload_builder::EthereumPayloadBuilder::new( reth_ethereum_payload_builder::EthereumPayloadBuilder::new(
EthEvmConfig::new(ctx.chain_spec()), EthEvmConfig::new(ctx.chain_spec()),
EthereumBuilderConfig::new(default_extra_data_bytes()), EthereumBuilderConfig::new(conf.extradata_bytes()),
), ),
); );