fix(builder): desired block gas limit (#13351)

This commit is contained in:
Roman Krasiuk
2024-12-12 17:29:33 +01:00
committed by GitHub
parent 6ff2510ad9
commit e9577729f8
19 changed files with 66 additions and 50 deletions

View File

@ -16,9 +16,9 @@ pub struct PayloadBuilderArgs {
#[arg(long = "builder.extradata", value_parser = ExtradataValueParser::default(), default_value_t = default_extra_data())]
pub extradata: String,
/// Target gas ceiling for built blocks.
#[arg(long = "builder.gaslimit", default_value = "30000000", value_name = "GAS_LIMIT")]
pub max_gas_limit: u64,
/// Target gas limit for built blocks.
#[arg(long = "builder.gaslimit", default_value_t = ETHEREUM_BLOCK_GAS_LIMIT, value_name = "GAS_LIMIT")]
pub gas_limit: u64,
/// The interval at which the job should build a new payload after the last.
///
@ -41,7 +41,7 @@ impl Default for PayloadBuilderArgs {
fn default() -> Self {
Self {
extradata: default_extra_data(),
max_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
interval: Duration::from_secs(1),
deadline: SLOT_DURATION,
max_payload_tasks: 3,
@ -62,8 +62,8 @@ impl PayloadBuilderConfig for PayloadBuilderArgs {
self.deadline
}
fn max_gas_limit(&self) -> u64 {
self.max_gas_limit
fn gas_limit(&self) -> u64 {
self.gas_limit
}
fn max_payload_tasks(&self) -> usize {
@ -129,7 +129,7 @@ mod tests {
}
#[test]
fn test_default_extradata() {
fn test_default_extra_data() {
let extradata = default_extra_data();
let args = CommandParser::<PayloadBuilderArgs>::parse_from([
"reth",

View File

@ -52,7 +52,7 @@ pub struct TxPoolArgs {
/// The default enforced gas limit for transactions entering the pool
#[arg(long = "txpool.gas-limit", default_value_t = ETHEREUM_BLOCK_GAS_LIMIT)]
pub gas_limit: u64,
pub enforced_gas_limit: u64,
/// Price bump percentage to replace an already existing blob transaction
#[arg(long = "blobpool.pricebump", default_value_t = REPLACE_BLOB_PRICE_BUMP)]
@ -105,7 +105,7 @@ impl Default for TxPoolArgs {
max_account_slots: TXPOOL_MAX_ACCOUNT_SLOTS_PER_SENDER,
price_bump: DEFAULT_PRICE_BUMP,
minimal_protocol_basefee: MIN_PROTOCOL_BASE_FEE,
gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
enforced_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
blob_transaction_price_bump: REPLACE_BLOB_PRICE_BUMP,
max_tx_input_bytes: DEFAULT_MAX_TX_INPUT_BYTES,
max_cached_entries: DEFAULT_MAX_CACHED_BLOBS,
@ -151,7 +151,7 @@ impl RethTransactionPoolConfig for TxPoolArgs {
replace_blob_tx_price_bump: self.blob_transaction_price_bump,
},
minimal_protocol_basefee: self.minimal_protocol_basefee,
gas_limit: self.gas_limit,
gas_limit: self.enforced_gas_limit,
pending_tx_listener_buffer_size: self.pending_tx_listener_buffer_size,
new_tx_listener_buffer_size: self.new_tx_listener_buffer_size,
max_new_pending_txs_notifications: self.max_new_pending_txs_notifications,

View File

@ -24,8 +24,8 @@ pub trait PayloadBuilderConfig {
/// The deadline for when the payload builder job should resolve.
fn deadline(&self) -> Duration;
/// Target gas ceiling for built blocks.
fn max_gas_limit(&self) -> u64;
/// Target gas limit for built blocks.
fn gas_limit(&self) -> u64;
/// Maximum number of tasks to spawn for building a payload.
fn max_payload_tasks(&self) -> usize;