From d6de4f40ddce339c760c95e2bf4b8aceb571af7f Mon Sep 17 00:00:00 2001 From: Daniyar Itegulov Date: Mon, 21 Oct 2024 22:17:08 +1100 Subject: [PATCH 01/21] feat(external-node): save protocol version before opening a batch (#3136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Moved protocol version fetching a bit earlier in the flow for EN so that it is present by the time we insert the corresponding unsealed batch. ## Why ❔ Persisted unsealed batches now uniformly have protocol version present in them (both main and external nodes). ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- core/lib/dal/src/protocol_versions_dal.rs | 41 ++++- core/node/node_sync/src/external_io.rs | 211 +++++++++++++++++----- 2 files changed, 201 insertions(+), 51 deletions(-) diff --git a/core/lib/dal/src/protocol_versions_dal.rs b/core/lib/dal/src/protocol_versions_dal.rs index 3382d8c836e..fcc756e3006 100644 --- a/core/lib/dal/src/protocol_versions_dal.rs +++ b/core/lib/dal/src/protocol_versions_dal.rs @@ -190,6 +190,43 @@ impl ProtocolVersionsDal<'_, '_> { ProtocolVersionId::try_from(row.id as u16).map_err(|err| sqlx::Error::Decode(err.into())) } + /// Returns base system contracts' hashes. Prefer `load_base_system_contracts_by_version_id` if + /// you also want to load the contracts themselves AND expect the contracts to be in the DB + /// already. + pub async fn get_base_system_contract_hashes_by_version_id( + &mut self, + version_id: u16, + ) -> anyhow::Result> { + let row = sqlx::query!( + r#" + SELECT + bootloader_code_hash, + default_account_code_hash, + evm_emulator_code_hash + FROM + protocol_versions + WHERE + id = $1 + "#, + i32::from(version_id) + ) + .instrument("get_base_system_contract_hashes_by_version_id") + .with_arg("version_id", &version_id) + .fetch_optional(self.storage) + .await + .context("cannot fetch system contract hashes")?; + + Ok(if let Some(row) = row { + Some(BaseSystemContractsHashes { + bootloader: H256::from_slice(&row.bootloader_code_hash), + default_aa: H256::from_slice(&row.default_account_code_hash), + evm_emulator: row.evm_emulator_code_hash.as_deref().map(H256::from_slice), + }) + } else { + None + }) + } + pub async fn load_base_system_contracts_by_version_id( &mut self, version_id: u16, @@ -207,7 +244,9 @@ impl ProtocolVersionsDal<'_, '_> { "#, i32::from(version_id) ) - .fetch_optional(self.storage.conn()) + .instrument("load_base_system_contracts_by_version_id") + .with_arg("version_id", &version_id) + .fetch_optional(self.storage) .await .context("cannot fetch system contract hashes")?; diff --git a/core/node/node_sync/src/external_io.rs b/core/node/node_sync/src/external_io.rs index 5e3a5ce9f46..a0be233a002 100644 --- a/core/node/node_sync/src/external_io.rs +++ b/core/node/node_sync/src/external_io.rs @@ -104,6 +104,63 @@ impl ExternalIO { } }) } + + async fn ensure_protocol_version_is_saved( + &self, + protocol_version: ProtocolVersionId, + ) -> anyhow::Result<()> { + let base_system_contract_hashes = self + .pool + .connection_tagged("sync_layer") + .await? + .protocol_versions_dal() + .get_base_system_contract_hashes_by_version_id(protocol_version as u16) + .await?; + if base_system_contract_hashes.is_some() { + return Ok(()); + } + tracing::info!("Fetching protocol version {protocol_version:?} from the main node"); + + let protocol_version = self + .main_node_client + .fetch_protocol_version(protocol_version) + .await + .context("failed to fetch protocol version from the main node")? + .context("protocol version is missing on the main node")?; + let minor = protocol_version + .minor_version() + .context("Missing minor protocol version")?; + let bootloader_code_hash = protocol_version + .bootloader_code_hash() + .context("Missing bootloader code hash")?; + let default_account_code_hash = protocol_version + .default_account_code_hash() + .context("Missing default account code hash")?; + let evm_emulator_code_hash = protocol_version.evm_emulator_code_hash(); + let l2_system_upgrade_tx_hash = protocol_version.l2_system_upgrade_tx_hash(); + self.pool + .connection_tagged("sync_layer") + .await? + .protocol_versions_dal() + .save_protocol_version( + ProtocolSemanticVersion { + minor: minor + .try_into() + .context("cannot convert protocol version")?, + patch: VersionPatch(0), + }, + protocol_version.timestamp, + Default::default(), // verification keys are unused for EN + BaseSystemContractsHashes { + bootloader: bootloader_code_hash, + default_aa: default_account_code_hash, + evm_emulator: evm_emulator_code_hash, + }, + l2_system_upgrade_tx_hash, + ) + .await?; + Ok(()) + } } impl IoSealCriteria for ExternalIO { @@ -254,6 +311,8 @@ impl StateKeeperIO for ExternalIO { cursor.next_l2_block ); + self.ensure_protocol_version_is_saved(params.protocol_version) + .await?; self.pool .connection_tagged("sync_layer") .await? @@ -261,7 +320,7 @@ impl StateKeeperIO for ExternalIO { .insert_l1_batch(UnsealedL1BatchHeader { number: cursor.l1_batch, timestamp: params.first_l2_block.timestamp, - protocol_version: None, + protocol_version: Some(params.protocol_version), fee_address: params.operator_address, fee_input: params.fee_input, }) @@ -351,63 +410,21 @@ impl StateKeeperIO for ExternalIO { .connection_tagged("sync_layer") .await? .protocol_versions_dal() - .load_base_system_contracts_by_version_id(protocol_version as u16) - .await - .context("failed loading base system contracts")?; - - if let Some(contracts) = base_system_contracts { - return Ok(contracts); - } - tracing::info!("Fetching protocol version {protocol_version:?} from the main node"); - - let protocol_version = self - .main_node_client - .fetch_protocol_version(protocol_version) - .await - .context("failed to fetch protocol version from the main node")? - .context("protocol version is missing on the main node")?; - let minor = protocol_version - .minor_version() - .context("Missing minor protocol version")?; - let bootloader_code_hash = protocol_version - .bootloader_code_hash() - .context("Missing bootloader code hash")?; - let default_account_code_hash = protocol_version - .default_account_code_hash() - .context("Missing default account code hash")?; - let evm_emulator_code_hash = protocol_version.evm_emulator_code_hash(); - let l2_system_upgrade_tx_hash = protocol_version.l2_system_upgrade_tx_hash(); - self.pool - .connection_tagged("sync_layer") + .get_base_system_contract_hashes_by_version_id(protocol_version as u16) .await? - .protocol_versions_dal() - .save_protocol_version( - ProtocolSemanticVersion { - minor: minor - .try_into() - .context("cannot convert protocol version")?, - patch: VersionPatch(0), - }, - protocol_version.timestamp, - Default::default(), // verification keys are unused for EN - BaseSystemContractsHashes { - bootloader: bootloader_code_hash, - default_aa: default_account_code_hash, - evm_emulator: evm_emulator_code_hash, - }, - l2_system_upgrade_tx_hash, - ) - .await?; + .with_context(|| { + format!("Cannot load base system contracts' hashes for {protocol_version:?}. They should already be present") + })?; let bootloader = self - .get_base_system_contract(bootloader_code_hash, cursor.next_l2_block) + .get_base_system_contract(base_system_contracts.bootloader, cursor.next_l2_block) .await .with_context(|| format!("cannot fetch bootloader code for {protocol_version:?}"))?; let default_aa = self - .get_base_system_contract(default_account_code_hash, cursor.next_l2_block) + .get_base_system_contract(base_system_contracts.default_aa, cursor.next_l2_block) .await .with_context(|| format!("cannot fetch default AA code for {protocol_version:?}"))?; - let evm_emulator = if let Some(hash) = evm_emulator_code_hash { + let evm_emulator = if let Some(hash) = base_system_contracts.evm_emulator { Some( self.get_base_system_contract(hash, cursor.next_l2_block) .await @@ -459,3 +476,97 @@ impl StateKeeperIO for ExternalIO { Ok(hash) } } + +#[cfg(test)] +mod tests { + use std::time::Duration; + + use zksync_dal::{ConnectionPool, CoreDal}; + use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; + use zksync_state_keeper::{io::L1BatchParams, L2BlockParams, StateKeeperIO}; + use zksync_types::{ + api, fee_model::BatchFeeInput, L1BatchNumber, L2BlockNumber, L2ChainId, ProtocolVersionId, + H256, + }; + + use crate::{sync_action::SyncAction, testonly::MockMainNodeClient, ActionQueue, ExternalIO}; + + #[tokio::test] + async fn insert_batch_with_protocol_version() { + // Whenever ExternalIO inserts an unsealed batch into DB it should populate it with protocol + // version and make sure that it is present in the DB (i.e. fetch it from main node if not). + let pool = ConnectionPool::test_pool().await; + let mut conn = pool.connection().await.unwrap(); + insert_genesis_batch(&mut conn, &GenesisParams::mock()) + .await + .unwrap(); + let (actions_sender, action_queue) = ActionQueue::new(); + let mut client = MockMainNodeClient::default(); + let next_protocol_version = api::ProtocolVersion { + minor_version: Some(ProtocolVersionId::next() as u16), + timestamp: 1, + bootloader_code_hash: Some(H256::repeat_byte(1)), + default_account_code_hash: Some(H256::repeat_byte(1)), + evm_emulator_code_hash: Some(H256::repeat_byte(1)), + ..api::ProtocolVersion::default() + }; + client.insert_protocol_version(next_protocol_version.clone()); + let mut external_io = ExternalIO::new( + pool.clone(), + action_queue, + Box::new(client), + L2ChainId::default(), + ) + .unwrap(); + + let (cursor, _) = external_io.initialize().await.unwrap(); + let params = L1BatchParams { + protocol_version: ProtocolVersionId::next(), + validation_computational_gas_limit: u32::MAX, + operator_address: Default::default(), + fee_input: BatchFeeInput::pubdata_independent(2, 3, 4), + first_l2_block: L2BlockParams { + timestamp: 1, + virtual_blocks: 1, + }, + }; + actions_sender + .push_action_unchecked(SyncAction::OpenBatch { + params: params.clone(), + number: L1BatchNumber(1), + first_l2_block_number: L2BlockNumber(1), + }) + .await + .unwrap(); + let fetched_params = external_io + .wait_for_new_batch_params(&cursor, Duration::from_secs(10)) + .await + .unwrap() + .unwrap(); + assert_eq!(fetched_params, params); + + // Verify that the next protocol version is in DB + let fetched_protocol_version = conn + .protocol_versions_dal() + .get_protocol_version_with_latest_patch(ProtocolVersionId::next()) + .await + .unwrap() + .unwrap(); + assert_eq!( + fetched_protocol_version.version.minor as u16, + next_protocol_version.minor_version.unwrap() + ); + + // Verify that the unsealed batch has protocol version + let unsealed_batch = conn + .blocks_dal() + .get_unsealed_l1_batch() + .await + .unwrap() + .unwrap(); + assert_eq!( + unsealed_batch.protocol_version, + Some(fetched_protocol_version.version.minor) + ); + } +} From cd160830a0b7ebe5af4ecbd944da1cd51af3528a Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:35:40 +0300 Subject: [PATCH 02/21] fix(mempool): minor mempool improvements (#3113) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ fixes two mempool issues: 1) `gc` does not really ensure `size <= capatity` (found by @jcsec-security), fix: purge some accounts with lowest score from priority queue 2) Mempool actor built l2 tx filter based on current l1 gas prices. This doesn't make sense when there is an open batch, if there is some then we should use its fee params. ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- core/lib/mempool/src/mempool_store.rs | 55 +++++++++++++++++---- core/lib/mempool/src/tests.rs | 50 +++++++++++++------ core/node/state_keeper/src/mempool_actor.rs | 31 +++++++++--- 3 files changed, 104 insertions(+), 32 deletions(-) diff --git a/core/lib/mempool/src/mempool_store.rs b/core/lib/mempool/src/mempool_store.rs index 334a4783a76..f6f9b72f9b6 100644 --- a/core/lib/mempool/src/mempool_store.rs +++ b/core/lib/mempool/src/mempool_store.rs @@ -1,4 +1,4 @@ -use std::collections::{hash_map, BTreeSet, HashMap, HashSet}; +use std::collections::{hash_map, BTreeSet, HashMap}; use zksync_types::{ l1::L1Tx, l2::L2Tx, Address, ExecuteTransactionCommon, Nonce, PriorityOpId, Transaction, @@ -221,22 +221,57 @@ impl MempoolStore { } fn gc(&mut self) -> Vec
{ - if self.size >= self.capacity { - let index: HashSet<_> = self + if self.size > self.capacity { + let mut transactions = std::mem::take(&mut self.l2_transactions_per_account); + let mut possibly_kept: Vec<_> = self .l2_priority_queue .iter() - .map(|pointer| pointer.account) + .rev() + .filter_map(|pointer| { + transactions + .remove(&pointer.account) + .map(|txs| (pointer.account, txs)) + }) .collect(); - let transactions = std::mem::take(&mut self.l2_transactions_per_account); - let (kept, drained) = transactions + + let mut sum = 0; + let mut number_of_accounts_kept = 0; + for (_, txs) in &possibly_kept { + sum += txs.len(); + if sum <= self.capacity as usize { + number_of_accounts_kept += 1; + } else { + break; + } + } + if number_of_accounts_kept == 0 && !possibly_kept.is_empty() { + tracing::warn!("mempool capacity is too low to handle txs from single account, consider increasing capacity"); + // Keep at least one entry, otherwise mempool won't return any new L2 tx to process. + number_of_accounts_kept = 1; + } + let (kept, drained) = { + let mut drained: Vec<_> = transactions.into_keys().collect(); + let also_drained = possibly_kept + .split_off(number_of_accounts_kept) + .into_iter() + .map(|(address, _)| address); + drained.extend(also_drained); + + (possibly_kept, drained) + }; + + let l2_priority_queue = std::mem::take(&mut self.l2_priority_queue); + self.l2_priority_queue = l2_priority_queue .into_iter() - .partition(|(address, _)| index.contains(address)); - self.l2_transactions_per_account = kept; + .rev() + .take(number_of_accounts_kept) + .collect(); + self.l2_transactions_per_account = kept.into_iter().collect(); self.size = self .l2_transactions_per_account .iter() - .fold(0, |agg, (_, tnxs)| agg + tnxs.len() as u64); - return drained.into_keys().collect(); + .fold(0, |agg, (_, txs)| agg + txs.len() as u64); + return drained; } vec![] } diff --git a/core/lib/mempool/src/tests.rs b/core/lib/mempool/src/tests.rs index 96ef600984f..b84ab7d5765 100644 --- a/core/lib/mempool/src/tests.rs +++ b/core/lib/mempool/src/tests.rs @@ -321,32 +321,26 @@ fn stashed_accounts() { #[test] fn mempool_capacity() { - let mut mempool = MempoolStore::new(PriorityOpId(0), 5); + let mut mempool = MempoolStore::new(PriorityOpId(0), 4); let account0 = Address::random(); let account1 = Address::random(); let account2 = Address::random(); + let account3 = Address::random(); let transactions = vec![ gen_l2_tx(account0, Nonce(0)), gen_l2_tx(account0, Nonce(1)), gen_l2_tx(account0, Nonce(2)), - gen_l2_tx(account1, Nonce(1)), - gen_l2_tx(account2, Nonce(1)), + gen_l2_tx_with_timestamp(account1, Nonce(0), unix_timestamp_ms() + 1), + gen_l2_tx_with_timestamp(account2, Nonce(0), unix_timestamp_ms() + 2), + gen_l2_tx(account3, Nonce(1)), ]; mempool.insert(transactions, HashMap::new()); - // the mempool is full. Accounts with non-sequential nonces got stashed + // Mempool is full. Accounts with non-sequential nonces and some accounts with lowest score should be purged. assert_eq!( HashSet::<_>::from_iter(mempool.get_mempool_info().purged_accounts), - HashSet::<_>::from_iter(vec![account1, account2]), - ); - // verify that existing good-to-go transactions and new ones got picked - mempool.insert( - vec![gen_l2_tx_with_timestamp( - account1, - Nonce(0), - unix_timestamp_ms() + 1, - )], - HashMap::new(), + HashSet::from([account2, account3]), ); + // verify that good-to-go transactions are kept. for _ in 0..3 { assert_eq!( mempool @@ -363,6 +357,34 @@ fn mempool_capacity() { .initiator_account(), account1 ); + assert!(!mempool.has_next(&L2TxFilter::default())); +} + +#[test] +fn mempool_does_not_purge_all_accounts() { + let mut mempool = MempoolStore::new(PriorityOpId(0), 1); + let account0 = Address::random(); + let account1 = Address::random(); + let transactions = vec![ + gen_l2_tx(account0, Nonce(0)), + gen_l2_tx(account0, Nonce(1)), + gen_l2_tx(account1, Nonce(1)), + ]; + mempool.insert(transactions, HashMap::new()); + // Mempool is full. Account 1 has tx with non-sequential nonce so it should be purged. + // Txs from account 0 have sequential nonces but their number is greater than capacity; they should be kept. + assert_eq!(mempool.get_mempool_info().purged_accounts, vec![account1]); + // verify that good-to-go transactions are kept. + for _ in 0..2 { + assert_eq!( + mempool + .next_transaction(&L2TxFilter::default()) + .unwrap() + .initiator_account(), + account0 + ); + } + assert!(!mempool.has_next(&L2TxFilter::default())); } fn gen_l2_tx(address: Address, nonce: Nonce) -> Transaction { diff --git a/core/node/state_keeper/src/mempool_actor.rs b/core/node/state_keeper/src/mempool_actor.rs index dbe1e4cb977..a17f2670cbb 100644 --- a/core/node/state_keeper/src/mempool_actor.rs +++ b/core/node/state_keeper/src/mempool_actor.rs @@ -89,20 +89,35 @@ impl MempoolFetcher { .await .context("failed getting pending protocol version")?; - let l2_tx_filter = l2_tx_filter( - self.batch_fee_input_provider.as_ref(), - protocol_version.into(), - ) - .await - .context("failed creating L2 transaction filter")?; + let (fee_per_gas, gas_per_pubdata) = if let Some(unsealed_batch) = storage + .blocks_dal() + .get_unsealed_l1_batch() + .await + .context("failed getting unsealed batch")? + { + let (fee_per_gas, gas_per_pubdata) = derive_base_fee_and_gas_per_pubdata( + unsealed_batch.fee_input, + protocol_version.into(), + ); + (fee_per_gas, gas_per_pubdata as u32) + } else { + let filter = l2_tx_filter( + self.batch_fee_input_provider.as_ref(), + protocol_version.into(), + ) + .await + .context("failed creating L2 transaction filter")?; + + (filter.fee_per_gas, filter.gas_per_pubdata) + }; let transactions = storage .transactions_dal() .sync_mempool( &mempool_info.stashed_accounts, &mempool_info.purged_accounts, - l2_tx_filter.gas_per_pubdata, - l2_tx_filter.fee_per_gas, + gas_per_pubdata, + fee_per_gas, self.sync_batch_size, ) .await From 0757ecd56e531888127cd146f8c2745099a6ed93 Mon Sep 17 00:00:00 2001 From: Daniyar Itegulov Date: Mon, 21 Oct 2024 23:52:59 +1100 Subject: [PATCH 03/21] chore(zkstack_cli): build sys contract with `--frozen-lockfile` (#3138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ ## Why ❔ ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- zkstack_cli/crates/common/src/contracts.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zkstack_cli/crates/common/src/contracts.rs b/zkstack_cli/crates/common/src/contracts.rs index c95849131c1..8f5ae805602 100644 --- a/zkstack_cli/crates/common/src/contracts.rs +++ b/zkstack_cli/crates/common/src/contracts.rs @@ -26,7 +26,8 @@ pub fn build_l2_contracts(shell: Shell, link_to_code: PathBuf) -> anyhow::Result pub fn build_system_contracts(shell: Shell, link_to_code: PathBuf) -> anyhow::Result<()> { let _dir_guard = shell.push_dir(link_to_code.join("contracts/system-contracts")); - Cmd::new(cmd!(shell, "yarn install")).run()?; + // Do not update era-contract's lockfile to avoid dirty submodule + Cmd::new(cmd!(shell, "yarn install --frozen-lockfile")).run()?; Cmd::new(cmd!(shell, "yarn preprocess:system-contracts")).run()?; Cmd::new(cmd!( shell, From 7c289649b7b3c418c7193a35b51c264cf4970f3c Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Mon, 21 Oct 2024 16:01:59 +0200 Subject: [PATCH 04/21] feat(prover): Add min_provers and dry_run features. Improve metrics and test. (#3129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Improve metrics and test. Add min_provers config. Add dry_run config option for Agent. ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- .../config/src/configs/prover_autoscaler.rs | 9 + .../src/proto/config/prover_autoscaler.proto | 7 + .../protobuf_config/src/prover_autoscaler.rs | 32 +- prover/Cargo.lock | 22 + prover/Cargo.toml | 1 + .../crates/bin/prover_autoscaler/Cargo.toml | 1 + .../prover_autoscaler/src/global/queuer.rs | 18 +- .../prover_autoscaler/src/global/scaler.rs | 399 +++++++++++++++--- .../prover_autoscaler/src/global/watcher.rs | 21 +- .../bin/prover_autoscaler/src/k8s/scaler.rs | 15 + .../bin/prover_autoscaler/src/k8s/watcher.rs | 7 +- .../crates/bin/prover_autoscaler/src/main.rs | 2 +- .../bin/prover_autoscaler/src/metrics.rs | 10 +- 13 files changed, 467 insertions(+), 77 deletions(-) diff --git a/core/lib/config/src/configs/prover_autoscaler.rs b/core/lib/config/src/configs/prover_autoscaler.rs index 6f83f0d2d18..b24a1a26651 100644 --- a/core/lib/config/src/configs/prover_autoscaler.rs +++ b/core/lib/config/src/configs/prover_autoscaler.rs @@ -30,6 +30,9 @@ pub struct ProverAutoscalerAgentConfig { pub namespaces: Vec, /// Watched cluster name. Also can be set via flag. pub cluster_name: Option, + /// If dry-run enabled don't do any k8s updates, just report success. + #[serde(default = "ProverAutoscalerAgentConfig::default_dry_run")] + pub dry_run: bool, } #[derive(Debug, Clone, PartialEq, Deserialize, Default)] @@ -53,6 +56,8 @@ pub struct ProverAutoscalerScalerConfig { pub prover_speed: HashMap, /// Maximum number of provers which can be run per cluster/GPU. pub max_provers: HashMap>, + /// Minimum number of provers per namespace. + pub min_provers: HashMap, /// Duration after which pending pod considered long pending. #[serde(default = "ProverAutoscalerScalerConfig::default_long_pending_duration")] pub long_pending_duration: Duration, @@ -99,6 +104,10 @@ impl ProverAutoscalerAgentConfig { pub fn default_namespaces() -> Vec { vec!["prover-blue".to_string(), "prover-red".to_string()] } + + pub fn default_dry_run() -> bool { + true + } } impl ProverAutoscalerScalerConfig { diff --git a/core/lib/protobuf_config/src/proto/config/prover_autoscaler.proto b/core/lib/protobuf_config/src/proto/config/prover_autoscaler.proto index 8363b625119..9b7f201e9b7 100644 --- a/core/lib/protobuf_config/src/proto/config/prover_autoscaler.proto +++ b/core/lib/protobuf_config/src/proto/config/prover_autoscaler.proto @@ -17,6 +17,7 @@ message ProverAutoscalerAgentConfig { optional uint32 http_port = 2; // required repeated string namespaces = 3; // optional optional string cluster_name = 4; // optional + optional bool dry_run = 5; // optional } message ProtocolVersion { @@ -39,6 +40,11 @@ message MaxProver { optional uint32 max = 2; // required } +message MinProver { + optional string namespace = 1; // required + optional uint32 min = 2; // required +} + message ProverAutoscalerScalerConfig { optional uint32 prometheus_port = 1; // required optional std.Duration scaler_run_interval = 2; // optional @@ -49,4 +55,5 @@ message ProverAutoscalerScalerConfig { repeated ProverSpeed prover_speed = 7; // optional optional uint32 long_pending_duration_s = 8; // optional repeated MaxProver max_provers = 9; // optional + repeated MinProver min_provers = 10; // optional } diff --git a/core/lib/protobuf_config/src/prover_autoscaler.rs b/core/lib/protobuf_config/src/prover_autoscaler.rs index e95e4003972..51f1b162d4c 100644 --- a/core/lib/protobuf_config/src/prover_autoscaler.rs +++ b/core/lib/protobuf_config/src/prover_autoscaler.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use anyhow::Context as _; +use anyhow::Context; use time::Duration; use zksync_config::configs::{self, prover_autoscaler::Gpu}; use zksync_protobuf::{read_optional, repr::ProtoRepr, required, ProtoFmt}; @@ -42,6 +42,7 @@ impl ProtoRepr for proto::ProverAutoscalerAgentConfig { .context("http_port")?, namespaces: self.namespaces.to_vec(), cluster_name: Some("".to_string()), + dry_run: self.dry_run.unwrap_or(Self::Type::default_dry_run()), }) } @@ -51,6 +52,7 @@ impl ProtoRepr for proto::ProverAutoscalerAgentConfig { http_port: Some(this.http_port.into()), namespaces: this.namespaces.clone(), cluster_name: this.cluster_name.clone(), + dry_run: Some(this.dry_run), } } } @@ -103,6 +105,13 @@ impl ProtoRepr for proto::ProverAutoscalerScalerConfig { } acc }), + min_provers: self + .min_provers + .iter() + .enumerate() + .map(|(i, e)| e.read().context(i)) + .collect::>() + .context("min_provers")?, }) } @@ -137,6 +146,11 @@ impl ProtoRepr for proto::ProverAutoscalerScalerConfig { }) }) .collect(), + min_provers: this + .min_provers + .iter() + .map(|(k, v)| proto::MinProver::build(&(k.clone(), *v))) + .collect(), } } } @@ -208,3 +222,19 @@ impl ProtoRepr for proto::MaxProver { } } } + +impl ProtoRepr for proto::MinProver { + type Type = (String, u32); + fn read(&self) -> anyhow::Result { + Ok(( + required(&self.namespace).context("namespace")?.clone(), + *required(&self.min).context("min")?, + )) + } + fn build(this: &Self::Type) -> Self { + Self { + namespace: Some(this.0.to_string()), + min: Some(this.1), + } + } +} diff --git a/prover/Cargo.lock b/prover/Cargo.lock index dd2df67902f..e5b42f1601b 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -6702,6 +6702,27 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "tracing-test" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" +dependencies = [ + "tracing-core", + "tracing-subscriber", + "tracing-test-macro", +] + +[[package]] +name = "tracing-test-macro" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" +dependencies = [ + "quote 1.0.36", + "syn 2.0.66", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -8300,6 +8321,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", + "tracing-test", "url", "vise", "zksync_config", diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 61169dd4363..af022e691c1 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -58,6 +58,7 @@ tokio-util = "0.7.11" toml_edit = "0.14.4" tracing = "0.1" tracing-subscriber = "0.3" +tracing-test = "0.2.5" url = "2.5.2" vise = "0.2.0" diff --git a/prover/crates/bin/prover_autoscaler/Cargo.toml b/prover/crates/bin/prover_autoscaler/Cargo.toml index 9743b45593e..fbf3ecae909 100644 --- a/prover/crates/bin/prover_autoscaler/Cargo.toml +++ b/prover/crates/bin/prover_autoscaler/Cargo.toml @@ -43,3 +43,4 @@ tracing-subscriber = { workspace = true, features = ["env-filter"] } tracing.workspace = true url.workspace = true vise.workspace = true +tracing-test.workspace = true diff --git a/prover/crates/bin/prover_autoscaler/src/global/queuer.rs b/prover/crates/bin/prover_autoscaler/src/global/queuer.rs index 1ef5d96386b..32610ebf3c3 100644 --- a/prover/crates/bin/prover_autoscaler/src/global/queuer.rs +++ b/prover/crates/bin/prover_autoscaler/src/global/queuer.rs @@ -5,6 +5,10 @@ use reqwest::Method; use zksync_prover_job_monitor::autoscaler_queue_reporter::VersionedQueueReport; use zksync_utils::http_with_retries::send_request_with_retries; +use crate::metrics::{AUTOSCALER_METRICS, DEFAULT_ERROR_CODE}; + +const MAX_RETRIES: usize = 5; + #[derive(Debug)] pub struct Queue { pub queue: HashMap, @@ -24,15 +28,19 @@ impl Queuer { pub async fn get_queue(&self) -> anyhow::Result { let url = &self.prover_job_monitor_url; - let response = send_request_with_retries(url, 5, Method::GET, None, None).await; - let res = response - .map_err(|err| anyhow::anyhow!("Failed fetching queue from url: {url}: {err:?}"))? + let response = send_request_with_retries(url, MAX_RETRIES, Method::GET, None, None).await; + let response = response.map_err(|err| { + AUTOSCALER_METRICS.calls[&(url.clone(), DEFAULT_ERROR_CODE)].inc(); + anyhow::anyhow!("Failed fetching queue from url: {url}: {err:?}") + })?; + + AUTOSCALER_METRICS.calls[&(url.clone(), response.status().as_u16())].inc(); + let response = response .json::>() .await .context("Failed to read response as json")?; - Ok(Queue { - queue: res + queue: response .iter() .map(|x| (x.version.to_string(), x.report.prover_jobs.queued as u64)) .collect::>(), diff --git a/prover/crates/bin/prover_autoscaler/src/global/scaler.rs b/prover/crates/bin/prover_autoscaler/src/global/scaler.rs index dd3f3cf1ad3..f10902f5dd2 100644 --- a/prover/crates/bin/prover_autoscaler/src/global/scaler.rs +++ b/prover/crates/bin/prover_autoscaler/src/global/scaler.rs @@ -44,9 +44,9 @@ struct GPUPoolKey { } static PROVER_DEPLOYMENT_RE: Lazy = - Lazy::new(|| Regex::new(r"^prover-gpu-fri-spec-(\d{1,2})?(-(?[ltvpa]\d+))?$").unwrap()); + Lazy::new(|| Regex::new(r"^circuit-prover-gpu(-(?[ltvpa]\d+))?$").unwrap()); static PROVER_POD_RE: Lazy = - Lazy::new(|| Regex::new(r"^prover-gpu-fri-spec-(\d{1,2})?(-(?[ltvpa]\d+))?").unwrap()); + Lazy::new(|| Regex::new(r"^circuit-prover-gpu(-(?[ltvpa]\d+))?").unwrap()); pub struct Scaler { /// namespace to Protocol Version configuration. @@ -56,6 +56,7 @@ pub struct Scaler { /// Which cluster to use first. cluster_priorities: HashMap, + min_provers: HashMap, max_provers: HashMap>, prover_speed: HashMap, long_pending_duration: chrono::Duration, @@ -83,11 +84,19 @@ impl Scaler { queuer: queuer::Queuer, config: ProverAutoscalerScalerConfig, ) -> Self { + config + .protocol_versions + .iter() + .for_each(|(namespace, version)| { + AUTOSCALER_METRICS.prover_protocol_version[&(namespace.clone(), version.clone())] + .set(1); + }); Self { namespaces: config.protocol_versions, watcher, queuer, cluster_priorities: config.cluster_priorities, + min_provers: config.min_provers, max_provers: config.max_provers, prover_speed: config.prover_speed, long_pending_duration: chrono::Duration::seconds( @@ -200,16 +209,23 @@ impl Scaler { self.speed(gpu) * n as u64 } - fn normalize_queue(&self, gpu: Gpu, q: u64) -> u64 { + fn normalize_queue(&self, gpu: Gpu, queue: u64) -> u64 { let speed = self.speed(gpu); // Divide and round up if there's any remainder. - (q + speed - 1) / speed * speed + (queue + speed - 1) / speed * speed } - fn run(&self, namespace: &String, q: u64, clusters: &Clusters) -> HashMap { + fn run(&self, namespace: &String, queue: u64, clusters: &Clusters) -> HashMap { let sc = self.sorted_clusters(namespace, clusters); tracing::debug!("Sorted clusters for namespace {}: {:?}", namespace, &sc); + // Increase queue size, if it's too small, to make sure that required min_provers are + // running. + let queue: u64 = self.min_provers.get(namespace).map_or(queue, |min| { + self.normalize_queue(Gpu::L4, queue) + .max(self.provers_to_speed(Gpu::L4, *min)) + }); + let mut total: i64 = 0; let mut provers: HashMap = HashMap::new(); for c in &sc { @@ -228,9 +244,9 @@ impl Scaler { } // Remove unneeded pods. - if (total as u64) > self.normalize_queue(Gpu::L4, q) { + if (total as u64) > self.normalize_queue(Gpu::L4, queue) { for c in sc.iter().rev() { - let mut excess_queue = total as u64 - self.normalize_queue(c.gpu, q); + let mut excess_queue = total as u64 - self.normalize_queue(c.gpu, queue); let mut excess_provers = (excess_queue / self.speed(c.gpu)) as u32; let p = provers.entry(c.to_key()).or_default(); if *p < excess_provers { @@ -255,11 +271,11 @@ impl Scaler { } } - tracing::debug!("Queue coverd with provers: {}", total); + tracing::debug!("Queue covered with provers: {}", total); // Add required provers. - if (total as u64) < q { + if (total as u64) < queue { for c in &sc { - let mut required_queue = q - total as u64; + let mut required_queue = queue - total as u64; let mut required_provers = (self.normalize_queue(c.gpu, required_queue) / self.speed(c.gpu)) as u32; let p = provers.entry(c.to_key()).or_default(); @@ -306,6 +322,7 @@ impl Task for Scaler { let guard = self.watcher.data.lock().await; if let Err(err) = watcher::check_is_ready(&guard.is_ready) { + AUTOSCALER_METRICS.clusters_not_ready.inc(); tracing::warn!("Skipping Scaler run: {}", err); return Ok(()); } @@ -329,70 +346,342 @@ impl Task for Scaler { #[cfg(test)] mod tests { - use std::sync::Arc; - - use tokio::sync::Mutex; - use super::*; use crate::{ cluster_types::{Deployment, Namespace, Pod}, global::{queuer, watcher}, }; + #[tracing_test::traced_test] #[test] fn test_run() { - let watcher = watcher::Watcher { - cluster_agents: vec![], - data: Arc::new(Mutex::new(watcher::WatchedData::default())), - }; - let queuer = queuer::Queuer { - prover_job_monitor_url: "".to_string(), - }; let scaler = Scaler::new( - watcher, - queuer, + watcher::Watcher::default(), + queuer::Queuer::default(), ProverAutoscalerScalerConfig { - max_provers: HashMap::from([("foo".to_string(), HashMap::from([(Gpu::L4, 100)]))]), + cluster_priorities: [("foo".into(), 0), ("bar".into(), 10)].into(), + min_provers: [("prover-other".into(), 2)].into(), + max_provers: [ + ("foo".into(), [(Gpu::L4, 100)].into()), + ("bar".into(), [(Gpu::L4, 100)].into()), + ] + .into(), ..Default::default() }, ); - let got = scaler.run( - &"prover".to_string(), - 1499, - &Clusters { - clusters: HashMap::from([( - "foo".to_string(), - Cluster { - name: "foo".to_string(), - namespaces: HashMap::from([( - "prover".to_string(), - Namespace { - deployments: HashMap::from([( - "prover-gpu-fri-spec-1".to_string(), - Deployment { + + assert_eq!( + scaler.run( + &"prover".into(), + 1499, + &Clusters { + clusters: [( + "foo".into(), + Cluster { + name: "foo".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment::default(), + )] + .into(), + pods: [( + "circuit-prover-gpu-7c5f8fc747-gmtcr".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + )] + .into(), + }, + )] + .into(), + }, + )] + .into(), + }, + ), + [( + GPUPoolKey { + cluster: "foo".into(), + gpu: Gpu::L4, + }, + 3, + )] + .into(), + "3 new provers" + ); + assert_eq!( + scaler.run( + &"prover".into(), + 499, + &Clusters { + clusters: [ + ( + "foo".into(), + Cluster { + name: "foo".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment::default(), + )] + .into(), ..Default::default() }, - )]), - pods: HashMap::from([( - "prover-gpu-fri-spec-1-c47644679-x9xqp".to_string(), - Pod { - status: "Running".to_string(), - ..Default::default() + )] + .into(), + }, + ), + ( + "bar".into(), + Cluster { + name: "bar".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment { + running: 1, + desired: 1, + }, + )] + .into(), + pods: [( + "circuit-prover-gpu-7c5f8fc747-gmtcr".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + )] + .into(), }, - )]), + )] + .into(), }, - )]), + ) + ] + .into(), + }, + ), + [ + ( + GPUPoolKey { + cluster: "foo".into(), + gpu: Gpu::L4, }, - )]), - }, + 0, + ), + ( + GPUPoolKey { + cluster: "bar".into(), + gpu: Gpu::L4, + }, + 1, + ) + ] + .into(), + "Preserve running" ); - let want = HashMap::from([( - GPUPoolKey { - cluster: "foo".to_string(), - gpu: Gpu::L4, + } + + #[tracing_test::traced_test] + #[test] + fn test_run_min_provers() { + let scaler = Scaler::new( + watcher::Watcher::default(), + queuer::Queuer::default(), + ProverAutoscalerScalerConfig { + cluster_priorities: [("foo".into(), 0), ("bar".into(), 10)].into(), + min_provers: [("prover".into(), 2)].into(), + max_provers: [ + ("foo".into(), [(Gpu::L4, 100)].into()), + ("bar".into(), [(Gpu::L4, 100)].into()), + ] + .into(), + ..Default::default() }, - 3, - )]); - assert_eq!(got, want); + ); + + assert_eq!( + scaler.run( + &"prover".into(), + 10, + &Clusters { + clusters: [ + ( + "foo".into(), + Cluster { + name: "foo".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment::default(), + )] + .into(), + ..Default::default() + }, + )] + .into(), + }, + ), + ( + "bar".into(), + Cluster { + name: "bar".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment::default(), + )] + .into(), + ..Default::default() + }, + )] + .into(), + }, + ) + ] + .into(), + }, + ), + [ + ( + GPUPoolKey { + cluster: "foo".into(), + gpu: Gpu::L4, + }, + 2, + ), + ( + GPUPoolKey { + cluster: "bar".into(), + gpu: Gpu::L4, + }, + 0, + ) + ] + .into(), + "Min 2 provers, non running" + ); + assert_eq!( + scaler.run( + &"prover".into(), + 0, + &Clusters { + clusters: [ + ( + "foo".into(), + Cluster { + name: "foo".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment { + running: 3, + desired: 3, + }, + )] + .into(), + pods: [ + ( + "circuit-prover-gpu-7c5f8fc747-gmtcr".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + ), + ( + "circuit-prover-gpu-7c5f8fc747-gmtc2".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + ), + ( + "circuit-prover-gpu-7c5f8fc747-gmtc3".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + ) + ] + .into(), + }, + )] + .into(), + }, + ), + ( + "bar".into(), + Cluster { + name: "bar".into(), + namespaces: [( + "prover".into(), + Namespace { + deployments: [( + "circuit-prover-gpu".into(), + Deployment { + running: 2, + desired: 2, + }, + )] + .into(), + pods: [ + ( + "circuit-prover-gpu-7c5f8fc747-gmtcr".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + ), + ( + "circuit-prover-gpu-7c5f8fc747-gmtc2".into(), + Pod { + status: "Running".into(), + ..Default::default() + }, + ) + ] + .into(), + }, + )] + .into(), + }, + ) + ] + .into(), + }, + ), + [ + ( + GPUPoolKey { + cluster: "foo".into(), + gpu: Gpu::L4, + }, + 2, + ), + ( + GPUPoolKey { + cluster: "bar".into(), + gpu: Gpu::L4, + }, + 0, + ) + ] + .into(), + "Min 2 provers, 5 running" + ); } } diff --git a/prover/crates/bin/prover_autoscaler/src/global/watcher.rs b/prover/crates/bin/prover_autoscaler/src/global/watcher.rs index 01fa68c60f8..646b320e12d 100644 --- a/prover/crates/bin/prover_autoscaler/src/global/watcher.rs +++ b/prover/crates/bin/prover_autoscaler/src/global/watcher.rs @@ -9,9 +9,12 @@ use zksync_utils::http_with_retries::send_request_with_retries; use crate::{ cluster_types::{Cluster, Clusters}, + metrics::{AUTOSCALER_METRICS, DEFAULT_ERROR_CODE}, task_wiring::Task, }; +const MAX_RETRIES: usize = 5; + #[derive(Default)] pub struct WatchedData { pub clusters: Clusters, @@ -27,7 +30,7 @@ pub fn check_is_ready(v: &Vec) -> Result<()> { Ok(()) } -#[derive(Clone)] +#[derive(Default, Clone)] pub struct Watcher { /// List of base URLs of all agents. pub cluster_agents: Vec>, @@ -74,15 +77,19 @@ impl Task for Watcher { .context("Failed to join URL with /cluster")? .to_string(); let response = - send_request_with_retries(&url, 5, Method::GET, None, None).await; - let res = response - .map_err(|err| { - anyhow::anyhow!("Failed fetching cluster from url: {url}: {err:?}") - })? + send_request_with_retries(&url, MAX_RETRIES, Method::GET, None, None).await; + + let response = response.map_err(|err| { + // TODO: refactor send_request_with_retries to return status. + AUTOSCALER_METRICS.calls[&(url.clone(), DEFAULT_ERROR_CODE)].inc(); + anyhow::anyhow!("Failed fetching cluster from url: {url}: {err:?}") + })?; + AUTOSCALER_METRICS.calls[&(url, response.status().as_u16())].inc(); + let response = response .json::() .await .context("Failed to read response as json"); - Ok((i, res)) + Ok((i, response)) }) }) .collect(); diff --git a/prover/crates/bin/prover_autoscaler/src/k8s/scaler.rs b/prover/crates/bin/prover_autoscaler/src/k8s/scaler.rs index 170b0b10650..5e6f56aacc9 100644 --- a/prover/crates/bin/prover_autoscaler/src/k8s/scaler.rs +++ b/prover/crates/bin/prover_autoscaler/src/k8s/scaler.rs @@ -4,9 +4,14 @@ use kube::api::{Api, Patch, PatchParams}; #[derive(Clone)] pub struct Scaler { pub client: kube::Client, + dry_run: bool, } impl Scaler { + pub fn new(client: kube::Client, dry_run: bool) -> Self { + Self { client, dry_run } + } + pub async fn scale(&self, namespace: &str, name: &str, size: i32) -> anyhow::Result<()> { let deployments: Api = Api::namespaced(self.client.clone(), namespace); @@ -18,6 +23,16 @@ impl Scaler { "replicas": size } }); + + if self.dry_run { + tracing::info!( + "Dry run of scaled deployment/{} to {} replica(s).", + name, + size + ); + return Ok(()); + } + let pp = PatchParams::default(); deployments.patch(name, &pp, &Patch::Merge(patch)).await?; tracing::info!("Scaled deployment/{} to {} replica(s).", name, size); diff --git a/prover/crates/bin/prover_autoscaler/src/k8s/watcher.rs b/prover/crates/bin/prover_autoscaler/src/k8s/watcher.rs index 8746d17663b..f94dfc3704f 100644 --- a/prover/crates/bin/prover_autoscaler/src/k8s/watcher.rs +++ b/prover/crates/bin/prover_autoscaler/src/k8s/watcher.rs @@ -9,10 +9,7 @@ use kube::{ }; use tokio::sync::Mutex; -use crate::{ - cluster_types::{Cluster, Deployment, Namespace, Pod}, - metrics::AUTOSCALER_METRICS, -}; +use crate::cluster_types::{Cluster, Deployment, Namespace, Pod}; #[derive(Clone)] pub struct Watcher { @@ -38,8 +35,6 @@ impl Watcher { pub async fn run(self) -> anyhow::Result<()> { // TODO: add actual metrics - AUTOSCALER_METRICS.protocol_version.set(1); - AUTOSCALER_METRICS.calls.inc_by(1); // TODO: watch for a list of namespaces, get: // - deployments (name, running, desired) [done] diff --git a/prover/crates/bin/prover_autoscaler/src/main.rs b/prover/crates/bin/prover_autoscaler/src/main.rs index e3aec1fbd39..45e476079a5 100644 --- a/prover/crates/bin/prover_autoscaler/src/main.rs +++ b/prover/crates/bin/prover_autoscaler/src/main.rs @@ -95,7 +95,7 @@ async fn main() -> anyhow::Result<()> { // TODO: maybe get cluster name from curl -H "Metadata-Flavor: Google" // http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-name let watcher = Watcher::new(client.clone(), cluster, agent_config.namespaces); - let scaler = Scaler { client }; + let scaler = Scaler::new(client, agent_config.dry_run); tasks.push(tokio::spawn(watcher.clone().run())); tasks.push(tokio::spawn(agent::run_server( agent_config.http_port, diff --git a/prover/crates/bin/prover_autoscaler/src/metrics.rs b/prover/crates/bin/prover_autoscaler/src/metrics.rs index 09cbaa6ba00..d94ac8b97e9 100644 --- a/prover/crates/bin/prover_autoscaler/src/metrics.rs +++ b/prover/crates/bin/prover_autoscaler/src/metrics.rs @@ -1,13 +1,19 @@ use vise::{Counter, Gauge, LabeledFamily, Metrics}; use zksync_config::configs::prover_autoscaler::Gpu; +pub const DEFAULT_ERROR_CODE: u16 = 500; + #[derive(Debug, Metrics)] #[metrics(prefix = "autoscaler")] pub(crate) struct AutoscalerMetrics { - pub protocol_version: Gauge, - pub calls: Counter, + #[metrics(labels = ["target_namespace", "protocol_version"])] + pub prover_protocol_version: LabeledFamily<(String, String), Gauge, 2>, #[metrics(labels = ["target_cluster", "target_namespace", "gpu"])] pub provers: LabeledFamily<(String, String, Gpu), Gauge, 3>, + pub clusters_not_ready: Counter, + #[metrics(labels = ["target", "status"])] + pub calls: LabeledFamily<(String, u16), Counter, 2>, + // TODO: count of command send succes/fail } #[vise::register] From 7241ae139b2b6bf9a9966eaa2f22203583a3786f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 22 Oct 2024 09:29:51 +0200 Subject: [PATCH 05/21] fix(tee_prover): add zstd compression (#3144) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Add zstd compression for the HTTP connection between `proof_data_handler` and `zksync_tee_prover`. ## Why ❔ This enables faster intercloud communication. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --------- Signed-off-by: Harald Hoyer --- Cargo.lock | 37 +++++++++++++++++++++++++ core/bin/zksync_tee_prover/Cargo.toml | 2 +- core/node/proof_data_handler/Cargo.toml | 1 + core/node/proof_data_handler/src/lib.rs | 2 ++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5da4cc8c143..05c26a74834 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,6 +292,20 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-compression" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +dependencies = [ + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "zstd", + "zstd-safe", +] + [[package]] name = "async-executor" version = "1.13.1" @@ -5886,6 +5900,7 @@ version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ + "async-compression", "base64 0.22.1", "bytes", "encoding_rs", @@ -8309,13 +8324,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ + "async-compression", "bitflags 2.6.0", "bytes", + "futures-core", "http 1.1.0", "http-body 1.0.1", "http-body-util", "pin-project-lite", "tokio", + "tokio-util", "tower-layer", "tower-service", ] @@ -10866,6 +10884,7 @@ dependencies = [ "serde_json", "tokio", "tower 0.4.13", + "tower-http", "tracing", "vise", "zksync_basic_types", @@ -11414,6 +11433,24 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.13+zstd.1.5.6" diff --git a/core/bin/zksync_tee_prover/Cargo.toml b/core/bin/zksync_tee_prover/Cargo.toml index 85908eebeaa..b853da348ee 100644 --- a/core/bin/zksync_tee_prover/Cargo.toml +++ b/core/bin/zksync_tee_prover/Cargo.toml @@ -15,7 +15,7 @@ publish = false anyhow.workspace = true async-trait.workspace = true envy.workspace = true -reqwest.workspace = true +reqwest = { workspace = true, features = ["zstd"] } secp256k1 = { workspace = true, features = ["serde"] } serde = { workspace = true, features = ["derive"] } thiserror.workspace = true diff --git a/core/node/proof_data_handler/Cargo.toml b/core/node/proof_data_handler/Cargo.toml index 76dc89eda04..e2ddc972a2f 100644 --- a/core/node/proof_data_handler/Cargo.toml +++ b/core/node/proof_data_handler/Cargo.toml @@ -22,6 +22,7 @@ zksync_utils.workspace = true anyhow.workspace = true axum.workspace = true tokio.workspace = true +tower-http = { workspace = true, features = ["compression-zstd", "decompression-zstd"] } tracing.workspace = true [dev-dependencies] diff --git a/core/node/proof_data_handler/src/lib.rs b/core/node/proof_data_handler/src/lib.rs index a482a7bc07b..661c76d2000 100644 --- a/core/node/proof_data_handler/src/lib.rs +++ b/core/node/proof_data_handler/src/lib.rs @@ -139,4 +139,6 @@ fn create_proof_processing_router( } router + .layer(tower_http::compression::CompressionLayer::new()) + .layer(tower_http::decompression::RequestDecompressionLayer::new().zstd(true)) } From abeee8190d3c3a5e577d71024bdfb30ff516ad03 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 22 Oct 2024 16:19:30 +0300 Subject: [PATCH 06/21] fix(en): Return `SyncState` health check (#3142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Returns `SyncState`-based health check, which was removed when transitioning to the node framework. ## Why ❔ This health check looks useful and is used at least in some internal automations. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- core/bin/external_node/src/tests/mod.rs | 14 +++++++++++--- .../layers/state_keeper/external_io.rs | 6 ++++++ .../implementations/layers/sync_state_updater.rs | 8 ++++++++ core/node/node_sync/src/sync_state.rs | 1 + 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/core/bin/external_node/src/tests/mod.rs b/core/bin/external_node/src/tests/mod.rs index b21dbd0db9a..c5dd88748e5 100644 --- a/core/bin/external_node/src/tests/mod.rs +++ b/core/bin/external_node/src/tests/mod.rs @@ -22,10 +22,18 @@ const POLL_INTERVAL: Duration = Duration::from_millis(100); #[tracing::instrument] // Add args to the test logs async fn external_node_basics(components_str: &'static str) { let _guard = zksync_vlog::ObservabilityBuilder::new().try_build().ok(); // Enable logging to simplify debugging - let (env, env_handles) = utils::TestEnvironment::with_genesis_block(components_str).await; - let expected_health_components = utils::expected_health_components(&env.components); + let mut expected_health_components = utils::expected_health_components(&env.components); + let expected_shutdown_components = expected_health_components.clone(); + let has_core_or_api = env.components.0.iter().any(|component| { + [Component::Core, Component::HttpApi, Component::WsApi].contains(component) + }); + if has_core_or_api { + // The `sync_state` component doesn't signal its shutdown, but should be present in the list of components + expected_health_components.push("sync_state"); + } + let l2_client = utils::mock_l2_client(&env); let eth_client = utils::mock_eth_client(env.config.diamond_proxy_address()); @@ -84,7 +92,7 @@ async fn external_node_basics(components_str: &'static str) { let health_data = app_health.check_health().await; tracing::info!(?health_data, "final health data"); assert_matches!(health_data.inner().status(), HealthStatus::ShutDown); - for name in expected_health_components { + for name in expected_shutdown_components { let component_health = &health_data.components()[name]; assert_matches!(component_health.status(), HealthStatus::ShutDown); } diff --git a/core/node/node_framework/src/implementations/layers/state_keeper/external_io.rs b/core/node/node_framework/src/implementations/layers/state_keeper/external_io.rs index 31b76550767..2c23f5aa9a1 100644 --- a/core/node/node_framework/src/implementations/layers/state_keeper/external_io.rs +++ b/core/node/node_framework/src/implementations/layers/state_keeper/external_io.rs @@ -8,6 +8,7 @@ use zksync_types::L2ChainId; use crate::{ implementations::resources::{ action_queue::ActionQueueSenderResource, + healthcheck::AppHealthCheckResource, main_node_client::MainNodeClientResource, pools::{MasterPool, PoolResource}, state_keeper::{ConditionalSealerResource, StateKeeperIOResource}, @@ -26,6 +27,7 @@ pub struct ExternalIOLayer { #[derive(Debug, FromContext)] #[context(crate = crate)] pub struct Input { + pub app_health: AppHealthCheckResource, pub pool: PoolResource, pub main_node_client: MainNodeClientResource, } @@ -57,6 +59,10 @@ impl WiringLayer for ExternalIOLayer { async fn wire(self, input: Self::Input) -> Result { // Create `SyncState` resource. let sync_state = SyncState::default(); + let app_health = &input.app_health.0; + app_health + .insert_custom_component(Arc::new(sync_state.clone())) + .map_err(WiringError::internal)?; // Create `ActionQueueSender` resource. let (action_queue_sender, action_queue) = ActionQueue::new(); diff --git a/core/node/node_framework/src/implementations/layers/sync_state_updater.rs b/core/node/node_framework/src/implementations/layers/sync_state_updater.rs index 1f86b43f7a5..dd2652dfddb 100644 --- a/core/node/node_framework/src/implementations/layers/sync_state_updater.rs +++ b/core/node/node_framework/src/implementations/layers/sync_state_updater.rs @@ -1,9 +1,12 @@ +use std::sync::Arc; + use zksync_dal::{ConnectionPool, Core}; use zksync_node_sync::SyncState; use zksync_web3_decl::client::{DynClient, L2}; use crate::{ implementations::resources::{ + healthcheck::AppHealthCheckResource, main_node_client::MainNodeClientResource, pools::{MasterPool, PoolResource}, sync_state::SyncStateResource, @@ -24,6 +27,7 @@ pub struct SyncStateUpdaterLayer; pub struct Input { /// Fetched to check whether the `SyncState` was already provided by another layer. pub sync_state: Option, + pub app_health: AppHealthCheckResource, pub master_pool: PoolResource, pub main_node_client: MainNodeClientResource, } @@ -62,6 +66,10 @@ impl WiringLayer for SyncStateUpdaterLayer { let MainNodeClientResource(main_node_client) = input.main_node_client; let sync_state = SyncState::default(); + let app_health = &input.app_health.0; + app_health + .insert_custom_component(Arc::new(sync_state.clone())) + .map_err(WiringError::internal)?; Ok(Output { sync_state: Some(sync_state.clone().into()), diff --git a/core/node/node_sync/src/sync_state.rs b/core/node/node_sync/src/sync_state.rs index e061ff7da01..f8a2fe00ec0 100644 --- a/core/node/node_sync/src/sync_state.rs +++ b/core/node/node_sync/src/sync_state.rs @@ -173,6 +173,7 @@ impl CheckHealth for SyncState { Health::from(&*self.0.borrow()) } } + impl SyncStateInner { fn is_synced(&self) -> (bool, Option) { if let (Some(main_node_block), Some(local_block)) = (self.main_node_block, self.local_block) From b29be7d9a8c664beac5d8384548db54de0ba882f Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 22 Oct 2024 16:45:10 +0200 Subject: [PATCH 07/21] feat(zkstack_cli): Autocompletion support (#3097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Add autocomplete feature to zkstack: ```bash ❯ zkstack chain dev -- Chain related commands consensus -- Update ZKsync containers -- Run containers for local development contract-verifier -- Run contract verifier ecosystem -- Ecosystem related commands explorer -- Run block-explorer external-node -- External Node related commands help -- Print this message or the help of the given subcommand(s) markdown update -- portal -- Run dapp-portal prover -- Prover related commands server -- Run server ``` ```bash ❯ zkstack ecosystem build-transactions -- Create transactions to build ecosystem contracts change-default-chain -- Change the default chain create -- Create a new ecosystem and chain, setting necessary configurations for later initialization help -- Print this message or the help of the given subcommand(s) init -- Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations setup-observability -- Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo ``` ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --------- Co-authored-by: Danil --- .github/workflows/ci-core-lint-reusable.yml | 1 + zkstack_cli/Cargo.lock | 12 +- zkstack_cli/Cargo.toml | 3 +- zkstack_cli/crates/zkstack/Cargo.toml | 6 +- zkstack_cli/crates/zkstack/build.rs | 121 +- .../crates/zkstack/completion/_zkstack.zsh | 4997 ++++++++++++ .../crates/zkstack/completion/zkstack.fish | 701 ++ .../crates/zkstack/completion/zkstack.sh | 6998 +++++++++++++++++ .../zkstack/src/commands/args/autocomplete.rs | 13 + .../crates/zkstack/src/commands/args/mod.rs | 2 + .../zkstack/src/commands/autocomplete.rs | 52 + .../zkstack/src/commands/chain/args/create.rs | 4 +- .../src/commands/chain/args/init/configs.rs | 2 +- .../src/commands/chain/args/init/mod.rs | 2 +- .../zkstack/src/commands/dev/commands/lint.rs | 67 +- .../src/commands/dev/commands/lint_utils.rs | 1 + .../commands/dev/commands/test/args/fees.rs | 2 +- .../dev/commands/test/args/recovery.rs | 2 +- .../commands/dev/commands/test/args/revert.rs | 2 +- .../src/commands/ecosystem/args/create.rs | 4 +- .../src/commands/ecosystem/args/init.rs | 2 +- .../crates/zkstack/src/commands/mod.rs | 1 + zkstack_cli/crates/zkstack/src/main.rs | 78 +- zkstack_cli/crates/zkstack/src/messages.rs | 7 + 24 files changed, 13021 insertions(+), 59 deletions(-) create mode 100644 zkstack_cli/crates/zkstack/completion/_zkstack.zsh create mode 100644 zkstack_cli/crates/zkstack/completion/zkstack.fish create mode 100644 zkstack_cli/crates/zkstack/completion/zkstack.sh create mode 100644 zkstack_cli/crates/zkstack/src/commands/args/autocomplete.rs create mode 100644 zkstack_cli/crates/zkstack/src/commands/autocomplete.rs diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 53b25835ff5..0babbd1c9db 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -49,6 +49,7 @@ jobs: ci_run zkstack dev lint -t js --check ci_run zkstack dev lint -t ts --check ci_run zkstack dev lint -t rs --check + ci_run zkstack dev lint -t autocompletion --check - name: Check Database run: | diff --git a/zkstack_cli/Cargo.lock b/zkstack_cli/Cargo.lock index 63561c02b9d..7770d06a197 100644 --- a/zkstack_cli/Cargo.lock +++ b/zkstack_cli/Cargo.lock @@ -609,6 +609,15 @@ dependencies = [ "terminal_size", ] +[[package]] +name = "clap_complete" +version = "4.5.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb" +dependencies = [ + "clap", +] + [[package]] name = "clap_derive" version = "4.5.18" @@ -6709,11 +6718,12 @@ dependencies = [ "chrono", "clap", "clap-markdown", + "clap_complete", "cliclack", "common", "config", + "dirs", "ethers", - "eyre", "futures", "human-panic", "lazy_static", diff --git a/zkstack_cli/Cargo.toml b/zkstack_cli/Cargo.toml index a805cf85d51..1f493f9c3e4 100644 --- a/zkstack_cli/Cargo.toml +++ b/zkstack_cli/Cargo.toml @@ -40,11 +40,12 @@ zksync_protobuf_build = "=0.5.0" # External dependencies anyhow = "1.0.82" clap = { version = "4.4", features = ["derive", "wrap_help", "string"] } +clap_complete = "4.5.33" +dirs = "5.0.1" slugify-rs = "0.0.3" cliclack = "0.2.5" console = "0.15.8" chrono = "0.4.38" -eyre = "0.6.12" ethers = "2.0" futures = "0.3.30" human-panic = "2.0" diff --git a/zkstack_cli/crates/zkstack/Cargo.toml b/zkstack_cli/crates/zkstack/Cargo.toml index a9fcecaf79b..93a78c751b1 100644 --- a/zkstack_cli/crates/zkstack/Cargo.toml +++ b/zkstack_cli/crates/zkstack/Cargo.toml @@ -14,10 +14,12 @@ keywords.workspace = true anyhow.workspace = true chrono.workspace = true clap.workspace = true +clap_complete.workspace = true clap-markdown.workspace = true cliclack.workspace = true common.workspace = true config.workspace = true +dirs.workspace = true ethers.workspace = true futures.workspace = true human-panic.workspace = true @@ -49,6 +51,8 @@ rand.workspace = true zksync_consensus_utils.workspace = true [build-dependencies] -eyre.workspace = true +anyhow.workspace = true +clap_complete.workspace = true +dirs.workspace = true ethers.workspace = true zksync_protobuf_build.workspace = true diff --git a/zkstack_cli/crates/zkstack/build.rs b/zkstack_cli/crates/zkstack/build.rs index 92f34a542b7..bccf5bae89f 100644 --- a/zkstack_cli/crates/zkstack/build.rs +++ b/zkstack_cli/crates/zkstack/build.rs @@ -1,12 +1,23 @@ -use std::path::PathBuf; +use std::path::{Path, PathBuf}; +use anyhow::{anyhow, Context}; use ethers::contract::Abigen; -fn main() -> eyre::Result<()> { +const COMPLETION_DIR: &str = "completion"; + +fn main() -> anyhow::Result<()> { let outdir = PathBuf::from(std::env::var("OUT_DIR")?).canonicalize()?; - Abigen::new("ConsensusRegistry", "abi/ConsensusRegistry.json")? - .generate()? - .write_to_file(outdir.join("consensus_registry_abi.rs"))?; + Abigen::new("ConsensusRegistry", "abi/ConsensusRegistry.json") + .map_err(|_| anyhow!("Failed ABI deserialization"))? + .generate() + .map_err(|_| anyhow!("Failed ABI generation"))? + .write_to_file(outdir.join("consensus_registry_abi.rs")) + .context("Failed to write ABI to file")?; + + if let Err(e) = configure_shell_autocompletion() { + println!("cargo:warning=It was not possible to install autocomplete scripts. Please generate them manually with `zkstack autocomplete`"); + println!("cargo:error={}", e); + }; zksync_protobuf_build::Config { input_root: "src/commands/consensus/proto".into(), @@ -19,3 +30,103 @@ fn main() -> eyre::Result<()> { .unwrap(); Ok(()) } + +fn configure_shell_autocompletion() -> anyhow::Result<()> { + // Array of supported shells + let shells = [ + clap_complete::Shell::Bash, + clap_complete::Shell::Fish, + clap_complete::Shell::Zsh, + ]; + + for shell in shells { + std::fs::create_dir_all(&shell.autocomplete_folder()?) + .context("it was impossible to create the configuration directory")?; + + let src = Path::new(COMPLETION_DIR).join(shell.autocomplete_file_name()?); + let dst = shell + .autocomplete_folder()? + .join(shell.autocomplete_file_name()?); + + std::fs::copy(src, dst)?; + + shell + .configure_autocomplete() + .context("failed to run extra configuration requirements")?; + } + + Ok(()) +} + +pub trait ShellAutocomplete { + fn autocomplete_folder(&self) -> anyhow::Result; + fn autocomplete_file_name(&self) -> anyhow::Result; + /// Extra steps required for shells enable command autocomplete. + fn configure_autocomplete(&self) -> anyhow::Result<()>; +} + +impl ShellAutocomplete for clap_complete::Shell { + fn autocomplete_folder(&self) -> anyhow::Result { + let home_dir = dirs::home_dir().context("missing home folder")?; + + match self { + clap_complete::Shell::Bash => Ok(home_dir.join(".bash_completion.d")), + clap_complete::Shell::Fish => Ok(home_dir.join(".config/fish/completions")), + clap_complete::Shell::Zsh => Ok(home_dir.join(".zsh/completion")), + _ => anyhow::bail!("unsupported shell"), + } + } + + fn autocomplete_file_name(&self) -> anyhow::Result { + let crate_name = env!("CARGO_PKG_NAME"); + + match self { + clap_complete::Shell::Bash => Ok(format!("{}.sh", crate_name)), + clap_complete::Shell::Fish => Ok(format!("{}.fish", crate_name)), + clap_complete::Shell::Zsh => Ok(format!("_{}.zsh", crate_name)), + _ => anyhow::bail!("unsupported shell"), + } + } + + fn configure_autocomplete(&self) -> anyhow::Result<()> { + match self { + clap_complete::Shell::Bash | clap_complete::Shell::Zsh => { + let shell = &self.to_string().to_lowercase(); + let completion_file = self + .autocomplete_folder()? + .join(self.autocomplete_file_name()?); + + // Source the completion file inside .{shell}rc + let shell_rc = dirs::home_dir() + .context("missing home directory")? + .join(format!(".{}rc", shell)); + + if shell_rc.exists() { + let shell_rc_content = std::fs::read_to_string(&shell_rc) + .context(format!("could not read .{}rc", shell))?; + + if !shell_rc_content.contains("# zkstack completion") { + std::fs::write( + shell_rc, + format!( + "{}\n# zkstack completion\nsource \"{}\"\n", + shell_rc_content, + completion_file.to_str().unwrap() + ), + ) + .context(format!("could not write .{}rc", shell))?; + } + } else { + println!( + "cargo:warning=Please add the following line to your .{}rc:", + shell + ); + println!("cargo:warning=source {}", completion_file.to_str().unwrap()); + } + } + _ => (), + } + + Ok(()) + } +} diff --git a/zkstack_cli/crates/zkstack/completion/_zkstack.zsh b/zkstack_cli/crates/zkstack/completion/_zkstack.zsh new file mode 100644 index 00000000000..a8a60a6130a --- /dev/null +++ b/zkstack_cli/crates/zkstack/completion/_zkstack.zsh @@ -0,0 +1,4997 @@ +#compdef zkstack + +autoload -U is-at-least + +_zkstack() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'-V[Print version]' \ +'--version[Print version]' \ +":: :_zkstack_commands" \ +"*::: :->zkstack" \ +&& ret=0 + case $state in + (zkstack) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-command-$line[1]:" + case $line[1] in + (autocomplete) +_arguments "${_arguments_options[@]}" : \ +'--generate=[The shell to generate the autocomplete script for]:GENERATOR:(bash elvish fish powershell zsh)' \ +'-o+[The out directory to write the autocomplete script to]:OUT:_files' \ +'--out=[The out directory to write the autocomplete script to]:OUT:_files' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(ecosystem) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__ecosystem_commands" \ +"*::: :->ecosystem" \ +&& ret=0 + + case $state in + (ecosystem) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-ecosystem-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +'--ecosystem-name=[]:ECOSYSTEM_NAME: ' \ +'--l1-network=[L1 Network]:L1_NETWORK:(localhost sepolia holesky mainnet)' \ +'--link-to-code=[Code link]:LINK_TO_CODE:_files -/' \ +'--chain-name=[]:CHAIN_NAME: ' \ +'--chain-id=[Chain ID]:CHAIN_ID: ' \ +'--prover-mode=[Prover options]:PROVER_MODE:(no-proofs gpu)' \ +'--wallet-creation=[Wallet options]:WALLET_CREATION:((localhost\:"Load wallets from localhost mnemonic, they are funded for localhost env" +random\:"Generate random wallets" +empty\:"Generate placeholder wallets" +in-file\:"Specify file with wallets"))' \ +'--wallet-path=[Wallet path]:WALLET_PATH:_files' \ +'--l1-batch-commit-data-generator-mode=[Commit data generation mode]:L1_BATCH_COMMIT_DATA_GENERATOR_MODE:(rollup validium)' \ +'--base-token-address=[Base token address]:BASE_TOKEN_ADDRESS: ' \ +'--base-token-price-nominator=[Base token nominator]:BASE_TOKEN_PRICE_NOMINATOR: ' \ +'--base-token-price-denominator=[Base token denominator]:BASE_TOKEN_PRICE_DENOMINATOR: ' \ +'--set-as-default=[Set as default chain]' \ +'--start-containers=[Start reth and postgres containers after creation]' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--legacy-bridge[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(build-transactions) +_arguments "${_arguments_options[@]}" : \ +'--sender=[Address of the transaction sender]:SENDER: ' \ +'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ +'-o+[Output directory for the generated files]:OUT:_files' \ +'--out=[Output directory for the generated files]:OUT:_files' \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +'--deploy-erc20=[Deploy ERC20 contracts]' \ +'--deploy-ecosystem=[Deploy ecosystem contracts]' \ +'--ecosystem-contracts-path=[Path to ecosystem contracts]:ECOSYSTEM_CONTRACTS_PATH:_files' \ +'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--deploy-paymaster=[Deploy Paymaster contract]' \ +'--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ +'--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ +'-o+[Enable Grafana]' \ +'--observability=[Enable Grafana]' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-u[Use default database urls and names]' \ +'--use-default[Use default database urls and names]' \ +'-d[]' \ +'--dont-drop[]' \ +'--ecosystem-only[Initialize ecosystem only and skip chain initialization (chain can be initialized later with \`chain init\` subcommand)]' \ +'--dev[Deploy ecosystem using all defaults. Suitable for local development]' \ +'--no-port-reallocation[Do not reallocate ports]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(change-default-chain) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'::name:' \ +&& ret=0 +;; +(setup-observability) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__ecosystem__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-ecosystem-help-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build-transactions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(change-default-chain) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup-observability) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(chain) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__chain_commands" \ +"*::: :->chain" \ +&& ret=0 + + case $state in + (chain) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +'--chain-name=[]:CHAIN_NAME: ' \ +'--chain-id=[Chain ID]:CHAIN_ID: ' \ +'--prover-mode=[Prover options]:PROVER_MODE:(no-proofs gpu)' \ +'--wallet-creation=[Wallet options]:WALLET_CREATION:((localhost\:"Load wallets from localhost mnemonic, they are funded for localhost env" +random\:"Generate random wallets" +empty\:"Generate placeholder wallets" +in-file\:"Specify file with wallets"))' \ +'--wallet-path=[Wallet path]:WALLET_PATH:_files' \ +'--l1-batch-commit-data-generator-mode=[Commit data generation mode]:L1_BATCH_COMMIT_DATA_GENERATOR_MODE:(rollup validium)' \ +'--base-token-address=[Base token address]:BASE_TOKEN_ADDRESS: ' \ +'--base-token-price-nominator=[Base token nominator]:BASE_TOKEN_PRICE_NOMINATOR: ' \ +'--base-token-price-denominator=[Base token denominator]:BASE_TOKEN_PRICE_DENOMINATOR: ' \ +'--set-as-default=[Set as default chain]' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--legacy-bridge[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(build-transactions) +_arguments "${_arguments_options[@]}" : \ +'-o+[Output directory for the generated files]:OUT:_files' \ +'--out=[Output directory for the generated files]:OUT:_files' \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ +'--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ +'--deploy-paymaster=[]' \ +'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-u[Use default database urls and names]' \ +'--use-default[Use default database urls and names]' \ +'-d[]' \ +'--dont-drop[]' \ +'--no-port-reallocation[Do not reallocate ports]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +":: :_zkstack__chain__init_commands" \ +"*::: :->init" \ +&& ret=0 + + case $state in + (init) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-init-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +'--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ +'--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ +'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-u[Use default database urls and names]' \ +'--use-default[Use default database urls and names]' \ +'-d[]' \ +'--dont-drop[]' \ +'--no-port-reallocation[Do not reallocate ports]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__chain__init__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-init-help-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(genesis) +_arguments "${_arguments_options[@]}" : \ +'--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ +'--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-u[Use default database urls and names]' \ +'--use-default[Use default database urls and names]' \ +'-d[]' \ +'--dont-drop[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__chain__genesis_commands" \ +"*::: :->genesis" \ +&& ret=0 + + case $state in + (genesis) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-genesis-command-$line[1]:" + case $line[1] in + (init-database) +_arguments "${_arguments_options[@]}" : \ +'--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ +'--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-u[Use default database urls and names]' \ +'--use-default[Use default database urls and names]' \ +'-d[]' \ +'--dont-drop[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(server) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__chain__genesis__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-genesis-help-command-$line[1]:" + case $line[1] in + (init-database) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(server) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(register-chain) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(deploy-l2-contracts) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(accept-chain-ownership) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(initialize-bridges) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(deploy-consensus-registry) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(deploy-multicall3) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(deploy-upgrader) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(deploy-paymaster) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(update-token-multiplier-setter) +_arguments "${_arguments_options[@]}" : \ +'--verify=[Verify deployed contracts]' \ +'--verifier=[Verifier to use]:VERIFIER:(etherscan sourcify blockscout oklink)' \ +'--verifier-url=[Verifier URL, if using a custom provider]:VERIFIER_URL: ' \ +'--verifier-api-key=[Verifier API key]:VERIFIER_API_KEY: ' \ +'*-a+[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[List of additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--resume[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__chain__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-help-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build-transactions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__chain__help__init_commands" \ +"*::: :->init" \ +&& ret=0 + + case $state in + (init) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-help-init-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(genesis) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__chain__help__genesis_commands" \ +"*::: :->genesis" \ +&& ret=0 + + case $state in + (genesis) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-chain-help-genesis-command-$line[1]:" + case $line[1] in + (init-database) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(server) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(register-chain) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-l2-contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(accept-chain-ownership) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(initialize-bridges) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-consensus-registry) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-multicall3) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-upgrader) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-paymaster) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(update-token-multiplier-setter) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(dev) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev_commands" \ +"*::: :->dev" \ +&& ret=0 + + case $state in + (dev) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-command-$line[1]:" + case $line[1] in + (database) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__database_commands" \ +"*::: :->database" \ +&& ret=0 + + case $state in + (database) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-database-command-$line[1]:" + case $line[1] in + (check-sqlx-data) +_arguments "${_arguments_options[@]}" : \ +'-p+[Prover database]' \ +'--prover=[Prover database]' \ +'--prover-url=[URL of the Prover database. If not specified, it is used from the current chain'\''s secrets]:PROVER_URL: ' \ +'-c+[Core database]' \ +'--core=[Core database]' \ +'--core-url=[URL of the Core database. If not specified, it is used from the current chain'\''s secrets.]:CORE_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +'-p+[Prover database]' \ +'--prover=[Prover database]' \ +'--prover-url=[URL of the Prover database. If not specified, it is used from the current chain'\''s secrets]:PROVER_URL: ' \ +'-c+[Core database]' \ +'--core=[Core database]' \ +'--core-url=[URL of the Core database. If not specified, it is used from the current chain'\''s secrets.]:CORE_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(migrate) +_arguments "${_arguments_options[@]}" : \ +'-p+[Prover database]' \ +'--prover=[Prover database]' \ +'--prover-url=[URL of the Prover database. If not specified, it is used from the current chain'\''s secrets]:PROVER_URL: ' \ +'-c+[Core database]' \ +'--core=[Core database]' \ +'--core-url=[URL of the Core database. If not specified, it is used from the current chain'\''s secrets.]:CORE_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(new-migration) +_arguments "${_arguments_options[@]}" : \ +'--database=[Database to create new migration for]:DATABASE:(prover core)' \ +'--name=[Migration name]:NAME: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(prepare) +_arguments "${_arguments_options[@]}" : \ +'-p+[Prover database]' \ +'--prover=[Prover database]' \ +'--prover-url=[URL of the Prover database. If not specified, it is used from the current chain'\''s secrets]:PROVER_URL: ' \ +'-c+[Core database]' \ +'--core=[Core database]' \ +'--core-url=[URL of the Core database. If not specified, it is used from the current chain'\''s secrets.]:CORE_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +'-p+[Prover database]' \ +'--prover=[Prover database]' \ +'--prover-url=[URL of the Prover database. If not specified, it is used from the current chain'\''s secrets]:PROVER_URL: ' \ +'-c+[Core database]' \ +'--core=[Core database]' \ +'--core-url=[URL of the Core database. If not specified, it is used from the current chain'\''s secrets.]:CORE_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(setup) +_arguments "${_arguments_options[@]}" : \ +'-p+[Prover database]' \ +'--prover=[Prover database]' \ +'--prover-url=[URL of the Prover database. If not specified, it is used from the current chain'\''s secrets]:PROVER_URL: ' \ +'-c+[Core database]' \ +'--core=[Core database]' \ +'--core-url=[URL of the Core database. If not specified, it is used from the current chain'\''s secrets.]:CORE_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__database__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-database-help-command-$line[1]:" + case $line[1] in + (check-sqlx-data) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(migrate) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(new-migration) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prepare) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(test) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__test_commands" \ +"*::: :->test" \ +&& ret=0 + + case $state in + (test) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-test-command-$line[1]:" + case $line[1] in + (integration) +_arguments "${_arguments_options[@]}" : \ +'-t+[Run just the tests matching a pattern. Same as the -t flag on jest.]:TEST_PATTERN: ' \ +'--test-pattern=[Run just the tests matching a pattern. Same as the -t flag on jest.]:TEST_PATTERN: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-e[Run tests for external node]' \ +'--external-node[Run tests for external node]' \ +'-n[Do not install or build dependencies]' \ +'--no-deps[Do not install or build dependencies]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(fees) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-n[Do not install or build dependencies]' \ +'--no-deps[Do not install or build dependencies]' \ +'--no-kill[The test will not kill all the nodes during execution]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'--enable-consensus[Enable consensus]' \ +'-e[Run tests for external node]' \ +'--external-node[Run tests for external node]' \ +'-n[Do not install or build dependencies]' \ +'--no-deps[Do not install or build dependencies]' \ +'--no-kill[The test will not kill all the nodes during execution]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(recovery) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-s[Run recovery from a snapshot instead of genesis]' \ +'--snapshot[Run recovery from a snapshot instead of genesis]' \ +'-n[Do not install or build dependencies]' \ +'--no-deps[Do not install or build dependencies]' \ +'--no-kill[The test will not kill all the nodes during execution]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(upgrade) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-n[Do not install or build dependencies]' \ +'--no-deps[Do not install or build dependencies]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(build) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(rust) +_arguments "${_arguments_options[@]}" : \ +'--options=[Cargo test flags]:OPTIONS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(l1-contracts) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(wallet) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(loadtest) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__test__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-test-help-command-$line[1]:" + case $line[1] in + (integration) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(fees) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(recovery) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(upgrade) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(rust) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(l1-contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(wallet) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(loadtest) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(clean) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__clean_commands" \ +"*::: :->clean" \ +&& ret=0 + + case $state in + (clean) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-clean-command-$line[1]:" + case $line[1] in + (all) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(containers) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(contracts-cache) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__clean__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-clean-help-command-$line[1]:" + case $line[1] in + (all) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(containers) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contracts-cache) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(snapshot) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__snapshot_commands" \ +"*::: :->snapshot" \ +&& ret=0 + + case $state in + (snapshot) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-snapshot-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__snapshot__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-snapshot-help-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(lint) +_arguments "${_arguments_options[@]}" : \ +'*-t+[]:TARGETS:(md sol js ts rs contracts autocompletion)' \ +'*--targets=[]:TARGETS:(md sol js ts rs contracts autocompletion)' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-c[]' \ +'--check[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(fmt) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-c[]' \ +'--check[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__fmt_commands" \ +"*::: :->fmt" \ +&& ret=0 + + case $state in + (fmt) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-fmt-command-$line[1]:" + case $line[1] in + (rustfmt) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(contract) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(prettier) +_arguments "${_arguments_options[@]}" : \ +'*-t+[]:TARGETS:(md sol js ts rs contracts autocompletion)' \ +'*--targets=[]:TARGETS:(md sol js ts rs contracts autocompletion)' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__fmt__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-fmt-help-command-$line[1]:" + case $line[1] in + (rustfmt) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contract) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prettier) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__prover_commands" \ +"*::: :->prover" \ +&& ret=0 + + case $state in + (prover) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-prover-command-$line[1]:" + case $line[1] in + (info) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(insert-batch) +_arguments "${_arguments_options[@]}" : \ +'--number=[]:NUMBER: ' \ +'--version=[]:VERSION: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--default[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(insert-version) +_arguments "${_arguments_options[@]}" : \ +'--version=[]:VERSION: ' \ +'--snark-wrapper=[]:SNARK_WRAPPER: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--default[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__prover__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-prover-help-command-$line[1]:" + case $line[1] in + (info) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(insert-batch) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(insert-version) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(contracts) +_arguments "${_arguments_options[@]}" : \ +'--l1-contracts=[Build L1 contracts]' \ +'--l2-contracts=[Build L2 contracts]' \ +'--system-contracts=[Build system contracts]' \ +'--test-contracts=[Build test contracts]' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(config-writer) +_arguments "${_arguments_options[@]}" : \ +'-p+[Path to the config file to override]:PATH: ' \ +'--path=[Path to the config file to override]:PATH: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(send-transactions) +_arguments "${_arguments_options[@]}" : \ +'--file=[]:FILE:_files' \ +'--private-key=[]:PRIVATE_KEY: ' \ +'--l1-rpc-url=[]:L1_RPC_URL: ' \ +'--confirmations=[]:CONFIRMATIONS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(status) +_arguments "${_arguments_options[@]}" : \ +'-u+[URL of the health check endpoint]:URL: ' \ +'--url=[URL of the health check endpoint]:URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__dev__status_commands" \ +"*::: :->status" \ +&& ret=0 + + case $state in + (status) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-status-command-$line[1]:" + case $line[1] in + (ports) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__status__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-status-help-command-$line[1]:" + case $line[1] in + (ports) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(generate-genesis) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-command-$line[1]:" + case $line[1] in + (database) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__database_commands" \ +"*::: :->database" \ +&& ret=0 + + case $state in + (database) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-database-command-$line[1]:" + case $line[1] in + (check-sqlx-data) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(migrate) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(new-migration) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prepare) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(test) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__test_commands" \ +"*::: :->test" \ +&& ret=0 + + case $state in + (test) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-test-command-$line[1]:" + case $line[1] in + (integration) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(fees) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(recovery) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(upgrade) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(rust) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(l1-contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(wallet) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(loadtest) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(clean) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__clean_commands" \ +"*::: :->clean" \ +&& ret=0 + + case $state in + (clean) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-clean-command-$line[1]:" + case $line[1] in + (all) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(containers) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contracts-cache) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(snapshot) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__snapshot_commands" \ +"*::: :->snapshot" \ +&& ret=0 + + case $state in + (snapshot) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-snapshot-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(lint) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(fmt) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__fmt_commands" \ +"*::: :->fmt" \ +&& ret=0 + + case $state in + (fmt) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-fmt-command-$line[1]:" + case $line[1] in + (rustfmt) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contract) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prettier) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__prover_commands" \ +"*::: :->prover" \ +&& ret=0 + + case $state in + (prover) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-prover-command-$line[1]:" + case $line[1] in + (info) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(insert-batch) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(insert-version) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(config-writer) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(send-transactions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(status) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__dev__help__status_commands" \ +"*::: :->status" \ +&& ret=0 + + case $state in + (status) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-dev-help-status-command-$line[1]:" + case $line[1] in + (ports) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(generate-genesis) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__prover_commands" \ +"*::: :->prover" \ +&& ret=0 + + case $state in + (prover) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-prover-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" : \ +'--proof-store-dir=[]:PROOF_STORE_DIR: ' \ +'--bucket-base-url=[]:BUCKET_BASE_URL: ' \ +'--credentials-file=[]:CREDENTIALS_FILE: ' \ +'--bucket-name=[]:BUCKET_NAME: ' \ +'--location=[]:LOCATION: ' \ +'--project-id=[]:PROJECT_ID: ' \ +'--shall-save-to-public-bucket=[]:SHALL_SAVE_TO_PUBLIC_BUCKET:(true false)' \ +'--public-store-dir=[]:PUBLIC_STORE_DIR: ' \ +'--public-bucket-base-url=[]:PUBLIC_BUCKET_BASE_URL: ' \ +'--public-credentials-file=[]:PUBLIC_CREDENTIALS_FILE: ' \ +'--public-bucket-name=[]:PUBLIC_BUCKET_NAME: ' \ +'--public-location=[]:PUBLIC_LOCATION: ' \ +'--public-project-id=[]:PUBLIC_PROJECT_ID: ' \ +'(--clone)--bellman-cuda-dir=[]:BELLMAN_CUDA_DIR: ' \ +'--bellman-cuda=[]' \ +'--setup-compressor-key=[]' \ +'--path=[]:PATH: ' \ +'--region=[]:REGION:(us europe asia)' \ +'--mode=[]:MODE:(download generate)' \ +'--setup-keys=[]' \ +'--setup-database=[]:SETUP_DATABASE:(true false)' \ +'--prover-db-url=[Prover database url without database name]:PROVER_DB_URL: ' \ +'--prover-db-name=[Prover database name]:PROVER_DB_NAME: ' \ +'-u+[Use default database urls and names]:USE_DEFAULT:(true false)' \ +'--use-default=[Use default database urls and names]:USE_DEFAULT:(true false)' \ +'-d+[]:DONT_DROP:(true false)' \ +'--dont-drop=[]:DONT_DROP:(true false)' \ +'--cloud-type=[]:CLOUD_TYPE:(gcp local)' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--dev[]' \ +'(--bellman-cuda-dir)--clone[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(setup-keys) +_arguments "${_arguments_options[@]}" : \ +'--region=[]:REGION:(us europe asia)' \ +'--mode=[]:MODE:(download generate)' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +'--component=[]:COMPONENT:(gateway witness-generator witness-vector-generator prover circuit-prover compressor prover-job-monitor)' \ +'--round=[]:ROUND:(all-rounds basic-circuits leaf-aggregation node-aggregation recursion-tip scheduler)' \ +'--threads=[]:THREADS: ' \ +'--max-allocation=[Memory allocation limit in bytes (for prover component)]:MAX_ALLOCATION: ' \ +'--witness-vector-generator-count=[]:WITNESS_VECTOR_GENERATOR_COUNT: ' \ +'--max-allocation=[]:MAX_ALLOCATION: ' \ +'--docker=[]:DOCKER:(true false)' \ +'--tag=[]:TAG: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(init-bellman-cuda) +_arguments "${_arguments_options[@]}" : \ +'(--clone)--bellman-cuda-dir=[]:BELLMAN_CUDA_DIR: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'(--bellman-cuda-dir)--clone[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(compressor-keys) +_arguments "${_arguments_options[@]}" : \ +'--path=[]:PATH: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__prover__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-prover-help-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup-keys) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init-bellman-cuda) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(compressor-keys) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(server) +_arguments "${_arguments_options[@]}" : \ +'*--components=[Components of server to run]:COMPONENTS: ' \ +'*-a+[Additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[Additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--genesis[Run server in genesis mode]' \ +'--build[Build server but don'\''t run it]' \ +'--uring[Enables uring support for RocksDB]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(external-node) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__external-node_commands" \ +"*::: :->external-node" \ +&& ret=0 + + case $state in + (external-node) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-external-node-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +'--db-url=[]:DB_URL: ' \ +'--db-name=[]:DB_NAME: ' \ +'--l1-rpc-url=[]:L1_RPC_URL: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-u[Use default database urls and names]' \ +'--use-default[Use default database urls and names]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +'*--components=[Components of server to run]:COMPONENTS: ' \ +'--enable-consensus=[Enable consensus]' \ +'*-a+[Additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'*--additional-args=[Additional arguments that can be passed through the CLI]:ADDITIONAL_ARGS: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--reinit[]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__external-node__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-external-node-help-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(containers) +_arguments "${_arguments_options[@]}" : \ +'-o+[Enable Grafana]' \ +'--observability=[Enable Grafana]' \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(contract-verifier) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__contract-verifier_commands" \ +"*::: :->contract-verifier" \ +&& ret=0 + + case $state in + (contract-verifier) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-contract-verifier-command-$line[1]:" + case $line[1] in + (run) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +'--zksolc-version=[Version of zksolc to install]:ZKSOLC_VERSION: ' \ +'--zkvyper-version=[Version of zkvyper to install]:ZKVYPER_VERSION: ' \ +'--solc-version=[Version of solc to install]:SOLC_VERSION: ' \ +'--era-vm-solc-version=[Version of era vm solc to install]:ERA_VM_SOLC_VERSION: ' \ +'--vyper-version=[Version of vyper to install]:VYPER_VERSION: ' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--only[Install only provided compilers]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__contract-verifier__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-contract-verifier-help-command-$line[1]:" + case $line[1] in + (run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(portal) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(explorer) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__explorer_commands" \ +"*::: :->explorer" \ +&& ret=0 + + case $state in + (explorer) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-explorer-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(run-backend) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__explorer__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-explorer-help-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run-backend) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(consensus) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_zkstack__consensus_commands" \ +"*::: :->consensus" \ +&& ret=0 + + case $state in + (consensus) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-consensus-command-$line[1]:" + case $line[1] in + (set-attester-committee) +_arguments "${_arguments_options[@]}" : \ +'--from-file=[Sets the attester committee in the consensus registry contract to the committee in the yaml file. File format is definied in \`commands/consensus/proto/mod.proto\`]:FROM_FILE:_files' \ +'--chain=[Chain to use]:CHAIN: ' \ +'--from-genesis[Sets the attester committee in the consensus registry contract to \`consensus.genesis_spec.attesters\` in general.yaml]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(get-attester-committee) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__consensus__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-consensus-help-command-$line[1]:" + case $line[1] in + (set-attester-committee) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(get-attester-committee) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(update) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-c[Update only the config files]' \ +'--only-config[Update only the config files]' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(markdown) +_arguments "${_arguments_options[@]}" : \ +'--chain=[Chain to use]:CHAIN: ' \ +'-v[Verbose mode]' \ +'--verbose[Verbose mode]' \ +'--ignore-prerequisites[Ignores prerequisites checks]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-command-$line[1]:" + case $line[1] in + (autocomplete) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(ecosystem) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__ecosystem_commands" \ +"*::: :->ecosystem" \ +&& ret=0 + + case $state in + (ecosystem) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-ecosystem-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build-transactions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(change-default-chain) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup-observability) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(chain) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__chain_commands" \ +"*::: :->chain" \ +&& ret=0 + + case $state in + (chain) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-chain-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build-transactions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__chain__init_commands" \ +"*::: :->init" \ +&& ret=0 + + case $state in + (init) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-chain-init-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(genesis) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__chain__genesis_commands" \ +"*::: :->genesis" \ +&& ret=0 + + case $state in + (genesis) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-chain-genesis-command-$line[1]:" + case $line[1] in + (init-database) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(server) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(register-chain) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-l2-contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(accept-chain-ownership) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(initialize-bridges) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-consensus-registry) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-multicall3) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-upgrader) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(deploy-paymaster) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(update-token-multiplier-setter) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(dev) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev_commands" \ +"*::: :->dev" \ +&& ret=0 + + case $state in + (dev) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-command-$line[1]:" + case $line[1] in + (database) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__database_commands" \ +"*::: :->database" \ +&& ret=0 + + case $state in + (database) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-database-command-$line[1]:" + case $line[1] in + (check-sqlx-data) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(migrate) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(new-migration) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prepare) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(test) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__test_commands" \ +"*::: :->test" \ +&& ret=0 + + case $state in + (test) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-test-command-$line[1]:" + case $line[1] in + (integration) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(fees) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(recovery) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(upgrade) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(build) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(rust) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(l1-contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(wallet) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(loadtest) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(clean) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__clean_commands" \ +"*::: :->clean" \ +&& ret=0 + + case $state in + (clean) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-clean-command-$line[1]:" + case $line[1] in + (all) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(containers) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contracts-cache) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(snapshot) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__snapshot_commands" \ +"*::: :->snapshot" \ +&& ret=0 + + case $state in + (snapshot) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-snapshot-command-$line[1]:" + case $line[1] in + (create) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(lint) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(fmt) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__fmt_commands" \ +"*::: :->fmt" \ +&& ret=0 + + case $state in + (fmt) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-fmt-command-$line[1]:" + case $line[1] in + (rustfmt) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contract) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prettier) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__prover_commands" \ +"*::: :->prover" \ +&& ret=0 + + case $state in + (prover) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-prover-command-$line[1]:" + case $line[1] in + (info) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(insert-batch) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(insert-version) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(contracts) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(config-writer) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(send-transactions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(status) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__dev__status_commands" \ +"*::: :->status" \ +&& ret=0 + + case $state in + (status) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-dev-status-command-$line[1]:" + case $line[1] in + (ports) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(generate-genesis) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(prover) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__prover_commands" \ +"*::: :->prover" \ +&& ret=0 + + case $state in + (prover) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-prover-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(setup-keys) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init-bellman-cuda) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(compressor-keys) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(server) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(external-node) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__external-node_commands" \ +"*::: :->external-node" \ +&& ret=0 + + case $state in + (external-node) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-external-node-command-$line[1]:" + case $line[1] in + (configs) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(containers) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(contract-verifier) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__contract-verifier_commands" \ +"*::: :->contract-verifier" \ +&& ret=0 + + case $state in + (contract-verifier) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-contract-verifier-command-$line[1]:" + case $line[1] in + (run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(portal) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(explorer) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__explorer_commands" \ +"*::: :->explorer" \ +&& ret=0 + + case $state in + (explorer) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-explorer-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run-backend) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(consensus) +_arguments "${_arguments_options[@]}" : \ +":: :_zkstack__help__consensus_commands" \ +"*::: :->consensus" \ +&& ret=0 + + case $state in + (consensus) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:zkstack-help-consensus-command-$line[1]:" + case $line[1] in + (set-attester-committee) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(get-attester-committee) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(update) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(markdown) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +} + +(( $+functions[_zkstack_commands] )) || +_zkstack_commands() { + local commands; commands=( +'autocomplete:Create shell autocompletion files' \ +'ecosystem:Ecosystem related commands' \ +'chain:Chain related commands' \ +'dev:Supervisor related commands' \ +'prover:Prover related commands' \ +'server:Run server' \ +'external-node:External Node related commands' \ +'containers:Run containers for local development' \ +'contract-verifier:Run contract verifier' \ +'portal:Run dapp-portal' \ +'explorer:Run block-explorer' \ +'consensus:Consensus utilities' \ +'update:Update ZKsync' \ +'markdown:Print markdown help' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack commands' commands "$@" +} +(( $+functions[_zkstack__autocomplete_commands] )) || +_zkstack__autocomplete_commands() { + local commands; commands=() + _describe -t commands 'zkstack autocomplete commands' commands "$@" +} +(( $+functions[_zkstack__chain_commands] )) || +_zkstack__chain_commands() { + local commands; commands=( +'create:Create a new chain, setting the necessary configurations for later initialization' \ +'build-transactions:Create unsigned transactions for chain deployment' \ +'init:Initialize chain, deploying necessary contracts and performing on-chain operations' \ +'genesis:Run server genesis' \ +'register-chain:Register a new chain on L1 (executed by L1 governor). This command deploys and configures Governance, ChainAdmin, and DiamondProxy contracts, registers chain with BridgeHub and sets pending admin for DiamondProxy. Note\: After completion, L2 governor can accept ownership by running \`accept-chain-ownership\`' \ +'deploy-l2-contracts:Deploy all L2 contracts (executed by L1 governor)' \ +'accept-chain-ownership:Accept ownership of L2 chain (executed by L2 governor). This command should be run after \`register-chain\` to accept ownership of newly created DiamondProxy contract' \ +'initialize-bridges:Initialize bridges on L2' \ +'deploy-consensus-registry:Deploy L2 consensus registry' \ +'deploy-multicall3:Deploy L2 multicall3' \ +'deploy-upgrader:Deploy Default Upgrader' \ +'deploy-paymaster:Deploy paymaster smart contract' \ +'update-token-multiplier-setter:Update Token Multiplier Setter address on L1' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack chain commands' commands "$@" +} +(( $+functions[_zkstack__chain__accept-chain-ownership_commands] )) || +_zkstack__chain__accept-chain-ownership_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain accept-chain-ownership commands' commands "$@" +} +(( $+functions[_zkstack__chain__build-transactions_commands] )) || +_zkstack__chain__build-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain build-transactions commands' commands "$@" +} +(( $+functions[_zkstack__chain__create_commands] )) || +_zkstack__chain__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain create commands' commands "$@" +} +(( $+functions[_zkstack__chain__deploy-consensus-registry_commands] )) || +_zkstack__chain__deploy-consensus-registry_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain deploy-consensus-registry commands' commands "$@" +} +(( $+functions[_zkstack__chain__deploy-l2-contracts_commands] )) || +_zkstack__chain__deploy-l2-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain deploy-l2-contracts commands' commands "$@" +} +(( $+functions[_zkstack__chain__deploy-multicall3_commands] )) || +_zkstack__chain__deploy-multicall3_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain deploy-multicall3 commands' commands "$@" +} +(( $+functions[_zkstack__chain__deploy-paymaster_commands] )) || +_zkstack__chain__deploy-paymaster_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain deploy-paymaster commands' commands "$@" +} +(( $+functions[_zkstack__chain__deploy-upgrader_commands] )) || +_zkstack__chain__deploy-upgrader_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain deploy-upgrader commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis_commands] )) || +_zkstack__chain__genesis_commands() { + local commands; commands=( +'init-database:Initialize databases' \ +'server:Runs server genesis' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack chain genesis commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis__help_commands] )) || +_zkstack__chain__genesis__help_commands() { + local commands; commands=( +'init-database:Initialize databases' \ +'server:Runs server genesis' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack chain genesis help commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis__help__help_commands] )) || +_zkstack__chain__genesis__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain genesis help help commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis__help__init-database_commands] )) || +_zkstack__chain__genesis__help__init-database_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain genesis help init-database commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis__help__server_commands] )) || +_zkstack__chain__genesis__help__server_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain genesis help server commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis__init-database_commands] )) || +_zkstack__chain__genesis__init-database_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain genesis init-database commands' commands "$@" +} +(( $+functions[_zkstack__chain__genesis__server_commands] )) || +_zkstack__chain__genesis__server_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain genesis server commands' commands "$@" +} +(( $+functions[_zkstack__chain__help_commands] )) || +_zkstack__chain__help_commands() { + local commands; commands=( +'create:Create a new chain, setting the necessary configurations for later initialization' \ +'build-transactions:Create unsigned transactions for chain deployment' \ +'init:Initialize chain, deploying necessary contracts and performing on-chain operations' \ +'genesis:Run server genesis' \ +'register-chain:Register a new chain on L1 (executed by L1 governor). This command deploys and configures Governance, ChainAdmin, and DiamondProxy contracts, registers chain with BridgeHub and sets pending admin for DiamondProxy. Note\: After completion, L2 governor can accept ownership by running \`accept-chain-ownership\`' \ +'deploy-l2-contracts:Deploy all L2 contracts (executed by L1 governor)' \ +'accept-chain-ownership:Accept ownership of L2 chain (executed by L2 governor). This command should be run after \`register-chain\` to accept ownership of newly created DiamondProxy contract' \ +'initialize-bridges:Initialize bridges on L2' \ +'deploy-consensus-registry:Deploy L2 consensus registry' \ +'deploy-multicall3:Deploy L2 multicall3' \ +'deploy-upgrader:Deploy Default Upgrader' \ +'deploy-paymaster:Deploy paymaster smart contract' \ +'update-token-multiplier-setter:Update Token Multiplier Setter address on L1' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack chain help commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__accept-chain-ownership_commands] )) || +_zkstack__chain__help__accept-chain-ownership_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help accept-chain-ownership commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__build-transactions_commands] )) || +_zkstack__chain__help__build-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help build-transactions commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__create_commands] )) || +_zkstack__chain__help__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help create commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__deploy-consensus-registry_commands] )) || +_zkstack__chain__help__deploy-consensus-registry_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help deploy-consensus-registry commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__deploy-l2-contracts_commands] )) || +_zkstack__chain__help__deploy-l2-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help deploy-l2-contracts commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__deploy-multicall3_commands] )) || +_zkstack__chain__help__deploy-multicall3_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help deploy-multicall3 commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__deploy-paymaster_commands] )) || +_zkstack__chain__help__deploy-paymaster_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help deploy-paymaster commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__deploy-upgrader_commands] )) || +_zkstack__chain__help__deploy-upgrader_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help deploy-upgrader commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__genesis_commands] )) || +_zkstack__chain__help__genesis_commands() { + local commands; commands=( +'init-database:Initialize databases' \ +'server:Runs server genesis' \ + ) + _describe -t commands 'zkstack chain help genesis commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__genesis__init-database_commands] )) || +_zkstack__chain__help__genesis__init-database_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help genesis init-database commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__genesis__server_commands] )) || +_zkstack__chain__help__genesis__server_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help genesis server commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__help_commands] )) || +_zkstack__chain__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help help commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__init_commands] )) || +_zkstack__chain__help__init_commands() { + local commands; commands=( +'configs:Initialize chain configs' \ + ) + _describe -t commands 'zkstack chain help init commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__init__configs_commands] )) || +_zkstack__chain__help__init__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help init configs commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__initialize-bridges_commands] )) || +_zkstack__chain__help__initialize-bridges_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help initialize-bridges commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__register-chain_commands] )) || +_zkstack__chain__help__register-chain_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help register-chain commands' commands "$@" +} +(( $+functions[_zkstack__chain__help__update-token-multiplier-setter_commands] )) || +_zkstack__chain__help__update-token-multiplier-setter_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain help update-token-multiplier-setter commands' commands "$@" +} +(( $+functions[_zkstack__chain__init_commands] )) || +_zkstack__chain__init_commands() { + local commands; commands=( +'configs:Initialize chain configs' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack chain init commands' commands "$@" +} +(( $+functions[_zkstack__chain__init__configs_commands] )) || +_zkstack__chain__init__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain init configs commands' commands "$@" +} +(( $+functions[_zkstack__chain__init__help_commands] )) || +_zkstack__chain__init__help_commands() { + local commands; commands=( +'configs:Initialize chain configs' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack chain init help commands' commands "$@" +} +(( $+functions[_zkstack__chain__init__help__configs_commands] )) || +_zkstack__chain__init__help__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain init help configs commands' commands "$@" +} +(( $+functions[_zkstack__chain__init__help__help_commands] )) || +_zkstack__chain__init__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain init help help commands' commands "$@" +} +(( $+functions[_zkstack__chain__initialize-bridges_commands] )) || +_zkstack__chain__initialize-bridges_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain initialize-bridges commands' commands "$@" +} +(( $+functions[_zkstack__chain__register-chain_commands] )) || +_zkstack__chain__register-chain_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain register-chain commands' commands "$@" +} +(( $+functions[_zkstack__chain__update-token-multiplier-setter_commands] )) || +_zkstack__chain__update-token-multiplier-setter_commands() { + local commands; commands=() + _describe -t commands 'zkstack chain update-token-multiplier-setter commands' commands "$@" +} +(( $+functions[_zkstack__consensus_commands] )) || +_zkstack__consensus_commands() { + local commands; commands=( +'set-attester-committee:Sets the attester committee in the consensus registry contract to \`consensus.genesis_spec.attesters\` in general.yaml' \ +'get-attester-committee:Fetches the attester committee from the consensus registry contract' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack consensus commands' commands "$@" +} +(( $+functions[_zkstack__consensus__get-attester-committee_commands] )) || +_zkstack__consensus__get-attester-committee_commands() { + local commands; commands=() + _describe -t commands 'zkstack consensus get-attester-committee commands' commands "$@" +} +(( $+functions[_zkstack__consensus__help_commands] )) || +_zkstack__consensus__help_commands() { + local commands; commands=( +'set-attester-committee:Sets the attester committee in the consensus registry contract to \`consensus.genesis_spec.attesters\` in general.yaml' \ +'get-attester-committee:Fetches the attester committee from the consensus registry contract' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack consensus help commands' commands "$@" +} +(( $+functions[_zkstack__consensus__help__get-attester-committee_commands] )) || +_zkstack__consensus__help__get-attester-committee_commands() { + local commands; commands=() + _describe -t commands 'zkstack consensus help get-attester-committee commands' commands "$@" +} +(( $+functions[_zkstack__consensus__help__help_commands] )) || +_zkstack__consensus__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack consensus help help commands' commands "$@" +} +(( $+functions[_zkstack__consensus__help__set-attester-committee_commands] )) || +_zkstack__consensus__help__set-attester-committee_commands() { + local commands; commands=() + _describe -t commands 'zkstack consensus help set-attester-committee commands' commands "$@" +} +(( $+functions[_zkstack__consensus__set-attester-committee_commands] )) || +_zkstack__consensus__set-attester-committee_commands() { + local commands; commands=() + _describe -t commands 'zkstack consensus set-attester-committee commands' commands "$@" +} +(( $+functions[_zkstack__containers_commands] )) || +_zkstack__containers_commands() { + local commands; commands=() + _describe -t commands 'zkstack containers commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier_commands] )) || +_zkstack__contract-verifier_commands() { + local commands; commands=( +'run:Run contract verifier' \ +'init:Download required binaries for contract verifier' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack contract-verifier commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier__help_commands] )) || +_zkstack__contract-verifier__help_commands() { + local commands; commands=( +'run:Run contract verifier' \ +'init:Download required binaries for contract verifier' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack contract-verifier help commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier__help__help_commands] )) || +_zkstack__contract-verifier__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack contract-verifier help help commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier__help__init_commands] )) || +_zkstack__contract-verifier__help__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack contract-verifier help init commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier__help__run_commands] )) || +_zkstack__contract-verifier__help__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack contract-verifier help run commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier__init_commands] )) || +_zkstack__contract-verifier__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack contract-verifier init commands' commands "$@" +} +(( $+functions[_zkstack__contract-verifier__run_commands] )) || +_zkstack__contract-verifier__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack contract-verifier run commands' commands "$@" +} +(( $+functions[_zkstack__dev_commands] )) || +_zkstack__dev_commands() { + local commands; commands=( +'database:Database related commands' \ +'test:Run tests' \ +'clean:Clean artifacts' \ +'snapshot:Snapshots creator' \ +'lint:Lint code' \ +'fmt:Format code' \ +'prover:Protocol version used by provers' \ +'contracts:Build contracts' \ +'config-writer:Overwrite general config' \ +'send-transactions:Send transactions from file' \ +'status:Get status of the server' \ +'generate-genesis:Generate new genesis file based on current contracts' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean_commands] )) || +_zkstack__dev__clean_commands() { + local commands; commands=( +'all:Remove containers and contracts cache' \ +'containers:Remove containers and docker volumes' \ +'contracts-cache:Remove contracts caches' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev clean commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__all_commands] )) || +_zkstack__dev__clean__all_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean all commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__containers_commands] )) || +_zkstack__dev__clean__containers_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean containers commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__contracts-cache_commands] )) || +_zkstack__dev__clean__contracts-cache_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean contracts-cache commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__help_commands] )) || +_zkstack__dev__clean__help_commands() { + local commands; commands=( +'all:Remove containers and contracts cache' \ +'containers:Remove containers and docker volumes' \ +'contracts-cache:Remove contracts caches' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev clean help commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__help__all_commands] )) || +_zkstack__dev__clean__help__all_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean help all commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__help__containers_commands] )) || +_zkstack__dev__clean__help__containers_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean help containers commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__help__contracts-cache_commands] )) || +_zkstack__dev__clean__help__contracts-cache_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean help contracts-cache commands' commands "$@" +} +(( $+functions[_zkstack__dev__clean__help__help_commands] )) || +_zkstack__dev__clean__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev clean help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__config-writer_commands] )) || +_zkstack__dev__config-writer_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev config-writer commands' commands "$@" +} +(( $+functions[_zkstack__dev__contracts_commands] )) || +_zkstack__dev__contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev contracts commands' commands "$@" +} +(( $+functions[_zkstack__dev__database_commands] )) || +_zkstack__dev__database_commands() { + local commands; commands=( +'check-sqlx-data:Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked.' \ +'drop:Drop databases. If no databases are selected, all databases will be dropped.' \ +'migrate:Migrate databases. If no databases are selected, all databases will be migrated.' \ +'new-migration:Create new migration' \ +'prepare:Prepare sqlx-data.json. If no databases are selected, all databases will be prepared.' \ +'reset:Reset databases. If no databases are selected, all databases will be reset.' \ +'setup:Setup databases. If no databases are selected, all databases will be setup.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev database commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__check-sqlx-data_commands] )) || +_zkstack__dev__database__check-sqlx-data_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database check-sqlx-data commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__drop_commands] )) || +_zkstack__dev__database__drop_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database drop commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help_commands] )) || +_zkstack__dev__database__help_commands() { + local commands; commands=( +'check-sqlx-data:Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked.' \ +'drop:Drop databases. If no databases are selected, all databases will be dropped.' \ +'migrate:Migrate databases. If no databases are selected, all databases will be migrated.' \ +'new-migration:Create new migration' \ +'prepare:Prepare sqlx-data.json. If no databases are selected, all databases will be prepared.' \ +'reset:Reset databases. If no databases are selected, all databases will be reset.' \ +'setup:Setup databases. If no databases are selected, all databases will be setup.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev database help commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__check-sqlx-data_commands] )) || +_zkstack__dev__database__help__check-sqlx-data_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help check-sqlx-data commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__drop_commands] )) || +_zkstack__dev__database__help__drop_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help drop commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__help_commands] )) || +_zkstack__dev__database__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__migrate_commands] )) || +_zkstack__dev__database__help__migrate_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help migrate commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__new-migration_commands] )) || +_zkstack__dev__database__help__new-migration_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help new-migration commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__prepare_commands] )) || +_zkstack__dev__database__help__prepare_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help prepare commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__reset_commands] )) || +_zkstack__dev__database__help__reset_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help reset commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__help__setup_commands] )) || +_zkstack__dev__database__help__setup_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database help setup commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__migrate_commands] )) || +_zkstack__dev__database__migrate_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database migrate commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__new-migration_commands] )) || +_zkstack__dev__database__new-migration_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database new-migration commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__prepare_commands] )) || +_zkstack__dev__database__prepare_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database prepare commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__reset_commands] )) || +_zkstack__dev__database__reset_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database reset commands' commands "$@" +} +(( $+functions[_zkstack__dev__database__setup_commands] )) || +_zkstack__dev__database__setup_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev database setup commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt_commands] )) || +_zkstack__dev__fmt_commands() { + local commands; commands=( +'rustfmt:' \ +'contract:' \ +'prettier:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev fmt commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__contract_commands] )) || +_zkstack__dev__fmt__contract_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt contract commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__help_commands] )) || +_zkstack__dev__fmt__help_commands() { + local commands; commands=( +'rustfmt:' \ +'contract:' \ +'prettier:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev fmt help commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__help__contract_commands] )) || +_zkstack__dev__fmt__help__contract_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt help contract commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__help__help_commands] )) || +_zkstack__dev__fmt__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__help__prettier_commands] )) || +_zkstack__dev__fmt__help__prettier_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt help prettier commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__help__rustfmt_commands] )) || +_zkstack__dev__fmt__help__rustfmt_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt help rustfmt commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__prettier_commands] )) || +_zkstack__dev__fmt__prettier_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt prettier commands' commands "$@" +} +(( $+functions[_zkstack__dev__fmt__rustfmt_commands] )) || +_zkstack__dev__fmt__rustfmt_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev fmt rustfmt commands' commands "$@" +} +(( $+functions[_zkstack__dev__generate-genesis_commands] )) || +_zkstack__dev__generate-genesis_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev generate-genesis commands' commands "$@" +} +(( $+functions[_zkstack__dev__help_commands] )) || +_zkstack__dev__help_commands() { + local commands; commands=( +'database:Database related commands' \ +'test:Run tests' \ +'clean:Clean artifacts' \ +'snapshot:Snapshots creator' \ +'lint:Lint code' \ +'fmt:Format code' \ +'prover:Protocol version used by provers' \ +'contracts:Build contracts' \ +'config-writer:Overwrite general config' \ +'send-transactions:Send transactions from file' \ +'status:Get status of the server' \ +'generate-genesis:Generate new genesis file based on current contracts' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev help commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__clean_commands] )) || +_zkstack__dev__help__clean_commands() { + local commands; commands=( +'all:Remove containers and contracts cache' \ +'containers:Remove containers and docker volumes' \ +'contracts-cache:Remove contracts caches' \ + ) + _describe -t commands 'zkstack dev help clean commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__clean__all_commands] )) || +_zkstack__dev__help__clean__all_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help clean all commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__clean__containers_commands] )) || +_zkstack__dev__help__clean__containers_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help clean containers commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__clean__contracts-cache_commands] )) || +_zkstack__dev__help__clean__contracts-cache_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help clean contracts-cache commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__config-writer_commands] )) || +_zkstack__dev__help__config-writer_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help config-writer commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__contracts_commands] )) || +_zkstack__dev__help__contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help contracts commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database_commands] )) || +_zkstack__dev__help__database_commands() { + local commands; commands=( +'check-sqlx-data:Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked.' \ +'drop:Drop databases. If no databases are selected, all databases will be dropped.' \ +'migrate:Migrate databases. If no databases are selected, all databases will be migrated.' \ +'new-migration:Create new migration' \ +'prepare:Prepare sqlx-data.json. If no databases are selected, all databases will be prepared.' \ +'reset:Reset databases. If no databases are selected, all databases will be reset.' \ +'setup:Setup databases. If no databases are selected, all databases will be setup.' \ + ) + _describe -t commands 'zkstack dev help database commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__check-sqlx-data_commands] )) || +_zkstack__dev__help__database__check-sqlx-data_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database check-sqlx-data commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__drop_commands] )) || +_zkstack__dev__help__database__drop_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database drop commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__migrate_commands] )) || +_zkstack__dev__help__database__migrate_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database migrate commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__new-migration_commands] )) || +_zkstack__dev__help__database__new-migration_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database new-migration commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__prepare_commands] )) || +_zkstack__dev__help__database__prepare_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database prepare commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__reset_commands] )) || +_zkstack__dev__help__database__reset_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database reset commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__database__setup_commands] )) || +_zkstack__dev__help__database__setup_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help database setup commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__fmt_commands] )) || +_zkstack__dev__help__fmt_commands() { + local commands; commands=( +'rustfmt:' \ +'contract:' \ +'prettier:' \ + ) + _describe -t commands 'zkstack dev help fmt commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__fmt__contract_commands] )) || +_zkstack__dev__help__fmt__contract_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help fmt contract commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__fmt__prettier_commands] )) || +_zkstack__dev__help__fmt__prettier_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help fmt prettier commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__fmt__rustfmt_commands] )) || +_zkstack__dev__help__fmt__rustfmt_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help fmt rustfmt commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__generate-genesis_commands] )) || +_zkstack__dev__help__generate-genesis_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help generate-genesis commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__help_commands] )) || +_zkstack__dev__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__lint_commands] )) || +_zkstack__dev__help__lint_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help lint commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__prover_commands] )) || +_zkstack__dev__help__prover_commands() { + local commands; commands=( +'info:' \ +'insert-batch:' \ +'insert-version:' \ + ) + _describe -t commands 'zkstack dev help prover commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__prover__info_commands] )) || +_zkstack__dev__help__prover__info_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help prover info commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__prover__insert-batch_commands] )) || +_zkstack__dev__help__prover__insert-batch_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help prover insert-batch commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__prover__insert-version_commands] )) || +_zkstack__dev__help__prover__insert-version_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help prover insert-version commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__send-transactions_commands] )) || +_zkstack__dev__help__send-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help send-transactions commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__snapshot_commands] )) || +_zkstack__dev__help__snapshot_commands() { + local commands; commands=( +'create:' \ + ) + _describe -t commands 'zkstack dev help snapshot commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__snapshot__create_commands] )) || +_zkstack__dev__help__snapshot__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help snapshot create commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__status_commands] )) || +_zkstack__dev__help__status_commands() { + local commands; commands=( +'ports:Show used ports' \ + ) + _describe -t commands 'zkstack dev help status commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__status__ports_commands] )) || +_zkstack__dev__help__status__ports_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help status ports commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test_commands] )) || +_zkstack__dev__help__test_commands() { + local commands; commands=( +'integration:Run integration tests' \ +'fees:Run fees test' \ +'revert:Run revert tests' \ +'recovery:Run recovery tests' \ +'upgrade:Run upgrade tests' \ +'build:Build all test dependencies' \ +'rust:Run unit-tests, accepts optional cargo test flags' \ +'l1-contracts:Run L1 contracts tests' \ +'prover:Run prover tests' \ +'wallet:Print test wallets information' \ +'loadtest:Run loadtest' \ + ) + _describe -t commands 'zkstack dev help test commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__build_commands] )) || +_zkstack__dev__help__test__build_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test build commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__fees_commands] )) || +_zkstack__dev__help__test__fees_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test fees commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__integration_commands] )) || +_zkstack__dev__help__test__integration_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test integration commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__l1-contracts_commands] )) || +_zkstack__dev__help__test__l1-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test l1-contracts commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__loadtest_commands] )) || +_zkstack__dev__help__test__loadtest_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test loadtest commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__prover_commands] )) || +_zkstack__dev__help__test__prover_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test prover commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__recovery_commands] )) || +_zkstack__dev__help__test__recovery_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test recovery commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__revert_commands] )) || +_zkstack__dev__help__test__revert_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test revert commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__rust_commands] )) || +_zkstack__dev__help__test__rust_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test rust commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__upgrade_commands] )) || +_zkstack__dev__help__test__upgrade_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test upgrade commands' commands "$@" +} +(( $+functions[_zkstack__dev__help__test__wallet_commands] )) || +_zkstack__dev__help__test__wallet_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev help test wallet commands' commands "$@" +} +(( $+functions[_zkstack__dev__lint_commands] )) || +_zkstack__dev__lint_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev lint commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover_commands] )) || +_zkstack__dev__prover_commands() { + local commands; commands=( +'info:' \ +'insert-batch:' \ +'insert-version:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev prover commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__help_commands] )) || +_zkstack__dev__prover__help_commands() { + local commands; commands=( +'info:' \ +'insert-batch:' \ +'insert-version:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev prover help commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__help__help_commands] )) || +_zkstack__dev__prover__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__help__info_commands] )) || +_zkstack__dev__prover__help__info_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover help info commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__help__insert-batch_commands] )) || +_zkstack__dev__prover__help__insert-batch_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover help insert-batch commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__help__insert-version_commands] )) || +_zkstack__dev__prover__help__insert-version_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover help insert-version commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__info_commands] )) || +_zkstack__dev__prover__info_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover info commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__insert-batch_commands] )) || +_zkstack__dev__prover__insert-batch_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover insert-batch commands' commands "$@" +} +(( $+functions[_zkstack__dev__prover__insert-version_commands] )) || +_zkstack__dev__prover__insert-version_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev prover insert-version commands' commands "$@" +} +(( $+functions[_zkstack__dev__send-transactions_commands] )) || +_zkstack__dev__send-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev send-transactions commands' commands "$@" +} +(( $+functions[_zkstack__dev__snapshot_commands] )) || +_zkstack__dev__snapshot_commands() { + local commands; commands=( +'create:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev snapshot commands' commands "$@" +} +(( $+functions[_zkstack__dev__snapshot__create_commands] )) || +_zkstack__dev__snapshot__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev snapshot create commands' commands "$@" +} +(( $+functions[_zkstack__dev__snapshot__help_commands] )) || +_zkstack__dev__snapshot__help_commands() { + local commands; commands=( +'create:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev snapshot help commands' commands "$@" +} +(( $+functions[_zkstack__dev__snapshot__help__create_commands] )) || +_zkstack__dev__snapshot__help__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev snapshot help create commands' commands "$@" +} +(( $+functions[_zkstack__dev__snapshot__help__help_commands] )) || +_zkstack__dev__snapshot__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev snapshot help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__status_commands] )) || +_zkstack__dev__status_commands() { + local commands; commands=( +'ports:Show used ports' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev status commands' commands "$@" +} +(( $+functions[_zkstack__dev__status__help_commands] )) || +_zkstack__dev__status__help_commands() { + local commands; commands=( +'ports:Show used ports' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev status help commands' commands "$@" +} +(( $+functions[_zkstack__dev__status__help__help_commands] )) || +_zkstack__dev__status__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev status help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__status__help__ports_commands] )) || +_zkstack__dev__status__help__ports_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev status help ports commands' commands "$@" +} +(( $+functions[_zkstack__dev__status__ports_commands] )) || +_zkstack__dev__status__ports_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev status ports commands' commands "$@" +} +(( $+functions[_zkstack__dev__test_commands] )) || +_zkstack__dev__test_commands() { + local commands; commands=( +'integration:Run integration tests' \ +'fees:Run fees test' \ +'revert:Run revert tests' \ +'recovery:Run recovery tests' \ +'upgrade:Run upgrade tests' \ +'build:Build all test dependencies' \ +'rust:Run unit-tests, accepts optional cargo test flags' \ +'l1-contracts:Run L1 contracts tests' \ +'prover:Run prover tests' \ +'wallet:Print test wallets information' \ +'loadtest:Run loadtest' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev test commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__build_commands] )) || +_zkstack__dev__test__build_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test build commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__fees_commands] )) || +_zkstack__dev__test__fees_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test fees commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help_commands] )) || +_zkstack__dev__test__help_commands() { + local commands; commands=( +'integration:Run integration tests' \ +'fees:Run fees test' \ +'revert:Run revert tests' \ +'recovery:Run recovery tests' \ +'upgrade:Run upgrade tests' \ +'build:Build all test dependencies' \ +'rust:Run unit-tests, accepts optional cargo test flags' \ +'l1-contracts:Run L1 contracts tests' \ +'prover:Run prover tests' \ +'wallet:Print test wallets information' \ +'loadtest:Run loadtest' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack dev test help commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__build_commands] )) || +_zkstack__dev__test__help__build_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help build commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__fees_commands] )) || +_zkstack__dev__test__help__fees_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help fees commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__help_commands] )) || +_zkstack__dev__test__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help help commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__integration_commands] )) || +_zkstack__dev__test__help__integration_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help integration commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__l1-contracts_commands] )) || +_zkstack__dev__test__help__l1-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help l1-contracts commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__loadtest_commands] )) || +_zkstack__dev__test__help__loadtest_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help loadtest commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__prover_commands] )) || +_zkstack__dev__test__help__prover_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help prover commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__recovery_commands] )) || +_zkstack__dev__test__help__recovery_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help recovery commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__revert_commands] )) || +_zkstack__dev__test__help__revert_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help revert commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__rust_commands] )) || +_zkstack__dev__test__help__rust_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help rust commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__upgrade_commands] )) || +_zkstack__dev__test__help__upgrade_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help upgrade commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__help__wallet_commands] )) || +_zkstack__dev__test__help__wallet_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test help wallet commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__integration_commands] )) || +_zkstack__dev__test__integration_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test integration commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__l1-contracts_commands] )) || +_zkstack__dev__test__l1-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test l1-contracts commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__loadtest_commands] )) || +_zkstack__dev__test__loadtest_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test loadtest commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__prover_commands] )) || +_zkstack__dev__test__prover_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test prover commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__recovery_commands] )) || +_zkstack__dev__test__recovery_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test recovery commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__revert_commands] )) || +_zkstack__dev__test__revert_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test revert commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__rust_commands] )) || +_zkstack__dev__test__rust_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test rust commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__upgrade_commands] )) || +_zkstack__dev__test__upgrade_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test upgrade commands' commands "$@" +} +(( $+functions[_zkstack__dev__test__wallet_commands] )) || +_zkstack__dev__test__wallet_commands() { + local commands; commands=() + _describe -t commands 'zkstack dev test wallet commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem_commands] )) || +_zkstack__ecosystem_commands() { + local commands; commands=( +'create:Create a new ecosystem and chain, setting necessary configurations for later initialization' \ +'build-transactions:Create transactions to build ecosystem contracts' \ +'init:Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations' \ +'change-default-chain:Change the default chain' \ +'setup-observability:Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack ecosystem commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__build-transactions_commands] )) || +_zkstack__ecosystem__build-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem build-transactions commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__change-default-chain_commands] )) || +_zkstack__ecosystem__change-default-chain_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem change-default-chain commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__create_commands] )) || +_zkstack__ecosystem__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem create commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help_commands] )) || +_zkstack__ecosystem__help_commands() { + local commands; commands=( +'create:Create a new ecosystem and chain, setting necessary configurations for later initialization' \ +'build-transactions:Create transactions to build ecosystem contracts' \ +'init:Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations' \ +'change-default-chain:Change the default chain' \ +'setup-observability:Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack ecosystem help commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help__build-transactions_commands] )) || +_zkstack__ecosystem__help__build-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem help build-transactions commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help__change-default-chain_commands] )) || +_zkstack__ecosystem__help__change-default-chain_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem help change-default-chain commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help__create_commands] )) || +_zkstack__ecosystem__help__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem help create commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help__help_commands] )) || +_zkstack__ecosystem__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem help help commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help__init_commands] )) || +_zkstack__ecosystem__help__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem help init commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__help__setup-observability_commands] )) || +_zkstack__ecosystem__help__setup-observability_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem help setup-observability commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__init_commands] )) || +_zkstack__ecosystem__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem init commands' commands "$@" +} +(( $+functions[_zkstack__ecosystem__setup-observability_commands] )) || +_zkstack__ecosystem__setup-observability_commands() { + local commands; commands=() + _describe -t commands 'zkstack ecosystem setup-observability commands' commands "$@" +} +(( $+functions[_zkstack__explorer_commands] )) || +_zkstack__explorer_commands() { + local commands; commands=( +'init:Initialize explorer (create database to store explorer data and generate docker compose file with explorer services). Runs for all chains, unless --chain is passed' \ +'run-backend:Start explorer backend services (api, data_fetcher, worker) for a given chain. Uses default chain, unless --chain is passed' \ +'run:Run explorer app' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack explorer commands' commands "$@" +} +(( $+functions[_zkstack__explorer__help_commands] )) || +_zkstack__explorer__help_commands() { + local commands; commands=( +'init:Initialize explorer (create database to store explorer data and generate docker compose file with explorer services). Runs for all chains, unless --chain is passed' \ +'run-backend:Start explorer backend services (api, data_fetcher, worker) for a given chain. Uses default chain, unless --chain is passed' \ +'run:Run explorer app' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack explorer help commands' commands "$@" +} +(( $+functions[_zkstack__explorer__help__help_commands] )) || +_zkstack__explorer__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer help help commands' commands "$@" +} +(( $+functions[_zkstack__explorer__help__init_commands] )) || +_zkstack__explorer__help__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer help init commands' commands "$@" +} +(( $+functions[_zkstack__explorer__help__run_commands] )) || +_zkstack__explorer__help__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer help run commands' commands "$@" +} +(( $+functions[_zkstack__explorer__help__run-backend_commands] )) || +_zkstack__explorer__help__run-backend_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer help run-backend commands' commands "$@" +} +(( $+functions[_zkstack__explorer__init_commands] )) || +_zkstack__explorer__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer init commands' commands "$@" +} +(( $+functions[_zkstack__explorer__run_commands] )) || +_zkstack__explorer__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer run commands' commands "$@" +} +(( $+functions[_zkstack__explorer__run-backend_commands] )) || +_zkstack__explorer__run-backend_commands() { + local commands; commands=() + _describe -t commands 'zkstack explorer run-backend commands' commands "$@" +} +(( $+functions[_zkstack__external-node_commands] )) || +_zkstack__external-node_commands() { + local commands; commands=( +'configs:Prepare configs for EN' \ +'init:Init databases' \ +'run:Run external node' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack external-node commands' commands "$@" +} +(( $+functions[_zkstack__external-node__configs_commands] )) || +_zkstack__external-node__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node configs commands' commands "$@" +} +(( $+functions[_zkstack__external-node__help_commands] )) || +_zkstack__external-node__help_commands() { + local commands; commands=( +'configs:Prepare configs for EN' \ +'init:Init databases' \ +'run:Run external node' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack external-node help commands' commands "$@" +} +(( $+functions[_zkstack__external-node__help__configs_commands] )) || +_zkstack__external-node__help__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node help configs commands' commands "$@" +} +(( $+functions[_zkstack__external-node__help__help_commands] )) || +_zkstack__external-node__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node help help commands' commands "$@" +} +(( $+functions[_zkstack__external-node__help__init_commands] )) || +_zkstack__external-node__help__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node help init commands' commands "$@" +} +(( $+functions[_zkstack__external-node__help__run_commands] )) || +_zkstack__external-node__help__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node help run commands' commands "$@" +} +(( $+functions[_zkstack__external-node__init_commands] )) || +_zkstack__external-node__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node init commands' commands "$@" +} +(( $+functions[_zkstack__external-node__run_commands] )) || +_zkstack__external-node__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack external-node run commands' commands "$@" +} +(( $+functions[_zkstack__help_commands] )) || +_zkstack__help_commands() { + local commands; commands=( +'autocomplete:Create shell autocompletion files' \ +'ecosystem:Ecosystem related commands' \ +'chain:Chain related commands' \ +'dev:Supervisor related commands' \ +'prover:Prover related commands' \ +'server:Run server' \ +'external-node:External Node related commands' \ +'containers:Run containers for local development' \ +'contract-verifier:Run contract verifier' \ +'portal:Run dapp-portal' \ +'explorer:Run block-explorer' \ +'consensus:Consensus utilities' \ +'update:Update ZKsync' \ +'markdown:Print markdown help' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack help commands' commands "$@" +} +(( $+functions[_zkstack__help__autocomplete_commands] )) || +_zkstack__help__autocomplete_commands() { + local commands; commands=() + _describe -t commands 'zkstack help autocomplete commands' commands "$@" +} +(( $+functions[_zkstack__help__chain_commands] )) || +_zkstack__help__chain_commands() { + local commands; commands=( +'create:Create a new chain, setting the necessary configurations for later initialization' \ +'build-transactions:Create unsigned transactions for chain deployment' \ +'init:Initialize chain, deploying necessary contracts and performing on-chain operations' \ +'genesis:Run server genesis' \ +'register-chain:Register a new chain on L1 (executed by L1 governor). This command deploys and configures Governance, ChainAdmin, and DiamondProxy contracts, registers chain with BridgeHub and sets pending admin for DiamondProxy. Note\: After completion, L2 governor can accept ownership by running \`accept-chain-ownership\`' \ +'deploy-l2-contracts:Deploy all L2 contracts (executed by L1 governor)' \ +'accept-chain-ownership:Accept ownership of L2 chain (executed by L2 governor). This command should be run after \`register-chain\` to accept ownership of newly created DiamondProxy contract' \ +'initialize-bridges:Initialize bridges on L2' \ +'deploy-consensus-registry:Deploy L2 consensus registry' \ +'deploy-multicall3:Deploy L2 multicall3' \ +'deploy-upgrader:Deploy Default Upgrader' \ +'deploy-paymaster:Deploy paymaster smart contract' \ +'update-token-multiplier-setter:Update Token Multiplier Setter address on L1' \ + ) + _describe -t commands 'zkstack help chain commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__accept-chain-ownership_commands] )) || +_zkstack__help__chain__accept-chain-ownership_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain accept-chain-ownership commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__build-transactions_commands] )) || +_zkstack__help__chain__build-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain build-transactions commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__create_commands] )) || +_zkstack__help__chain__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain create commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__deploy-consensus-registry_commands] )) || +_zkstack__help__chain__deploy-consensus-registry_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain deploy-consensus-registry commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__deploy-l2-contracts_commands] )) || +_zkstack__help__chain__deploy-l2-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain deploy-l2-contracts commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__deploy-multicall3_commands] )) || +_zkstack__help__chain__deploy-multicall3_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain deploy-multicall3 commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__deploy-paymaster_commands] )) || +_zkstack__help__chain__deploy-paymaster_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain deploy-paymaster commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__deploy-upgrader_commands] )) || +_zkstack__help__chain__deploy-upgrader_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain deploy-upgrader commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__genesis_commands] )) || +_zkstack__help__chain__genesis_commands() { + local commands; commands=( +'init-database:Initialize databases' \ +'server:Runs server genesis' \ + ) + _describe -t commands 'zkstack help chain genesis commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__genesis__init-database_commands] )) || +_zkstack__help__chain__genesis__init-database_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain genesis init-database commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__genesis__server_commands] )) || +_zkstack__help__chain__genesis__server_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain genesis server commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__init_commands] )) || +_zkstack__help__chain__init_commands() { + local commands; commands=( +'configs:Initialize chain configs' \ + ) + _describe -t commands 'zkstack help chain init commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__init__configs_commands] )) || +_zkstack__help__chain__init__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain init configs commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__initialize-bridges_commands] )) || +_zkstack__help__chain__initialize-bridges_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain initialize-bridges commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__register-chain_commands] )) || +_zkstack__help__chain__register-chain_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain register-chain commands' commands "$@" +} +(( $+functions[_zkstack__help__chain__update-token-multiplier-setter_commands] )) || +_zkstack__help__chain__update-token-multiplier-setter_commands() { + local commands; commands=() + _describe -t commands 'zkstack help chain update-token-multiplier-setter commands' commands "$@" +} +(( $+functions[_zkstack__help__consensus_commands] )) || +_zkstack__help__consensus_commands() { + local commands; commands=( +'set-attester-committee:Sets the attester committee in the consensus registry contract to \`consensus.genesis_spec.attesters\` in general.yaml' \ +'get-attester-committee:Fetches the attester committee from the consensus registry contract' \ + ) + _describe -t commands 'zkstack help consensus commands' commands "$@" +} +(( $+functions[_zkstack__help__consensus__get-attester-committee_commands] )) || +_zkstack__help__consensus__get-attester-committee_commands() { + local commands; commands=() + _describe -t commands 'zkstack help consensus get-attester-committee commands' commands "$@" +} +(( $+functions[_zkstack__help__consensus__set-attester-committee_commands] )) || +_zkstack__help__consensus__set-attester-committee_commands() { + local commands; commands=() + _describe -t commands 'zkstack help consensus set-attester-committee commands' commands "$@" +} +(( $+functions[_zkstack__help__containers_commands] )) || +_zkstack__help__containers_commands() { + local commands; commands=() + _describe -t commands 'zkstack help containers commands' commands "$@" +} +(( $+functions[_zkstack__help__contract-verifier_commands] )) || +_zkstack__help__contract-verifier_commands() { + local commands; commands=( +'run:Run contract verifier' \ +'init:Download required binaries for contract verifier' \ + ) + _describe -t commands 'zkstack help contract-verifier commands' commands "$@" +} +(( $+functions[_zkstack__help__contract-verifier__init_commands] )) || +_zkstack__help__contract-verifier__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack help contract-verifier init commands' commands "$@" +} +(( $+functions[_zkstack__help__contract-verifier__run_commands] )) || +_zkstack__help__contract-verifier__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack help contract-verifier run commands' commands "$@" +} +(( $+functions[_zkstack__help__dev_commands] )) || +_zkstack__help__dev_commands() { + local commands; commands=( +'database:Database related commands' \ +'test:Run tests' \ +'clean:Clean artifacts' \ +'snapshot:Snapshots creator' \ +'lint:Lint code' \ +'fmt:Format code' \ +'prover:Protocol version used by provers' \ +'contracts:Build contracts' \ +'config-writer:Overwrite general config' \ +'send-transactions:Send transactions from file' \ +'status:Get status of the server' \ +'generate-genesis:Generate new genesis file based on current contracts' \ + ) + _describe -t commands 'zkstack help dev commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__clean_commands] )) || +_zkstack__help__dev__clean_commands() { + local commands; commands=( +'all:Remove containers and contracts cache' \ +'containers:Remove containers and docker volumes' \ +'contracts-cache:Remove contracts caches' \ + ) + _describe -t commands 'zkstack help dev clean commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__clean__all_commands] )) || +_zkstack__help__dev__clean__all_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev clean all commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__clean__containers_commands] )) || +_zkstack__help__dev__clean__containers_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev clean containers commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__clean__contracts-cache_commands] )) || +_zkstack__help__dev__clean__contracts-cache_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev clean contracts-cache commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__config-writer_commands] )) || +_zkstack__help__dev__config-writer_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev config-writer commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__contracts_commands] )) || +_zkstack__help__dev__contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev contracts commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database_commands] )) || +_zkstack__help__dev__database_commands() { + local commands; commands=( +'check-sqlx-data:Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked.' \ +'drop:Drop databases. If no databases are selected, all databases will be dropped.' \ +'migrate:Migrate databases. If no databases are selected, all databases will be migrated.' \ +'new-migration:Create new migration' \ +'prepare:Prepare sqlx-data.json. If no databases are selected, all databases will be prepared.' \ +'reset:Reset databases. If no databases are selected, all databases will be reset.' \ +'setup:Setup databases. If no databases are selected, all databases will be setup.' \ + ) + _describe -t commands 'zkstack help dev database commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__check-sqlx-data_commands] )) || +_zkstack__help__dev__database__check-sqlx-data_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database check-sqlx-data commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__drop_commands] )) || +_zkstack__help__dev__database__drop_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database drop commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__migrate_commands] )) || +_zkstack__help__dev__database__migrate_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database migrate commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__new-migration_commands] )) || +_zkstack__help__dev__database__new-migration_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database new-migration commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__prepare_commands] )) || +_zkstack__help__dev__database__prepare_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database prepare commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__reset_commands] )) || +_zkstack__help__dev__database__reset_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database reset commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__database__setup_commands] )) || +_zkstack__help__dev__database__setup_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev database setup commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__fmt_commands] )) || +_zkstack__help__dev__fmt_commands() { + local commands; commands=( +'rustfmt:' \ +'contract:' \ +'prettier:' \ + ) + _describe -t commands 'zkstack help dev fmt commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__fmt__contract_commands] )) || +_zkstack__help__dev__fmt__contract_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev fmt contract commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__fmt__prettier_commands] )) || +_zkstack__help__dev__fmt__prettier_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev fmt prettier commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__fmt__rustfmt_commands] )) || +_zkstack__help__dev__fmt__rustfmt_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev fmt rustfmt commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__generate-genesis_commands] )) || +_zkstack__help__dev__generate-genesis_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev generate-genesis commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__lint_commands] )) || +_zkstack__help__dev__lint_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev lint commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__prover_commands] )) || +_zkstack__help__dev__prover_commands() { + local commands; commands=( +'info:' \ +'insert-batch:' \ +'insert-version:' \ + ) + _describe -t commands 'zkstack help dev prover commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__prover__info_commands] )) || +_zkstack__help__dev__prover__info_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev prover info commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__prover__insert-batch_commands] )) || +_zkstack__help__dev__prover__insert-batch_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev prover insert-batch commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__prover__insert-version_commands] )) || +_zkstack__help__dev__prover__insert-version_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev prover insert-version commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__send-transactions_commands] )) || +_zkstack__help__dev__send-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev send-transactions commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__snapshot_commands] )) || +_zkstack__help__dev__snapshot_commands() { + local commands; commands=( +'create:' \ + ) + _describe -t commands 'zkstack help dev snapshot commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__snapshot__create_commands] )) || +_zkstack__help__dev__snapshot__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev snapshot create commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__status_commands] )) || +_zkstack__help__dev__status_commands() { + local commands; commands=( +'ports:Show used ports' \ + ) + _describe -t commands 'zkstack help dev status commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__status__ports_commands] )) || +_zkstack__help__dev__status__ports_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev status ports commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test_commands] )) || +_zkstack__help__dev__test_commands() { + local commands; commands=( +'integration:Run integration tests' \ +'fees:Run fees test' \ +'revert:Run revert tests' \ +'recovery:Run recovery tests' \ +'upgrade:Run upgrade tests' \ +'build:Build all test dependencies' \ +'rust:Run unit-tests, accepts optional cargo test flags' \ +'l1-contracts:Run L1 contracts tests' \ +'prover:Run prover tests' \ +'wallet:Print test wallets information' \ +'loadtest:Run loadtest' \ + ) + _describe -t commands 'zkstack help dev test commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__build_commands] )) || +_zkstack__help__dev__test__build_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test build commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__fees_commands] )) || +_zkstack__help__dev__test__fees_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test fees commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__integration_commands] )) || +_zkstack__help__dev__test__integration_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test integration commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__l1-contracts_commands] )) || +_zkstack__help__dev__test__l1-contracts_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test l1-contracts commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__loadtest_commands] )) || +_zkstack__help__dev__test__loadtest_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test loadtest commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__prover_commands] )) || +_zkstack__help__dev__test__prover_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test prover commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__recovery_commands] )) || +_zkstack__help__dev__test__recovery_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test recovery commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__revert_commands] )) || +_zkstack__help__dev__test__revert_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test revert commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__rust_commands] )) || +_zkstack__help__dev__test__rust_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test rust commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__upgrade_commands] )) || +_zkstack__help__dev__test__upgrade_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test upgrade commands' commands "$@" +} +(( $+functions[_zkstack__help__dev__test__wallet_commands] )) || +_zkstack__help__dev__test__wallet_commands() { + local commands; commands=() + _describe -t commands 'zkstack help dev test wallet commands' commands "$@" +} +(( $+functions[_zkstack__help__ecosystem_commands] )) || +_zkstack__help__ecosystem_commands() { + local commands; commands=( +'create:Create a new ecosystem and chain, setting necessary configurations for later initialization' \ +'build-transactions:Create transactions to build ecosystem contracts' \ +'init:Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations' \ +'change-default-chain:Change the default chain' \ +'setup-observability:Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo' \ + ) + _describe -t commands 'zkstack help ecosystem commands' commands "$@" +} +(( $+functions[_zkstack__help__ecosystem__build-transactions_commands] )) || +_zkstack__help__ecosystem__build-transactions_commands() { + local commands; commands=() + _describe -t commands 'zkstack help ecosystem build-transactions commands' commands "$@" +} +(( $+functions[_zkstack__help__ecosystem__change-default-chain_commands] )) || +_zkstack__help__ecosystem__change-default-chain_commands() { + local commands; commands=() + _describe -t commands 'zkstack help ecosystem change-default-chain commands' commands "$@" +} +(( $+functions[_zkstack__help__ecosystem__create_commands] )) || +_zkstack__help__ecosystem__create_commands() { + local commands; commands=() + _describe -t commands 'zkstack help ecosystem create commands' commands "$@" +} +(( $+functions[_zkstack__help__ecosystem__init_commands] )) || +_zkstack__help__ecosystem__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack help ecosystem init commands' commands "$@" +} +(( $+functions[_zkstack__help__ecosystem__setup-observability_commands] )) || +_zkstack__help__ecosystem__setup-observability_commands() { + local commands; commands=() + _describe -t commands 'zkstack help ecosystem setup-observability commands' commands "$@" +} +(( $+functions[_zkstack__help__explorer_commands] )) || +_zkstack__help__explorer_commands() { + local commands; commands=( +'init:Initialize explorer (create database to store explorer data and generate docker compose file with explorer services). Runs for all chains, unless --chain is passed' \ +'run-backend:Start explorer backend services (api, data_fetcher, worker) for a given chain. Uses default chain, unless --chain is passed' \ +'run:Run explorer app' \ + ) + _describe -t commands 'zkstack help explorer commands' commands "$@" +} +(( $+functions[_zkstack__help__explorer__init_commands] )) || +_zkstack__help__explorer__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack help explorer init commands' commands "$@" +} +(( $+functions[_zkstack__help__explorer__run_commands] )) || +_zkstack__help__explorer__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack help explorer run commands' commands "$@" +} +(( $+functions[_zkstack__help__explorer__run-backend_commands] )) || +_zkstack__help__explorer__run-backend_commands() { + local commands; commands=() + _describe -t commands 'zkstack help explorer run-backend commands' commands "$@" +} +(( $+functions[_zkstack__help__external-node_commands] )) || +_zkstack__help__external-node_commands() { + local commands; commands=( +'configs:Prepare configs for EN' \ +'init:Init databases' \ +'run:Run external node' \ + ) + _describe -t commands 'zkstack help external-node commands' commands "$@" +} +(( $+functions[_zkstack__help__external-node__configs_commands] )) || +_zkstack__help__external-node__configs_commands() { + local commands; commands=() + _describe -t commands 'zkstack help external-node configs commands' commands "$@" +} +(( $+functions[_zkstack__help__external-node__init_commands] )) || +_zkstack__help__external-node__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack help external-node init commands' commands "$@" +} +(( $+functions[_zkstack__help__external-node__run_commands] )) || +_zkstack__help__external-node__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack help external-node run commands' commands "$@" +} +(( $+functions[_zkstack__help__help_commands] )) || +_zkstack__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack help help commands' commands "$@" +} +(( $+functions[_zkstack__help__markdown_commands] )) || +_zkstack__help__markdown_commands() { + local commands; commands=() + _describe -t commands 'zkstack help markdown commands' commands "$@" +} +(( $+functions[_zkstack__help__portal_commands] )) || +_zkstack__help__portal_commands() { + local commands; commands=() + _describe -t commands 'zkstack help portal commands' commands "$@" +} +(( $+functions[_zkstack__help__prover_commands] )) || +_zkstack__help__prover_commands() { + local commands; commands=( +'init:Initialize prover' \ +'setup-keys:Generate setup keys' \ +'run:Run prover' \ +'init-bellman-cuda:Initialize bellman-cuda' \ +'compressor-keys:Download compressor keys' \ + ) + _describe -t commands 'zkstack help prover commands' commands "$@" +} +(( $+functions[_zkstack__help__prover__compressor-keys_commands] )) || +_zkstack__help__prover__compressor-keys_commands() { + local commands; commands=() + _describe -t commands 'zkstack help prover compressor-keys commands' commands "$@" +} +(( $+functions[_zkstack__help__prover__init_commands] )) || +_zkstack__help__prover__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack help prover init commands' commands "$@" +} +(( $+functions[_zkstack__help__prover__init-bellman-cuda_commands] )) || +_zkstack__help__prover__init-bellman-cuda_commands() { + local commands; commands=() + _describe -t commands 'zkstack help prover init-bellman-cuda commands' commands "$@" +} +(( $+functions[_zkstack__help__prover__run_commands] )) || +_zkstack__help__prover__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack help prover run commands' commands "$@" +} +(( $+functions[_zkstack__help__prover__setup-keys_commands] )) || +_zkstack__help__prover__setup-keys_commands() { + local commands; commands=() + _describe -t commands 'zkstack help prover setup-keys commands' commands "$@" +} +(( $+functions[_zkstack__help__server_commands] )) || +_zkstack__help__server_commands() { + local commands; commands=() + _describe -t commands 'zkstack help server commands' commands "$@" +} +(( $+functions[_zkstack__help__update_commands] )) || +_zkstack__help__update_commands() { + local commands; commands=() + _describe -t commands 'zkstack help update commands' commands "$@" +} +(( $+functions[_zkstack__markdown_commands] )) || +_zkstack__markdown_commands() { + local commands; commands=() + _describe -t commands 'zkstack markdown commands' commands "$@" +} +(( $+functions[_zkstack__portal_commands] )) || +_zkstack__portal_commands() { + local commands; commands=() + _describe -t commands 'zkstack portal commands' commands "$@" +} +(( $+functions[_zkstack__prover_commands] )) || +_zkstack__prover_commands() { + local commands; commands=( +'init:Initialize prover' \ +'setup-keys:Generate setup keys' \ +'run:Run prover' \ +'init-bellman-cuda:Initialize bellman-cuda' \ +'compressor-keys:Download compressor keys' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack prover commands' commands "$@" +} +(( $+functions[_zkstack__prover__compressor-keys_commands] )) || +_zkstack__prover__compressor-keys_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover compressor-keys commands' commands "$@" +} +(( $+functions[_zkstack__prover__help_commands] )) || +_zkstack__prover__help_commands() { + local commands; commands=( +'init:Initialize prover' \ +'setup-keys:Generate setup keys' \ +'run:Run prover' \ +'init-bellman-cuda:Initialize bellman-cuda' \ +'compressor-keys:Download compressor keys' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'zkstack prover help commands' commands "$@" +} +(( $+functions[_zkstack__prover__help__compressor-keys_commands] )) || +_zkstack__prover__help__compressor-keys_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover help compressor-keys commands' commands "$@" +} +(( $+functions[_zkstack__prover__help__help_commands] )) || +_zkstack__prover__help__help_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover help help commands' commands "$@" +} +(( $+functions[_zkstack__prover__help__init_commands] )) || +_zkstack__prover__help__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover help init commands' commands "$@" +} +(( $+functions[_zkstack__prover__help__init-bellman-cuda_commands] )) || +_zkstack__prover__help__init-bellman-cuda_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover help init-bellman-cuda commands' commands "$@" +} +(( $+functions[_zkstack__prover__help__run_commands] )) || +_zkstack__prover__help__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover help run commands' commands "$@" +} +(( $+functions[_zkstack__prover__help__setup-keys_commands] )) || +_zkstack__prover__help__setup-keys_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover help setup-keys commands' commands "$@" +} +(( $+functions[_zkstack__prover__init_commands] )) || +_zkstack__prover__init_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover init commands' commands "$@" +} +(( $+functions[_zkstack__prover__init-bellman-cuda_commands] )) || +_zkstack__prover__init-bellman-cuda_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover init-bellman-cuda commands' commands "$@" +} +(( $+functions[_zkstack__prover__run_commands] )) || +_zkstack__prover__run_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover run commands' commands "$@" +} +(( $+functions[_zkstack__prover__setup-keys_commands] )) || +_zkstack__prover__setup-keys_commands() { + local commands; commands=() + _describe -t commands 'zkstack prover setup-keys commands' commands "$@" +} +(( $+functions[_zkstack__server_commands] )) || +_zkstack__server_commands() { + local commands; commands=() + _describe -t commands 'zkstack server commands' commands "$@" +} +(( $+functions[_zkstack__update_commands] )) || +_zkstack__update_commands() { + local commands; commands=() + _describe -t commands 'zkstack update commands' commands "$@" +} + +if [ "$funcstack[1]" = "_zkstack" ]; then + _zkstack "$@" +else + compdef _zkstack zkstack +fi diff --git a/zkstack_cli/crates/zkstack/completion/zkstack.fish b/zkstack_cli/crates/zkstack/completion/zkstack.fish new file mode 100644 index 00000000000..d490085e615 --- /dev/null +++ b/zkstack_cli/crates/zkstack/completion/zkstack.fish @@ -0,0 +1,701 @@ +# Print an optspec for argparse to handle cmd's options that are independent of any subcommand. +function __fish_zkstack_global_optspecs + string join \n v/verbose chain= ignore-prerequisites h/help V/version +end + +function __fish_zkstack_needs_command + # Figure out if the current invocation already has a command. + set -l cmd (commandline -opc) + set -e cmd[1] + argparse -s (__fish_zkstack_global_optspecs) -- $cmd 2>/dev/null + or return + if set -q argv[1] + # Also print the command, so this can be used to figure out what it is. + echo $argv[1] + return 1 + end + return 0 +end + +function __fish_zkstack_using_subcommand + set -l cmd (__fish_zkstack_needs_command) + test -z "$cmd" + and return 1 + contains -- $cmd[1] $argv +end + +complete -c zkstack -n "__fish_zkstack_needs_command" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_needs_command" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_needs_command" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_needs_command" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_needs_command" -s V -l version -d 'Print version' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "autocomplete" -d 'Create shell autocompletion files' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "ecosystem" -d 'Ecosystem related commands' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "chain" -d 'Chain related commands' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "dev" -d 'Supervisor related commands' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "prover" -d 'Prover related commands' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "server" -d 'Run server' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "external-node" -d 'External Node related commands' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "containers" -d 'Run containers for local development' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "contract-verifier" -d 'Run contract verifier' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "portal" -d 'Run dapp-portal' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "explorer" -d 'Run block-explorer' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "consensus" -d 'Consensus utilities' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "update" -d 'Update ZKsync' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "markdown" -d 'Print markdown help' +complete -c zkstack -n "__fish_zkstack_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand autocomplete" -l generate -d 'The shell to generate the autocomplete script for' -r -f -a "{bash\t'',elvish\t'',fish\t'',powershell\t'',zsh\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand autocomplete" -s o -l out -d 'The out directory to write the autocomplete script to' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand autocomplete" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand autocomplete" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand autocomplete" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand autocomplete" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -f -a "create" -d 'Create a new ecosystem and chain, setting necessary configurations for later initialization' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -f -a "build-transactions" -d 'Create transactions to build ecosystem contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -f -a "init" -d 'Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -f -a "change-default-chain" -d 'Change the default chain' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -f -a "setup-observability" -d 'Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and not __fish_seen_subcommand_from create build-transactions init change-default-chain setup-observability help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l ecosystem-name -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l l1-network -d 'L1 Network' -r -f -a "{localhost\t'',sepolia\t'',holesky\t'',mainnet\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l link-to-code -d 'Code link' -r -f -a "(__fish_complete_directories)" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l chain-name -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l chain-id -d 'Chain ID' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l prover-mode -d 'Prover options' -r -f -a "{no-proofs\t'',gpu\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l wallet-creation -d 'Wallet options' -r -f -a "{localhost\t'Load wallets from localhost mnemonic, they are funded for localhost env',random\t'Generate random wallets',empty\t'Generate placeholder wallets',in-file\t'Specify file with wallets'}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l wallet-path -d 'Wallet path' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l l1-batch-commit-data-generator-mode -d 'Commit data generation mode' -r -f -a "{rollup\t'',validium\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l base-token-address -d 'Base token address' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l base-token-price-nominator -d 'Base token nominator' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l base-token-price-denominator -d 'Base token denominator' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l set-as-default -d 'Set as default chain' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l start-containers -d 'Start reth and postgres containers after creation' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l legacy-bridge +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l sender -d 'Address of the transaction sender' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l l1-rpc-url -d 'L1 RPC URL' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -s o -l out -d 'Output directory for the generated files' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from build-transactions" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l deploy-erc20 -d 'Deploy ERC20 contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l deploy-ecosystem -d 'Deploy ecosystem contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l ecosystem-contracts-path -d 'Path to ecosystem contracts' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l l1-rpc-url -d 'L1 RPC URL' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l deploy-paymaster -d 'Deploy Paymaster contract' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l server-db-url -d 'Server database url without database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l server-db-name -d 'Server database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s o -l observability -d 'Enable Grafana' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s u -l use-default -d 'Use default database urls and names' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s d -l dont-drop +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l ecosystem-only -d 'Initialize ecosystem only and skip chain initialization (chain can be initialized later with `chain init` subcommand)' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l dev -d 'Deploy ecosystem using all defaults. Suitable for local development' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l no-port-reallocation -d 'Do not reallocate ports' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from change-default-chain" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from change-default-chain" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from change-default-chain" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from change-default-chain" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from setup-observability" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from setup-observability" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from setup-observability" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from setup-observability" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from help" -f -a "create" -d 'Create a new ecosystem and chain, setting necessary configurations for later initialization' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from help" -f -a "build-transactions" -d 'Create transactions to build ecosystem contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from help" -f -a "init" -d 'Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from help" -f -a "change-default-chain" -d 'Change the default chain' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from help" -f -a "setup-observability" -d 'Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "create" -d 'Create a new chain, setting the necessary configurations for later initialization' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "build-transactions" -d 'Create unsigned transactions for chain deployment' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "init" -d 'Initialize chain, deploying necessary contracts and performing on-chain operations' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "genesis" -d 'Run server genesis' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "register-chain" -d 'Register a new chain on L1 (executed by L1 governor). This command deploys and configures Governance, ChainAdmin, and DiamondProxy contracts, registers chain with BridgeHub and sets pending admin for DiamondProxy. Note: After completion, L2 governor can accept ownership by running `accept-chain-ownership`' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "deploy-l2-contracts" -d 'Deploy all L2 contracts (executed by L1 governor)' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "accept-chain-ownership" -d 'Accept ownership of L2 chain (executed by L2 governor). This command should be run after `register-chain` to accept ownership of newly created DiamondProxy contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "initialize-bridges" -d 'Initialize bridges on L2' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "deploy-consensus-registry" -d 'Deploy L2 consensus registry' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "deploy-multicall3" -d 'Deploy L2 multicall3' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "deploy-upgrader" -d 'Deploy Default Upgrader' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "deploy-paymaster" -d 'Deploy paymaster smart contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "update-token-multiplier-setter" -d 'Update Token Multiplier Setter address on L1' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and not __fish_seen_subcommand_from create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l chain-name -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l chain-id -d 'Chain ID' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l prover-mode -d 'Prover options' -r -f -a "{no-proofs\t'',gpu\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l wallet-creation -d 'Wallet options' -r -f -a "{localhost\t'Load wallets from localhost mnemonic, they are funded for localhost env',random\t'Generate random wallets',empty\t'Generate placeholder wallets',in-file\t'Specify file with wallets'}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l wallet-path -d 'Wallet path' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l l1-batch-commit-data-generator-mode -d 'Commit data generation mode' -r -f -a "{rollup\t'',validium\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l base-token-address -d 'Base token address' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l base-token-price-nominator -d 'Base token nominator' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l base-token-price-denominator -d 'Base token denominator' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l set-as-default -d 'Set as default chain' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l legacy-bridge +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -s o -l out -d 'Output directory for the generated files' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l l1-rpc-url -d 'L1 RPC URL' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from build-transactions" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l server-db-url -d 'Server database url without database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l server-db-name -d 'Server database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l deploy-paymaster -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l l1-rpc-url -d 'L1 RPC URL' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s u -l use-default -d 'Use default database urls and names' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s d -l dont-drop +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l no-port-reallocation -d 'Do not reallocate ports' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -f -a "configs" -d 'Initialize chain configs' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l server-db-url -d 'Server database url without database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l server-db-name -d 'Server database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s u -l use-default -d 'Use default database urls and names' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s d -l dont-drop +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -f -a "init-database" -d 'Initialize databases' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -f -a "server" -d 'Runs server genesis' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from register-chain" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-l2-contracts" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from accept-chain-ownership" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from initialize-bridges" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-consensus-registry" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-multicall3" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-upgrader" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from deploy-paymaster" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l verify -d 'Verify deployed contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l verifier -d 'Verifier to use' -r -f -a "{etherscan\t'',sourcify\t'',blockscout\t'',oklink\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l verifier-url -d 'Verifier URL, if using a custom provider' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l verifier-api-key -d 'Verifier API key' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -s a -l additional-args -d 'List of additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l resume +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from update-token-multiplier-setter" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "create" -d 'Create a new chain, setting the necessary configurations for later initialization' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "build-transactions" -d 'Create unsigned transactions for chain deployment' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "init" -d 'Initialize chain, deploying necessary contracts and performing on-chain operations' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "genesis" -d 'Run server genesis' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "register-chain" -d 'Register a new chain on L1 (executed by L1 governor). This command deploys and configures Governance, ChainAdmin, and DiamondProxy contracts, registers chain with BridgeHub and sets pending admin for DiamondProxy. Note: After completion, L2 governor can accept ownership by running `accept-chain-ownership`' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "deploy-l2-contracts" -d 'Deploy all L2 contracts (executed by L1 governor)' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "accept-chain-ownership" -d 'Accept ownership of L2 chain (executed by L2 governor). This command should be run after `register-chain` to accept ownership of newly created DiamondProxy contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "initialize-bridges" -d 'Initialize bridges on L2' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "deploy-consensus-registry" -d 'Deploy L2 consensus registry' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "deploy-multicall3" -d 'Deploy L2 multicall3' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "deploy-upgrader" -d 'Deploy Default Upgrader' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "deploy-paymaster" -d 'Deploy paymaster smart contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "update-token-multiplier-setter" -d 'Update Token Multiplier Setter address on L1' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "database" -d 'Database related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "test" -d 'Run tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "clean" -d 'Clean artifacts' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "snapshot" -d 'Snapshots creator' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "lint" -d 'Lint code' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "fmt" -d 'Format code' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "prover" -d 'Protocol version used by provers' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "contracts" -d 'Build contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "config-writer" -d 'Overwrite general config' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "send-transactions" -d 'Send transactions from file' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "status" -d 'Get status of the server' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "generate-genesis" -d 'Generate new genesis file based on current contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and not __fish_seen_subcommand_from database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "check-sqlx-data" -d 'Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked.' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "drop" -d 'Drop databases. If no databases are selected, all databases will be dropped.' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "migrate" -d 'Migrate databases. If no databases are selected, all databases will be migrated.' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "new-migration" -d 'Create new migration' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "prepare" -d 'Prepare sqlx-data.json. If no databases are selected, all databases will be prepared.' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "reset" -d 'Reset databases. If no databases are selected, all databases will be reset.' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "setup" -d 'Setup databases. If no databases are selected, all databases will be setup.' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from database" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "integration" -d 'Run integration tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "fees" -d 'Run fees test' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "revert" -d 'Run revert tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "recovery" -d 'Run recovery tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "upgrade" -d 'Run upgrade tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "build" -d 'Build all test dependencies' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "rust" -d 'Run unit-tests, accepts optional cargo test flags' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "l1-contracts" -d 'Run L1 contracts tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "prover" -d 'Run prover tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "wallet" -d 'Print test wallets information' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "loadtest" -d 'Run loadtest' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from test" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -f -a "all" -d 'Remove containers and contracts cache' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -f -a "containers" -d 'Remove containers and docker volumes' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -f -a "contracts-cache" -d 'Remove contracts caches' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from clean" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from snapshot" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from snapshot" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from snapshot" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from snapshot" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from snapshot" -f -a "create" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from snapshot" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from lint" -s t -l targets -r -f -a "{md\t'',sol\t'',js\t'',ts\t'',rs\t'',contracts\t'',autocompletion\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from lint" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from lint" -s c -l check +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from lint" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from lint" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from lint" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -s c -l check +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -f -a "rustfmt" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -f -a "contract" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -f -a "prettier" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from fmt" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -f -a "info" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -f -a "insert-batch" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -f -a "insert-version" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from prover" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -l l1-contracts -d 'Build L1 contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -l l2-contracts -d 'Build L2 contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -l system-contracts -d 'Build system contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -l test-contracts -d 'Build test contracts' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from contracts" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from config-writer" -s p -l path -d 'Path to the config file to override' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from config-writer" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from config-writer" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from config-writer" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from config-writer" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -l file -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -l private-key -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -l l1-rpc-url -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -l confirmations -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from send-transactions" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -s u -l url -d 'URL of the health check endpoint' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -f -a "ports" -d 'Show used ports' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from status" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from generate-genesis" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from generate-genesis" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from generate-genesis" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from generate-genesis" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "database" -d 'Database related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "test" -d 'Run tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "clean" -d 'Clean artifacts' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "snapshot" -d 'Snapshots creator' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "lint" -d 'Lint code' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "fmt" -d 'Format code' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "prover" -d 'Protocol version used by provers' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "contracts" -d 'Build contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "config-writer" -d 'Overwrite general config' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "send-transactions" -d 'Send transactions from file' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "status" -d 'Get status of the server' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "generate-genesis" -d 'Generate new genesis file based on current contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand dev; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -f -a "init" -d 'Initialize prover' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -f -a "setup-keys" -d 'Generate setup keys' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -f -a "run" -d 'Run prover' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -f -a "init-bellman-cuda" -d 'Initialize bellman-cuda' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -f -a "compressor-keys" -d 'Download compressor keys' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and not __fish_seen_subcommand_from init setup-keys run init-bellman-cuda compressor-keys help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l proof-store-dir -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bucket-base-url -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l credentials-file -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bucket-name -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l location -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l project-id -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l shall-save-to-public-bucket -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-store-dir -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-bucket-base-url -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-credentials-file -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-bucket-name -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-location -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-project-id -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bellman-cuda-dir -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bellman-cuda -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l setup-compressor-key -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l path -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l region -r -f -a "{us\t'',europe\t'',asia\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l mode -r -f -a "{download\t'',generate\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l setup-keys -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l setup-database -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l prover-db-url -d 'Prover database url without database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l prover-db-name -d 'Prover database name' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -s u -l use-default -d 'Use default database urls and names' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -s d -l dont-drop -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l cloud-type -r -f -a "{gcp\t'',local\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l dev +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l clone +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from setup-keys" -l region -r -f -a "{us\t'',europe\t'',asia\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from setup-keys" -l mode -r -f -a "{download\t'',generate\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from setup-keys" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from setup-keys" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from setup-keys" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from setup-keys" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l component -r -f -a "{gateway\t'',witness-generator\t'',witness-vector-generator\t'',prover\t'',circuit-prover\t'',compressor\t'',prover-job-monitor\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l round -r -f -a "{all-rounds\t'',basic-circuits\t'',leaf-aggregation\t'',node-aggregation\t'',recursion-tip\t'',scheduler\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l threads -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l max-allocation -d 'Memory allocation limit in bytes (for prover component)' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l witness-vector-generator-count -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l max-allocation -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l docker -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l tag -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from run" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init-bellman-cuda" -l bellman-cuda-dir -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init-bellman-cuda" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init-bellman-cuda" -l clone +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init-bellman-cuda" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init-bellman-cuda" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init-bellman-cuda" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from compressor-keys" -l path -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from compressor-keys" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from compressor-keys" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from compressor-keys" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from compressor-keys" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from help" -f -a "init" -d 'Initialize prover' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from help" -f -a "setup-keys" -d 'Generate setup keys' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from help" -f -a "run" -d 'Run prover' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from help" -f -a "init-bellman-cuda" -d 'Initialize bellman-cuda' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from help" -f -a "compressor-keys" -d 'Download compressor keys' +complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -l components -d 'Components of server to run' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -s a -l additional-args -d 'Additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -l genesis -d 'Run server in genesis mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -l build -d 'Build server but don\'t run it' +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -l uring -d 'Enables uring support for RocksDB' +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand server" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -f -a "configs" -d 'Prepare configs for EN' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -f -a "init" -d 'Init databases' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -f -a "run" -d 'Run external node' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not __fish_seen_subcommand_from configs init run help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l db-url -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l db-name -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l l1-rpc-url -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -s u -l use-default -d 'Use default database urls and names' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -l components -d 'Components of server to run' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -l enable-consensus -d 'Enable consensus' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -s a -l additional-args -d 'Additional arguments that can be passed through the CLI' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -l reinit +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from run" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from help" -f -a "configs" -d 'Prepare configs for EN' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from help" -f -a "init" -d 'Init databases' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from help" -f -a "run" -d 'Run external node' +complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand containers" -s o -l observability -d 'Enable Grafana' -r -f -a "{true\t'',false\t''}" +complete -c zkstack -n "__fish_zkstack_using_subcommand containers" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand containers" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand containers" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand containers" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -f -a "run" -d 'Run contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -f -a "init" -d 'Download required binaries for contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and not __fish_seen_subcommand_from run init help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from run" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from run" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from run" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from run" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l zksolc-version -d 'Version of zksolc to install' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l zkvyper-version -d 'Version of zkvyper to install' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l solc-version -d 'Version of solc to install' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l era-vm-solc-version -d 'Version of era vm solc to install' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l vyper-version -d 'Version of vyper to install' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l only -d 'Install only provided compilers' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from help" -f -a "run" -d 'Run contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from help" -f -a "init" -d 'Download required binaries for contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand contract-verifier; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand portal" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand portal" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand portal" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand portal" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -f -a "init" -d 'Initialize explorer (create database to store explorer data and generate docker compose file with explorer services). Runs for all chains, unless --chain is passed' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -f -a "run-backend" -d 'Start explorer backend services (api, data_fetcher, worker) for a given chain. Uses default chain, unless --chain is passed' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -f -a "run" -d 'Run explorer app' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and not __fish_seen_subcommand_from init run-backend run help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run-backend" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run-backend" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run-backend" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run-backend" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from run" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from help" -f -a "init" -d 'Initialize explorer (create database to store explorer data and generate docker compose file with explorer services). Runs for all chains, unless --chain is passed' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from help" -f -a "run-backend" -d 'Start explorer backend services (api, data_fetcher, worker) for a given chain. Uses default chain, unless --chain is passed' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from help" -f -a "run" -d 'Run explorer app' +complete -c zkstack -n "__fish_zkstack_using_subcommand explorer; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -f -a "set-attester-committee" -d 'Sets the attester committee in the consensus registry contract to `consensus.genesis_spec.attesters` in general.yaml' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -f -a "get-attester-committee" -d 'Fetches the attester committee from the consensus registry contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and not __fish_seen_subcommand_from set-attester-committee get-attester-committee help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from set-attester-committee" -l from-file -d 'Sets the attester committee in the consensus registry contract to the committee in the yaml file. File format is definied in `commands/consensus/proto/mod.proto`' -r -F +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from set-attester-committee" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from set-attester-committee" -l from-genesis -d 'Sets the attester committee in the consensus registry contract to `consensus.genesis_spec.attesters` in general.yaml' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from set-attester-committee" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from set-attester-committee" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from set-attester-committee" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from get-attester-committee" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from get-attester-committee" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from get-attester-committee" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from get-attester-committee" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from help" -f -a "set-attester-committee" -d 'Sets the attester committee in the consensus registry contract to `consensus.genesis_spec.attesters` in general.yaml' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from help" -f -a "get-attester-committee" -d 'Fetches the attester committee from the consensus registry contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand consensus; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand update" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand update" -s c -l only-config -d 'Update only the config files' +complete -c zkstack -n "__fish_zkstack_using_subcommand update" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand update" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand update" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand markdown" -l chain -d 'Chain to use' -r +complete -c zkstack -n "__fish_zkstack_using_subcommand markdown" -s v -l verbose -d 'Verbose mode' +complete -c zkstack -n "__fish_zkstack_using_subcommand markdown" -l ignore-prerequisites -d 'Ignores prerequisites checks' +complete -c zkstack -n "__fish_zkstack_using_subcommand markdown" -s h -l help -d 'Print help' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "autocomplete" -d 'Create shell autocompletion files' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "ecosystem" -d 'Ecosystem related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "chain" -d 'Chain related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "dev" -d 'Supervisor related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "prover" -d 'Prover related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "server" -d 'Run server' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "external-node" -d 'External Node related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "containers" -d 'Run containers for local development' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "contract-verifier" -d 'Run contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "portal" -d 'Run dapp-portal' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "explorer" -d 'Run block-explorer' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "consensus" -d 'Consensus utilities' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "update" -d 'Update ZKsync' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "markdown" -d 'Print markdown help' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and not __fish_seen_subcommand_from autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from ecosystem" -f -a "create" -d 'Create a new ecosystem and chain, setting necessary configurations for later initialization' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from ecosystem" -f -a "build-transactions" -d 'Create transactions to build ecosystem contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from ecosystem" -f -a "init" -d 'Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from ecosystem" -f -a "change-default-chain" -d 'Change the default chain' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from ecosystem" -f -a "setup-observability" -d 'Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "create" -d 'Create a new chain, setting the necessary configurations for later initialization' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "build-transactions" -d 'Create unsigned transactions for chain deployment' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "init" -d 'Initialize chain, deploying necessary contracts and performing on-chain operations' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "genesis" -d 'Run server genesis' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "register-chain" -d 'Register a new chain on L1 (executed by L1 governor). This command deploys and configures Governance, ChainAdmin, and DiamondProxy contracts, registers chain with BridgeHub and sets pending admin for DiamondProxy. Note: After completion, L2 governor can accept ownership by running `accept-chain-ownership`' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "deploy-l2-contracts" -d 'Deploy all L2 contracts (executed by L1 governor)' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "accept-chain-ownership" -d 'Accept ownership of L2 chain (executed by L2 governor). This command should be run after `register-chain` to accept ownership of newly created DiamondProxy contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "initialize-bridges" -d 'Initialize bridges on L2' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "deploy-consensus-registry" -d 'Deploy L2 consensus registry' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "deploy-multicall3" -d 'Deploy L2 multicall3' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "deploy-upgrader" -d 'Deploy Default Upgrader' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "deploy-paymaster" -d 'Deploy paymaster smart contract' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from chain" -f -a "update-token-multiplier-setter" -d 'Update Token Multiplier Setter address on L1' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "database" -d 'Database related commands' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "test" -d 'Run tests' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "clean" -d 'Clean artifacts' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "snapshot" -d 'Snapshots creator' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "lint" -d 'Lint code' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "fmt" -d 'Format code' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "prover" -d 'Protocol version used by provers' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "contracts" -d 'Build contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "config-writer" -d 'Overwrite general config' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "send-transactions" -d 'Send transactions from file' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "status" -d 'Get status of the server' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from dev" -f -a "generate-genesis" -d 'Generate new genesis file based on current contracts' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from prover" -f -a "init" -d 'Initialize prover' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from prover" -f -a "setup-keys" -d 'Generate setup keys' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from prover" -f -a "run" -d 'Run prover' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from prover" -f -a "init-bellman-cuda" -d 'Initialize bellman-cuda' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from prover" -f -a "compressor-keys" -d 'Download compressor keys' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from external-node" -f -a "configs" -d 'Prepare configs for EN' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from external-node" -f -a "init" -d 'Init databases' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from external-node" -f -a "run" -d 'Run external node' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from contract-verifier" -f -a "run" -d 'Run contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from contract-verifier" -f -a "init" -d 'Download required binaries for contract verifier' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from explorer" -f -a "init" -d 'Initialize explorer (create database to store explorer data and generate docker compose file with explorer services). Runs for all chains, unless --chain is passed' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from explorer" -f -a "run-backend" -d 'Start explorer backend services (api, data_fetcher, worker) for a given chain. Uses default chain, unless --chain is passed' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from explorer" -f -a "run" -d 'Run explorer app' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from consensus" -f -a "set-attester-committee" -d 'Sets the attester committee in the consensus registry contract to `consensus.genesis_spec.attesters` in general.yaml' +complete -c zkstack -n "__fish_zkstack_using_subcommand help; and __fish_seen_subcommand_from consensus" -f -a "get-attester-committee" -d 'Fetches the attester committee from the consensus registry contract' diff --git a/zkstack_cli/crates/zkstack/completion/zkstack.sh b/zkstack_cli/crates/zkstack/completion/zkstack.sh new file mode 100644 index 00000000000..27639acd50b --- /dev/null +++ b/zkstack_cli/crates/zkstack/completion/zkstack.sh @@ -0,0 +1,6998 @@ +_zkstack() { + local i cur prev opts cmd + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + cmd="" + opts="" + + for i in ${COMP_WORDS[@]} + do + case "${cmd},${i}" in + ",$1") + cmd="zkstack" + ;; + zkstack,autocomplete) + cmd="zkstack__autocomplete" + ;; + zkstack,chain) + cmd="zkstack__chain" + ;; + zkstack,consensus) + cmd="zkstack__consensus" + ;; + zkstack,containers) + cmd="zkstack__containers" + ;; + zkstack,contract-verifier) + cmd="zkstack__contract__verifier" + ;; + zkstack,dev) + cmd="zkstack__dev" + ;; + zkstack,ecosystem) + cmd="zkstack__ecosystem" + ;; + zkstack,explorer) + cmd="zkstack__explorer" + ;; + zkstack,external-node) + cmd="zkstack__external__node" + ;; + zkstack,help) + cmd="zkstack__help" + ;; + zkstack,markdown) + cmd="zkstack__markdown" + ;; + zkstack,portal) + cmd="zkstack__portal" + ;; + zkstack,prover) + cmd="zkstack__prover" + ;; + zkstack,server) + cmd="zkstack__server" + ;; + zkstack,update) + cmd="zkstack__update" + ;; + zkstack__chain,accept-chain-ownership) + cmd="zkstack__chain__accept__chain__ownership" + ;; + zkstack__chain,build-transactions) + cmd="zkstack__chain__build__transactions" + ;; + zkstack__chain,create) + cmd="zkstack__chain__create" + ;; + zkstack__chain,deploy-consensus-registry) + cmd="zkstack__chain__deploy__consensus__registry" + ;; + zkstack__chain,deploy-l2-contracts) + cmd="zkstack__chain__deploy__l2__contracts" + ;; + zkstack__chain,deploy-multicall3) + cmd="zkstack__chain__deploy__multicall3" + ;; + zkstack__chain,deploy-paymaster) + cmd="zkstack__chain__deploy__paymaster" + ;; + zkstack__chain,deploy-upgrader) + cmd="zkstack__chain__deploy__upgrader" + ;; + zkstack__chain,genesis) + cmd="zkstack__chain__genesis" + ;; + zkstack__chain,help) + cmd="zkstack__chain__help" + ;; + zkstack__chain,init) + cmd="zkstack__chain__init" + ;; + zkstack__chain,initialize-bridges) + cmd="zkstack__chain__initialize__bridges" + ;; + zkstack__chain,register-chain) + cmd="zkstack__chain__register__chain" + ;; + zkstack__chain,update-token-multiplier-setter) + cmd="zkstack__chain__update__token__multiplier__setter" + ;; + zkstack__chain__genesis,help) + cmd="zkstack__chain__genesis__help" + ;; + zkstack__chain__genesis,init-database) + cmd="zkstack__chain__genesis__init__database" + ;; + zkstack__chain__genesis,server) + cmd="zkstack__chain__genesis__server" + ;; + zkstack__chain__genesis__help,help) + cmd="zkstack__chain__genesis__help__help" + ;; + zkstack__chain__genesis__help,init-database) + cmd="zkstack__chain__genesis__help__init__database" + ;; + zkstack__chain__genesis__help,server) + cmd="zkstack__chain__genesis__help__server" + ;; + zkstack__chain__help,accept-chain-ownership) + cmd="zkstack__chain__help__accept__chain__ownership" + ;; + zkstack__chain__help,build-transactions) + cmd="zkstack__chain__help__build__transactions" + ;; + zkstack__chain__help,create) + cmd="zkstack__chain__help__create" + ;; + zkstack__chain__help,deploy-consensus-registry) + cmd="zkstack__chain__help__deploy__consensus__registry" + ;; + zkstack__chain__help,deploy-l2-contracts) + cmd="zkstack__chain__help__deploy__l2__contracts" + ;; + zkstack__chain__help,deploy-multicall3) + cmd="zkstack__chain__help__deploy__multicall3" + ;; + zkstack__chain__help,deploy-paymaster) + cmd="zkstack__chain__help__deploy__paymaster" + ;; + zkstack__chain__help,deploy-upgrader) + cmd="zkstack__chain__help__deploy__upgrader" + ;; + zkstack__chain__help,genesis) + cmd="zkstack__chain__help__genesis" + ;; + zkstack__chain__help,help) + cmd="zkstack__chain__help__help" + ;; + zkstack__chain__help,init) + cmd="zkstack__chain__help__init" + ;; + zkstack__chain__help,initialize-bridges) + cmd="zkstack__chain__help__initialize__bridges" + ;; + zkstack__chain__help,register-chain) + cmd="zkstack__chain__help__register__chain" + ;; + zkstack__chain__help,update-token-multiplier-setter) + cmd="zkstack__chain__help__update__token__multiplier__setter" + ;; + zkstack__chain__help__genesis,init-database) + cmd="zkstack__chain__help__genesis__init__database" + ;; + zkstack__chain__help__genesis,server) + cmd="zkstack__chain__help__genesis__server" + ;; + zkstack__chain__help__init,configs) + cmd="zkstack__chain__help__init__configs" + ;; + zkstack__chain__init,configs) + cmd="zkstack__chain__init__configs" + ;; + zkstack__chain__init,help) + cmd="zkstack__chain__init__help" + ;; + zkstack__chain__init__help,configs) + cmd="zkstack__chain__init__help__configs" + ;; + zkstack__chain__init__help,help) + cmd="zkstack__chain__init__help__help" + ;; + zkstack__consensus,get-attester-committee) + cmd="zkstack__consensus__get__attester__committee" + ;; + zkstack__consensus,help) + cmd="zkstack__consensus__help" + ;; + zkstack__consensus,set-attester-committee) + cmd="zkstack__consensus__set__attester__committee" + ;; + zkstack__consensus__help,get-attester-committee) + cmd="zkstack__consensus__help__get__attester__committee" + ;; + zkstack__consensus__help,help) + cmd="zkstack__consensus__help__help" + ;; + zkstack__consensus__help,set-attester-committee) + cmd="zkstack__consensus__help__set__attester__committee" + ;; + zkstack__contract__verifier,help) + cmd="zkstack__contract__verifier__help" + ;; + zkstack__contract__verifier,init) + cmd="zkstack__contract__verifier__init" + ;; + zkstack__contract__verifier,run) + cmd="zkstack__contract__verifier__run" + ;; + zkstack__contract__verifier__help,help) + cmd="zkstack__contract__verifier__help__help" + ;; + zkstack__contract__verifier__help,init) + cmd="zkstack__contract__verifier__help__init" + ;; + zkstack__contract__verifier__help,run) + cmd="zkstack__contract__verifier__help__run" + ;; + zkstack__dev,clean) + cmd="zkstack__dev__clean" + ;; + zkstack__dev,config-writer) + cmd="zkstack__dev__config__writer" + ;; + zkstack__dev,contracts) + cmd="zkstack__dev__contracts" + ;; + zkstack__dev,database) + cmd="zkstack__dev__database" + ;; + zkstack__dev,fmt) + cmd="zkstack__dev__fmt" + ;; + zkstack__dev,generate-genesis) + cmd="zkstack__dev__generate__genesis" + ;; + zkstack__dev,help) + cmd="zkstack__dev__help" + ;; + zkstack__dev,lint) + cmd="zkstack__dev__lint" + ;; + zkstack__dev,prover) + cmd="zkstack__dev__prover" + ;; + zkstack__dev,send-transactions) + cmd="zkstack__dev__send__transactions" + ;; + zkstack__dev,snapshot) + cmd="zkstack__dev__snapshot" + ;; + zkstack__dev,status) + cmd="zkstack__dev__status" + ;; + zkstack__dev,test) + cmd="zkstack__dev__test" + ;; + zkstack__dev__clean,all) + cmd="zkstack__dev__clean__all" + ;; + zkstack__dev__clean,containers) + cmd="zkstack__dev__clean__containers" + ;; + zkstack__dev__clean,contracts-cache) + cmd="zkstack__dev__clean__contracts__cache" + ;; + zkstack__dev__clean,help) + cmd="zkstack__dev__clean__help" + ;; + zkstack__dev__clean__help,all) + cmd="zkstack__dev__clean__help__all" + ;; + zkstack__dev__clean__help,containers) + cmd="zkstack__dev__clean__help__containers" + ;; + zkstack__dev__clean__help,contracts-cache) + cmd="zkstack__dev__clean__help__contracts__cache" + ;; + zkstack__dev__clean__help,help) + cmd="zkstack__dev__clean__help__help" + ;; + zkstack__dev__database,check-sqlx-data) + cmd="zkstack__dev__database__check__sqlx__data" + ;; + zkstack__dev__database,drop) + cmd="zkstack__dev__database__drop" + ;; + zkstack__dev__database,help) + cmd="zkstack__dev__database__help" + ;; + zkstack__dev__database,migrate) + cmd="zkstack__dev__database__migrate" + ;; + zkstack__dev__database,new-migration) + cmd="zkstack__dev__database__new__migration" + ;; + zkstack__dev__database,prepare) + cmd="zkstack__dev__database__prepare" + ;; + zkstack__dev__database,reset) + cmd="zkstack__dev__database__reset" + ;; + zkstack__dev__database,setup) + cmd="zkstack__dev__database__setup" + ;; + zkstack__dev__database__help,check-sqlx-data) + cmd="zkstack__dev__database__help__check__sqlx__data" + ;; + zkstack__dev__database__help,drop) + cmd="zkstack__dev__database__help__drop" + ;; + zkstack__dev__database__help,help) + cmd="zkstack__dev__database__help__help" + ;; + zkstack__dev__database__help,migrate) + cmd="zkstack__dev__database__help__migrate" + ;; + zkstack__dev__database__help,new-migration) + cmd="zkstack__dev__database__help__new__migration" + ;; + zkstack__dev__database__help,prepare) + cmd="zkstack__dev__database__help__prepare" + ;; + zkstack__dev__database__help,reset) + cmd="zkstack__dev__database__help__reset" + ;; + zkstack__dev__database__help,setup) + cmd="zkstack__dev__database__help__setup" + ;; + zkstack__dev__fmt,contract) + cmd="zkstack__dev__fmt__contract" + ;; + zkstack__dev__fmt,help) + cmd="zkstack__dev__fmt__help" + ;; + zkstack__dev__fmt,prettier) + cmd="zkstack__dev__fmt__prettier" + ;; + zkstack__dev__fmt,rustfmt) + cmd="zkstack__dev__fmt__rustfmt" + ;; + zkstack__dev__fmt__help,contract) + cmd="zkstack__dev__fmt__help__contract" + ;; + zkstack__dev__fmt__help,help) + cmd="zkstack__dev__fmt__help__help" + ;; + zkstack__dev__fmt__help,prettier) + cmd="zkstack__dev__fmt__help__prettier" + ;; + zkstack__dev__fmt__help,rustfmt) + cmd="zkstack__dev__fmt__help__rustfmt" + ;; + zkstack__dev__help,clean) + cmd="zkstack__dev__help__clean" + ;; + zkstack__dev__help,config-writer) + cmd="zkstack__dev__help__config__writer" + ;; + zkstack__dev__help,contracts) + cmd="zkstack__dev__help__contracts" + ;; + zkstack__dev__help,database) + cmd="zkstack__dev__help__database" + ;; + zkstack__dev__help,fmt) + cmd="zkstack__dev__help__fmt" + ;; + zkstack__dev__help,generate-genesis) + cmd="zkstack__dev__help__generate__genesis" + ;; + zkstack__dev__help,help) + cmd="zkstack__dev__help__help" + ;; + zkstack__dev__help,lint) + cmd="zkstack__dev__help__lint" + ;; + zkstack__dev__help,prover) + cmd="zkstack__dev__help__prover" + ;; + zkstack__dev__help,send-transactions) + cmd="zkstack__dev__help__send__transactions" + ;; + zkstack__dev__help,snapshot) + cmd="zkstack__dev__help__snapshot" + ;; + zkstack__dev__help,status) + cmd="zkstack__dev__help__status" + ;; + zkstack__dev__help,test) + cmd="zkstack__dev__help__test" + ;; + zkstack__dev__help__clean,all) + cmd="zkstack__dev__help__clean__all" + ;; + zkstack__dev__help__clean,containers) + cmd="zkstack__dev__help__clean__containers" + ;; + zkstack__dev__help__clean,contracts-cache) + cmd="zkstack__dev__help__clean__contracts__cache" + ;; + zkstack__dev__help__database,check-sqlx-data) + cmd="zkstack__dev__help__database__check__sqlx__data" + ;; + zkstack__dev__help__database,drop) + cmd="zkstack__dev__help__database__drop" + ;; + zkstack__dev__help__database,migrate) + cmd="zkstack__dev__help__database__migrate" + ;; + zkstack__dev__help__database,new-migration) + cmd="zkstack__dev__help__database__new__migration" + ;; + zkstack__dev__help__database,prepare) + cmd="zkstack__dev__help__database__prepare" + ;; + zkstack__dev__help__database,reset) + cmd="zkstack__dev__help__database__reset" + ;; + zkstack__dev__help__database,setup) + cmd="zkstack__dev__help__database__setup" + ;; + zkstack__dev__help__fmt,contract) + cmd="zkstack__dev__help__fmt__contract" + ;; + zkstack__dev__help__fmt,prettier) + cmd="zkstack__dev__help__fmt__prettier" + ;; + zkstack__dev__help__fmt,rustfmt) + cmd="zkstack__dev__help__fmt__rustfmt" + ;; + zkstack__dev__help__prover,info) + cmd="zkstack__dev__help__prover__info" + ;; + zkstack__dev__help__prover,insert-batch) + cmd="zkstack__dev__help__prover__insert__batch" + ;; + zkstack__dev__help__prover,insert-version) + cmd="zkstack__dev__help__prover__insert__version" + ;; + zkstack__dev__help__snapshot,create) + cmd="zkstack__dev__help__snapshot__create" + ;; + zkstack__dev__help__status,ports) + cmd="zkstack__dev__help__status__ports" + ;; + zkstack__dev__help__test,build) + cmd="zkstack__dev__help__test__build" + ;; + zkstack__dev__help__test,fees) + cmd="zkstack__dev__help__test__fees" + ;; + zkstack__dev__help__test,integration) + cmd="zkstack__dev__help__test__integration" + ;; + zkstack__dev__help__test,l1-contracts) + cmd="zkstack__dev__help__test__l1__contracts" + ;; + zkstack__dev__help__test,loadtest) + cmd="zkstack__dev__help__test__loadtest" + ;; + zkstack__dev__help__test,prover) + cmd="zkstack__dev__help__test__prover" + ;; + zkstack__dev__help__test,recovery) + cmd="zkstack__dev__help__test__recovery" + ;; + zkstack__dev__help__test,revert) + cmd="zkstack__dev__help__test__revert" + ;; + zkstack__dev__help__test,rust) + cmd="zkstack__dev__help__test__rust" + ;; + zkstack__dev__help__test,upgrade) + cmd="zkstack__dev__help__test__upgrade" + ;; + zkstack__dev__help__test,wallet) + cmd="zkstack__dev__help__test__wallet" + ;; + zkstack__dev__prover,help) + cmd="zkstack__dev__prover__help" + ;; + zkstack__dev__prover,info) + cmd="zkstack__dev__prover__info" + ;; + zkstack__dev__prover,insert-batch) + cmd="zkstack__dev__prover__insert__batch" + ;; + zkstack__dev__prover,insert-version) + cmd="zkstack__dev__prover__insert__version" + ;; + zkstack__dev__prover__help,help) + cmd="zkstack__dev__prover__help__help" + ;; + zkstack__dev__prover__help,info) + cmd="zkstack__dev__prover__help__info" + ;; + zkstack__dev__prover__help,insert-batch) + cmd="zkstack__dev__prover__help__insert__batch" + ;; + zkstack__dev__prover__help,insert-version) + cmd="zkstack__dev__prover__help__insert__version" + ;; + zkstack__dev__snapshot,create) + cmd="zkstack__dev__snapshot__create" + ;; + zkstack__dev__snapshot,help) + cmd="zkstack__dev__snapshot__help" + ;; + zkstack__dev__snapshot__help,create) + cmd="zkstack__dev__snapshot__help__create" + ;; + zkstack__dev__snapshot__help,help) + cmd="zkstack__dev__snapshot__help__help" + ;; + zkstack__dev__status,help) + cmd="zkstack__dev__status__help" + ;; + zkstack__dev__status,ports) + cmd="zkstack__dev__status__ports" + ;; + zkstack__dev__status__help,help) + cmd="zkstack__dev__status__help__help" + ;; + zkstack__dev__status__help,ports) + cmd="zkstack__dev__status__help__ports" + ;; + zkstack__dev__test,build) + cmd="zkstack__dev__test__build" + ;; + zkstack__dev__test,fees) + cmd="zkstack__dev__test__fees" + ;; + zkstack__dev__test,help) + cmd="zkstack__dev__test__help" + ;; + zkstack__dev__test,integration) + cmd="zkstack__dev__test__integration" + ;; + zkstack__dev__test,l1-contracts) + cmd="zkstack__dev__test__l1__contracts" + ;; + zkstack__dev__test,loadtest) + cmd="zkstack__dev__test__loadtest" + ;; + zkstack__dev__test,prover) + cmd="zkstack__dev__test__prover" + ;; + zkstack__dev__test,recovery) + cmd="zkstack__dev__test__recovery" + ;; + zkstack__dev__test,revert) + cmd="zkstack__dev__test__revert" + ;; + zkstack__dev__test,rust) + cmd="zkstack__dev__test__rust" + ;; + zkstack__dev__test,upgrade) + cmd="zkstack__dev__test__upgrade" + ;; + zkstack__dev__test,wallet) + cmd="zkstack__dev__test__wallet" + ;; + zkstack__dev__test__help,build) + cmd="zkstack__dev__test__help__build" + ;; + zkstack__dev__test__help,fees) + cmd="zkstack__dev__test__help__fees" + ;; + zkstack__dev__test__help,help) + cmd="zkstack__dev__test__help__help" + ;; + zkstack__dev__test__help,integration) + cmd="zkstack__dev__test__help__integration" + ;; + zkstack__dev__test__help,l1-contracts) + cmd="zkstack__dev__test__help__l1__contracts" + ;; + zkstack__dev__test__help,loadtest) + cmd="zkstack__dev__test__help__loadtest" + ;; + zkstack__dev__test__help,prover) + cmd="zkstack__dev__test__help__prover" + ;; + zkstack__dev__test__help,recovery) + cmd="zkstack__dev__test__help__recovery" + ;; + zkstack__dev__test__help,revert) + cmd="zkstack__dev__test__help__revert" + ;; + zkstack__dev__test__help,rust) + cmd="zkstack__dev__test__help__rust" + ;; + zkstack__dev__test__help,upgrade) + cmd="zkstack__dev__test__help__upgrade" + ;; + zkstack__dev__test__help,wallet) + cmd="zkstack__dev__test__help__wallet" + ;; + zkstack__ecosystem,build-transactions) + cmd="zkstack__ecosystem__build__transactions" + ;; + zkstack__ecosystem,change-default-chain) + cmd="zkstack__ecosystem__change__default__chain" + ;; + zkstack__ecosystem,create) + cmd="zkstack__ecosystem__create" + ;; + zkstack__ecosystem,help) + cmd="zkstack__ecosystem__help" + ;; + zkstack__ecosystem,init) + cmd="zkstack__ecosystem__init" + ;; + zkstack__ecosystem,setup-observability) + cmd="zkstack__ecosystem__setup__observability" + ;; + zkstack__ecosystem__help,build-transactions) + cmd="zkstack__ecosystem__help__build__transactions" + ;; + zkstack__ecosystem__help,change-default-chain) + cmd="zkstack__ecosystem__help__change__default__chain" + ;; + zkstack__ecosystem__help,create) + cmd="zkstack__ecosystem__help__create" + ;; + zkstack__ecosystem__help,help) + cmd="zkstack__ecosystem__help__help" + ;; + zkstack__ecosystem__help,init) + cmd="zkstack__ecosystem__help__init" + ;; + zkstack__ecosystem__help,setup-observability) + cmd="zkstack__ecosystem__help__setup__observability" + ;; + zkstack__explorer,help) + cmd="zkstack__explorer__help" + ;; + zkstack__explorer,init) + cmd="zkstack__explorer__init" + ;; + zkstack__explorer,run) + cmd="zkstack__explorer__run" + ;; + zkstack__explorer,run-backend) + cmd="zkstack__explorer__run__backend" + ;; + zkstack__explorer__help,help) + cmd="zkstack__explorer__help__help" + ;; + zkstack__explorer__help,init) + cmd="zkstack__explorer__help__init" + ;; + zkstack__explorer__help,run) + cmd="zkstack__explorer__help__run" + ;; + zkstack__explorer__help,run-backend) + cmd="zkstack__explorer__help__run__backend" + ;; + zkstack__external__node,configs) + cmd="zkstack__external__node__configs" + ;; + zkstack__external__node,help) + cmd="zkstack__external__node__help" + ;; + zkstack__external__node,init) + cmd="zkstack__external__node__init" + ;; + zkstack__external__node,run) + cmd="zkstack__external__node__run" + ;; + zkstack__external__node__help,configs) + cmd="zkstack__external__node__help__configs" + ;; + zkstack__external__node__help,help) + cmd="zkstack__external__node__help__help" + ;; + zkstack__external__node__help,init) + cmd="zkstack__external__node__help__init" + ;; + zkstack__external__node__help,run) + cmd="zkstack__external__node__help__run" + ;; + zkstack__help,autocomplete) + cmd="zkstack__help__autocomplete" + ;; + zkstack__help,chain) + cmd="zkstack__help__chain" + ;; + zkstack__help,consensus) + cmd="zkstack__help__consensus" + ;; + zkstack__help,containers) + cmd="zkstack__help__containers" + ;; + zkstack__help,contract-verifier) + cmd="zkstack__help__contract__verifier" + ;; + zkstack__help,dev) + cmd="zkstack__help__dev" + ;; + zkstack__help,ecosystem) + cmd="zkstack__help__ecosystem" + ;; + zkstack__help,explorer) + cmd="zkstack__help__explorer" + ;; + zkstack__help,external-node) + cmd="zkstack__help__external__node" + ;; + zkstack__help,help) + cmd="zkstack__help__help" + ;; + zkstack__help,markdown) + cmd="zkstack__help__markdown" + ;; + zkstack__help,portal) + cmd="zkstack__help__portal" + ;; + zkstack__help,prover) + cmd="zkstack__help__prover" + ;; + zkstack__help,server) + cmd="zkstack__help__server" + ;; + zkstack__help,update) + cmd="zkstack__help__update" + ;; + zkstack__help__chain,accept-chain-ownership) + cmd="zkstack__help__chain__accept__chain__ownership" + ;; + zkstack__help__chain,build-transactions) + cmd="zkstack__help__chain__build__transactions" + ;; + zkstack__help__chain,create) + cmd="zkstack__help__chain__create" + ;; + zkstack__help__chain,deploy-consensus-registry) + cmd="zkstack__help__chain__deploy__consensus__registry" + ;; + zkstack__help__chain,deploy-l2-contracts) + cmd="zkstack__help__chain__deploy__l2__contracts" + ;; + zkstack__help__chain,deploy-multicall3) + cmd="zkstack__help__chain__deploy__multicall3" + ;; + zkstack__help__chain,deploy-paymaster) + cmd="zkstack__help__chain__deploy__paymaster" + ;; + zkstack__help__chain,deploy-upgrader) + cmd="zkstack__help__chain__deploy__upgrader" + ;; + zkstack__help__chain,genesis) + cmd="zkstack__help__chain__genesis" + ;; + zkstack__help__chain,init) + cmd="zkstack__help__chain__init" + ;; + zkstack__help__chain,initialize-bridges) + cmd="zkstack__help__chain__initialize__bridges" + ;; + zkstack__help__chain,register-chain) + cmd="zkstack__help__chain__register__chain" + ;; + zkstack__help__chain,update-token-multiplier-setter) + cmd="zkstack__help__chain__update__token__multiplier__setter" + ;; + zkstack__help__chain__genesis,init-database) + cmd="zkstack__help__chain__genesis__init__database" + ;; + zkstack__help__chain__genesis,server) + cmd="zkstack__help__chain__genesis__server" + ;; + zkstack__help__chain__init,configs) + cmd="zkstack__help__chain__init__configs" + ;; + zkstack__help__consensus,get-attester-committee) + cmd="zkstack__help__consensus__get__attester__committee" + ;; + zkstack__help__consensus,set-attester-committee) + cmd="zkstack__help__consensus__set__attester__committee" + ;; + zkstack__help__contract__verifier,init) + cmd="zkstack__help__contract__verifier__init" + ;; + zkstack__help__contract__verifier,run) + cmd="zkstack__help__contract__verifier__run" + ;; + zkstack__help__dev,clean) + cmd="zkstack__help__dev__clean" + ;; + zkstack__help__dev,config-writer) + cmd="zkstack__help__dev__config__writer" + ;; + zkstack__help__dev,contracts) + cmd="zkstack__help__dev__contracts" + ;; + zkstack__help__dev,database) + cmd="zkstack__help__dev__database" + ;; + zkstack__help__dev,fmt) + cmd="zkstack__help__dev__fmt" + ;; + zkstack__help__dev,generate-genesis) + cmd="zkstack__help__dev__generate__genesis" + ;; + zkstack__help__dev,lint) + cmd="zkstack__help__dev__lint" + ;; + zkstack__help__dev,prover) + cmd="zkstack__help__dev__prover" + ;; + zkstack__help__dev,send-transactions) + cmd="zkstack__help__dev__send__transactions" + ;; + zkstack__help__dev,snapshot) + cmd="zkstack__help__dev__snapshot" + ;; + zkstack__help__dev,status) + cmd="zkstack__help__dev__status" + ;; + zkstack__help__dev,test) + cmd="zkstack__help__dev__test" + ;; + zkstack__help__dev__clean,all) + cmd="zkstack__help__dev__clean__all" + ;; + zkstack__help__dev__clean,containers) + cmd="zkstack__help__dev__clean__containers" + ;; + zkstack__help__dev__clean,contracts-cache) + cmd="zkstack__help__dev__clean__contracts__cache" + ;; + zkstack__help__dev__database,check-sqlx-data) + cmd="zkstack__help__dev__database__check__sqlx__data" + ;; + zkstack__help__dev__database,drop) + cmd="zkstack__help__dev__database__drop" + ;; + zkstack__help__dev__database,migrate) + cmd="zkstack__help__dev__database__migrate" + ;; + zkstack__help__dev__database,new-migration) + cmd="zkstack__help__dev__database__new__migration" + ;; + zkstack__help__dev__database,prepare) + cmd="zkstack__help__dev__database__prepare" + ;; + zkstack__help__dev__database,reset) + cmd="zkstack__help__dev__database__reset" + ;; + zkstack__help__dev__database,setup) + cmd="zkstack__help__dev__database__setup" + ;; + zkstack__help__dev__fmt,contract) + cmd="zkstack__help__dev__fmt__contract" + ;; + zkstack__help__dev__fmt,prettier) + cmd="zkstack__help__dev__fmt__prettier" + ;; + zkstack__help__dev__fmt,rustfmt) + cmd="zkstack__help__dev__fmt__rustfmt" + ;; + zkstack__help__dev__prover,info) + cmd="zkstack__help__dev__prover__info" + ;; + zkstack__help__dev__prover,insert-batch) + cmd="zkstack__help__dev__prover__insert__batch" + ;; + zkstack__help__dev__prover,insert-version) + cmd="zkstack__help__dev__prover__insert__version" + ;; + zkstack__help__dev__snapshot,create) + cmd="zkstack__help__dev__snapshot__create" + ;; + zkstack__help__dev__status,ports) + cmd="zkstack__help__dev__status__ports" + ;; + zkstack__help__dev__test,build) + cmd="zkstack__help__dev__test__build" + ;; + zkstack__help__dev__test,fees) + cmd="zkstack__help__dev__test__fees" + ;; + zkstack__help__dev__test,integration) + cmd="zkstack__help__dev__test__integration" + ;; + zkstack__help__dev__test,l1-contracts) + cmd="zkstack__help__dev__test__l1__contracts" + ;; + zkstack__help__dev__test,loadtest) + cmd="zkstack__help__dev__test__loadtest" + ;; + zkstack__help__dev__test,prover) + cmd="zkstack__help__dev__test__prover" + ;; + zkstack__help__dev__test,recovery) + cmd="zkstack__help__dev__test__recovery" + ;; + zkstack__help__dev__test,revert) + cmd="zkstack__help__dev__test__revert" + ;; + zkstack__help__dev__test,rust) + cmd="zkstack__help__dev__test__rust" + ;; + zkstack__help__dev__test,upgrade) + cmd="zkstack__help__dev__test__upgrade" + ;; + zkstack__help__dev__test,wallet) + cmd="zkstack__help__dev__test__wallet" + ;; + zkstack__help__ecosystem,build-transactions) + cmd="zkstack__help__ecosystem__build__transactions" + ;; + zkstack__help__ecosystem,change-default-chain) + cmd="zkstack__help__ecosystem__change__default__chain" + ;; + zkstack__help__ecosystem,create) + cmd="zkstack__help__ecosystem__create" + ;; + zkstack__help__ecosystem,init) + cmd="zkstack__help__ecosystem__init" + ;; + zkstack__help__ecosystem,setup-observability) + cmd="zkstack__help__ecosystem__setup__observability" + ;; + zkstack__help__explorer,init) + cmd="zkstack__help__explorer__init" + ;; + zkstack__help__explorer,run) + cmd="zkstack__help__explorer__run" + ;; + zkstack__help__explorer,run-backend) + cmd="zkstack__help__explorer__run__backend" + ;; + zkstack__help__external__node,configs) + cmd="zkstack__help__external__node__configs" + ;; + zkstack__help__external__node,init) + cmd="zkstack__help__external__node__init" + ;; + zkstack__help__external__node,run) + cmd="zkstack__help__external__node__run" + ;; + zkstack__help__prover,compressor-keys) + cmd="zkstack__help__prover__compressor__keys" + ;; + zkstack__help__prover,init) + cmd="zkstack__help__prover__init" + ;; + zkstack__help__prover,init-bellman-cuda) + cmd="zkstack__help__prover__init__bellman__cuda" + ;; + zkstack__help__prover,run) + cmd="zkstack__help__prover__run" + ;; + zkstack__help__prover,setup-keys) + cmd="zkstack__help__prover__setup__keys" + ;; + zkstack__prover,compressor-keys) + cmd="zkstack__prover__compressor__keys" + ;; + zkstack__prover,help) + cmd="zkstack__prover__help" + ;; + zkstack__prover,init) + cmd="zkstack__prover__init" + ;; + zkstack__prover,init-bellman-cuda) + cmd="zkstack__prover__init__bellman__cuda" + ;; + zkstack__prover,run) + cmd="zkstack__prover__run" + ;; + zkstack__prover,setup-keys) + cmd="zkstack__prover__setup__keys" + ;; + zkstack__prover__help,compressor-keys) + cmd="zkstack__prover__help__compressor__keys" + ;; + zkstack__prover__help,help) + cmd="zkstack__prover__help__help" + ;; + zkstack__prover__help,init) + cmd="zkstack__prover__help__init" + ;; + zkstack__prover__help,init-bellman-cuda) + cmd="zkstack__prover__help__init__bellman__cuda" + ;; + zkstack__prover__help,run) + cmd="zkstack__prover__help__run" + ;; + zkstack__prover__help,setup-keys) + cmd="zkstack__prover__help__setup__keys" + ;; + *) + ;; + esac + done + + case "${cmd}" in + zkstack) + opts="-v -h -V --verbose --chain --ignore-prerequisites --help --version autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__autocomplete) + opts="-o -v -h --generate --out --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --generate) + COMPREPLY=($(compgen -W "bash elvish fish powershell zsh" -- "${cur}")) + return 0 + ;; + --out) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain) + opts="-v -h --verbose --chain --ignore-prerequisites --help create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__accept__chain__ownership) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__build__transactions) + opts="-o -a -v -h --out --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --l1-rpc-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --out) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__create) + opts="-v -h --chain-name --chain-id --prover-mode --wallet-creation --wallet-path --l1-batch-commit-data-generator-mode --base-token-address --base-token-price-nominator --base-token-price-denominator --set-as-default --legacy-bridge --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain-id) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --prover-mode) + COMPREPLY=($(compgen -W "no-proofs gpu" -- "${cur}")) + return 0 + ;; + --wallet-creation) + COMPREPLY=($(compgen -W "localhost random empty in-file" -- "${cur}")) + return 0 + ;; + --wallet-path) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' + COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi + return 0 + ;; + --l1-batch-commit-data-generator-mode) + COMPREPLY=($(compgen -W "rollup validium" -- "${cur}")) + return 0 + ;; + --base-token-address) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --base-token-price-nominator) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --base-token-price-denominator) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --set-as-default) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__deploy__consensus__registry) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__deploy__l2__contracts) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__deploy__multicall3) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__deploy__paymaster) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__deploy__upgrader) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis) + opts="-u -d -v -h --server-db-url --server-db-name --use-default --dont-drop --verbose --chain --ignore-prerequisites --help init-database server help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --server-db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --server-db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis__help) + opts="init-database server help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis__help__init__database) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis__help__server) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis__init__database) + opts="-u -d -v -h --server-db-url --server-db-name --use-default --dont-drop --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --server-db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --server-db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__genesis__server) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help) + opts="create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__accept__chain__ownership) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__build__transactions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__deploy__consensus__registry) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__deploy__l2__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__deploy__multicall3) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__deploy__paymaster) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__deploy__upgrader) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__genesis) + opts="init-database server" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__genesis__init__database) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__genesis__server) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__init) + opts="configs" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__init__configs) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__initialize__bridges) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__register__chain) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__help__update__token__multiplier__setter) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__init) + opts="-a -u -d -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --server-db-url --server-db-name --use-default --dont-drop --deploy-paymaster --l1-rpc-url --no-port-reallocation --verbose --chain --ignore-prerequisites --help configs help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --server-db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --server-db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --deploy-paymaster) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__init__configs) + opts="-u -d -v -h --server-db-url --server-db-name --use-default --dont-drop --l1-rpc-url --no-port-reallocation --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --server-db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --server-db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__init__help) + opts="configs help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__init__help__configs) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__init__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__initialize__bridges) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__register__chain) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__chain__update__token__multiplier__setter) + opts="-a -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus) + opts="-v -h --verbose --chain --ignore-prerequisites --help set-attester-committee get-attester-committee help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus__get__attester__committee) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus__help) + opts="set-attester-committee get-attester-committee help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus__help__get__attester__committee) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus__help__set__attester__committee) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__consensus__set__attester__committee) + opts="-v -h --from-genesis --from-file --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --from-file) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__containers) + opts="-o -v -h --observability --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --observability) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier) + opts="-v -h --verbose --chain --ignore-prerequisites --help run init help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier__help) + opts="run init help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier__help__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier__init) + opts="-v -h --zksolc-version --zkvyper-version --solc-version --era-vm-solc-version --vyper-version --only --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --zksolc-version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --zkvyper-version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --solc-version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --era-vm-solc-version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --vyper-version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__contract__verifier__run) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev) + opts="-v -h --verbose --chain --ignore-prerequisites --help database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean) + opts="-v -h --verbose --chain --ignore-prerequisites --help all containers contracts-cache help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__all) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__containers) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__contracts__cache) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__help) + opts="all containers contracts-cache help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__help__all) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__help__containers) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__help__contracts__cache) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__clean__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__config__writer) + opts="-p -v -h --path --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --path) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__contracts) + opts="-v -h --l1-contracts --l2-contracts --system-contracts --test-contracts --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --l1-contracts) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --l2-contracts) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --system-contracts) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --test-contracts) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database) + opts="-v -h --verbose --chain --ignore-prerequisites --help check-sqlx-data drop migrate new-migration prepare reset setup help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__check__sqlx__data) + opts="-p -c -v -h --prover --prover-url --core --core-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --prover) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --core) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --core-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__drop) + opts="-p -c -v -h --prover --prover-url --core --core-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --prover) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --core) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --core-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help) + opts="check-sqlx-data drop migrate new-migration prepare reset setup help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__check__sqlx__data) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__drop) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__migrate) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__new__migration) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__prepare) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__reset) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__help__setup) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__migrate) + opts="-p -c -v -h --prover --prover-url --core --core-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --prover) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --core) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --core-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__new__migration) + opts="-v -h --database --name --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --database) + COMPREPLY=($(compgen -W "prover core" -- "${cur}")) + return 0 + ;; + --name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__prepare) + opts="-p -c -v -h --prover --prover-url --core --core-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --prover) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --core) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --core-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__reset) + opts="-p -c -v -h --prover --prover-url --core --core-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --prover) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --core) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --core-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__database__setup) + opts="-p -c -v -h --prover --prover-url --core --core-url --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --prover) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --core) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --core-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt) + opts="-c -v -h --check --verbose --chain --ignore-prerequisites --help rustfmt contract prettier help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__contract) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__help) + opts="rustfmt contract prettier help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__help__contract) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__help__prettier) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__help__rustfmt) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__prettier) + opts="-t -v -h --targets --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --targets) + COMPREPLY=($(compgen -W "md sol js ts rs contracts autocompletion" -- "${cur}")) + return 0 + ;; + -t) + COMPREPLY=($(compgen -W "md sol js ts rs contracts autocompletion" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__fmt__rustfmt) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__generate__genesis) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help) + opts="database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__clean) + opts="all containers contracts-cache" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__clean__all) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__clean__containers) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__clean__contracts__cache) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__config__writer) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database) + opts="check-sqlx-data drop migrate new-migration prepare reset setup" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__check__sqlx__data) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__drop) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__migrate) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__new__migration) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__prepare) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__reset) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__database__setup) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__fmt) + opts="rustfmt contract prettier" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__fmt__contract) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__fmt__prettier) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__fmt__rustfmt) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__generate__genesis) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__lint) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__prover) + opts="info insert-batch insert-version" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__prover__info) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__prover__insert__batch) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__prover__insert__version) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__send__transactions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__snapshot) + opts="create" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__snapshot__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__status) + opts="ports" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__status__ports) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test) + opts="integration fees revert recovery upgrade build rust l1-contracts prover wallet loadtest" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__build) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__fees) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__integration) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__l1__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__loadtest) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__prover) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__recovery) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__revert) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__rust) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__upgrade) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__help__test__wallet) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__lint) + opts="-c -t -v -h --check --targets --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --targets) + COMPREPLY=($(compgen -W "md sol js ts rs contracts autocompletion" -- "${cur}")) + return 0 + ;; + -t) + COMPREPLY=($(compgen -W "md sol js ts rs contracts autocompletion" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover) + opts="-v -h --verbose --chain --ignore-prerequisites --help info insert-batch insert-version help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__help) + opts="info insert-batch insert-version help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__help__info) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__help__insert__batch) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__help__insert__version) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__info) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__insert__batch) + opts="-v -h --number --default --version --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --number) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__prover__insert__version) + opts="-v -h --default --version --snark-wrapper --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --version) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --snark-wrapper) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__send__transactions) + opts="-v -h --file --private-key --l1-rpc-url --confirmations --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --file) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --private-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --confirmations) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__snapshot) + opts="-v -h --verbose --chain --ignore-prerequisites --help create help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__snapshot__create) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__snapshot__help) + opts="create help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__snapshot__help__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__snapshot__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__status) + opts="-u -v -h --url --verbose --chain --ignore-prerequisites --help ports help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -u) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__status__help) + opts="ports help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__status__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__status__help__ports) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__status__ports) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test) + opts="-v -h --verbose --chain --ignore-prerequisites --help integration fees revert recovery upgrade build rust l1-contracts prover wallet loadtest help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__build) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__fees) + opts="-n -v -h --no-deps --no-kill --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help) + opts="integration fees revert recovery upgrade build rust l1-contracts prover wallet loadtest help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__build) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__fees) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__integration) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__l1__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__loadtest) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__prover) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__recovery) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__revert) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__rust) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__upgrade) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__help__wallet) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__integration) + opts="-e -n -t -v -h --external-node --no-deps --test-pattern --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --test-pattern) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -t) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__l1__contracts) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__loadtest) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__prover) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__recovery) + opts="-s -n -v -h --snapshot --no-deps --no-kill --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__revert) + opts="-e -n -v -h --enable-consensus --external-node --no-deps --no-kill --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__rust) + opts="-v -h --options --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --options) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__upgrade) + opts="-n -v -h --no-deps --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__dev__test__wallet) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem) + opts="-v -h --verbose --chain --ignore-prerequisites --help create build-transactions init change-default-chain setup-observability help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__build__transactions) + opts="-o -a -v -h --sender --l1-rpc-url --out --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --sender) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --out) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__change__default__chain) + opts="-v -h --verbose --chain --ignore-prerequisites --help [NAME]" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__create) + opts="-v -h --ecosystem-name --l1-network --link-to-code --chain-name --chain-id --prover-mode --wallet-creation --wallet-path --l1-batch-commit-data-generator-mode --base-token-address --base-token-price-nominator --base-token-price-denominator --set-as-default --legacy-bridge --start-containers --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --ecosystem-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-network) + COMPREPLY=($(compgen -W "localhost sepolia holesky mainnet" -- "${cur}")) + return 0 + ;; + --link-to-code) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi + return 0 + ;; + --chain-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain-id) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --prover-mode) + COMPREPLY=($(compgen -W "no-proofs gpu" -- "${cur}")) + return 0 + ;; + --wallet-creation) + COMPREPLY=($(compgen -W "localhost random empty in-file" -- "${cur}")) + return 0 + ;; + --wallet-path) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' + COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi + return 0 + ;; + --l1-batch-commit-data-generator-mode) + COMPREPLY=($(compgen -W "rollup validium" -- "${cur}")) + return 0 + ;; + --base-token-address) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --base-token-price-nominator) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --base-token-price-denominator) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --set-as-default) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --start-containers) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help) + opts="create build-transactions init change-default-chain setup-observability help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help__build__transactions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help__change__default__chain) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__help__setup__observability) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__init) + opts="-a -u -d -o -v -h --deploy-erc20 --deploy-ecosystem --ecosystem-contracts-path --l1-rpc-url --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --deploy-paymaster --server-db-url --server-db-name --use-default --dont-drop --ecosystem-only --dev --observability --no-port-reallocation --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --deploy-erc20) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --deploy-ecosystem) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --ecosystem-contracts-path) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verify) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --verifier) + COMPREPLY=($(compgen -W "etherscan sourcify blockscout oklink" -- "${cur}")) + return 0 + ;; + --verifier-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --verifier-api-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --deploy-paymaster) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --server-db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --server-db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --observability) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__ecosystem__setup__observability) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer) + opts="-v -h --verbose --chain --ignore-prerequisites --help init run-backend run help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__help) + opts="init run-backend run help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__help__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__help__run__backend) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__init) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__run) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__explorer__run__backend) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node) + opts="-v -h --verbose --chain --ignore-prerequisites --help configs init run help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__configs) + opts="-u -v -h --db-url --db-name --l1-rpc-url --use-default --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --l1-rpc-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__help) + opts="configs init run help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__help__configs) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__help__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__init) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__external__node__run) + opts="-a -v -h --reinit --components --enable-consensus --additional-args --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --components) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --enable-consensus) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help) + opts="autocomplete ecosystem chain dev prover server external-node containers contract-verifier portal explorer consensus update markdown help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__autocomplete) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain) + opts="create build-transactions init genesis register-chain deploy-l2-contracts accept-chain-ownership initialize-bridges deploy-consensus-registry deploy-multicall3 deploy-upgrader deploy-paymaster update-token-multiplier-setter" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__accept__chain__ownership) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__build__transactions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__deploy__consensus__registry) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__deploy__l2__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__deploy__multicall3) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__deploy__paymaster) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__deploy__upgrader) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__genesis) + opts="init-database server" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__genesis__init__database) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__genesis__server) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__init) + opts="configs" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__init__configs) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__initialize__bridges) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__register__chain) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__chain__update__token__multiplier__setter) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__consensus) + opts="set-attester-committee get-attester-committee" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__consensus__get__attester__committee) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__consensus__set__attester__committee) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__containers) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__contract__verifier) + opts="run init" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__contract__verifier__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__contract__verifier__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev) + opts="database test clean snapshot lint fmt prover contracts config-writer send-transactions status generate-genesis" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__clean) + opts="all containers contracts-cache" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__clean__all) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__clean__containers) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__clean__contracts__cache) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__config__writer) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database) + opts="check-sqlx-data drop migrate new-migration prepare reset setup" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__check__sqlx__data) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__drop) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__migrate) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__new__migration) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__prepare) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__reset) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__database__setup) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__fmt) + opts="rustfmt contract prettier" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__fmt__contract) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__fmt__prettier) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__fmt__rustfmt) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__generate__genesis) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__lint) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__prover) + opts="info insert-batch insert-version" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__prover__info) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__prover__insert__batch) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__prover__insert__version) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__send__transactions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__snapshot) + opts="create" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__snapshot__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__status) + opts="ports" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__status__ports) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test) + opts="integration fees revert recovery upgrade build rust l1-contracts prover wallet loadtest" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__build) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__fees) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__integration) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__l1__contracts) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__loadtest) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__prover) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__recovery) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__revert) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__rust) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__upgrade) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__dev__test__wallet) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__ecosystem) + opts="create build-transactions init change-default-chain setup-observability" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__ecosystem__build__transactions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__ecosystem__change__default__chain) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__ecosystem__create) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__ecosystem__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__ecosystem__setup__observability) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__explorer) + opts="init run-backend run" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__explorer__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__explorer__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__explorer__run__backend) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__external__node) + opts="configs init run" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__external__node__configs) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__external__node__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__external__node__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__markdown) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__portal) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__prover) + opts="init setup-keys run init-bellman-cuda compressor-keys" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__prover__compressor__keys) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__prover__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__prover__init__bellman__cuda) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__prover__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__prover__setup__keys) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__server) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__help__update) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__markdown) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__portal) + opts="-v -h --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover) + opts="-v -h --verbose --chain --ignore-prerequisites --help init setup-keys run init-bellman-cuda compressor-keys help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__compressor__keys) + opts="-v -h --path --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --path) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help) + opts="init setup-keys run init-bellman-cuda compressor-keys help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help__compressor__keys) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help__init__bellman__cuda) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help__run) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__help__setup__keys) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__init) + opts="-u -d -v -h --dev --proof-store-dir --bucket-base-url --credentials-file --bucket-name --location --project-id --shall-save-to-public-bucket --public-store-dir --public-bucket-base-url --public-credentials-file --public-bucket-name --public-location --public-project-id --clone --bellman-cuda-dir --bellman-cuda --setup-compressor-key --path --region --mode --setup-keys --setup-database --prover-db-url --prover-db-name --use-default --dont-drop --cloud-type --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --proof-store-dir) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --bucket-base-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --credentials-file) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --bucket-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --location) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --project-id) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --shall-save-to-public-bucket) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --public-store-dir) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-bucket-base-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-credentials-file) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-bucket-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-location) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-project-id) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --bellman-cuda-dir) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --bellman-cuda) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --setup-compressor-key) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --path) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --region) + COMPREPLY=($(compgen -W "us europe asia" -- "${cur}")) + return 0 + ;; + --mode) + COMPREPLY=($(compgen -W "download generate" -- "${cur}")) + return 0 + ;; + --setup-keys) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --setup-database) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --prover-db-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --prover-db-name) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --use-default) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -u) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --dont-drop) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + -d) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --cloud-type) + COMPREPLY=($(compgen -W "gcp local" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__init__bellman__cuda) + opts="-v -h --clone --bellman-cuda-dir --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --bellman-cuda-dir) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__run) + opts="-v -h --component --round --threads --max-allocation --witness-vector-generator-count --max-allocation --docker --tag --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --component) + COMPREPLY=($(compgen -W "gateway witness-generator witness-vector-generator prover circuit-prover compressor prover-job-monitor" -- "${cur}")) + return 0 + ;; + --round) + COMPREPLY=($(compgen -W "all-rounds basic-circuits leaf-aggregation node-aggregation recursion-tip scheduler" -- "${cur}")) + return 0 + ;; + --threads) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --max-allocation) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --witness-vector-generator-count) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --max-allocation) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --docker) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --tag) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__prover__setup__keys) + opts="-v -h --region --mode --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --region) + COMPREPLY=($(compgen -W "us europe asia" -- "${cur}")) + return 0 + ;; + --mode) + COMPREPLY=($(compgen -W "download generate" -- "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__server) + opts="-a -v -h --components --genesis --additional-args --build --uring --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --components) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --additional-args) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -a) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + zkstack__update) + opts="-c -v -h --only-config --verbose --chain --ignore-prerequisites --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --chain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + esac +} + +if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then + complete -F _zkstack -o nosort -o bashdefault -o default zkstack +else + complete -F _zkstack -o bashdefault -o default zkstack +fi diff --git a/zkstack_cli/crates/zkstack/src/commands/args/autocomplete.rs b/zkstack_cli/crates/zkstack/src/commands/args/autocomplete.rs new file mode 100644 index 00000000000..8e44d644f39 --- /dev/null +++ b/zkstack_cli/crates/zkstack/src/commands/args/autocomplete.rs @@ -0,0 +1,13 @@ +use std::path::PathBuf; + +use clap::Parser; + +#[derive(Debug, Parser)] +pub struct AutocompleteArgs { + /// The shell to generate the autocomplete script for + #[arg(long = "generate", value_enum)] + pub generator: clap_complete::Shell, + /// The out directory to write the autocomplete script to + #[arg(short, long, default_value = "./")] + pub out: PathBuf, +} diff --git a/zkstack_cli/crates/zkstack/src/commands/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/args/mod.rs index d18b05c910e..5fa83aadf51 100644 --- a/zkstack_cli/crates/zkstack/src/commands/args/mod.rs +++ b/zkstack_cli/crates/zkstack/src/commands/args/mod.rs @@ -1,7 +1,9 @@ +pub use autocomplete::*; pub use containers::*; pub use run_server::*; pub use update::*; +mod autocomplete; mod containers; mod run_server; mod update; diff --git a/zkstack_cli/crates/zkstack/src/commands/autocomplete.rs b/zkstack_cli/crates/zkstack/src/commands/autocomplete.rs new file mode 100644 index 00000000000..0f2105cd5ef --- /dev/null +++ b/zkstack_cli/crates/zkstack/src/commands/autocomplete.rs @@ -0,0 +1,52 @@ +use std::{ + fs::File, + io::{BufWriter, Write}, +}; + +use anyhow::Context; +use clap::CommandFactory; +use clap_complete::{generate, Generator}; +use common::logger; + +use super::args::AutocompleteArgs; +use crate::{ + messages::{msg_generate_autocomplete_file, MSG_OUTRO_AUTOCOMPLETE_GENERATION}, + ZkStack, +}; + +pub fn run(args: AutocompleteArgs) -> anyhow::Result<()> { + let filename = autocomplete_file_name(&args.generator); + let path = args.out.join(filename); + + logger::info(msg_generate_autocomplete_file( + path.to_str() + .context("the output file path is an invalid UTF8 string")?, + )); + + let file = File::create(path).context("Failed to create file")?; + let mut writer = BufWriter::new(file); + + generate_completions(args.generator, &mut writer)?; + + logger::outro(MSG_OUTRO_AUTOCOMPLETE_GENERATION); + + Ok(()) +} + +pub fn generate_completions(gen: G, buf: &mut dyn Write) -> anyhow::Result<()> { + let mut cmd = ZkStack::command(); + let cmd_name = cmd.get_name().to_string(); + + generate(gen, &mut cmd, cmd_name, buf); + + Ok(()) +} + +pub fn autocomplete_file_name(shell: &clap_complete::Shell) -> &'static str { + match shell { + clap_complete::Shell::Bash => "zkstack.sh", + clap_complete::Shell::Fish => "zkstack.fish", + clap_complete::Shell::Zsh => "_zkstack.zsh", + _ => todo!(), + } +} diff --git a/zkstack_cli/crates/zkstack/src/commands/chain/args/create.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/create.rs index 5fc46c1b227..ccf64ad27ac 100644 --- a/zkstack_cli/crates/zkstack/src/commands/chain/args/create.rs +++ b/zkstack_cli/crates/zkstack/src/commands/chain/args/create.rs @@ -1,7 +1,7 @@ use std::{path::PathBuf, str::FromStr}; use anyhow::{bail, Context}; -use clap::{Parser, ValueEnum}; +use clap::{Parser, ValueEnum, ValueHint}; use common::{Prompt, PromptConfirm, PromptSelect}; use config::forge_interface::deploy_ecosystem::output::Erc20Token; use serde::{Deserialize, Serialize}; @@ -53,7 +53,7 @@ pub struct ChainCreateArgs { prover_mode: Option, #[clap(long, help = MSG_WALLET_CREATION_HELP, value_enum)] wallet_creation: Option, - #[clap(long, help = MSG_WALLET_PATH_HELP)] + #[clap(long, help = MSG_WALLET_PATH_HELP, value_hint = ValueHint::FilePath)] wallet_path: Option, #[clap(long, help = MSG_L1_COMMIT_DATA_GENERATOR_MODE_HELP)] l1_batch_commit_data_generator_mode: Option, diff --git a/zkstack_cli/crates/zkstack/src/commands/chain/args/init/configs.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/configs.rs index c26ad647524..b34809643cf 100644 --- a/zkstack_cli/crates/zkstack/src/commands/chain/args/init/configs.rs +++ b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/configs.rs @@ -24,7 +24,7 @@ pub struct InitConfigsArgs { pub genesis_args: GenesisArgs, #[clap(long, help = MSG_L1_RPC_URL_HELP)] pub l1_rpc_url: Option, - #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP, default_value = "false", default_missing_value = "true", num_args = 0..=1)] + #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP)] pub no_port_reallocation: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs index be4d28202b8..d92de9a0641 100644 --- a/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs +++ b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs @@ -29,7 +29,7 @@ pub struct InitArgs { pub deploy_paymaster: Option, #[clap(long, help = MSG_L1_RPC_URL_HELP)] pub l1_rpc_url: Option, - #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP, default_value = "false", default_missing_value = "true", num_args = 0..=1)] + #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP)] pub no_port_reallocation: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs index 71f21a02e73..6c3c3fa3d75 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs @@ -1,13 +1,23 @@ +use std::{ + fs::File, + io::{Read, Write}, + path::Path, +}; + +use anyhow::{bail, Context}; use clap::Parser; use common::{cmd::Cmd, logger, spinner::Spinner}; use config::EcosystemConfig; use xshell::{cmd, Shell}; -use crate::commands::dev::{ - commands::lint_utils::{get_unignored_files, Target}, - messages::{ - msg_running_linter_for_extension_spinner, msg_running_linters_for_files, - MSG_LINT_CONFIG_PATH_ERR, MSG_RUNNING_CONTRACTS_LINTER_SPINNER, +use crate::commands::{ + autocomplete::{autocomplete_file_name, generate_completions}, + dev::{ + commands::lint_utils::{get_unignored_files, Target}, + messages::{ + msg_running_linter_for_extension_spinner, msg_running_linters_for_files, + MSG_LINT_CONFIG_PATH_ERR, MSG_RUNNING_CONTRACTS_LINTER_SPINNER, + }, }, }; @@ -30,6 +40,7 @@ pub fn run(shell: &Shell, args: LintArgs) -> anyhow::Result<()> { Target::Js, Target::Ts, Target::Contracts, + Target::Autocompletion, ] } else { args.targets.clone() @@ -43,10 +54,13 @@ pub fn run(shell: &Shell, args: LintArgs) -> anyhow::Result<()> { match target { Target::Rs => lint_rs(shell, &ecosystem, args.check)?, Target::Contracts => lint_contracts(shell, &ecosystem, args.check)?, + Target::Autocompletion => lint_autocompletion_files(shell, args.check)?, ext => lint(shell, &ecosystem, &ext, args.check)?, } } + logger::outro("Linting complete."); + Ok(()) } @@ -81,6 +95,7 @@ fn get_linter(target: &Target) -> Vec { Target::Js => vec!["eslint".to_string()], Target::Ts => vec!["eslint".to_string(), "--ext".to_string(), "ts".to_string()], Target::Contracts => vec![], + Target::Autocompletion => vec![], } } @@ -133,3 +148,45 @@ fn lint_contracts(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> an Ok(()) } + +fn lint_autocompletion_files(_shell: &Shell, check: bool) -> anyhow::Result<()> { + let completion_folder = Path::new("./zkstack_cli/crates/zkstack/completion/"); + if !completion_folder.exists() { + logger::info("WARNING: Please run this command from the project's root folder"); + return Ok(()); + } + + // Array of supported shells + let shells = [ + clap_complete::Shell::Bash, + clap_complete::Shell::Fish, + clap_complete::Shell::Zsh, + ]; + + for shell in shells { + let mut writer = Vec::new(); + + generate_completions(shell, &mut writer) + .context("Failed to generate autocompletion file")?; + + let new = String::from_utf8(writer)?; + + let path = completion_folder.join(autocomplete_file_name(&shell)); + let mut autocomplete_file = File::open(path.clone()) + .context(format!("failed to open {}", autocomplete_file_name(&shell)))?; + + let mut old = String::new(); + autocomplete_file.read_to_string(&mut old)?; + + if new != old { + if !check { + let mut autocomplete_file = File::create(path).context("Failed to create file")?; + autocomplete_file.write_all(new.as_bytes())?; + } else { + bail!("Autocompletion files need to be regenerated. Run `zkstack dev lint -t autocompletion` to fix this issue.") + } + } + } + + Ok(()) +} diff --git a/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint_utils.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint_utils.rs index 9095e445384..11a32504710 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint_utils.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint_utils.rs @@ -14,6 +14,7 @@ pub enum Target { Ts, Rs, Contracts, + Autocompletion, } #[derive(Deserialize, Serialize, Debug)] diff --git a/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/fees.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/fees.rs index 83d505aa575..9e76850ff2e 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/fees.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/fees.rs @@ -7,6 +7,6 @@ use crate::commands::dev::messages::{MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP}; pub struct FeesArgs { #[clap(short, long, help = MSG_NO_DEPS_HELP)] pub no_deps: bool, - #[clap(short, long, help = MSG_NO_KILL_HELP)] + #[clap(long, help = MSG_NO_KILL_HELP)] pub no_kill: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs index cf4734fd82e..b6ce278a1ca 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs @@ -11,6 +11,6 @@ pub struct RecoveryArgs { pub snapshot: bool, #[clap(short, long, help = MSG_NO_DEPS_HELP)] pub no_deps: bool, - #[clap(short, long, help = MSG_NO_KILL_HELP)] + #[clap(long, help = MSG_NO_KILL_HELP)] pub no_kill: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/revert.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/revert.rs index e4fb7fba2a9..9f86eec7f3d 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/revert.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/revert.rs @@ -13,6 +13,6 @@ pub struct RevertArgs { pub external_node: bool, #[clap(short, long, help = MSG_NO_DEPS_HELP)] pub no_deps: bool, - #[clap(short, long, help = MSG_NO_KILL_HELP)] + #[clap(long, help = MSG_NO_KILL_HELP)] pub no_kill: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/create.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/create.rs index 2e5c50f4538..14cb5206f6a 100644 --- a/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/create.rs +++ b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/create.rs @@ -1,7 +1,7 @@ use std::path::{Path, PathBuf}; use anyhow::bail; -use clap::Parser; +use clap::{Parser, ValueHint}; use common::{cmd::Cmd, logger, Prompt, PromptConfirm, PromptSelect}; use serde::{Deserialize, Serialize}; use slugify_rs::slugify; @@ -26,7 +26,7 @@ pub struct EcosystemCreateArgs { pub ecosystem_name: Option, #[clap(long, help = MSG_L1_NETWORK_HELP, value_enum)] pub l1_network: Option, - #[clap(long, help = MSG_LINK_TO_CODE_HELP)] + #[clap(long, help = MSG_LINK_TO_CODE_HELP, value_hint = ValueHint::DirPath)] pub link_to_code: Option, #[clap(flatten)] #[serde(flatten)] diff --git a/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs index 830b7b25e47..a77a9c28ca9 100644 --- a/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs +++ b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs @@ -96,7 +96,7 @@ pub struct EcosystemInitArgs { pub dev: bool, #[clap(long, short = 'o', help = MSG_OBSERVABILITY_HELP, default_missing_value = "true", num_args = 0..=1)] pub observability: Option, - #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP, default_value = "false", default_missing_value = "true", num_args = 0..=1)] + #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP)] pub no_port_reallocation: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/mod.rs b/zkstack_cli/crates/zkstack/src/commands/mod.rs index c46400cc865..b5319cbc6bf 100644 --- a/zkstack_cli/crates/zkstack/src/commands/mod.rs +++ b/zkstack_cli/crates/zkstack/src/commands/mod.rs @@ -1,4 +1,5 @@ pub mod args; +pub mod autocomplete; pub mod chain; pub mod consensus; pub mod containers; diff --git a/zkstack_cli/crates/zkstack/src/main.rs b/zkstack_cli/crates/zkstack/src/main.rs index 404ac893810..3ebe26a4fa2 100644 --- a/zkstack_cli/crates/zkstack/src/main.rs +++ b/zkstack_cli/crates/zkstack/src/main.rs @@ -1,6 +1,6 @@ use clap::{command, Parser, Subcommand}; use commands::{ - args::{ContainersArgs, UpdateArgs}, + args::{AutocompleteArgs, ContainersArgs, UpdateArgs}, contract_verifier::ContractVerifierCommands, dev::DevCommands, }; @@ -29,6 +29,7 @@ mod utils; #[derive(Parser, Debug)] #[command( + name = "zkstack", version = version_message(env!("CARGO_PKG_VERSION")), about )] @@ -41,13 +42,15 @@ struct ZkStack { #[derive(Subcommand, Debug)] pub enum ZkStackSubcommands { + /// Create shell autocompletion files + Autocomplete(AutocompleteArgs), /// Ecosystem related commands #[command(subcommand, alias = "e")] Ecosystem(Box), /// Chain related commands #[command(subcommand, alias = "c")] Chain(Box), - /// Chain related commands + /// Supervisor related commands #[command(subcommand)] Dev(DevCommands), /// Prover related commands @@ -55,7 +58,7 @@ pub enum ZkStackSubcommands { Prover(ProverCommands), /// Run server Server(RunServerArgs), - /// External Node related commands + /// External Node related commands #[command(subcommand, alias = "en")] ExternalNode(ExternalNodeCommands), /// Run containers for local development @@ -69,11 +72,13 @@ pub enum ZkStackSubcommands { /// Run block-explorer #[command(subcommand)] Explorer(ExplorerCommands), + /// Consensus utilities #[command(subcommand)] Consensus(consensus::Command), /// Update ZKsync #[command(alias = "u")] Update(UpdateArgs), + /// Print markdown help #[command(hide = true)] Markdown, } @@ -98,8 +103,20 @@ async fn main() -> anyhow::Result<()> { // We must parse arguments before printing the intro, because some autogenerated // Clap commands (like `--version` would look odd otherwise). - let inception_args = ZkStack::parse(); + let zkstack_args = ZkStack::parse(); + + match run_subcommand(zkstack_args).await { + Ok(_) => {} + Err(error) => { + log_error(error); + std::process::exit(1); + } + } + Ok(()) +} + +async fn run_subcommand(zkstack_args: ZkStack) -> anyhow::Result<()> { init_prompt_theme(); logger::new_empty_line(); @@ -107,38 +124,30 @@ async fn main() -> anyhow::Result<()> { let shell = Shell::new().unwrap(); - init_global_config_inner(&shell, &inception_args.global)?; + init_global_config_inner(&shell, &zkstack_args.global)?; if !global_config().ignore_prerequisites { check_general_prerequisites(&shell); } - match run_subcommand(inception_args, &shell).await { - Ok(_) => {} - Err(error) => { - log_error(error); - std::process::exit(1); + match zkstack_args.command { + ZkStackSubcommands::Autocomplete(args) => commands::autocomplete::run(args)?, + ZkStackSubcommands::Ecosystem(args) => commands::ecosystem::run(&shell, *args).await?, + ZkStackSubcommands::Chain(args) => commands::chain::run(&shell, *args).await?, + ZkStackSubcommands::Dev(args) => commands::dev::run(&shell, args).await?, + ZkStackSubcommands::Prover(args) => commands::prover::run(&shell, args).await?, + ZkStackSubcommands::Server(args) => commands::server::run(&shell, args)?, + ZkStackSubcommands::Containers(args) => commands::containers::run(&shell, args)?, + ZkStackSubcommands::ExternalNode(args) => { + commands::external_node::run(&shell, args).await? } - } - Ok(()) -} - -async fn run_subcommand(inception_args: ZkStack, shell: &Shell) -> anyhow::Result<()> { - match inception_args.command { - ZkStackSubcommands::Ecosystem(args) => commands::ecosystem::run(shell, *args).await?, - ZkStackSubcommands::Chain(args) => commands::chain::run(shell, *args).await?, - ZkStackSubcommands::Dev(args) => commands::dev::run(shell, args).await?, - ZkStackSubcommands::Prover(args) => commands::prover::run(shell, args).await?, - ZkStackSubcommands::Server(args) => commands::server::run(shell, args)?, - ZkStackSubcommands::Containers(args) => commands::containers::run(shell, args)?, - ZkStackSubcommands::ExternalNode(args) => commands::external_node::run(shell, args).await?, ZkStackSubcommands::ContractVerifier(args) => { - commands::contract_verifier::run(shell, args).await? + commands::contract_verifier::run(&shell, args).await? } - ZkStackSubcommands::Explorer(args) => commands::explorer::run(shell, args).await?, - ZkStackSubcommands::Consensus(cmd) => cmd.run(shell).await?, - ZkStackSubcommands::Portal => commands::portal::run(shell).await?, - ZkStackSubcommands::Update(args) => commands::update::run(shell, args).await?, + ZkStackSubcommands::Explorer(args) => commands::explorer::run(&shell, args).await?, + ZkStackSubcommands::Consensus(cmd) => cmd.run(&shell).await?, + ZkStackSubcommands::Portal => commands::portal::run(&shell).await?, + ZkStackSubcommands::Update(args) => commands::update::run(&shell, args).await?, ZkStackSubcommands::Markdown => { clap_markdown::print_help_markdown::(); } @@ -146,11 +155,8 @@ async fn run_subcommand(inception_args: ZkStack, shell: &Shell) -> anyhow::Resul Ok(()) } -fn init_global_config_inner( - shell: &Shell, - inception_args: &ZkStackGlobalArgs, -) -> anyhow::Result<()> { - if let Some(name) = &inception_args.chain { +fn init_global_config_inner(shell: &Shell, zkstack_args: &ZkStackGlobalArgs) -> anyhow::Result<()> { + if let Some(name) = &zkstack_args.chain { if let Ok(config) = EcosystemConfig::from_file(shell) { let chains = config.list_of_chains(); if !chains.contains(name) { @@ -163,9 +169,9 @@ fn init_global_config_inner( } } init_global_config(GlobalConfig { - verbose: inception_args.verbose, - chain_name: inception_args.chain.clone(), - ignore_prerequisites: inception_args.ignore_prerequisites, + verbose: zkstack_args.verbose, + chain_name: zkstack_args.chain.clone(), + ignore_prerequisites: zkstack_args.ignore_prerequisites, }); Ok(()) } diff --git a/zkstack_cli/crates/zkstack/src/messages.rs b/zkstack_cli/crates/zkstack/src/messages.rs index 6d6a1ceb566..e2145c18ffd 100644 --- a/zkstack_cli/crates/zkstack/src/messages.rs +++ b/zkstack_cli/crates/zkstack/src/messages.rs @@ -16,6 +16,13 @@ pub(super) const MSG_CHAIN_NOT_INITIALIZED: &str = "Chain not initialized. Please create a chain first"; pub(super) const MSG_ARGS_VALIDATOR_ERR: &str = "Invalid arguments"; +/// Autocomplete message +pub(super) fn msg_generate_autocomplete_file(filename: &str) -> String { + format!("Generating completion file: {filename}") +} +pub(super) const MSG_OUTRO_AUTOCOMPLETE_GENERATION: &str = + "Autocompletion file correctly generated"; + /// Ecosystem create related messages pub(super) const MSG_L1_NETWORK_HELP: &str = "L1 Network"; pub(super) const MSG_LINK_TO_CODE_HELP: &str = "Code link"; From caee55fef4eed0ec58cceaeba277bbdedf5c6f51 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Wed, 23 Oct 2024 06:22:06 +0200 Subject: [PATCH 08/21] fix(consensus): preventing config update reverts (#3148) Random failures of consensus_global_config RPC may cause config reverts, until the consensus_genesis() RPC is fully deprecated. Although the problems of this sort are transient, this pr adds extra protection from this kind of situations to prevent unnecessary binary restarts. --- core/lib/dal/src/consensus_dal/mod.rs | 64 +++++++++++++++++---------- core/node/consensus/src/en.rs | 7 ++- 2 files changed, 46 insertions(+), 25 deletions(-) diff --git a/core/lib/dal/src/consensus_dal/mod.rs b/core/lib/dal/src/consensus_dal/mod.rs index 9515e93f2b3..4516434868c 100644 --- a/core/lib/dal/src/consensus_dal/mod.rs +++ b/core/lib/dal/src/consensus_dal/mod.rs @@ -16,10 +16,48 @@ use crate::{Core, CoreDal}; #[cfg(test)] mod tests; +/// Hash of the batch. pub fn batch_hash(info: &StoredBatchInfo) -> attester::BatchHash { attester::BatchHash(Keccak256::from_bytes(info.hash().0)) } +/// Verifies that the transition from `old` to `new` is admissible. +pub fn verify_config_transition(old: &GlobalConfig, new: &GlobalConfig) -> anyhow::Result<()> { + anyhow::ensure!( + old.genesis.chain_id == new.genesis.chain_id, + "changing chain_id is not allowed: old = {:?}, new = {:?}", + old.genesis.chain_id, + new.genesis.chain_id, + ); + // Note that it may happen that the fork number didn't change, + // in case the binary was updated to support more fields in genesis struct. + // In such a case, the old binary was not able to connect to the consensus network, + // because of the genesis hash mismatch. + // TODO: Perhaps it would be better to deny unknown fields in the genesis instead. + // It would require embedding the genesis either as a json string or protobuf bytes within + // the global config, so that the global config can be parsed with + // `deny_unknown_fields:false` while genesis would be parsed with + // `deny_unknown_fields:true`. + anyhow::ensure!( + old.genesis.fork_number <= new.genesis.fork_number, + "transition to a past fork is not allowed: old = {:?}, new = {:?}", + old.genesis.fork_number, + new.genesis.fork_number, + ); + new.genesis.verify().context("genesis.verify()")?; + // This is a temporary hack until the `consensus_genesis()` RPC is disabled. + if new + == (&GlobalConfig { + genesis: old.genesis.clone(), + registry_address: None, + seed_peers: [].into(), + }) + { + anyhow::bail!("new config is equal to truncated old config, which means that it was sourced from the wrong endpoint"); + } + Ok(()) +} + /// Storage access methods for `zksync_core::consensus` module. #[derive(Debug)] pub struct ConsensusDal<'a, 'c> { @@ -94,6 +132,8 @@ impl ConsensusDal<'_, '_> { if got == want { return Ok(()); } + verify_config_transition(got, want)?; + // If genesis didn't change, just update the config. if got.genesis == want.genesis { let s = zksync_protobuf::serde::Serialize; @@ -112,30 +152,6 @@ impl ConsensusDal<'_, '_> { txn.commit().await?; return Ok(()); } - - // Verify the genesis change. - anyhow::ensure!( - got.genesis.chain_id == want.genesis.chain_id, - "changing chain_id is not allowed: old = {:?}, new = {:?}", - got.genesis.chain_id, - want.genesis.chain_id, - ); - // Note that it may happen that the fork number didn't change, - // in case the binary was updated to support more fields in genesis struct. - // In such a case, the old binary was not able to connect to the consensus network, - // because of the genesis hash mismatch. - // TODO: Perhaps it would be better to deny unknown fields in the genesis instead. - // It would require embedding the genesis either as a json string or protobuf bytes within - // the global config, so that the global config can be parsed with - // `deny_unknown_fields:false` while genesis would be parsed with - // `deny_unknown_fields:true`. - anyhow::ensure!( - got.genesis.fork_number <= want.genesis.fork_number, - "transition to a past fork is not allowed: old = {:?}, new = {:?}", - got.genesis.fork_number, - want.genesis.fork_number, - ); - want.genesis.verify().context("genesis.verify()")?; } // Reset the consensus state. diff --git a/core/node/consensus/src/en.rs b/core/node/consensus/src/en.rs index 518a7ebb29a..8158cc5aeb2 100644 --- a/core/node/consensus/src/en.rs +++ b/core/node/consensus/src/en.rs @@ -100,7 +100,12 @@ impl EN { let old = old; loop { if let Ok(new) = self.fetch_global_config(ctx).await { - if new != old { + // We verify the transition here to work around the situation + // where `consenus_global_config()` RPC fails randomly and fallback + // to `consensus_genesis()` RPC activates. + if new != old + && consensus_dal::verify_config_transition(&old, &new).is_ok() + { return Err(anyhow::format_err!( "global config changed: old {old:?}, new {new:?}" ) From 5092031050b30c39107df788317a15eaa921b136 Mon Sep 17 00:00:00 2001 From: Daniyar Itegulov Date: Wed, 23 Oct 2024 19:28:32 +1100 Subject: [PATCH 09/21] fix(zkstack_cli): make progress bar optional in non-terminal envs (#3146) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Enables plain logging as a fallback for progress bar. ## Why ❔ Spinner does not print anything when zkstack is redirected to a file, piped or is just ran in an env with no virtual terminal. Most notably this affects our CI where all spinner messages are just swallowed into nowhere. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- zkstack_cli/crates/common/src/term/spinner.rs | 57 +++++++++++++++---- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/zkstack_cli/crates/common/src/term/spinner.rs b/zkstack_cli/crates/common/src/term/spinner.rs index b97ba075ac4..3ec2631804a 100644 --- a/zkstack_cli/crates/common/src/term/spinner.rs +++ b/zkstack_cli/crates/common/src/term/spinner.rs @@ -1,34 +1,40 @@ -use std::time::Instant; +use std::{fmt::Display, io::IsTerminal, time::Instant}; use cliclack::{spinner, ProgressBar}; -use crate::config::global_config; +use crate::{config::global_config, logger}; /// Spinner is a helper struct to show a spinner while some operation is running. pub struct Spinner { msg: String, - pb: ProgressBar, + output: SpinnerOutput, time: Instant, } impl Spinner { /// Create a new spinner with a message. pub fn new(msg: &str) -> Self { - let pb = spinner(); - pb.start(msg); - if global_config().verbose { - pb.stop(msg); - } + let output = if std::io::stdout().is_terminal() { + let pb = spinner(); + pb.start(msg); + if global_config().verbose { + pb.stop(msg); + } + SpinnerOutput::Progress(pb) + } else { + logger::info(msg); + SpinnerOutput::Plain() + }; Spinner { msg: msg.to_owned(), - pb, + output, time: Instant::now(), } } /// Manually finish the spinner. pub fn finish(self) { - self.pb.stop(format!( + self.output.stop(format!( "{} done in {} secs", self.msg, self.time.elapsed().as_secs_f64() @@ -37,7 +43,7 @@ impl Spinner { /// Interrupt the spinner with a failed message. pub fn fail(self) { - self.pb.error(format!( + self.output.error(format!( "{} failed in {} secs", self.msg, self.time.elapsed().as_secs_f64() @@ -46,6 +52,33 @@ impl Spinner { /// Freeze the spinner with current message. pub fn freeze(self) { - self.pb.stop(self.msg); + self.output.stop(self.msg); + } +} + +/// An abstraction that makes interactive progress bar optional in environments where virtual +/// terminal is not available. +/// +/// Uses plain `logger::{info,error}` as the fallback. +/// +/// See https://github.com/console-rs/indicatif/issues/530 for more details. +enum SpinnerOutput { + Progress(ProgressBar), + Plain(), +} + +impl SpinnerOutput { + fn error(&self, msg: impl Display) { + match self { + SpinnerOutput::Progress(pb) => pb.error(msg), + SpinnerOutput::Plain() => logger::error(msg), + } + } + + fn stop(self, msg: impl Display) { + match self { + SpinnerOutput::Progress(pb) => pb.stop(msg), + SpinnerOutput::Plain() => logger::info(msg), + } } } From 11e525e49531e2aa2d556337350b9af9355727fc Mon Sep 17 00:00:00 2001 From: Shahar Kaminsky Date: Wed, 23 Oct 2024 14:05:16 +0300 Subject: [PATCH 10/21] fix(zk chains): Increase Batch Seal Default Deadline (#3154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ This PR increases the L1 Batch seadl default deadline from 1 hour to 8 hours. ## Why ❔ - For lower TPS chains, this configuration matches reality better and is less wasteful in terms of Ethereum interactions. - For higher TPS chains, the batches will be sealed by other seal criteria anyways ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- etc/env/file_based/overrides/mainnet.yaml | 3 ++- etc/env/file_based/overrides/testnet.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/env/file_based/overrides/mainnet.yaml b/etc/env/file_based/overrides/mainnet.yaml index 0600abf694c..7565aac869a 100644 --- a/etc/env/file_based/overrides/mainnet.yaml +++ b/etc/env/file_based/overrides/mainnet.yaml @@ -1,5 +1,6 @@ state_keeper: - block_commit_deadline_ms: 3600000 + # Default batch seal time deadline: 8 hours + block_commit_deadline_ms: 28000000 minimal_l2_gas_price: 45250000 eth: sender: diff --git a/etc/env/file_based/overrides/testnet.yaml b/etc/env/file_based/overrides/testnet.yaml index e4da1ac96e2..d36cf9fc7bc 100644 --- a/etc/env/file_based/overrides/testnet.yaml +++ b/etc/env/file_based/overrides/testnet.yaml @@ -1,5 +1,6 @@ state_keeper: - block_commit_deadline_ms: 3600000 + # Default batch seal time deadline: 8 hours + block_commit_deadline_ms: 28000000 minimal_l2_gas_price: 25000000 eth: sender: From 35e84cc03a7fdd315932fb3020fe41c95a6e4bca Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Wed, 23 Oct 2024 15:15:47 +0400 Subject: [PATCH 11/21] feat(api): Implement eth_maxPriorityFeePerGas (#3135) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Fixes #13 Implements `eth_maxPriorityFeePerGas` method. ## Why ❔ This method is a de-facto standard now, and SDKs (e.g. viem) can use it assuming that it's supported. Even given that we're not really using EIP1559, we should still support it and return 0. ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- core/lib/web3_decl/src/namespaces/eth.rs | 3 +++ .../api_server/src/web3/backend_jsonrpsee/namespaces/eth.rs | 4 ++++ core/node/api_server/src/web3/namespaces/eth.rs | 5 +++++ core/tests/ts-integration/tests/api/web3.test.ts | 6 ++++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/lib/web3_decl/src/namespaces/eth.rs b/core/lib/web3_decl/src/namespaces/eth.rs index 399773b845d..40cb6300cff 100644 --- a/core/lib/web3_decl/src/namespaces/eth.rs +++ b/core/lib/web3_decl/src/namespaces/eth.rs @@ -185,6 +185,9 @@ pub trait EthNamespace { newest_block: BlockNumber, reward_percentiles: Vec, ) -> RpcResult; + + #[method(name = "maxPriorityFeePerGas")] + async fn max_priority_fee_per_gas(&self) -> RpcResult; } #[cfg(feature = "server")] diff --git a/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/eth.rs b/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/eth.rs index cc2209a35d3..34275601375 100644 --- a/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/eth.rs +++ b/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/eth.rs @@ -268,4 +268,8 @@ impl EthNamespaceServer for EthNamespace { .await .map_err(|err| self.current_method().map_err(err)) } + + async fn max_priority_fee_per_gas(&self) -> RpcResult { + Ok(self.max_priority_fee_per_gas_impl()) + } } diff --git a/core/node/api_server/src/web3/namespaces/eth.rs b/core/node/api_server/src/web3/namespaces/eth.rs index 5206cd3bc2b..ee37cb989f1 100644 --- a/core/node/api_server/src/web3/namespaces/eth.rs +++ b/core/node/api_server/src/web3/namespaces/eth.rs @@ -863,6 +863,11 @@ impl EthNamespace { } }) } + + pub fn max_priority_fee_per_gas_impl(&self) -> U256 { + // ZKsync does not require priority fee. + 0u64.into() + } } // Bogus methods. diff --git a/core/tests/ts-integration/tests/api/web3.test.ts b/core/tests/ts-integration/tests/api/web3.test.ts index 6f1b6c3aa6b..ceed9654df9 100644 --- a/core/tests/ts-integration/tests/api/web3.test.ts +++ b/core/tests/ts-integration/tests/api/web3.test.ts @@ -189,7 +189,8 @@ describe('web3 API compatibility tests', () => { ['eth_getCompilers', [], []], ['eth_hashrate', [], '0x0'], ['eth_mining', [], false], - ['eth_getUncleCountByBlockNumber', ['0x0'], '0x0'] + ['eth_getUncleCountByBlockNumber', ['0x0'], '0x0'], + ['eth_maxPriorityFeePerGas', [], '0x0'] ])('Should test bogus web3 methods (%s)', async (method: string, input: string[], output: string) => { await expect(alice.provider.send(method, input)).resolves.toEqual(output); }); @@ -271,7 +272,8 @@ describe('web3 API compatibility tests', () => { const eip1559ApiReceipt = await alice.provider.getTransaction(eip1559Tx.hash); expect(eip1559ApiReceipt.maxFeePerGas).toEqual(eip1559Tx.maxFeePerGas!); - expect(eip1559ApiReceipt.maxPriorityFeePerGas).toEqual(eip1559Tx.maxPriorityFeePerGas!); + // `ethers` will use value provided by `eth_maxPriorityFeePerGas`, and we return 0 there. + expect(eip1559ApiReceipt.maxPriorityFeePerGas).toEqual(0n); }); test('Should test getFilterChanges for pending transactions', async () => { From 08a3fe7ffd0410c51334193068649905337d5e84 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Wed, 23 Oct 2024 13:19:42 +0200 Subject: [PATCH 12/21] fix: Fix counter metric type to be Counter. (#3153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Fix counter metric type to be Counter. ## Why ❔ To have correct calculation of network errors across restarts. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- core/bin/zksync_tee_prover/src/metrics.rs | 4 ++-- core/bin/zksync_tee_prover/src/tee_prover.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/bin/zksync_tee_prover/src/metrics.rs b/core/bin/zksync_tee_prover/src/metrics.rs index 9f535967f79..769a8bbc7e0 100644 --- a/core/bin/zksync_tee_prover/src/metrics.rs +++ b/core/bin/zksync_tee_prover/src/metrics.rs @@ -2,7 +2,7 @@ use std::time::Duration; -use vise::{Buckets, Gauge, Histogram, Metrics, Unit}; +use vise::{Buckets, Counter, Gauge, Histogram, Metrics, Unit}; #[derive(Debug, Metrics)] #[metrics(prefix = "tee_prover")] @@ -13,7 +13,7 @@ pub(crate) struct TeeProverMetrics { pub proof_generation_time: Histogram, #[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)] pub proof_submitting_time: Histogram, - pub network_errors_counter: Gauge, + pub network_errors_counter: Counter, pub last_batch_number_processed: Gauge, } diff --git a/core/bin/zksync_tee_prover/src/tee_prover.rs b/core/bin/zksync_tee_prover/src/tee_prover.rs index bb7176644e6..5d22d1e7c63 100644 --- a/core/bin/zksync_tee_prover/src/tee_prover.rs +++ b/core/bin/zksync_tee_prover/src/tee_prover.rs @@ -155,7 +155,7 @@ impl Task for TeeProver { } } Err(err) => { - METRICS.network_errors_counter.inc_by(1); + METRICS.network_errors_counter.inc(); if !err.is_retriable() || retries > config.max_retries { return Err(err.into()); } From 0d78228c8c6a848644ded1e6807ee88f80212c9f Mon Sep 17 00:00:00 2001 From: zksync-era-bot <147085853+zksync-era-bot@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:23:19 +0400 Subject: [PATCH 13/21] chore(main): release core 25.0.0 (#3094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [25.0.0](https://github.com/matter-labs/zksync-era/compare/core-v24.29.0...core-v25.0.0) (2024-10-23) ### ⚠ BREAKING CHANGES * **contracts:** integrate protocol defense changes ([#2737](https://github.com/matter-labs/zksync-era/issues/2737)) ### Features * Add CoinMarketCap external API ([#2971](https://github.com/matter-labs/zksync-era/issues/2971)) ([c1cb30e](https://github.com/matter-labs/zksync-era/commit/c1cb30e59ca1d0b5fea5fe0980082aea0eb04aa2)) * **api:** Implement eth_maxPriorityFeePerGas ([#3135](https://github.com/matter-labs/zksync-era/issues/3135)) ([35e84cc](https://github.com/matter-labs/zksync-era/commit/35e84cc03a7fdd315932fb3020fe41c95a6e4bca)) * **api:** Make acceptable values cache lag configurable ([#3028](https://github.com/matter-labs/zksync-era/issues/3028)) ([6747529](https://github.com/matter-labs/zksync-era/commit/67475292ff770d2edd6884be27f976a4144778ae)) * **contracts:** integrate protocol defense changes ([#2737](https://github.com/matter-labs/zksync-era/issues/2737)) ([c60a348](https://github.com/matter-labs/zksync-era/commit/c60a3482ee09b3e371163e62f49e83bc6d6f4548)) * **external-node:** save protocol version before opening a batch ([#3136](https://github.com/matter-labs/zksync-era/issues/3136)) ([d6de4f4](https://github.com/matter-labs/zksync-era/commit/d6de4f40ddce339c760c95e2bf4b8aceb571af7f)) * Prover e2e test ([#2975](https://github.com/matter-labs/zksync-era/issues/2975)) ([0edd796](https://github.com/matter-labs/zksync-era/commit/0edd7962429b3530ae751bd7cc947c97193dd0ca)) * **prover:** Add min_provers and dry_run features. Improve metrics and test. ([#3129](https://github.com/matter-labs/zksync-era/issues/3129)) ([7c28964](https://github.com/matter-labs/zksync-era/commit/7c289649b7b3c418c7193a35b51c264cf4970f3c)) * **tee_verifier:** speedup SQL query for new jobs ([#3133](https://github.com/matter-labs/zksync-era/issues/3133)) ([30ceee8](https://github.com/matter-labs/zksync-era/commit/30ceee8a48046e349ff0234ebb24d468a0e0876c)) * vm2 tracers can access storage ([#3114](https://github.com/matter-labs/zksync-era/issues/3114)) ([e466b52](https://github.com/matter-labs/zksync-era/commit/e466b52948e3c4ed1cb5af4fd999a52028e4d216)) * **vm:** Return compressed bytecodes from `push_transaction()` ([#3126](https://github.com/matter-labs/zksync-era/issues/3126)) ([37f209f](https://github.com/matter-labs/zksync-era/commit/37f209fec8e7cb65c0e60003d46b9ea69c43caf1)) ### Bug Fixes * **call_tracer:** Flat call tracer fixes for blocks ([#3095](https://github.com/matter-labs/zksync-era/issues/3095)) ([30ddb29](https://github.com/matter-labs/zksync-era/commit/30ddb292977340beab37a81f75c35480cbdd59d3)) * **consensus:** preventing config update reverts ([#3148](https://github.com/matter-labs/zksync-era/issues/3148)) ([caee55f](https://github.com/matter-labs/zksync-era/commit/caee55fef4eed0ec58cceaeba277bbdedf5c6f51)) * **en:** Return `SyncState` health check ([#3142](https://github.com/matter-labs/zksync-era/issues/3142)) ([abeee81](https://github.com/matter-labs/zksync-era/commit/abeee8190d3c3a5e577d71024bdfb30ff516ad03)) * **external-node:** delete empty unsealed batch on EN initialization ([#3125](https://github.com/matter-labs/zksync-era/issues/3125)) ([5d5214b](https://github.com/matter-labs/zksync-era/commit/5d5214ba983823b306495d34fdd1d46abacce07a)) * Fix counter metric type to be Counter. ([#3153](https://github.com/matter-labs/zksync-era/issues/3153)) ([08a3fe7](https://github.com/matter-labs/zksync-era/commit/08a3fe7ffd0410c51334193068649905337d5e84)) * **mempool:** minor mempool improvements ([#3113](https://github.com/matter-labs/zksync-era/issues/3113)) ([cd16083](https://github.com/matter-labs/zksync-era/commit/cd160830a0b7ebe5af4ecbd944da1cd51af3528a)) * **prover:** Run for zero queue to allow scaling down to 0 ([#3115](https://github.com/matter-labs/zksync-era/issues/3115)) ([bbe1919](https://github.com/matter-labs/zksync-era/commit/bbe191937fa5c5711a7164fd4f0c2ae65cda0833)) * restore instruction count functionality ([#3081](https://github.com/matter-labs/zksync-era/issues/3081)) ([6159f75](https://github.com/matter-labs/zksync-era/commit/6159f7531a0340a69c4926c4e0325811ed7cabb8)) * **state-keeper:** save call trace for upgrade txs ([#3132](https://github.com/matter-labs/zksync-era/issues/3132)) ([e1c363f](https://github.com/matter-labs/zksync-era/commit/e1c363f8f5e03c8d62bba1523f17b87d6a0e25ad)) * **tee_prover:** add zstd compression ([#3144](https://github.com/matter-labs/zksync-era/issues/3144)) ([7241ae1](https://github.com/matter-labs/zksync-era/commit/7241ae139b2b6bf9a9966eaa2f22203583a3786f)) * **tee_verifier:** correctly initialize storage for re-execution ([#3017](https://github.com/matter-labs/zksync-era/issues/3017)) ([9d88373](https://github.com/matter-labs/zksync-era/commit/9d88373f1b745c489e98e5ef542644a70e815498)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: zksync-era-bot --- .github/release-please/manifest.json | 2 +- Cargo.lock | 2 +- core/CHANGELOG.md | 35 ++++++++++++++++++++++++++++ core/bin/external_node/Cargo.toml | 2 +- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json index a56866a8bd7..a0d1d73bdda 100644 --- a/.github/release-please/manifest.json +++ b/.github/release-please/manifest.json @@ -1,5 +1,5 @@ { - "core": "24.29.0", + "core": "25.0.0", "prover": "16.5.0", "zkstack_cli": "0.1.2" } diff --git a/Cargo.lock b/Cargo.lock index 05c26a74834..7e4cad34cf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10220,7 +10220,7 @@ dependencies = [ [[package]] name = "zksync_external_node" -version = "24.29.0" +version = "25.0.0" dependencies = [ "anyhow", "assert_matches", diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 59b49af1554..56239303cd4 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,5 +1,40 @@ # Changelog +## [25.0.0](https://github.com/matter-labs/zksync-era/compare/core-v24.29.0...core-v25.0.0) (2024-10-23) + + +### ⚠ BREAKING CHANGES + +* **contracts:** integrate protocol defense changes ([#2737](https://github.com/matter-labs/zksync-era/issues/2737)) + +### Features + +* Add CoinMarketCap external API ([#2971](https://github.com/matter-labs/zksync-era/issues/2971)) ([c1cb30e](https://github.com/matter-labs/zksync-era/commit/c1cb30e59ca1d0b5fea5fe0980082aea0eb04aa2)) +* **api:** Implement eth_maxPriorityFeePerGas ([#3135](https://github.com/matter-labs/zksync-era/issues/3135)) ([35e84cc](https://github.com/matter-labs/zksync-era/commit/35e84cc03a7fdd315932fb3020fe41c95a6e4bca)) +* **api:** Make acceptable values cache lag configurable ([#3028](https://github.com/matter-labs/zksync-era/issues/3028)) ([6747529](https://github.com/matter-labs/zksync-era/commit/67475292ff770d2edd6884be27f976a4144778ae)) +* **contracts:** integrate protocol defense changes ([#2737](https://github.com/matter-labs/zksync-era/issues/2737)) ([c60a348](https://github.com/matter-labs/zksync-era/commit/c60a3482ee09b3e371163e62f49e83bc6d6f4548)) +* **external-node:** save protocol version before opening a batch ([#3136](https://github.com/matter-labs/zksync-era/issues/3136)) ([d6de4f4](https://github.com/matter-labs/zksync-era/commit/d6de4f40ddce339c760c95e2bf4b8aceb571af7f)) +* Prover e2e test ([#2975](https://github.com/matter-labs/zksync-era/issues/2975)) ([0edd796](https://github.com/matter-labs/zksync-era/commit/0edd7962429b3530ae751bd7cc947c97193dd0ca)) +* **prover:** Add min_provers and dry_run features. Improve metrics and test. ([#3129](https://github.com/matter-labs/zksync-era/issues/3129)) ([7c28964](https://github.com/matter-labs/zksync-era/commit/7c289649b7b3c418c7193a35b51c264cf4970f3c)) +* **tee_verifier:** speedup SQL query for new jobs ([#3133](https://github.com/matter-labs/zksync-era/issues/3133)) ([30ceee8](https://github.com/matter-labs/zksync-era/commit/30ceee8a48046e349ff0234ebb24d468a0e0876c)) +* vm2 tracers can access storage ([#3114](https://github.com/matter-labs/zksync-era/issues/3114)) ([e466b52](https://github.com/matter-labs/zksync-era/commit/e466b52948e3c4ed1cb5af4fd999a52028e4d216)) +* **vm:** Return compressed bytecodes from `push_transaction()` ([#3126](https://github.com/matter-labs/zksync-era/issues/3126)) ([37f209f](https://github.com/matter-labs/zksync-era/commit/37f209fec8e7cb65c0e60003d46b9ea69c43caf1)) + + +### Bug Fixes + +* **call_tracer:** Flat call tracer fixes for blocks ([#3095](https://github.com/matter-labs/zksync-era/issues/3095)) ([30ddb29](https://github.com/matter-labs/zksync-era/commit/30ddb292977340beab37a81f75c35480cbdd59d3)) +* **consensus:** preventing config update reverts ([#3148](https://github.com/matter-labs/zksync-era/issues/3148)) ([caee55f](https://github.com/matter-labs/zksync-era/commit/caee55fef4eed0ec58cceaeba277bbdedf5c6f51)) +* **en:** Return `SyncState` health check ([#3142](https://github.com/matter-labs/zksync-era/issues/3142)) ([abeee81](https://github.com/matter-labs/zksync-era/commit/abeee8190d3c3a5e577d71024bdfb30ff516ad03)) +* **external-node:** delete empty unsealed batch on EN initialization ([#3125](https://github.com/matter-labs/zksync-era/issues/3125)) ([5d5214b](https://github.com/matter-labs/zksync-era/commit/5d5214ba983823b306495d34fdd1d46abacce07a)) +* Fix counter metric type to be Counter. ([#3153](https://github.com/matter-labs/zksync-era/issues/3153)) ([08a3fe7](https://github.com/matter-labs/zksync-era/commit/08a3fe7ffd0410c51334193068649905337d5e84)) +* **mempool:** minor mempool improvements ([#3113](https://github.com/matter-labs/zksync-era/issues/3113)) ([cd16083](https://github.com/matter-labs/zksync-era/commit/cd160830a0b7ebe5af4ecbd944da1cd51af3528a)) +* **prover:** Run for zero queue to allow scaling down to 0 ([#3115](https://github.com/matter-labs/zksync-era/issues/3115)) ([bbe1919](https://github.com/matter-labs/zksync-era/commit/bbe191937fa5c5711a7164fd4f0c2ae65cda0833)) +* restore instruction count functionality ([#3081](https://github.com/matter-labs/zksync-era/issues/3081)) ([6159f75](https://github.com/matter-labs/zksync-era/commit/6159f7531a0340a69c4926c4e0325811ed7cabb8)) +* **state-keeper:** save call trace for upgrade txs ([#3132](https://github.com/matter-labs/zksync-era/issues/3132)) ([e1c363f](https://github.com/matter-labs/zksync-era/commit/e1c363f8f5e03c8d62bba1523f17b87d6a0e25ad)) +* **tee_prover:** add zstd compression ([#3144](https://github.com/matter-labs/zksync-era/issues/3144)) ([7241ae1](https://github.com/matter-labs/zksync-era/commit/7241ae139b2b6bf9a9966eaa2f22203583a3786f)) +* **tee_verifier:** correctly initialize storage for re-execution ([#3017](https://github.com/matter-labs/zksync-era/issues/3017)) ([9d88373](https://github.com/matter-labs/zksync-era/commit/9d88373f1b745c489e98e5ef542644a70e815498)) + ## [24.29.0](https://github.com/matter-labs/zksync-era/compare/core-v24.28.0...core-v24.29.0) (2024-10-14) diff --git a/core/bin/external_node/Cargo.toml b/core/bin/external_node/Cargo.toml index 25f2400c79b..4e3dc548cf8 100644 --- a/core/bin/external_node/Cargo.toml +++ b/core/bin/external_node/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zksync_external_node" description = "Non-validator ZKsync node" -version = "24.29.0" # x-release-please-version +version = "25.0.0" # x-release-please-version edition.workspace = true authors.workspace = true homepage.workspace = true From bfedac03b53055c6e2d5fa6bd6bdc78e2cb1724c Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Wed, 23 Oct 2024 15:07:41 +0200 Subject: [PATCH 14/21] feat(prover): Autoscaler sends scale request to appropriate agents. (#3150) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Add feature for Autoscaler to send scale request to appropriate agents. ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. ref ZKD-1855 --- .../crates/bin/prover_autoscaler/src/agent.rs | 4 +- .../prover_autoscaler/src/cluster_types.rs | 2 + .../prover_autoscaler/src/global/scaler.rs | 96 +++++++++++++++--- .../prover_autoscaler/src/global/watcher.rs | 97 ++++++++++++++++++- 4 files changed, 177 insertions(+), 22 deletions(-) diff --git a/prover/crates/bin/prover_autoscaler/src/agent.rs b/prover/crates/bin/prover_autoscaler/src/agent.rs index 3269a43815c..f810bc41672 100644 --- a/prover/crates/bin/prover_autoscaler/src/agent.rs +++ b/prover/crates/bin/prover_autoscaler/src/agent.rs @@ -84,14 +84,14 @@ async fn get_cluster(State(app): State) -> Result, AppError> Ok(Json(cluster)) } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct ScaleDeploymentRequest { pub namespace: String, pub name: String, pub size: i32, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct ScaleRequest { pub deployments: Vec, } diff --git a/prover/crates/bin/prover_autoscaler/src/cluster_types.rs b/prover/crates/bin/prover_autoscaler/src/cluster_types.rs index c25b624b5d4..b800b86f3c2 100644 --- a/prover/crates/bin/prover_autoscaler/src/cluster_types.rs +++ b/prover/crates/bin/prover_autoscaler/src/cluster_types.rs @@ -45,6 +45,8 @@ pub struct Cluster { #[derive(Debug, Default, Clone, Serialize, Deserialize)] pub struct Clusters { pub clusters: HashMap, + /// Map from cluster to index in agent URLs Vec. + pub agent_ids: HashMap, } #[derive(Default, Debug, EnumString, Display, Hash, PartialEq, Eq, Clone, Copy)] diff --git a/prover/crates/bin/prover_autoscaler/src/global/scaler.rs b/prover/crates/bin/prover_autoscaler/src/global/scaler.rs index f10902f5dd2..884174562a1 100644 --- a/prover/crates/bin/prover_autoscaler/src/global/scaler.rs +++ b/prover/crates/bin/prover_autoscaler/src/global/scaler.rs @@ -8,6 +8,7 @@ use zksync_config::configs::prover_autoscaler::{Gpu, ProverAutoscalerScalerConfi use super::{queuer, watcher}; use crate::{ + agent::{ScaleDeploymentRequest, ScaleRequest}, cluster_types::{Cluster, Clusters, Pod, PodStatus}, metrics::AUTOSCALER_METRICS, task_wiring::Task, @@ -48,6 +49,16 @@ static PROVER_DEPLOYMENT_RE: Lazy = static PROVER_POD_RE: Lazy = Lazy::new(|| Regex::new(r"^circuit-prover-gpu(-(?[ltvpa]\d+))?").unwrap()); +/// gpu_to_prover converts Gpu type to corresponding deployment name. +fn gpu_to_prover(gpu: Gpu) -> String { + let s = "circuit-prover-gpu"; + match gpu { + Gpu::Unknown => "".into(), + Gpu::L4 => s.into(), + _ => format!("{}-{}", s, gpu.to_string().to_lowercase()), + } +} + pub struct Scaler { /// namespace to Protocol Version configuration. namespaces: HashMap, @@ -299,6 +310,47 @@ impl Scaler { } } +fn diff( + namespace: &str, + provers: HashMap, + clusters: &Clusters, + requests: &mut HashMap, +) { + provers + .into_iter() + .for_each(|(GPUPoolKey { cluster, gpu }, n)| { + let prover = gpu_to_prover(gpu); + clusters + .clusters + .get(&cluster) + .and_then(|c| c.namespaces.get(namespace)) + .and_then(|ns| ns.deployments.get(&prover)) + .map_or_else( + || { + tracing::error!( + "Wasn't able to find deployment {} in cluster {}, namespace {}", + prover, + cluster, + namespace + ) + }, + |d| { + if d.desired != n as i32 { + requests + .entry(cluster.clone()) + .or_default() + .deployments + .push(ScaleDeploymentRequest { + namespace: namespace.into(), + name: prover.clone(), + size: n as i32, + }); + } + }, + ); + }) +} + /// is_namespace_running returns true if there are some pods running in it. fn is_namespace_running(namespace: &str, clusters: &Clusters) -> bool { clusters @@ -309,7 +361,7 @@ fn is_namespace_running(namespace: &str, clusters: &Clusters) -> bool { .flat_map(|v| v.deployments.values()) .map( |d| d.running + d.desired, // If there is something running or expected to run, we - // should consider the namespace. + // should re-evaluate the namespace. ) .sum::() > 0 @@ -320,24 +372,32 @@ impl Task for Scaler { async fn invoke(&self) -> anyhow::Result<()> { let queue = self.queuer.get_queue().await.unwrap(); - let guard = self.watcher.data.lock().await; - if let Err(err) = watcher::check_is_ready(&guard.is_ready) { - AUTOSCALER_METRICS.clusters_not_ready.inc(); - tracing::warn!("Skipping Scaler run: {}", err); - return Ok(()); - } + let mut scale_requests: HashMap = HashMap::new(); + { + let guard = self.watcher.data.lock().await; // Keeping the lock during all calls of run() for + // consitency. + if let Err(err) = watcher::check_is_ready(&guard.is_ready) { + AUTOSCALER_METRICS.clusters_not_ready.inc(); + tracing::warn!("Skipping Scaler run: {}", err); + return Ok(()); + } - for (ns, ppv) in &self.namespaces { - let q = queue.queue.get(ppv).cloned().unwrap_or(0); - tracing::debug!("Running eval for namespace {ns} and PPV {ppv} found queue {q}"); - if q > 0 || is_namespace_running(ns, &guard.clusters) { - let provers = self.run(ns, q, &guard.clusters); - for (k, num) in &provers { - AUTOSCALER_METRICS.provers[&(k.cluster.clone(), ns.clone(), k.gpu)] - .set(*num as u64); + for (ns, ppv) in &self.namespaces { + let q = queue.queue.get(ppv).cloned().unwrap_or(0); + tracing::debug!("Running eval for namespace {ns} and PPV {ppv} found queue {q}"); + if q > 0 || is_namespace_running(ns, &guard.clusters) { + let provers = self.run(ns, q, &guard.clusters); + for (k, num) in &provers { + AUTOSCALER_METRICS.provers[&(k.cluster.clone(), ns.clone(), k.gpu)] + .set(*num as u64); + } + diff(ns, provers, &guard.clusters, &mut scale_requests); } - // TODO: compare before and desired, send commands [cluster,namespace,deployment] -> provers } + } // Unlock self.watcher.data. + + if let Err(err) = self.watcher.send_scale(scale_requests).await { + tracing::error!("Failed scale request: {}", err); } Ok(()) @@ -401,6 +461,7 @@ mod tests { }, )] .into(), + ..Default::default() }, ), [( @@ -467,6 +528,7 @@ mod tests { ) ] .into(), + ..Default::default() }, ), [ @@ -552,6 +614,7 @@ mod tests { ) ] .into(), + ..Default::default() }, ), [ @@ -662,6 +725,7 @@ mod tests { ) ] .into(), + ..Default::default() }, ), [ diff --git a/prover/crates/bin/prover_autoscaler/src/global/watcher.rs b/prover/crates/bin/prover_autoscaler/src/global/watcher.rs index 646b320e12d..1b54d332ebb 100644 --- a/prover/crates/bin/prover_autoscaler/src/global/watcher.rs +++ b/prover/crates/bin/prover_autoscaler/src/global/watcher.rs @@ -2,12 +2,17 @@ use std::{collections::HashMap, sync::Arc}; use anyhow::{anyhow, Context, Ok, Result}; use futures::future; -use reqwest::Method; +use reqwest::{ + header::{HeaderMap, HeaderValue, CONTENT_TYPE}, + Method, +}; + use tokio::sync::Mutex; use url::Url; use zksync_utils::http_with_retries::send_request_with_retries; use crate::{ + agent::{ScaleRequest, ScaleResponse}, cluster_types::{Cluster, Clusters}, metrics::{AUTOSCALER_METRICS, DEFAULT_ERROR_CODE}, task_wiring::Task, @@ -51,13 +56,96 @@ impl Watcher { }) .collect(), data: Arc::new(Mutex::new(WatchedData { - clusters: Clusters { - clusters: HashMap::new(), - }, + clusters: Clusters::default(), is_ready: vec![false; size], })), } } + + pub async fn send_scale(&self, requests: HashMap) -> anyhow::Result<()> { + let id_requests: HashMap; + { + // Convert cluster names into ids. Holding the data lock. + let guard = self.data.lock().await; + id_requests = requests + .into_iter() + .filter_map(|(cluster, scale_request)| { + guard.clusters.agent_ids.get(&cluster).map_or_else( + || { + tracing::error!("Failed to find id for cluster {}", cluster); + None + }, + |id| Some((*id, scale_request)), + ) + }) + .collect(); + } + + let handles: Vec<_> = id_requests + .into_iter() + .map(|(id, sr)| { + let url: String = self.cluster_agents[id] + .clone() + .join("/scale") + .unwrap() + .to_string(); + tracing::debug!("Sending scale request to {}, data: {:?}.", url, sr); + tokio::spawn(async move { + let mut headers = HeaderMap::new(); + headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + let response = send_request_with_retries( + &url, + MAX_RETRIES, + Method::POST, + Some(headers), + Some(serde_json::to_vec(&sr)?), + ) + .await; + let response = response.map_err(|err| { + AUTOSCALER_METRICS.calls[&(url.clone(), DEFAULT_ERROR_CODE)].inc(); + anyhow::anyhow!("Failed fetching cluster from url: {url}: {err:?}") + })?; + AUTOSCALER_METRICS.calls[&(url, response.status().as_u16())].inc(); + let response = response + .json::() + .await + .context("Failed to read response as json"); + Ok((id, response)) + }) + }) + .collect(); + + future::try_join_all( + future::join_all(handles) + .await + .into_iter() + .map(|h| async move { + let (id, res) = h??; + + let errors: Vec<_> = res + .expect("failed to do request to Agent") + .scale_result + .iter() + .filter_map(|e| { + if !e.is_empty() { + Some(format!("Agent {} failed to scale: {}", id, e)) + } else { + None + } + }) + .collect(); + + if !errors.is_empty() { + return Err(anyhow!(errors.join(";"))); + } + Ok(()) + }) + .collect::>(), + ) + .await?; + + Ok(()) + } } #[async_trait::async_trait] @@ -102,6 +190,7 @@ impl Task for Watcher { let (i, res) = h??; let c = res?; let mut guard = self.data.lock().await; + guard.clusters.agent_ids.insert(c.name.clone(), i); guard.clusters.clusters.insert(c.name.clone(), c); guard.is_ready[i] = true; Ok(()) From c79949b8ffde9867b961192afa6c815b44865ae4 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Wed, 23 Oct 2024 16:10:41 +0200 Subject: [PATCH 15/21] fix: Fix Doc lint. (#3158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Fix error found by Doc lint. ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. ref ZKD-1855 --- prover/crates/bin/prover_autoscaler/src/global/watcher.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/prover/crates/bin/prover_autoscaler/src/global/watcher.rs b/prover/crates/bin/prover_autoscaler/src/global/watcher.rs index 1b54d332ebb..6e02c0fe2fd 100644 --- a/prover/crates/bin/prover_autoscaler/src/global/watcher.rs +++ b/prover/crates/bin/prover_autoscaler/src/global/watcher.rs @@ -6,7 +6,6 @@ use reqwest::{ header::{HeaderMap, HeaderValue, CONTENT_TYPE}, Method, }; - use tokio::sync::Mutex; use url::Url; use zksync_utils::http_with_retries::send_request_with_retries; From 84986f44b32d0a7fa68c3f60b1ec266ce663e778 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Wed, 23 Oct 2024 17:20:20 +0300 Subject: [PATCH 16/21] test(vm): Run `multivm` tests with shadowing (#3137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Runs shared unit tests in the `multivm` crate for the shadowed VM. ## Why ❔ Allows to cheaply check VM divergences. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- core/lib/multivm/README.md | 2 + core/lib/multivm/src/versions/mod.rs | 2 + .../{testonly/shadow.rs => shadow/mod.rs} | 2 + core/lib/multivm/src/versions/shadow/tests.rs | 415 ++++++++++++++++++ .../versions/testonly/get_used_contracts.rs | 25 +- core/lib/multivm/src/versions/testonly/mod.rs | 12 +- .../src/versions/testonly/tester/mod.rs | 2 +- .../src/versions/vm_latest/tests/mod.rs | 9 +- core/lib/vm_interface/src/utils/dump.rs | 12 + core/lib/vm_interface/src/utils/mod.rs | 4 +- core/lib/vm_interface/src/utils/shadow.rs | 340 ++++++++------ 11 files changed, 674 insertions(+), 151 deletions(-) rename core/lib/multivm/src/versions/{testonly/shadow.rs => shadow/mod.rs} (99%) create mode 100644 core/lib/multivm/src/versions/shadow/tests.rs diff --git a/core/lib/multivm/README.md b/core/lib/multivm/README.md index f5e8a552242..34883db5990 100644 --- a/core/lib/multivm/README.md +++ b/core/lib/multivm/README.md @@ -14,5 +14,7 @@ If you want to add unit tests for the VM wrapper, consider the following: - Whenever possible, make tests reusable; declare test logic in the [`testonly`](src/versions/testonly/mod.rs) module, and then instantiate tests using this logic for the supported VM versions. If necessary, extend the tested VM trait so that test logic can be defined in a generic way. See the `testonly` module docs for more detailed guidelines. +- If you define a generic test, don't forget to add its instantiations for all supported VMs (`vm_latest`, `vm_fast` and + `shadow`). `shadow` tests allow checking VM divergences for free! - Do not use an RNG where it can be avoided (e.g., for test contract addresses). - Avoid using zero / default values in cases they can be treated specially by the tested code. diff --git a/core/lib/multivm/src/versions/mod.rs b/core/lib/multivm/src/versions/mod.rs index 1df706a6cce..b6523b3d474 100644 --- a/core/lib/multivm/src/versions/mod.rs +++ b/core/lib/multivm/src/versions/mod.rs @@ -1,3 +1,5 @@ +#[cfg(test)] +mod shadow; mod shared; #[cfg(test)] mod testonly; diff --git a/core/lib/multivm/src/versions/testonly/shadow.rs b/core/lib/multivm/src/versions/shadow/mod.rs similarity index 99% rename from core/lib/multivm/src/versions/testonly/shadow.rs rename to core/lib/multivm/src/versions/shadow/mod.rs index 6a7d42b06fc..fe9ce8eefcb 100644 --- a/core/lib/multivm/src/versions/testonly/shadow.rs +++ b/core/lib/multivm/src/versions/shadow/mod.rs @@ -28,6 +28,8 @@ use crate::{ vm_latest::HistoryEnabled, }; +mod tests; + type ReferenceVm = vm_latest::Vm, HistoryEnabled>; type ShadowedFastVm = crate::vm_instance::ShadowedFastVm; diff --git a/core/lib/multivm/src/versions/shadow/tests.rs b/core/lib/multivm/src/versions/shadow/tests.rs new file mode 100644 index 00000000000..64179f59be1 --- /dev/null +++ b/core/lib/multivm/src/versions/shadow/tests.rs @@ -0,0 +1,415 @@ +//! Unit tests from the `testonly` test suite. + +use std::collections::HashSet; + +use zksync_types::{writes::StateDiffRecord, StorageKey, Transaction, H256, U256}; + +use super::ShadowedFastVm; +use crate::{ + interface::{ + utils::{ShadowMut, ShadowRef}, + CurrentExecutionState, L2BlockEnv, VmExecutionMode, VmExecutionResultAndLogs, + }, + versions::testonly::TestedVm, +}; + +impl TestedVm for ShadowedFastVm { + type StateDump = (); + + fn dump_state(&self) -> Self::StateDump { + // Do nothing + } + + fn gas_remaining(&mut self) -> u32 { + self.get_mut("gas_remaining", |r| match r { + ShadowMut::Main(vm) => vm.gas_remaining(), + ShadowMut::Shadow(vm) => vm.gas_remaining(), + }) + } + + fn get_current_execution_state(&self) -> CurrentExecutionState { + self.get_custom("current_execution_state", |r| match r { + ShadowRef::Main(vm) => vm.get_current_execution_state(), + ShadowRef::Shadow(vm) => vm.get_current_execution_state(), + }) + } + + fn decommitted_hashes(&self) -> HashSet { + self.get("decommitted_hashes", |r| match r { + ShadowRef::Main(vm) => vm.decommitted_hashes(), + ShadowRef::Shadow(vm) => TestedVm::decommitted_hashes(vm), + }) + } + + fn execute_with_state_diffs( + &mut self, + diffs: Vec, + mode: VmExecutionMode, + ) -> VmExecutionResultAndLogs { + self.get_custom_mut("execute_with_state_diffs", |r| match r { + ShadowMut::Main(vm) => vm.execute_with_state_diffs(diffs.clone(), mode), + ShadowMut::Shadow(vm) => vm.execute_with_state_diffs(diffs.clone(), mode), + }) + } + + fn insert_bytecodes(&mut self, bytecodes: &[&[u8]]) { + self.get_mut("insert_bytecodes", |r| match r { + ShadowMut::Main(vm) => vm.insert_bytecodes(bytecodes), + ShadowMut::Shadow(vm) => TestedVm::insert_bytecodes(vm, bytecodes), + }); + } + + fn known_bytecode_hashes(&self) -> HashSet { + self.get("known_bytecode_hashes", |r| match r { + ShadowRef::Main(vm) => vm.known_bytecode_hashes(), + ShadowRef::Shadow(vm) => vm.known_bytecode_hashes(), + }) + } + + fn manually_decommit(&mut self, code_hash: H256) -> bool { + self.get_mut("manually_decommit", |r| match r { + ShadowMut::Main(vm) => vm.manually_decommit(code_hash), + ShadowMut::Shadow(vm) => vm.manually_decommit(code_hash), + }) + } + + fn verify_required_bootloader_heap(&self, cells: &[(u32, U256)]) { + self.get("verify_required_bootloader_heap", |r| match r { + ShadowRef::Main(vm) => vm.verify_required_bootloader_heap(cells), + ShadowRef::Shadow(vm) => vm.verify_required_bootloader_heap(cells), + }); + } + + fn write_to_bootloader_heap(&mut self, cells: &[(usize, U256)]) { + self.get_mut("manually_decommit", |r| match r { + ShadowMut::Main(vm) => vm.write_to_bootloader_heap(cells), + ShadowMut::Shadow(vm) => TestedVm::write_to_bootloader_heap(vm, cells), + }); + } + + fn read_storage(&mut self, key: StorageKey) -> U256 { + self.get_mut("read_storage", |r| match r { + ShadowMut::Main(vm) => vm.read_storage(key), + ShadowMut::Shadow(vm) => vm.read_storage(key), + }) + } + + fn last_l2_block_hash(&self) -> H256 { + self.get("last_l2_block_hash", |r| match r { + ShadowRef::Main(vm) => vm.last_l2_block_hash(), + ShadowRef::Shadow(vm) => vm.last_l2_block_hash(), + }) + } + + fn push_l2_block_unchecked(&mut self, block: L2BlockEnv) { + self.get_mut("push_l2_block_unchecked", |r| match r { + ShadowMut::Main(vm) => vm.push_l2_block_unchecked(block), + ShadowMut::Shadow(vm) => vm.push_l2_block_unchecked(block), + }); + } + + fn push_transaction_with_refund(&mut self, tx: Transaction, refund: u64) { + self.get_mut("push_transaction_with_refund", |r| match r { + ShadowMut::Main(vm) => vm.push_transaction_with_refund(tx.clone(), refund), + ShadowMut::Shadow(vm) => vm.push_transaction_with_refund(tx.clone(), refund), + }); + } +} + +mod block_tip { + use crate::versions::testonly::block_tip::*; + + #[test] + fn dry_run_upper_bound() { + test_dry_run_upper_bound::(); + } +} + +mod bootloader { + use crate::versions::testonly::bootloader::*; + + #[test] + fn dummy_bootloader() { + test_dummy_bootloader::(); + } + + #[test] + fn bootloader_out_of_gas() { + test_bootloader_out_of_gas::(); + } +} + +mod bytecode_publishing { + use crate::versions::testonly::bytecode_publishing::*; + + #[test] + fn bytecode_publishing() { + test_bytecode_publishing::(); + } +} + +mod circuits { + use crate::versions::testonly::circuits::*; + + #[test] + fn circuits() { + test_circuits::(); + } +} + +mod code_oracle { + use crate::versions::testonly::code_oracle::*; + + #[test] + fn code_oracle() { + test_code_oracle::(); + } + + #[test] + fn code_oracle_big_bytecode() { + test_code_oracle_big_bytecode::(); + } + + #[test] + fn refunds_in_code_oracle() { + test_refunds_in_code_oracle::(); + } +} + +mod default_aa { + use crate::versions::testonly::default_aa::*; + + #[test] + fn default_aa_interaction() { + test_default_aa_interaction::(); + } +} + +mod gas_limit { + use crate::versions::testonly::gas_limit::*; + + #[test] + fn tx_gas_limit_offset() { + test_tx_gas_limit_offset::(); + } +} + +mod get_used_contracts { + use crate::versions::testonly::get_used_contracts::*; + + #[test] + fn get_used_contracts() { + test_get_used_contracts::(); + } + + #[test] + fn get_used_contracts_with_far_call() { + test_get_used_contracts_with_far_call::(); + } + + #[test] + fn get_used_contracts_with_out_of_gas_far_call() { + test_get_used_contracts_with_out_of_gas_far_call::(); + } +} + +mod is_write_initial { + use crate::versions::testonly::is_write_initial::*; + + #[test] + fn is_write_initial_behaviour() { + test_is_write_initial_behaviour::(); + } +} + +mod l1_tx_execution { + use crate::versions::testonly::l1_tx_execution::*; + + #[test] + fn l1_tx_execution() { + test_l1_tx_execution::(); + } + + #[test] + fn l1_tx_execution_high_gas_limit() { + test_l1_tx_execution_high_gas_limit::(); + } +} + +mod l2_blocks { + use crate::versions::testonly::l2_blocks::*; + + #[test] + fn l2_block_initialization_timestamp() { + test_l2_block_initialization_timestamp::(); + } + + #[test] + fn l2_block_initialization_number_non_zero() { + test_l2_block_initialization_number_non_zero::(); + } + + #[test] + fn l2_block_same_l2_block() { + test_l2_block_same_l2_block::(); + } + + #[test] + fn l2_block_new_l2_block() { + test_l2_block_new_l2_block::(); + } + + #[test] + fn l2_block_first_in_batch() { + test_l2_block_first_in_batch::(); + } +} + +mod nonce_holder { + use crate::versions::testonly::nonce_holder::*; + + #[test] + fn nonce_holder() { + test_nonce_holder::(); + } +} + +mod precompiles { + use crate::versions::testonly::precompiles::*; + + #[test] + fn keccak() { + test_keccak::(); + } + + #[test] + fn sha256() { + test_sha256::(); + } + + #[test] + fn ecrecover() { + test_ecrecover::(); + } +} + +mod refunds { + use crate::versions::testonly::refunds::*; + + #[test] + fn predetermined_refunded_gas() { + test_predetermined_refunded_gas::(); + } + + #[test] + fn negative_pubdata_for_transaction() { + test_negative_pubdata_for_transaction::(); + } +} + +mod require_eip712 { + use crate::versions::testonly::require_eip712::*; + + #[test] + fn require_eip712() { + test_require_eip712::(); + } +} + +mod rollbacks { + use crate::versions::testonly::rollbacks::*; + + #[test] + fn vm_rollbacks() { + test_vm_rollbacks::(); + } + + #[test] + fn vm_loadnext_rollbacks() { + test_vm_loadnext_rollbacks::(); + } + + #[test] + fn rollback_in_call_mode() { + test_rollback_in_call_mode::(); + } +} + +mod secp256r1 { + use crate::versions::testonly::secp256r1::*; + + #[test] + fn secp256r1() { + test_secp256r1::(); + } +} + +mod simple_execution { + use crate::versions::testonly::simple_execution::*; + + #[test] + fn estimate_fee() { + test_estimate_fee::(); + } + + #[test] + fn simple_execute() { + test_simple_execute::(); + } +} + +mod storage { + use crate::versions::testonly::storage::*; + + #[test] + fn storage_behavior() { + test_storage_behavior::(); + } + + #[test] + fn transient_storage_behavior() { + test_transient_storage_behavior::(); + } +} + +mod tracing_execution_error { + use crate::versions::testonly::tracing_execution_error::*; + + #[test] + fn tracing_of_execution_errors() { + test_tracing_of_execution_errors::(); + } +} + +mod transfer { + use crate::versions::testonly::transfer::*; + + #[test] + fn send_and_transfer() { + test_send_and_transfer::(); + } + + #[test] + fn reentrancy_protection_send_and_transfer() { + test_reentrancy_protection_send_and_transfer::(); + } +} + +mod upgrade { + use crate::versions::testonly::upgrade::*; + + #[test] + fn protocol_upgrade_is_first() { + test_protocol_upgrade_is_first::(); + } + + #[test] + fn force_deploy_upgrade() { + test_force_deploy_upgrade::(); + } + + #[test] + fn complex_upgrader() { + test_complex_upgrader::(); + } +} diff --git a/core/lib/multivm/src/versions/testonly/get_used_contracts.rs b/core/lib/multivm/src/versions/testonly/get_used_contracts.rs index fbad94a0eee..d3ffee20c34 100644 --- a/core/lib/multivm/src/versions/testonly/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/testonly/get_used_contracts.rs @@ -1,4 +1,4 @@ -use std::{collections::HashSet, iter}; +use std::iter; use assert_matches::assert_matches; use ethabi::Token; @@ -11,7 +11,7 @@ use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; use super::{ read_proxy_counter_contract, read_test_contract, tester::{VmTester, VmTesterBuilder}, - TestedVm, BASE_SYSTEM_CONTRACTS, + TestedVm, }; use crate::{ interface::{ @@ -27,7 +27,7 @@ pub(crate) fn test_get_used_contracts() { .with_rich_accounts(1) .build::(); - assert!(known_bytecodes_without_base_system_contracts(&vm.vm).is_empty()); + assert!(vm.vm.known_bytecode_hashes().is_empty()); // create and push and execute some not-empty factory deps transaction with success status // to check that `get_decommitted_hashes()` updates @@ -44,10 +44,7 @@ pub(crate) fn test_get_used_contracts() { .contains(&h256_to_u256(tx.bytecode_hash))); // Note: `Default_AA` will be in the list of used contracts if L2 tx is used - assert_eq!( - vm.vm.decommitted_hashes(), - known_bytecodes_without_base_system_contracts(&vm.vm) - ); + assert_eq!(vm.vm.decommitted_hashes(), vm.vm.known_bytecode_hashes()); // create push and execute some non-empty factory deps transaction that fails // (`known_bytecodes` will be updated but we expect `get_decommitted_hashes()` to not be updated) @@ -80,23 +77,11 @@ pub(crate) fn test_get_used_contracts() { for factory_dep in tx2.execute.factory_deps { let hash = hash_bytecode(&factory_dep); let hash_to_u256 = h256_to_u256(hash); - assert!(known_bytecodes_without_base_system_contracts(&vm.vm).contains(&hash_to_u256)); + assert!(vm.vm.known_bytecode_hashes().contains(&hash_to_u256)); assert!(!vm.vm.decommitted_hashes().contains(&hash_to_u256)); } } -fn known_bytecodes_without_base_system_contracts(vm: &impl TestedVm) -> HashSet { - let mut known_bytecodes_without_base_system_contracts = vm.known_bytecode_hashes(); - known_bytecodes_without_base_system_contracts - .remove(&h256_to_u256(BASE_SYSTEM_CONTRACTS.default_aa.hash)); - if let Some(evm_emulator) = &BASE_SYSTEM_CONTRACTS.evm_emulator { - let was_removed = - known_bytecodes_without_base_system_contracts.remove(&h256_to_u256(evm_emulator.hash)); - assert!(was_removed); - } - known_bytecodes_without_base_system_contracts -} - /// Counter test contract bytecode inflated by appending lots of `NOP` opcodes at the end. This leads to non-trivial /// decommitment cost (>10,000 gas). fn inflated_counter_bytecode() -> Vec { diff --git a/core/lib/multivm/src/versions/testonly/mod.rs b/core/lib/multivm/src/versions/testonly/mod.rs index 838ba98a9aa..74cda6a9522 100644 --- a/core/lib/multivm/src/versions/testonly/mod.rs +++ b/core/lib/multivm/src/versions/testonly/mod.rs @@ -9,6 +9,8 @@ //! - Tests use [`VmTester`] built using [`VmTesterBuilder`] to create a VM instance. This allows to set up storage for the VM, //! custom [`SystemEnv`] / [`L1BatchEnv`], deployed contracts, pre-funded accounts etc. +use std::collections::HashSet; + use ethabi::Contract; use once_cell::sync::Lazy; use zksync_contracts::{ @@ -20,7 +22,7 @@ use zksync_types::{ utils::storage_key_for_eth_balance, Address, L1BatchNumber, L2BlockNumber, L2ChainId, ProtocolVersionId, U256, }; -use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, u256_to_h256}; +use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, u256_to_h256}; use zksync_vm_interface::{L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode}; pub(super) use self::tester::{TestedVm, VmTester, VmTesterBuilder}; @@ -45,7 +47,6 @@ pub(super) mod refunds; pub(super) mod require_eip712; pub(super) mod rollbacks; pub(super) mod secp256r1; -mod shadow; pub(super) mod simple_execution; pub(super) mod storage; mod tester; @@ -133,6 +134,13 @@ pub(crate) fn get_bootloader(test: &str) -> SystemContractCode { } } +pub(crate) fn filter_out_base_system_contracts(all_bytecode_hashes: &mut HashSet) { + all_bytecode_hashes.remove(&h256_to_u256(BASE_SYSTEM_CONTRACTS.default_aa.hash)); + if let Some(evm_emulator) = &BASE_SYSTEM_CONTRACTS.evm_emulator { + all_bytecode_hashes.remove(&h256_to_u256(evm_emulator.hash)); + } +} + pub(super) fn default_system_env() -> SystemEnv { SystemEnv { zk_porter_available: false, diff --git a/core/lib/multivm/src/versions/testonly/tester/mod.rs b/core/lib/multivm/src/versions/testonly/tester/mod.rs index 4bab9bca610..7432322e0c8 100644 --- a/core/lib/multivm/src/versions/testonly/tester/mod.rs +++ b/core/lib/multivm/src/versions/testonly/tester/mod.rs @@ -195,7 +195,7 @@ pub(crate) trait TestedVm: fn insert_bytecodes(&mut self, bytecodes: &[&[u8]]); - /// Includes bytecodes that have failed to decommit. + /// Includes bytecodes that have failed to decommit. Should exclude base system contract bytecodes (default AA / EVM emulator). fn known_bytecode_hashes(&self) -> HashSet; /// Returns `true` iff the decommit is fresh. diff --git a/core/lib/multivm/src/versions/vm_latest/tests/mod.rs b/core/lib/multivm/src/versions/vm_latest/tests/mod.rs index 2835f5b6faa..6f748d543d3 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/mod.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/mod.rs @@ -14,7 +14,7 @@ use crate::{ storage::{InMemoryStorage, ReadStorage, StorageView, WriteStorage}, CurrentExecutionState, L2BlockEnv, VmExecutionMode, VmExecutionResultAndLogs, }, - versions::testonly::TestedVm, + versions::testonly::{filter_out_base_system_contracts, TestedVm}, vm_latest::{ constants::BOOTLOADER_HEAP_PAGE, old_vm::{event_sink::InMemoryEventSink, history_recorder::HistoryRecorder}, @@ -104,13 +104,16 @@ impl TestedVm for TestedLatestVm { } fn known_bytecode_hashes(&self) -> HashSet { - self.state + let mut bytecode_hashes: HashSet<_> = self + .state .decommittment_processor .known_bytecodes .inner() .keys() .copied() - .collect() + .collect(); + filter_out_base_system_contracts(&mut bytecode_hashes); + bytecode_hashes } fn manually_decommit(&mut self, code_hash: H256) -> bool { diff --git a/core/lib/vm_interface/src/utils/dump.rs b/core/lib/vm_interface/src/utils/dump.rs index 522a455a11b..4076aa72270 100644 --- a/core/lib/vm_interface/src/utils/dump.rs +++ b/core/lib/vm_interface/src/utils/dump.rs @@ -139,6 +139,18 @@ impl DumpingVm { } } +impl AsRef for DumpingVm { + fn as_ref(&self) -> &Vm { + &self.inner + } +} + +impl AsMut for DumpingVm { + fn as_mut(&mut self) -> &mut Vm { + &mut self.inner + } +} + impl VmInterface for DumpingVm { type TracerDispatcher = Vm::TracerDispatcher; diff --git a/core/lib/vm_interface/src/utils/mod.rs b/core/lib/vm_interface/src/utils/mod.rs index 80a51c7b144..394df7fc9a1 100644 --- a/core/lib/vm_interface/src/utils/mod.rs +++ b/core/lib/vm_interface/src/utils/mod.rs @@ -2,7 +2,9 @@ pub use self::{ dump::VmDump, - shadow::{DivergenceErrors, DivergenceHandler, ShadowVm}, + shadow::{ + CheckDivergence, DivergenceErrors, DivergenceHandler, ShadowMut, ShadowRef, ShadowVm, + }, }; mod dump; diff --git a/core/lib/vm_interface/src/utils/shadow.rs b/core/lib/vm_interface/src/utils/shadow.rs index 8cdc899238e..e8ef87c3c7f 100644 --- a/core/lib/vm_interface/src/utils/shadow.rs +++ b/core/lib/vm_interface/src/utils/shadow.rs @@ -1,4 +1,5 @@ use std::{ + any, cell::RefCell, collections::{BTreeMap, BTreeSet}, fmt, @@ -65,6 +66,154 @@ impl VmWithReporting { } } +/// Reference to either the main or shadow VM. +#[derive(Debug)] +pub enum ShadowRef<'a, Main, Shadow> { + /// Reference to the main VM. + Main(&'a Main), + /// Reference to the shadow VM. + Shadow(&'a Shadow), +} + +/// Mutable reference to either the main or shadow VM. +#[derive(Debug)] +pub enum ShadowMut<'a, Main, Shadow> { + /// Reference to the main VM. + Main(&'a mut Main), + /// Reference to the shadow VM. + Shadow(&'a mut Shadow), +} + +/// Type that can check divergence between its instances. +pub trait CheckDivergence { + /// Checks divergences and returns a list of divergence errors, if any. + fn check_divergence(&self, other: &Self) -> DivergenceErrors; +} + +#[derive(Debug)] +struct DivergingEq(T); + +impl CheckDivergence for DivergingEq { + fn check_divergence(&self, other: &Self) -> DivergenceErrors { + let mut errors = DivergenceErrors::new(); + errors.check_match(any::type_name::(), &self.0, &other.0); + errors + } +} + +impl CheckDivergence for CurrentExecutionState { + fn check_divergence(&self, other: &Self) -> DivergenceErrors { + let mut errors = DivergenceErrors::new(); + errors.check_match("final_state.events", &self.events, &other.events); + errors.check_match( + "final_state.user_l2_to_l1_logs", + &self.user_l2_to_l1_logs, + &other.user_l2_to_l1_logs, + ); + errors.check_match( + "final_state.system_logs", + &self.system_logs, + &other.system_logs, + ); + errors.check_match( + "final_state.storage_refunds", + &self.storage_refunds, + &other.storage_refunds, + ); + errors.check_match( + "final_state.pubdata_costs", + &self.pubdata_costs, + &other.pubdata_costs, + ); + errors.check_match( + "final_state.used_contract_hashes", + &self.used_contract_hashes.iter().collect::>(), + &other.used_contract_hashes.iter().collect::>(), + ); + + let main_deduplicated_logs = DivergenceErrors::gather_logs(&self.deduplicated_storage_logs); + let shadow_deduplicated_logs = + DivergenceErrors::gather_logs(&other.deduplicated_storage_logs); + errors.check_match( + "deduplicated_storage_logs", + &main_deduplicated_logs, + &shadow_deduplicated_logs, + ); + errors + } +} + +impl CheckDivergence for VmExecutionResultAndLogs { + fn check_divergence(&self, other: &Self) -> DivergenceErrors { + let mut errors = DivergenceErrors::new(); + errors.check_match("result", &self.result, &other.result); + errors.check_match("logs.events", &self.logs.events, &other.logs.events); + errors.check_match( + "logs.system_l2_to_l1_logs", + &self.logs.system_l2_to_l1_logs, + &other.logs.system_l2_to_l1_logs, + ); + errors.check_match( + "logs.user_l2_to_l1_logs", + &self.logs.user_l2_to_l1_logs, + &other.logs.user_l2_to_l1_logs, + ); + let main_logs = UniqueStorageLogs::new(&self.logs.storage_logs); + let shadow_logs = UniqueStorageLogs::new(&other.logs.storage_logs); + errors.check_match("logs.storage_logs", &main_logs, &shadow_logs); + errors.check_match("refunds", &self.refunds, &other.refunds); + errors.check_match( + "statistics.circuit_statistic", + &self.statistics.circuit_statistic, + &other.statistics.circuit_statistic, + ); + errors.check_match( + "statistics.pubdata_published", + &self.statistics.pubdata_published, + &other.statistics.pubdata_published, + ); + errors.check_match( + "statistics.gas_remaining", + &self.statistics.gas_remaining, + &other.statistics.gas_remaining, + ); + errors.check_match( + "statistics.gas_used", + &self.statistics.gas_used, + &other.statistics.gas_used, + ); + errors.check_match( + "statistics.computational_gas_used", + &self.statistics.computational_gas_used, + &other.statistics.computational_gas_used, + ); + errors + } +} + +impl CheckDivergence for FinishedL1Batch { + fn check_divergence(&self, other: &Self) -> DivergenceErrors { + let mut errors = DivergenceErrors::new(); + errors.extend( + self.block_tip_execution_result + .check_divergence(&other.block_tip_execution_result), + ); + errors.extend( + self.final_execution_state + .check_divergence(&other.final_execution_state), + ); + + errors.check_match( + "final_bootloader_memory", + &self.final_bootloader_memory, + &other.final_bootloader_memory, + ); + errors.check_match("pubdata_input", &self.pubdata_input, &other.pubdata_input); + errors.check_match("state_diffs", &self.state_diffs, &other.state_diffs); + errors + } +} + /// Shadowed VM that executes 2 VMs for each operation and compares their outputs. /// /// If a divergence is detected, the VM state is dumped using [a pluggable handler](Self::set_dump_handler()), @@ -105,6 +254,66 @@ where pub fn dump_state(&self) -> VmDump { self.main.dump_state() } + + /// Gets the specified value from both the main and shadow VM, checking whether it matches on both. + pub fn get(&self, name: &str, mut action: impl FnMut(ShadowRef<'_, Main, Shadow>) -> R) -> R + where + R: PartialEq + fmt::Debug + 'static, + { + self.get_custom(name, |r| DivergingEq(action(r))).0 + } + + /// Same as [`Self::get()`], but uses custom divergence checks for the type encapsulated in the [`CheckDivergence`] trait. + pub fn get_custom( + &self, + name: &str, + mut action: impl FnMut(ShadowRef<'_, Main, Shadow>) -> R, + ) -> R { + let main_output = action(ShadowRef::Main(self.main.as_ref())); + let borrow = self.shadow.borrow(); + if let Some(shadow) = &*borrow { + let shadow_output = action(ShadowRef::Shadow(&shadow.vm)); + let errors = main_output.check_divergence(&shadow_output); + if let Err(err) = errors.into_result() { + drop(borrow); + self.report_shared(err.context(format!("get({name})"))); + } + } + main_output + } + + /// Gets the specified value from both the main and shadow VM, potentially changing their state + /// and checking whether the returned value matches. + pub fn get_mut( + &mut self, + name: &str, + mut action: impl FnMut(ShadowMut<'_, Main, Shadow>) -> R, + ) -> R + where + R: PartialEq + fmt::Debug + 'static, + { + self.get_custom_mut(name, |r| DivergingEq(action(r))).0 + } + + /// Same as [`Self::get_mut()`], but uses custom divergence checks for the type encapsulated in the [`CheckDivergence`] trait. + pub fn get_custom_mut( + &mut self, + name: &str, + mut action: impl FnMut(ShadowMut<'_, Main, Shadow>) -> R, + ) -> R + where + R: CheckDivergence, + { + let main_output = action(ShadowMut::Main(self.main.as_mut())); + if let Some(shadow) = self.shadow.get_mut() { + let shadow_output = action(ShadowMut::Shadow(&mut shadow.vm)); + let errors = main_output.check_divergence(&shadow_output); + if let Err(err) = errors.into_result() { + self.report_shared(err.context(format!("get_mut({name})"))); + } + } + main_output + } } impl ShadowVm @@ -151,7 +360,6 @@ where } } -/// **Important.** This doesn't properly handle tracers; they are not passed to the shadow VM! impl VmInterface for ShadowVm where S: ReadStorage, @@ -197,9 +405,7 @@ where let main_result = self.main.inspect(main_tracer, execution_mode); if let Some(shadow) = self.shadow.get_mut() { let shadow_result = shadow.vm.inspect(shadow_tracer, execution_mode); - let mut errors = DivergenceErrors::new(); - errors.check_results_match(&main_result, &shadow_result); - + let errors = main_result.check_divergence(&shadow_result); if let Err(err) = errors.into_result() { let ctx = format!("executing VM with mode {execution_mode:?}"); self.report(err.context(ctx)); @@ -240,8 +446,7 @@ where tx, with_compression, ); - let mut errors = DivergenceErrors::new(); - errors.check_results_match(&main_tx_result, &shadow_result.1); + let errors = main_tx_result.check_divergence(&shadow_result.1); if let Err(err) = errors.into_result() { let ctx = format!( "inspecting transaction {tx_repr}, with_compression={with_compression:?}" @@ -256,31 +461,7 @@ where let main_batch = self.main.finish_batch(); if let Some(shadow) = self.shadow.get_mut() { let shadow_batch = shadow.vm.finish_batch(); - let mut errors = DivergenceErrors::new(); - errors.check_results_match( - &main_batch.block_tip_execution_result, - &shadow_batch.block_tip_execution_result, - ); - errors.check_final_states_match( - &main_batch.final_execution_state, - &shadow_batch.final_execution_state, - ); - errors.check_match( - "final_bootloader_memory", - &main_batch.final_bootloader_memory, - &shadow_batch.final_bootloader_memory, - ); - errors.check_match( - "pubdata_input", - &main_batch.pubdata_input, - &shadow_batch.pubdata_input, - ); - errors.check_match( - "state_diffs", - &main_batch.state_diffs, - &shadow_batch.state_diffs, - ); - + let errors = main_batch.check_divergence(&shadow_batch); if let Err(err) = errors.into_result() { self.report(err); } @@ -321,63 +502,15 @@ impl DivergenceErrors { } } + fn extend(&mut self, from: Self) { + self.divergences.extend(from.divergences); + } + fn context(mut self, context: String) -> Self { self.context = Some(context); self } - fn check_results_match( - &mut self, - main_result: &VmExecutionResultAndLogs, - shadow_result: &VmExecutionResultAndLogs, - ) { - self.check_match("result", &main_result.result, &shadow_result.result); - self.check_match( - "logs.events", - &main_result.logs.events, - &shadow_result.logs.events, - ); - self.check_match( - "logs.system_l2_to_l1_logs", - &main_result.logs.system_l2_to_l1_logs, - &shadow_result.logs.system_l2_to_l1_logs, - ); - self.check_match( - "logs.user_l2_to_l1_logs", - &main_result.logs.user_l2_to_l1_logs, - &shadow_result.logs.user_l2_to_l1_logs, - ); - let main_logs = UniqueStorageLogs::new(&main_result.logs.storage_logs); - let shadow_logs = UniqueStorageLogs::new(&shadow_result.logs.storage_logs); - self.check_match("logs.storage_logs", &main_logs, &shadow_logs); - self.check_match("refunds", &main_result.refunds, &shadow_result.refunds); - self.check_match( - "statistics.circuit_statistic", - &main_result.statistics.circuit_statistic, - &shadow_result.statistics.circuit_statistic, - ); - self.check_match( - "statistics.pubdata_published", - &main_result.statistics.pubdata_published, - &shadow_result.statistics.pubdata_published, - ); - self.check_match( - "statistics.gas_remaining", - &main_result.statistics.gas_remaining, - &shadow_result.statistics.gas_remaining, - ); - self.check_match( - "statistics.gas_used", - &main_result.statistics.gas_used, - &shadow_result.statistics.gas_used, - ); - self.check_match( - "statistics.computational_gas_used", - &main_result.statistics.computational_gas_used, - &shadow_result.statistics.computational_gas_used, - ); - } - fn check_match(&mut self, context: &str, main: &T, shadow: &T) { if main != shadow { let comparison = pretty_assertions::Comparison::new(main, shadow); @@ -386,47 +519,6 @@ impl DivergenceErrors { } } - fn check_final_states_match( - &mut self, - main: &CurrentExecutionState, - shadow: &CurrentExecutionState, - ) { - self.check_match("final_state.events", &main.events, &shadow.events); - self.check_match( - "final_state.user_l2_to_l1_logs", - &main.user_l2_to_l1_logs, - &shadow.user_l2_to_l1_logs, - ); - self.check_match( - "final_state.system_logs", - &main.system_logs, - &shadow.system_logs, - ); - self.check_match( - "final_state.storage_refunds", - &main.storage_refunds, - &shadow.storage_refunds, - ); - self.check_match( - "final_state.pubdata_costs", - &main.pubdata_costs, - &shadow.pubdata_costs, - ); - self.check_match( - "final_state.used_contract_hashes", - &main.used_contract_hashes.iter().collect::>(), - &shadow.used_contract_hashes.iter().collect::>(), - ); - - let main_deduplicated_logs = Self::gather_logs(&main.deduplicated_storage_logs); - let shadow_deduplicated_logs = Self::gather_logs(&shadow.deduplicated_storage_logs); - self.check_match( - "deduplicated_storage_logs", - &main_deduplicated_logs, - &shadow_deduplicated_logs, - ); - } - fn gather_logs(logs: &[StorageLog]) -> BTreeMap { logs.iter() .filter(|log| log.is_write()) From 0aecae1e02d31d34d1ccc0ddf54617174d134e55 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 23 Oct 2024 18:00:00 +0200 Subject: [PATCH 17/21] feat(zkstack_cli): Add --dev flag to chain init and genesis (#3152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Add `--dev` flag to chain init and genesis. ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- .../crates/zkstack/completion/_zkstack.zsh | 19 ++--- .../crates/zkstack/completion/zkstack.fish | 7 +- .../crates/zkstack/completion/zkstack.sh | 10 +-- .../src/commands/chain/args/genesis.rs | 4 +- .../src/commands/chain/args/init/mod.rs | 73 +++++++++++++------ .../src/commands/ecosystem/args/init.rs | 24 ++++-- .../zkstack/src/commands/ecosystem/init.rs | 9 ++- zkstack_cli/crates/zkstack/src/messages.rs | 4 +- 8 files changed, 94 insertions(+), 56 deletions(-) diff --git a/zkstack_cli/crates/zkstack/completion/_zkstack.zsh b/zkstack_cli/crates/zkstack/completion/_zkstack.zsh index a8a60a6130a..b985f5b9334 100644 --- a/zkstack_cli/crates/zkstack/completion/_zkstack.zsh +++ b/zkstack_cli/crates/zkstack/completion/_zkstack.zsh @@ -131,12 +131,10 @@ _arguments "${_arguments_options[@]}" : \ '--observability=[Enable Grafana]' \ '--chain=[Chain to use]:CHAIN: ' \ '--resume[]' \ -'-u[Use default database urls and names]' \ -'--use-default[Use default database urls and names]' \ '-d[]' \ '--dont-drop[]' \ '--ecosystem-only[Initialize ecosystem only and skip chain initialization (chain can be initialized later with \`chain init\` subcommand)]' \ -'--dev[Deploy ecosystem using all defaults. Suitable for local development]' \ +'--dev[Use defaults for all options and flags. Suitable for local development]' \ '--no-port-reallocation[Do not reallocate ports]' \ '-v[Verbose mode]' \ '--verbose[Verbose mode]' \ @@ -286,11 +284,10 @@ _arguments "${_arguments_options[@]}" : \ '--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ '--chain=[Chain to use]:CHAIN: ' \ '--resume[]' \ -'-u[Use default database urls and names]' \ -'--use-default[Use default database urls and names]' \ '-d[]' \ '--dont-drop[]' \ '--no-port-reallocation[Do not reallocate ports]' \ +'--dev[Use defaults for all options and flags. Suitable for local development]' \ '-v[Verbose mode]' \ '--verbose[Verbose mode]' \ '--ignore-prerequisites[Ignores prerequisites checks]' \ @@ -312,8 +309,8 @@ _arguments "${_arguments_options[@]}" : \ '--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ '--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL: ' \ '--chain=[Chain to use]:CHAIN: ' \ -'-u[Use default database urls and names]' \ -'--use-default[Use default database urls and names]' \ +'-d[Use default database urls and names]' \ +'--dev[Use default database urls and names]' \ '-d[]' \ '--dont-drop[]' \ '--no-port-reallocation[Do not reallocate ports]' \ @@ -357,8 +354,8 @@ _arguments "${_arguments_options[@]}" : \ '--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ '--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ '--chain=[Chain to use]:CHAIN: ' \ -'-u[Use default database urls and names]' \ -'--use-default[Use default database urls and names]' \ +'-d[Use default database urls and names]' \ +'--dev[Use default database urls and names]' \ '-d[]' \ '--dont-drop[]' \ '-v[Verbose mode]' \ @@ -381,8 +378,8 @@ _arguments "${_arguments_options[@]}" : \ '--server-db-url=[Server database url without database name]:SERVER_DB_URL: ' \ '--server-db-name=[Server database name]:SERVER_DB_NAME: ' \ '--chain=[Chain to use]:CHAIN: ' \ -'-u[Use default database urls and names]' \ -'--use-default[Use default database urls and names]' \ +'-d[Use default database urls and names]' \ +'--dev[Use default database urls and names]' \ '-d[]' \ '--dont-drop[]' \ '-v[Verbose mode]' \ diff --git a/zkstack_cli/crates/zkstack/completion/zkstack.fish b/zkstack_cli/crates/zkstack/completion/zkstack.fish index d490085e615..f90bcf2c4ac 100644 --- a/zkstack_cli/crates/zkstack/completion/zkstack.fish +++ b/zkstack_cli/crates/zkstack/completion/zkstack.fish @@ -107,10 +107,9 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_se complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s o -l observability -d 'Enable Grafana' -r -f -a "{true\t'',false\t''}" complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l resume -complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s u -l use-default -d 'Use default database urls and names' complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s d -l dont-drop complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l ecosystem-only -d 'Initialize ecosystem only and skip chain initialization (chain can be initialized later with `chain init` subcommand)' -complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l dev -d 'Deploy ecosystem using all defaults. Suitable for local development' +complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l dev -d 'Use defaults for all options and flags. Suitable for local development' complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l no-port-reallocation -d 'Do not reallocate ports' complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' @@ -185,9 +184,9 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_s complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l l1-rpc-url -d 'L1 RPC URL' -r complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l resume -complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s u -l use-default -d 'Use default database urls and names' complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s d -l dont-drop complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l no-port-reallocation -d 'Do not reallocate ports' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l dev -d 'Use defaults for all options and flags. Suitable for local development' complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s v -l verbose -d 'Verbose mode' complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l ignore-prerequisites -d 'Ignores prerequisites checks' complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help (see more with \'--help\')' @@ -196,7 +195,7 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_s complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l server-db-url -d 'Server database url without database name' -r complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l server-db-name -d 'Server database name' -r complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l chain -d 'Chain to use' -r -complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s u -l use-default -d 'Use default database urls and names' +complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s d -l dev -d 'Use default database urls and names' complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s d -l dont-drop complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -s v -l verbose -d 'Verbose mode' complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from genesis" -l ignore-prerequisites -d 'Ignores prerequisites checks' diff --git a/zkstack_cli/crates/zkstack/completion/zkstack.sh b/zkstack_cli/crates/zkstack/completion/zkstack.sh index 27639acd50b..d21480bba2c 100644 --- a/zkstack_cli/crates/zkstack/completion/zkstack.sh +++ b/zkstack_cli/crates/zkstack/completion/zkstack.sh @@ -1441,7 +1441,7 @@ _zkstack() { return 0 ;; zkstack__chain__genesis) - opts="-u -d -v -h --server-db-url --server-db-name --use-default --dont-drop --verbose --chain --ignore-prerequisites --help init-database server help" + opts="-d -d -v -h --server-db-url --server-db-name --dev --dont-drop --verbose --chain --ignore-prerequisites --help init-database server help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1523,7 +1523,7 @@ _zkstack() { return 0 ;; zkstack__chain__genesis__init__database) - opts="-u -d -v -h --server-db-url --server-db-name --use-default --dont-drop --verbose --chain --ignore-prerequisites --help" + opts="-d -d -v -h --server-db-url --server-db-name --dev --dont-drop --verbose --chain --ignore-prerequisites --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1819,7 +1819,7 @@ _zkstack() { return 0 ;; zkstack__chain__init) - opts="-a -u -d -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --server-db-url --server-db-name --use-default --dont-drop --deploy-paymaster --l1-rpc-url --no-port-reallocation --verbose --chain --ignore-prerequisites --help configs help" + opts="-a -d -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --server-db-url --server-db-name --dont-drop --deploy-paymaster --l1-rpc-url --no-port-reallocation --dev --verbose --chain --ignore-prerequisites --help configs help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1877,7 +1877,7 @@ _zkstack() { return 0 ;; zkstack__chain__init__configs) - opts="-u -d -v -h --server-db-url --server-db-name --use-default --dont-drop --l1-rpc-url --no-port-reallocation --verbose --chain --ignore-prerequisites --help" + opts="-d -d -v -h --server-db-url --server-db-name --dev --dont-drop --l1-rpc-url --no-port-reallocation --verbose --chain --ignore-prerequisites --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4829,7 +4829,7 @@ _zkstack() { return 0 ;; zkstack__ecosystem__init) - opts="-a -u -d -o -v -h --deploy-erc20 --deploy-ecosystem --ecosystem-contracts-path --l1-rpc-url --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --deploy-paymaster --server-db-url --server-db-name --use-default --dont-drop --ecosystem-only --dev --observability --no-port-reallocation --verbose --chain --ignore-prerequisites --help" + opts="-a -d -o -v -h --deploy-erc20 --deploy-ecosystem --ecosystem-contracts-path --l1-rpc-url --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --deploy-paymaster --server-db-url --server-db-name --dont-drop --ecosystem-only --dev --observability --no-port-reallocation --verbose --chain --ignore-prerequisites --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/zkstack_cli/crates/zkstack/src/commands/chain/args/genesis.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/genesis.rs index aaf995985a3..f990cbfd77d 100644 --- a/zkstack_cli/crates/zkstack/src/commands/chain/args/genesis.rs +++ b/zkstack_cli/crates/zkstack/src/commands/chain/args/genesis.rs @@ -21,7 +21,7 @@ pub struct GenesisArgs { #[clap(long, help = MSG_SERVER_DB_NAME_HELP)] pub server_db_name: Option, #[clap(long, short, help = MSG_USE_DEFAULT_DATABASES_HELP)] - pub use_default: bool, + pub dev: bool, #[clap(long, short, action)] pub dont_drop: bool, } @@ -30,7 +30,7 @@ impl GenesisArgs { pub fn fill_values_with_prompt(self, config: &ChainConfig) -> GenesisArgsFinal { let DBNames { server_name, .. } = generate_db_names(config); let chain_name = config.name.clone(); - if self.use_default { + if self.dev { GenesisArgsFinal { server_db: DatabaseConfig::new(DATABASE_SERVER_URL.clone(), server_name), dont_drop: self.dont_drop, diff --git a/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs index d92de9a0641..a5c7a6890ca 100644 --- a/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs +++ b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs @@ -9,8 +9,9 @@ use crate::{ commands::chain::args::genesis::{GenesisArgs, GenesisArgsFinal}, defaults::LOCAL_RPC_URL, messages::{ - MSG_DEPLOY_PAYMASTER_PROMPT, MSG_GENESIS_ARGS_HELP, MSG_L1_RPC_URL_HELP, + MSG_DEPLOY_PAYMASTER_PROMPT, MSG_DEV_ARG_HELP, MSG_L1_RPC_URL_HELP, MSG_L1_RPC_URL_INVALID_ERR, MSG_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP, + MSG_SERVER_DB_NAME_HELP, MSG_SERVER_DB_URL_HELP, }, }; @@ -22,45 +23,70 @@ pub struct InitArgs { #[clap(flatten)] #[serde(flatten)] pub forge_args: ForgeScriptArgs, - #[clap(flatten, next_help_heading = MSG_GENESIS_ARGS_HELP)] - #[serde(flatten)] - pub genesis_args: GenesisArgs, + #[clap(long, help = MSG_SERVER_DB_URL_HELP)] + pub server_db_url: Option, + #[clap(long, help = MSG_SERVER_DB_NAME_HELP)] + pub server_db_name: Option, + #[clap(long, short, action)] + pub dont_drop: bool, #[clap(long, default_missing_value = "true", num_args = 0..=1)] pub deploy_paymaster: Option, #[clap(long, help = MSG_L1_RPC_URL_HELP)] pub l1_rpc_url: Option, #[clap(long, help = MSG_NO_PORT_REALLOCATION_HELP)] pub no_port_reallocation: bool, + #[clap(long, help = MSG_DEV_ARG_HELP)] + pub dev: bool, } impl InitArgs { + pub fn get_genesis_args(&self) -> GenesisArgs { + GenesisArgs { + server_db_url: self.server_db_url.clone(), + server_db_name: self.server_db_name.clone(), + dev: self.dev, + dont_drop: self.dont_drop, + } + } + pub fn fill_values_with_prompt(self, config: &ChainConfig) -> InitArgsFinal { - let deploy_paymaster = self.deploy_paymaster.unwrap_or_else(|| { - common::PromptConfirm::new(MSG_DEPLOY_PAYMASTER_PROMPT) - .default(true) - .ask() - }); + let genesis = self.get_genesis_args(); + + let deploy_paymaster = if self.dev { + true + } else { + self.deploy_paymaster.unwrap_or_else(|| { + common::PromptConfirm::new(MSG_DEPLOY_PAYMASTER_PROMPT) + .default(true) + .ask() + }) + }; - let l1_rpc_url = self.l1_rpc_url.unwrap_or_else(|| { - let mut prompt = Prompt::new(MSG_L1_RPC_URL_PROMPT); - if config.l1_network == L1Network::Localhost { - prompt = prompt.default(LOCAL_RPC_URL); - } - prompt - .validate_with(|val: &String| -> Result<(), String> { - Url::parse(val) - .map(|_| ()) - .map_err(|_| MSG_L1_RPC_URL_INVALID_ERR.to_string()) - }) - .ask() - }); + let l1_rpc_url = if self.dev { + LOCAL_RPC_URL.to_string() + } else { + self.l1_rpc_url.unwrap_or_else(|| { + let mut prompt = Prompt::new(MSG_L1_RPC_URL_PROMPT); + if config.l1_network == L1Network::Localhost { + prompt = prompt.default(LOCAL_RPC_URL); + } + prompt + .validate_with(|val: &String| -> Result<(), String> { + Url::parse(val) + .map(|_| ()) + .map_err(|_| MSG_L1_RPC_URL_INVALID_ERR.to_string()) + }) + .ask() + }) + }; InitArgsFinal { forge_args: self.forge_args, - genesis_args: self.genesis_args.fill_values_with_prompt(config), + genesis_args: genesis.fill_values_with_prompt(config), deploy_paymaster, l1_rpc_url, no_port_reallocation: self.no_port_reallocation, + dev: self.dev, } } } @@ -72,4 +98,5 @@ pub struct InitArgsFinal { pub deploy_paymaster: bool, pub l1_rpc_url: String, pub no_port_reallocation: bool, + pub dev: bool, } diff --git a/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs index a77a9c28ca9..09115fd49ba 100644 --- a/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs +++ b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs @@ -11,9 +11,9 @@ use crate::{ defaults::LOCAL_RPC_URL, messages::{ MSG_DEPLOY_ECOSYSTEM_PROMPT, MSG_DEPLOY_ERC20_PROMPT, MSG_DEV_ARG_HELP, - MSG_GENESIS_ARGS_HELP, MSG_L1_RPC_URL_HELP, MSG_L1_RPC_URL_INVALID_ERR, - MSG_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP, MSG_OBSERVABILITY_HELP, - MSG_OBSERVABILITY_PROMPT, + MSG_L1_RPC_URL_HELP, MSG_L1_RPC_URL_INVALID_ERR, MSG_L1_RPC_URL_PROMPT, + MSG_NO_PORT_REALLOCATION_HELP, MSG_OBSERVABILITY_HELP, MSG_OBSERVABILITY_PROMPT, + MSG_SERVER_DB_NAME_HELP, MSG_SERVER_DB_URL_HELP, }, }; @@ -86,9 +86,12 @@ pub struct EcosystemInitArgs { /// Deploy Paymaster contract #[clap(long, default_missing_value = "true", num_args = 0..=1)] pub deploy_paymaster: Option, - #[clap(flatten, next_help_heading = MSG_GENESIS_ARGS_HELP)] - #[serde(flatten)] - pub genesis_args: GenesisArgs, + #[clap(long, help = MSG_SERVER_DB_URL_HELP)] + pub server_db_url: Option, + #[clap(long, help = MSG_SERVER_DB_NAME_HELP)] + pub server_db_name: Option, + #[clap(long, short, action)] + pub dont_drop: bool, /// Initialize ecosystem only and skip chain initialization (chain can be initialized later with `chain init` subcommand) #[clap(long, default_value_t = false)] pub ecosystem_only: bool, @@ -101,6 +104,15 @@ pub struct EcosystemInitArgs { } impl EcosystemInitArgs { + pub fn get_genesis_args(&self) -> GenesisArgs { + GenesisArgs { + server_db_url: self.server_db_url.clone(), + server_db_name: self.server_db_name.clone(), + dev: self.dev, + dont_drop: self.dont_drop, + } + } + pub fn fill_values_with_prompt(self, l1_network: L1Network) -> EcosystemInitArgsFinal { let deploy_erc20 = if self.dev { true diff --git a/zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs index 6e006f8d65d..06b9b916111 100644 --- a/zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs +++ b/zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs @@ -341,10 +341,10 @@ async fn init_chains( }; // Set default values for dev mode let mut deploy_paymaster = init_args.deploy_paymaster; - let mut genesis_args = init_args.genesis_args.clone(); + let mut genesis_args = init_args.get_genesis_args().clone(); if final_init_args.dev { deploy_paymaster = Some(true); - genesis_args.use_default = true; + genesis_args.dev = true; } // Can't initialize multiple chains with the same DB if list_of_chains.len() > 1 { @@ -359,10 +359,13 @@ async fn init_chains( let chain_init_args = chain::args::init::InitArgs { forge_args: final_init_args.forge_args.clone(), - genesis_args: genesis_args.clone(), + server_db_url: genesis_args.server_db_url.clone(), + server_db_name: genesis_args.server_db_name.clone(), + dont_drop: genesis_args.dont_drop, deploy_paymaster, l1_rpc_url: Some(final_init_args.ecosystem.l1_rpc_url.clone()), no_port_reallocation: final_init_args.no_port_reallocation, + dev: final_init_args.dev, }; let final_chain_init_args = chain_init_args.fill_values_with_prompt(&chain_config); diff --git a/zkstack_cli/crates/zkstack/src/messages.rs b/zkstack_cli/crates/zkstack/src/messages.rs index e2145c18ffd..b9786dc4d8d 100644 --- a/zkstack_cli/crates/zkstack/src/messages.rs +++ b/zkstack_cli/crates/zkstack/src/messages.rs @@ -15,6 +15,8 @@ pub(super) const MSG_SELECTED_CONFIG: &str = "Selected config"; pub(super) const MSG_CHAIN_NOT_INITIALIZED: &str = "Chain not initialized. Please create a chain first"; pub(super) const MSG_ARGS_VALIDATOR_ERR: &str = "Invalid arguments"; +pub(super) const MSG_DEV_ARG_HELP: &str = + "Use defaults for all options and flags. Suitable for local development"; /// Autocomplete message pub(super) fn msg_generate_autocomplete_file(filename: &str) -> String { @@ -61,8 +63,6 @@ pub(super) fn msg_path_to_zksync_does_not_exist_err(path: &str) -> String { pub(super) const MSG_L1_RPC_URL_HELP: &str = "L1 RPC URL"; pub(super) const MSG_NO_PORT_REALLOCATION_HELP: &str = "Do not reallocate ports"; pub(super) const MSG_GENESIS_ARGS_HELP: &str = "Genesis options"; -pub(super) const MSG_DEV_ARG_HELP: &str = - "Deploy ecosystem using all defaults. Suitable for local development"; pub(super) const MSG_OBSERVABILITY_HELP: &str = "Enable Grafana"; pub(super) const MSG_OBSERVABILITY_PROMPT: &str = "Do you want to setup observability? (Grafana)"; pub(super) const MSG_DEPLOY_ECOSYSTEM_PROMPT: &str = From 724d9a9c7f2127263845b640c843e751fd3c21ae Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 23 Oct 2024 18:01:00 +0200 Subject: [PATCH 18/21] feat(zkstack_cli): Build dependencies at zkstack build time (#3157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Build dependencies (e.g., `yarn install`) at `zkstack` build time. ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- zkstack_cli/crates/zkstack/Cargo.toml | 1 + zkstack_cli/crates/zkstack/build.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/zkstack_cli/crates/zkstack/Cargo.toml b/zkstack_cli/crates/zkstack/Cargo.toml index 93a78c751b1..85ab8081eaa 100644 --- a/zkstack_cli/crates/zkstack/Cargo.toml +++ b/zkstack_cli/crates/zkstack/Cargo.toml @@ -55,4 +55,5 @@ anyhow.workspace = true clap_complete.workspace = true dirs.workspace = true ethers.workspace = true +xshell.workspace = true zksync_protobuf_build.workspace = true diff --git a/zkstack_cli/crates/zkstack/build.rs b/zkstack_cli/crates/zkstack/build.rs index bccf5bae89f..e52e952bf73 100644 --- a/zkstack_cli/crates/zkstack/build.rs +++ b/zkstack_cli/crates/zkstack/build.rs @@ -2,6 +2,7 @@ use std::path::{Path, PathBuf}; use anyhow::{anyhow, Context}; use ethers::contract::Abigen; +use xshell::{cmd, Shell}; const COMPLETION_DIR: &str = "completion"; @@ -14,6 +15,11 @@ fn main() -> anyhow::Result<()> { .write_to_file(outdir.join("consensus_registry_abi.rs")) .context("Failed to write ABI to file")?; + if let Err(e) = build_dependencies() { + println!("cargo:error=It was not possible to install projects dependencies"); + println!("cargo:error={}", e); + } + if let Err(e) = configure_shell_autocompletion() { println!("cargo:warning=It was not possible to install autocomplete scripts. Please generate them manually with `zkstack autocomplete`"); println!("cargo:error={}", e); @@ -130,3 +136,14 @@ impl ShellAutocomplete for clap_complete::Shell { Ok(()) } } + +fn build_dependencies() -> anyhow::Result<()> { + let shell = Shell::new()?; + let code_dir = Path::new("../"); + + let _dir_guard = shell.push_dir(code_dir); + + cmd!(shell, "yarn install") + .run() + .context("Failed to install dependencies") +} From 340a1786e32c8a4130ae4dafa26b8a545d0b3648 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Wed, 23 Oct 2024 18:07:33 +0200 Subject: [PATCH 19/21] docs: Add manual installation instruction for zkstack_cli (#3160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Add manual installation instruction for zkstack_cli. ## Why ❔ Using `curl | bash` could be problematic, we should provide better way. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- zkstack_cli/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zkstack_cli/README.md b/zkstack_cli/README.md index f1c92cc3d2e..e8116508821 100644 --- a/zkstack_cli/README.md +++ b/zkstack_cli/README.md @@ -30,6 +30,16 @@ zkstackup --local This command installs `zkstack` from the current repository. +#### Manual installation + +Run from the repository root: + +```bash +cargo install --path zkstack_cli/crates/zkstack --force --locked +``` + +And make sure that `.cargo/bin` is included into `PATH`. + ### Foundry Integration Foundry is used for deploying smart contracts. Pass flags for Foundry integration with the `-a` option, e.g., From e7b587ac8afee4d27fb9dd9ab0f5c02beafbc42c Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Wed, 23 Oct 2024 18:16:03 +0200 Subject: [PATCH 20/21] ci: Reduce GAR builder disk usage by moving keys around. (#3161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Move keys from prover to circuit-prover as the build sequentially. Remove prover-gar image after it being uploaded. ## Why ❔ To allow running this on a machine with 100G disk. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- ...ild-prover-fri-gpu-gar-and-circuit-prover-gpu-gar.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-prover-fri-gpu-gar-and-circuit-prover-gpu-gar.yml b/.github/workflows/build-prover-fri-gpu-gar-and-circuit-prover-gpu-gar.yml index b92fb8e8111..4639f8c77c4 100644 --- a/.github/workflows/build-prover-fri-gpu-gar-and-circuit-prover-gpu-gar.yml +++ b/.github/workflows/build-prover-fri-gpu-gar-and-circuit-prover-gpu-gar.yml @@ -28,7 +28,6 @@ jobs: - name: Download Setup data run: | gsutil -m rsync -r gs://matterlabs-setup-data-us/${{ inputs.setup_keys_id }} docker/prover-gpu-fri-gar - cp -v docker/prover-gpu-fri-gar/*.bin docker/circuit-prover-gpu-gar/ - name: Login to us-central1 GAR run: | @@ -70,6 +69,14 @@ jobs: --tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \ us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} + - name: Remove prover-gpu-fri-gar image to free space + run: | + docker image rm us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} + + - name: Move Setup data from prover-gpu-fri-gar to circuit-prover-gpu-gar + run: | + mv -v docker/prover-gpu-fri-gar/*.bin docker/circuit-prover-gpu-gar/ + - name: Build and push circuit-prover-gpu-gar uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 with: From d0f61b0552dcacc2e8e33fdbcae6f1e5fbb43820 Mon Sep 17 00:00:00 2001 From: Ivan Schasny <31857042+ischasny@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:43:34 +0100 Subject: [PATCH 21/21] fix: update logging in cbt l1 behaviour (#3149) Stop converting `BigDecimal` to `BigInt` when logging to avoid loosing precision. --- .../base_token_adjuster/src/base_token_l1_behaviour.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/node/base_token_adjuster/src/base_token_l1_behaviour.rs b/core/node/base_token_adjuster/src/base_token_l1_behaviour.rs index 0199b06ebd6..0922101e59d 100644 --- a/core/node/base_token_adjuster/src/base_token_l1_behaviour.rs +++ b/core/node/base_token_adjuster/src/base_token_l1_behaviour.rs @@ -6,7 +6,7 @@ use std::{ }; use anyhow::Context; -use bigdecimal::{num_bigint::ToBigInt, BigDecimal, Zero}; +use bigdecimal::{BigDecimal, Zero}; use zksync_config::BaseTokenAdjusterConfig; use zksync_eth_client::{BoundEthInterface, CallFunctionArgs, Options}; use zksync_node_fee_model::l1_gas_price::TxParamsProvider; @@ -57,7 +57,7 @@ impl BaseTokenL1Behaviour { self.update_last_persisted_l1_ratio(prev_ratio.clone()); tracing::info!( "Fetched current base token ratio from the L1: {}", - prev_ratio.to_bigint().unwrap() + prev_ratio ); prev_ratio }; @@ -71,7 +71,7 @@ impl BaseTokenL1Behaviour { "Skipping L1 update. current_ratio {}, previous_ratio {}, deviation {}", current_ratio, prev_ratio, - deviation.to_bigint().unwrap() + deviation ); return Ok(()); } @@ -98,7 +98,7 @@ impl BaseTokenL1Behaviour { new_ratio.denominator.get(), base_fee_per_gas, priority_fee_per_gas, - deviation.to_bigint().unwrap() + deviation ); METRICS .l1_gas_used