Skip to content

Commit

Permalink
fix(comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trantorian1 committed Jan 8, 2025
1 parent c8d8c67 commit 74f43cd
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
51 changes: 51 additions & 0 deletions crates/madara/node/src/cli/chain_config_overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,57 @@ pub struct ChainConfigOverrideParams {
///
/// Use the following syntax:
/// --chain-config-override=block_time=30s,pending_block_update_time=2s...
///
/// Parameters:
///
/// * chain_name: the name of the chain.
///
/// * chain_id: unique identifier for the chain, for example 'SN_MAIN'.
///
/// * feeder_gateway_url: default fgw for this chain.
///
/// * gateway url: default gw for this chain.
///
/// * native_fee_token_address: on-chain address of this chain's native
/// token
///
/// * parent_fee_token_address: on-chain address of the native token of
/// this chain's settlement layer.
///
/// * latest_protocol_version: latest version of the chain, update on new
/// method release, consensus change, etc...
///
/// * block_time: time it takes to close a block.
///
/// * pending_block_update_time: time interval at which the pending block
/// is updated. This is also referred to internally as a 'tick'. The
/// block update time should always be inferior to the block time.
///
/// * execution_batch_size: number of transaction to process in a single
/// tick.
///
/// * bouncer_config: execution limits per block. This has to be
/// yaml-encoded following the format in yaml chain config files.
///
/// * sequencer_address: the address of this chain's sequencer.
///
/// * eth_core_contract_address: address of the core contract on the
/// settlement layer.
///
/// * eth_gps_statement_verifier: address of the verifier contract on the
/// settlement layer.
///
/// * private_key: private key used by the node in sequencer mode to sign
/// the blocks it provides. This is zeroed.
///
/// * mempool_tx_limit: max number of transactions allowed in the mempool
/// in sequencer mode.
///
/// * mempool_declare_tx_limit: max number of declare transactions allowed
/// in sequencer mode.
///
/// * mempool_tx_max_age: max age of transactions in the mempool.
/// Transactions which are too old will be removed.
#[clap(env = "MADARA_CHAIN_CONFIG_OVERRIDE", long = "chain-config-override", value_parser = parse_key_value_yaml, use_value_delimiter = true, value_delimiter = ',')]
pub overrides: Vec<(String, Value)>,
}
Expand Down
1 change: 1 addition & 0 deletions crates/madara/node/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ pub struct RunCmd {
#[clap(env = "MADARA_PRESET", long, value_name = "PRESET NAME", group = "chain_config")]
pub preset: Option<ChainPreset>,

/// Overrides parameters from the Chain Config.
#[allow(missing_docs)]
#[clap(flatten)]
pub chain_config_override: ChainConfigOverrideParams,
Expand Down
3 changes: 1 addition & 2 deletions crates/madara/node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ async fn main() -> anyhow::Result<()> {
// If block time is inferior to the tick time, then only empty blocks will
// be produced as we will never update the pending block before storing it.
if run_cmd.is_sequencer() && chain_config.block_time < chain_config.pending_block_update_time {
tracing::error!(
anyhow::bail!(
"Block time ({}s) cannot be less than the pending block update time ({}s), as this will yield only empty blocks",
chain_config.block_time.as_secs(),
chain_config.pending_block_update_time.as_secs()
);
anyhow::bail!("Block time");
}

// Check if the devnet is running with the correct chain id.
Expand Down

0 comments on commit 74f43cd

Please sign in to comment.