feat: remove field ``max_gas_limit` from `BasicPayloadJobGeneratorConfig`` (#7949)

This commit is contained in:
Rupam Dey
2024-05-03 00:02:36 +05:30
committed by GitHub
parent 9eb7d961d7
commit e90dc44be9
5 changed files with 5 additions and 20 deletions

View File

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

View File

@ -224,8 +224,7 @@ where
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
// no extradata for OP
.extradata(Default::default())
.max_gas_limit(conf.max_gas_limit());
.extradata(Default::default());
let payload_generator = BasicPayloadJobGenerator::with_builder(
ctx.provider().clone(),

View File

@ -18,7 +18,7 @@ use reth_payload_builder::{
PayloadJobGenerator,
};
use reth_primitives::{
constants::{EMPTY_WITHDRAWALS, ETHEREUM_BLOCK_GAS_LIMIT, RETH_CLIENT_VERSION, SLOT_DURATION},
constants::{EMPTY_WITHDRAWALS, RETH_CLIENT_VERSION, SLOT_DURATION},
proofs, BlockNumberOrTag, Bytes, ChainSpec, SealedBlock, Withdrawals, B256, U256,
};
use reth_provider::{
@ -251,8 +251,6 @@ impl PayloadTaskGuard {
pub struct BasicPayloadJobGeneratorConfig {
/// Data to include in the block's extra data field.
extradata: Bytes,
/// Target gas ceiling for built blocks, defaults to [ETHEREUM_BLOCK_GAS_LIMIT] gas.
max_gas_limit: u64,
/// 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.
@ -296,21 +294,12 @@ impl BasicPayloadJobGeneratorConfig {
self.extradata = extradata;
self
}
/// Sets the target gas ceiling for mined blocks.
///
/// Defaults to [ETHEREUM_BLOCK_GAS_LIMIT] gas.
pub fn max_gas_limit(mut self, max_gas_limit: u64) -> Self {
self.max_gas_limit = max_gas_limit;
self
}
}
impl Default for BasicPayloadJobGeneratorConfig {
fn default() -> Self {
Self {
extradata: alloy_rlp::encode(RETH_CLIENT_VERSION.as_bytes()).into(),
max_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
interval: Duration::from_secs(1),
// 12s slot time
deadline: SLOT_DURATION,

View File

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

View File

@ -47,8 +47,7 @@ where
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit());
.extradata(conf.extradata_bytes());
let payload_generator = EmptyBlockPayloadJobGenerator::with_builder(
ctx.provider().clone(),