From f8f40a361f5253b7946e66f7a3739a010007af42 Mon Sep 17 00:00:00 2001 From: antiyro Date: Tue, 15 Oct 2024 11:40:04 +0100 Subject: [PATCH 1/2] cleared gas price on devnet --- crates/node/src/cli/mod.rs | 4 ++++ crates/node/src/main.rs | 1 + crates/node/src/service/l1.rs | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/node/src/cli/mod.rs b/crates/node/src/cli/mod.rs index 28f311b75..e162e03f8 100644 --- a/crates/node/src/cli/mod.rs +++ b/crates/node/src/cli/mod.rs @@ -179,6 +179,10 @@ impl RunCmd { pub fn is_sequencer(&self) -> bool { self.sequencer || self.devnet } + + pub fn is_devnet(&self) -> bool { + self.devnet + } } /// Starknet network types. diff --git a/crates/node/src/main.rs b/crates/node/src/main.rs index 1ac683512..c4d5cc4b4 100644 --- a/crates/node/src/main.rs +++ b/crates/node/src/main.rs @@ -109,6 +109,7 @@ async fn main() -> anyhow::Result<()> { chain_config.chain_id.clone(), chain_config.eth_core_contract_address, run_cmd.is_sequencer(), + run_cmd.is_devnet(), ) .await .context("Initializing the l1 sync service")?; diff --git a/crates/node/src/service/l1.rs b/crates/node/src/service/l1.rs index 6b09bb416..32ef0da4c 100644 --- a/crates/node/src/service/l1.rs +++ b/crates/node/src/service/l1.rs @@ -32,8 +32,9 @@ impl L1SyncService { chain_id: ChainId, l1_core_address: H160, authority: bool, + devnet: bool, ) -> anyhow::Result { - let eth_client = if !config.sync_l1_disabled { + let eth_client = if !config.sync_l1_disabled && (config.l1_endpoint.is_some() || !devnet) { if let Some(l1_rpc_url) = &config.l1_endpoint { let core_address = Address::from_slice(l1_core_address.as_bytes()); let l1_block_metrics = @@ -54,7 +55,7 @@ impl L1SyncService { // Note: gas price should be synced in case the madara is running in sequencer mode, // we haven't set any fix price for the gas, hence gas price should be none - let gas_price_sync_enabled = authority && (config.gas_price.is_none() || config.blob_gas_price.is_none()); + let gas_price_sync_enabled = authority && !devnet && (config.gas_price.is_none() || config.blob_gas_price.is_none()); let gas_price_poll = config.gas_price_poll; if gas_price_sync_enabled { From 8ea9454ca4967cc6d46fe8bd2e29e3412d662460 Mon Sep 17 00:00:00 2001 From: antiyro Date: Tue, 15 Oct 2024 11:49:34 +0100 Subject: [PATCH 2/2] cleaned for ci --- CHANGELOG.md | 1 + crates/node/src/service/l1.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cefb4cf1b..f4d18fd6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next release +- fix(cli): fixed devnet cli arguments - feat: gas fee flag added - fix(mempool): fixed proptesting of the inner mempool - fix(clippy): disallow printlns in workspace diff --git a/crates/node/src/service/l1.rs b/crates/node/src/service/l1.rs index 32ef0da4c..ce5139888 100644 --- a/crates/node/src/service/l1.rs +++ b/crates/node/src/service/l1.rs @@ -24,6 +24,7 @@ pub struct L1SyncService { } impl L1SyncService { + #[allow(clippy::too_many_arguments)] pub async fn new( config: &L1SyncParams, db: &DatabaseService, @@ -55,7 +56,8 @@ impl L1SyncService { // Note: gas price should be synced in case the madara is running in sequencer mode, // we haven't set any fix price for the gas, hence gas price should be none - let gas_price_sync_enabled = authority && !devnet && (config.gas_price.is_none() || config.blob_gas_price.is_none()); + let gas_price_sync_enabled = + authority && !devnet && (config.gas_price.is_none() || config.blob_gas_price.is_none()); let gas_price_poll = config.gas_price_poll; if gas_price_sync_enabled {