From 536bea5b203427acdb9db0ac58144580af8511eb Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Thu, 7 Nov 2024 12:35:16 +0100 Subject: [PATCH 1/2] feat(cli)!: remove default chain ID, endpoint URL --- crates/astria-cli/src/lib.rs | 3 --- crates/astria-cli/src/sequencer/account.rs | 6 +----- crates/astria-cli/src/sequencer/balance.rs | 6 +----- crates/astria-cli/src/sequencer/block_height.rs | 12 ++---------- crates/astria-cli/src/sequencer/bridge_account.rs | 6 +----- crates/astria-cli/src/sequencer/bridge_lock.rs | 12 ++---------- .../astria-cli/src/sequencer/bridge_sudo_change.rs | 12 ++---------- crates/astria-cli/src/sequencer/ics20_withdrawal.rs | 12 ++---------- .../astria-cli/src/sequencer/init_bridge_account.rs | 12 ++---------- crates/astria-cli/src/sequencer/submit.rs | 6 +----- crates/astria-cli/src/sequencer/sudo/fee_asset.rs | 12 ++---------- crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs | 12 ++---------- .../astria-cli/src/sequencer/sudo/ibc_sudo_change.rs | 12 ++---------- .../src/sequencer/sudo/sudo_address_change.rs | 12 ++---------- .../src/sequencer/sudo/validator_update.rs | 12 ++---------- crates/astria-cli/src/sequencer/transfer.rs | 12 ++---------- 16 files changed, 26 insertions(+), 133 deletions(-) diff --git a/crates/astria-cli/src/lib.rs b/crates/astria-cli/src/lib.rs index e4d7a90ba8..54153b61e2 100644 --- a/crates/astria-cli/src/lib.rs +++ b/crates/astria-cli/src/lib.rs @@ -15,9 +15,6 @@ use clap::{ }; use color_eyre::eyre; -const DEFAULT_SEQUENCER_RPC: &str = "https://rpc.sequencer.dusk-10.devnet.astria.org"; -const DEFAULT_SEQUENCER_CHAIN_ID: &str = "astria-dusk-10"; - /// Run commands against the Astria network. #[derive(Debug, Parser)] #[command(name = "astria-cli", version, about)] diff --git a/crates/astria-cli/src/sequencer/account.rs b/crates/astria-cli/src/sequencer/account.rs index 269470725f..ea6bd35d44 100644 --- a/crates/astria-cli/src/sequencer/account.rs +++ b/crates/astria-cli/src/sequencer/account.rs @@ -116,11 +116,7 @@ impl Nonce { #[derive(clap::Args, Debug)] struct ArgsInner { /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The address of the Sequencer account address: Address, diff --git a/crates/astria-cli/src/sequencer/balance.rs b/crates/astria-cli/src/sequencer/balance.rs index 2533dcc122..fcb9b4885c 100644 --- a/crates/astria-cli/src/sequencer/balance.rs +++ b/crates/astria-cli/src/sequencer/balance.rs @@ -31,11 +31,7 @@ enum SubCommand { #[derive(clap::Args, Debug)] struct Get { /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The address of the Sequencer account address: Address, diff --git a/crates/astria-cli/src/sequencer/block_height.rs b/crates/astria-cli/src/sequencer/block_height.rs index 6e9f1df628..a52262d48f 100644 --- a/crates/astria-cli/src/sequencer/block_height.rs +++ b/crates/astria-cli/src/sequencer/block_height.rs @@ -30,18 +30,10 @@ enum SubCommand { #[derive(clap::Args, Debug)] struct Get { /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, } diff --git a/crates/astria-cli/src/sequencer/bridge_account.rs b/crates/astria-cli/src/sequencer/bridge_account.rs index 146cd0ad4b..966ef9451c 100644 --- a/crates/astria-cli/src/sequencer/bridge_account.rs +++ b/crates/astria-cli/src/sequencer/bridge_account.rs @@ -30,11 +30,7 @@ enum SubCommand { #[derive(Debug, clap::Args)] struct Get { /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] pub(crate) sequencer_url: String, /// The bridge account address on the Sequencer pub(crate) address: Address, diff --git a/crates/astria-cli/src/sequencer/bridge_lock.rs b/crates/astria-cli/src/sequencer/bridge_lock.rs index 884064a3bd..a629192752 100644 --- a/crates/astria-cli/src/sequencer/bridge_lock.rs +++ b/crates/astria-cli/src/sequencer/bridge_lock.rs @@ -34,18 +34,10 @@ pub(super) struct Command { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The asset to lock. #[arg(long, default_value = "nria")] diff --git a/crates/astria-cli/src/sequencer/bridge_sudo_change.rs b/crates/astria-cli/src/sequencer/bridge_sudo_change.rs index 7c8479b215..de760b8181 100644 --- a/crates/astria-cli/src/sequencer/bridge_sudo_change.rs +++ b/crates/astria-cli/src/sequencer/bridge_sudo_change.rs @@ -39,18 +39,10 @@ pub(crate) struct Command { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] pub(crate) private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] pub(crate) sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] pub(crate) sequencer_chain_id: String, /// The asset to pay the transfer fees with. #[arg(long, default_value = "nria")] diff --git a/crates/astria-cli/src/sequencer/ics20_withdrawal.rs b/crates/astria-cli/src/sequencer/ics20_withdrawal.rs index c1053f9881..68ec8c1d72 100644 --- a/crates/astria-cli/src/sequencer/ics20_withdrawal.rs +++ b/crates/astria-cli/src/sequencer/ics20_withdrawal.rs @@ -67,18 +67,10 @@ pub(super) struct Command { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The asset to withdraw #[arg(long, default_value = "nria")] diff --git a/crates/astria-cli/src/sequencer/init_bridge_account.rs b/crates/astria-cli/src/sequencer/init_bridge_account.rs index 9a7e806d05..41085bc53d 100644 --- a/crates/astria-cli/src/sequencer/init_bridge_account.rs +++ b/crates/astria-cli/src/sequencer/init_bridge_account.rs @@ -22,18 +22,10 @@ pub(super) struct Command { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// Plaintext rollup name (to be hashed into a rollup ID) /// to initialize the bridge account with. diff --git a/crates/astria-cli/src/sequencer/submit.rs b/crates/astria-cli/src/sequencer/submit.rs index 577ef59c23..bb73942482 100644 --- a/crates/astria-cli/src/sequencer/submit.rs +++ b/crates/astria-cli/src/sequencer/submit.rs @@ -17,11 +17,7 @@ use color_eyre::eyre::{ #[derive(clap::Args, Debug)] pub(super) struct Command { /// The URL at which the Sequencer node is listening for ABCI commands. - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The source to read the pbjson formatted astra.protocol.transaction.v1.Transaction (use `-` /// to pass via STDIN). diff --git a/crates/astria-cli/src/sequencer/sudo/fee_asset.rs b/crates/astria-cli/src/sequencer/sudo/fee_asset.rs index dff0b8ddee..dd9a021f19 100644 --- a/crates/astria-cli/src/sequencer/sudo/fee_asset.rs +++ b/crates/astria-cli/src/sequencer/sudo/fee_asset.rs @@ -98,18 +98,10 @@ struct ArgsInner { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// Asset's denomination string #[arg(long)] diff --git a/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs b/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs index 1e3d735899..263bb22597 100644 --- a/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs +++ b/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs @@ -95,18 +95,10 @@ struct ArgsInner { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The address to add or remove as an IBC relayer #[arg(long)] diff --git a/crates/astria-cli/src/sequencer/sudo/ibc_sudo_change.rs b/crates/astria-cli/src/sequencer/sudo/ibc_sudo_change.rs index 67f2abd431..3e4218f33c 100644 --- a/crates/astria-cli/src/sequencer/sudo/ibc_sudo_change.rs +++ b/crates/astria-cli/src/sequencer/sudo/ibc_sudo_change.rs @@ -24,18 +24,10 @@ pub(super) struct Command { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The new address to take over sudo privileges #[arg(long)] diff --git a/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs b/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs index 9591fb5fa7..147dc0afc2 100644 --- a/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs +++ b/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs @@ -24,18 +24,10 @@ pub(super) struct Command { #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The new address to take over sudo privileges #[arg(long)] diff --git a/crates/astria-cli/src/sequencer/sudo/validator_update.rs b/crates/astria-cli/src/sequencer/sudo/validator_update.rs index 869769f4d9..d97d93f7e3 100644 --- a/crates/astria-cli/src/sequencer/sudo/validator_update.rs +++ b/crates/astria-cli/src/sequencer/sudo/validator_update.rs @@ -12,18 +12,10 @@ use crate::utils::submit_transaction; #[derive(clap::Args, Debug)] pub(super) struct Command { /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The bech32m prefix that will be used for constructing addresses using the private key #[arg(long, default_value = "astria")] diff --git a/crates/astria-cli/src/sequencer/transfer.rs b/crates/astria-cli/src/sequencer/transfer.rs index 885a9a4e2f..b80c46812f 100644 --- a/crates/astria-cli/src/sequencer/transfer.rs +++ b/crates/astria-cli/src/sequencer/transfer.rs @@ -33,18 +33,10 @@ pub(super) struct Command { // that overwrite the key on drop and don't reveal it when printing. private_key: String, /// The url of the Sequencer node - #[arg( - long, - env = "SEQUENCER_URL", - default_value = crate::DEFAULT_SEQUENCER_RPC - )] + #[arg(long, env = "SEQUENCER_URL")] sequencer_url: String, /// The chain id of the sequencing chain being used - #[arg( - long = "sequencer.chain-id", - env = "ROLLUP_SEQUENCER_CHAIN_ID", - default_value = crate::DEFAULT_SEQUENCER_CHAIN_ID - )] + #[arg(long = "sequencer.chain-id", env = "ROLLUP_SEQUENCER_CHAIN_ID")] sequencer_chain_id: String, /// The asset to transer. #[arg(long, default_value = "nria")] From 5a56f75f14e64e55774955e71b57c934e5d2367c Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Thu, 7 Nov 2024 12:44:56 +0100 Subject: [PATCH 2/2] update changelog --- crates/astria-cli/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/astria-cli/CHANGELOG.md b/crates/astria-cli/CHANGELOG.md index 09bc9674b2..e9fe5d2222 100644 --- a/crates/astria-cli/CHANGELOG.md +++ b/crates/astria-cli/CHANGELOG.md @@ -14,6 +14,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed ICS20 withdrawal source when using channel with more than one port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768) +### Changed + +- Removed default values from `--sequencer.chain-id` and `--sequencer-url` arguments + [#1792](https://github.com/astriaorg/astria/pull/1792) + ## [0.5.1] - 2024-10-23 ### Added