Skip to content

Commit

Permalink
chore(builder): remove extra data from basic payload generator (#13353)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
rkrasiuk and mattsse authored Dec 12, 2024
1 parent c816a3b commit 124aae1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 29 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/ethereum/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ impl EthereumPayloadBuilder {
let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_bytes());
.max_payload_tasks(conf.max_payload_tasks());

let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(),
Expand Down
4 changes: 1 addition & 3 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,7 @@ where
let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
// no extradata for OP
.extradata(Default::default());
.max_payload_tasks(conf.max_payload_tasks());

let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(),
Expand Down
6 changes: 3 additions & 3 deletions crates/payload/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-transaction-pool.workspace = true
reth-provider.workspace = true
reth-payload-builder.workspace = true
Expand All @@ -25,10 +24,11 @@ reth-tasks.workspace = true
reth-evm.workspace = true
reth-revm.workspace=true

# revm
revm.workspace = true

# ethereum
alloy-rlp.workspace = true
alloy-primitives.workspace = true
revm.workspace = true
alloy-consensus.workspace = true
alloy-eips.workspace = true

Expand Down
14 changes: 1 addition & 13 deletions crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::metrics::PayloadBuilderMetrics;
use alloy_consensus::constants::EMPTY_WITHDRAWALS;
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_util::FutureExt;
use reth_chainspec::EthereumHardforks;
Expand All @@ -20,7 +20,6 @@ use reth_payload_builder::{KeepPayloadJobAlive, PayloadId, PayloadJob, PayloadJo
use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes, PayloadKind};
use reth_primitives::{proofs, SealedHeader};
use reth_primitives_traits::constants::RETH_CLIENT_VERSION;
use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory};
use reth_revm::cached::CachedReads;
use reth_tasks::TaskSpawner;
Expand Down Expand Up @@ -247,8 +246,6 @@ impl PayloadTaskGuard {
/// Settings for the [`BasicPayloadJobGenerator`].
#[derive(Debug, Clone)]
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.
interval: Duration,
/// The deadline for when the payload builder job should resolve.
Expand Down Expand Up @@ -284,20 +281,11 @@ impl BasicPayloadJobGeneratorConfig {
self.max_payload_tasks = max_payload_tasks;
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 {
fn default() -> Self {
Self {
extradata: alloy_rlp::encode(RETH_CLIENT_VERSION.as_bytes()).into(),
interval: Duration::from_secs(1),
// 12s slot time
deadline: SLOT_DURATION,
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-engine-types/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,7 @@ where
let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_bytes());
.max_payload_tasks(conf.max_payload_tasks());

let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(),
Expand Down
6 changes: 2 additions & 4 deletions examples/custom-payload-builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use reth::{
payload::PayloadBuilderHandle,
providers::CanonStateSubscriptions,
transaction_pool::{PoolTransaction, TransactionPool},
version::default_extra_data_bytes,
};
use reth_basic_payload_builder::BasicPayloadJobGeneratorConfig;
use reth_chainspec::ChainSpec;
Expand Down Expand Up @@ -59,8 +58,7 @@ where
let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_bytes());
.max_payload_tasks(conf.max_payload_tasks());

let payload_generator = EmptyBlockPayloadJobGenerator::with_builder(
ctx.provider().clone(),
Expand All @@ -69,7 +67,7 @@ where
payload_job_config,
reth_ethereum_payload_builder::EthereumPayloadBuilder::new(
EthEvmConfig::new(ctx.chain_spec()),
EthereumBuilderConfig::new(default_extra_data_bytes()),
EthereumBuilderConfig::new(conf.extradata_bytes()),
),
);

Expand Down

0 comments on commit 124aae1

Please sign in to comment.