Skip to content

Commit 955cdc2

Browse files
committed
feat: set builder.gaslimit default value
1 parent c9ae0bb commit 955cdc2

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

crates/node/core/src/args/payload_builder.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{cli::config::PayloadBuilderConfig, version::default_extra_data};
22
use alloy_consensus::constants::MAXIMUM_EXTRA_DATA_SIZE;
3-
use alloy_eips::merge::SLOT_DURATION;
3+
use alloy_eips::{eip1559::ETHEREUM_BLOCK_GAS_LIMIT_36M, merge::SLOT_DURATION};
44
use clap::{
55
builder::{RangedU64ValueParser, TypedValueParser},
66
Arg, Args, Command,
@@ -17,8 +17,12 @@ pub struct PayloadBuilderArgs {
1717
pub extra_data: String,
1818

1919
/// Target gas limit for built blocks.
20-
#[arg(long = "builder.gaslimit", value_name = "GAS_LIMIT")]
21-
pub gas_limit: Option<u64>,
20+
#[arg(
21+
long = "builder.gaslimit",
22+
value_name = "GAS_LIMIT",
23+
default_value_t = ETHEREUM_BLOCK_GAS_LIMIT_36M
24+
)]
25+
pub gas_limit: u64,
2226

2327
/// The interval at which the job should build a new payload after the last.
2428
///
@@ -42,7 +46,7 @@ impl Default for PayloadBuilderArgs {
4246
Self {
4347
extra_data: default_extra_data(),
4448
interval: Duration::from_secs(1),
45-
gas_limit: None,
49+
gas_limit: ETHEREUM_BLOCK_GAS_LIMIT_36M,
4650
deadline: SLOT_DURATION,
4751
max_payload_tasks: 3,
4852
}
@@ -63,7 +67,7 @@ impl PayloadBuilderConfig for PayloadBuilderArgs {
6367
}
6468

6569
fn gas_limit(&self) -> Option<u64> {
66-
self.gas_limit
70+
Some(self.gas_limit)
6771
}
6872

6973
fn max_payload_tasks(&self) -> usize {

0 commit comments

Comments
 (0)