-
Notifications
You must be signed in to change notification settings - Fork 111
feat(l1)!: allow setting a target gas limit through CLI #4973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
3874c66
9fb22ce
f87fe21
d294577
510f969
42327cf
97d1a9b
8cea037
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ use std::{ | |
|
|
||
| use clap::{ArgAction, Parser as ClapParser, Subcommand as ClapSubcommand}; | ||
| use ethrex_blockchain::{BlockchainOptions, BlockchainType, error::ChainError}; | ||
| use ethrex_common::types::{Block, Genesis, fee_config::FeeConfig}; | ||
| use ethrex_common::types::{Block, DEFAULT_BUILDER_GAS_CEIL, Genesis, fee_config::FeeConfig}; | ||
| use ethrex_p2p::{ | ||
| discv4::peer_table::TARGET_PEERS, sync::SyncMode, tx_broadcaster::BROADCAST_INTERVAL_MS, | ||
| types::Node, | ||
|
|
@@ -230,6 +230,14 @@ pub struct Options { | |
| help_heading = "Block producer options" | ||
| )] | ||
| pub extra_data: String, | ||
| #[arg( | ||
| long = "block-producer.gas-limit", | ||
| default_value_t = DEFAULT_BUILDER_GAS_CEIL, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this? Isn't the default gas ceil different depending on the fork? I understand if you want to overwrite it but, isnt the default different for each fork? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. The default gas limit is set by each client independently of the network. For example, geth currently has a default of 60M: I think we should bump this default to 60M, but I didn't change that in this PR since it's important enough to merit its own PR and discussion. |
||
| value_name = "GAS_LIMIT", | ||
| help = "Target block gas limit.", | ||
| help_heading = "Block producer options" | ||
| )] | ||
| pub gas_limit: u64, | ||
| } | ||
|
|
||
| impl Options { | ||
|
|
@@ -302,6 +310,7 @@ impl Default for Options { | |
| tx_broadcasting_time_interval: Default::default(), | ||
| target_peers: Default::default(), | ||
| extra_data: get_minimal_client_version(), | ||
| gas_limit: DEFAULT_BUILDER_GAS_CEIL, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,7 @@ pub fn init_blockchain(store: Store, blockchain_opts: BlockchainOptions) -> Arc< | |
| Blockchain::new(store, blockchain_opts).into() | ||
| } | ||
|
|
||
| #[allow(clippy::too_many_arguments)] | ||
| #[expect(clippy::too_many_arguments)] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :agite: |
||
| pub async fn init_rpc_api( | ||
| opts: &Options, | ||
| peer_handler: PeerHandler, | ||
|
|
@@ -141,8 +141,6 @@ pub async fn init_rpc_api( | |
| cancel_token: CancellationToken, | ||
| tracker: TaskTracker, | ||
| log_filter_handler: Option<reload::Handle<EnvFilter, Registry>>, | ||
| gas_ceil: Option<u64>, | ||
| extra_data: String, | ||
| ) { | ||
| init_datadir(&opts.datadir); | ||
|
|
||
|
|
@@ -182,8 +180,8 @@ pub async fn init_rpc_api( | |
| peer_handler, | ||
| get_client_version(), | ||
| log_filter_handler, | ||
| gas_ceil, | ||
| extra_data, | ||
| opts.gas_limit, | ||
| opts.extra_data.clone(), | ||
| ); | ||
|
|
||
| tracker.spawn(rpc_api); | ||
|
|
@@ -463,9 +461,6 @@ pub async fn init_l1( | |
| cancel_token.clone(), | ||
| tracker.clone(), | ||
| log_filter_handler, | ||
| // TODO (#4482): Make this configurable. | ||
| None, | ||
| opts.extra_data.clone(), | ||
| ) | ||
| .await; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.