Skip to content
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

fix(cli): fixed devnet cli arguments #344

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- fix(cli): fixed devnet cli arguments
- fix(db): max rocksdb LOG files count and size and add more memory metrics
- fix(devnet): devnet predeployed contracts stable address across systems
- feat: gas fee flag added
Expand Down
4 changes: 4 additions & 0 deletions crates/node/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions crates/node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
Expand Down
7 changes: 5 additions & 2 deletions crates/node/src/service/l1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct L1SyncService {
}

impl L1SyncService {
#[allow(clippy::too_many_arguments)]
pub async fn new(
config: &L1SyncParams,
db: &DatabaseService,
Expand All @@ -32,8 +33,9 @@ impl L1SyncService {
chain_id: ChainId,
l1_core_address: H160,
authority: bool,
devnet: bool,
) -> anyhow::Result<Self> {
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 =
Expand All @@ -54,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 && (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 {
Expand Down
Loading