From b9f87c49a968709bfccb330f66c7347ec56c4944 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 16:48:00 +0200 Subject: [PATCH 001/103] refactor: add `zks` as `zki dev` subcommand --- zk_toolbox/Cargo.lock | 3 + zk_toolbox/crates/zk_inception/Cargo.toml | 25 +- .../src/commands/dev/commands/clean/mod.rs | 97 ++++++++ .../commands/dev/commands/config_writer.rs | 35 +++ .../src/commands/dev/commands/contracts.rs | 147 +++++++++++ .../dev/commands/database/args/mod.rs | 67 +++++ .../commands/database/args/new_migration.rs | 48 ++++ .../dev/commands/database/check_sqlx_data.rs | 59 +++++ .../commands/dev/commands/database/drop.rs | 42 ++++ .../commands/dev/commands/database/migrate.rs | 54 ++++ .../src/commands/dev/commands/database/mod.rs | 48 ++++ .../dev/commands/database/new_migration.rs | 43 ++++ .../commands/dev/commands/database/prepare.rs | 58 +++++ .../commands/dev/commands/database/reset.rs | 46 ++++ .../commands/dev/commands/database/setup.rs | 56 +++++ .../src/commands/dev/commands/fmt.rs | 129 ++++++++++ .../src/commands/dev/commands/lint.rs | 135 ++++++++++ .../src/commands/dev/commands/lint_utils.rs | 55 +++++ .../src/commands/dev/commands/mod.rs | 12 + .../dev/commands/prover/args/insert_batch.rs | 40 +++ .../commands/prover/args/insert_version.rs | 49 ++++ .../commands/dev/commands/prover/args/mod.rs | 2 + .../src/commands/dev/commands/prover/info.rs | 95 +++++++ .../dev/commands/prover/insert_batch.rs | 44 ++++ .../dev/commands/prover/insert_version.rs | 44 ++++ .../src/commands/dev/commands/prover/mod.rs | 22 ++ .../commands/send_transactions/args/mod.rs | 69 ++++++ .../dev/commands/send_transactions/mod.rs | 132 ++++++++++ .../src/commands/dev/commands/snapshot.rs | 40 +++ .../src/commands/dev/commands/sql_fmt.rs | 149 +++++++++++ .../commands/dev/commands/test/args/fees.rs | 12 + .../dev/commands/test/args/integration.rs | 16 ++ .../commands/dev/commands/test/args/mod.rs | 6 + .../dev/commands/test/args/recovery.rs | 14 ++ .../commands/dev/commands/test/args/revert.rs | 18 ++ .../commands/dev/commands/test/args/rust.rs | 9 + .../dev/commands/test/args/upgrade.rs | 9 + .../src/commands/dev/commands/test/build.rs | 13 + .../src/commands/dev/commands/test/db.rs | 34 +++ .../src/commands/dev/commands/test/fees.rs | 65 +++++ .../commands/dev/commands/test/integration.rs | 67 +++++ .../dev/commands/test/l1_contracts.rs | 18 ++ .../commands/dev/commands/test/loadtest.rs | 52 ++++ .../src/commands/dev/commands/test/mod.rs | 69 ++++++ .../src/commands/dev/commands/test/prover.rs | 31 +++ .../commands/dev/commands/test/recovery.rs | 68 +++++ .../src/commands/dev/commands/test/revert.rs | 70 ++++++ .../src/commands/dev/commands/test/rust.rs | 86 +++++++ .../src/commands/dev/commands/test/upgrade.rs | 33 +++ .../src/commands/dev/commands/test/utils.rs | 111 +++++++++ .../src/commands/dev/commands/test/wallet.rs | 35 +++ .../zk_inception/src/commands/dev/consts.rs | 1 + .../zk_inception/src/commands/dev/dals.rs | 98 ++++++++ .../zk_inception/src/commands/dev/defaults.rs | 5 + .../zk_inception/src/commands/dev/messages.rs | 232 ++++++++++++++++++ .../zk_inception/src/commands/dev/mod.rs | 62 +++++ .../crates/zk_inception/src/commands/mod.rs | 1 + zk_toolbox/crates/zk_inception/src/main.rs | 5 + 58 files changed, 3074 insertions(+), 11 deletions(-) create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/clean/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/config_writer.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/contracts.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/new_migration.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/check_sqlx_data.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/drop.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/migrate.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/new_migration.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/prepare.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/reset.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/setup.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/fmt.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint_utils.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_batch.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_version.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/info.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_batch.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_version.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/args/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/snapshot.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/sql_fmt.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/fees.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/integration.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/revert.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/rust.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/upgrade.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/build.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/db.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/fees.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/integration.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/l1_contracts.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/loadtest.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/mod.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/prover.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/recovery.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/revert.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/rust.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/upgrade.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/utils.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/wallet.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/consts.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/dals.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/defaults.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/messages.rs create mode 100644 zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 297ef404698f..e2be9a190c26 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -6685,6 +6685,7 @@ name = "zk_inception" version = "0.1.0" dependencies = [ "anyhow", + "chrono", "clap", "clap-markdown", "cliclack", @@ -6692,6 +6693,7 @@ dependencies = [ "config", "ethers", "eyre", + "futures", "human-panic", "lazy_static", "secrecy", @@ -6699,6 +6701,7 @@ dependencies = [ "serde_json", "serde_yaml", "slugify-rs", + "sqruff-lib", "strum", "thiserror", "tokio", diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zk_inception/Cargo.toml index 28b709c557b7..a81451297f5f 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zk_inception/Cargo.toml @@ -12,30 +12,33 @@ keywords.workspace = true [dependencies] anyhow.workspace = true +chrono.workspace = true clap.workspace = true +clap-markdown.workspace = true cliclack.workspace = true +common.workspace = true config.workspace = true +ethers.workspace = true +futures.workspace = true human-panic.workspace = true lazy_static.workspace = true -serde_yaml.workspace = true +secrecy.workspace = true serde.workspace = true serde_json.workspace = true -xshell.workspace = true -ethers.workspace = true -common.workspace = true -tokio.workspace = true -types.workspace = true +serde_yaml.workspace = true +slugify-rs.workspace = true strum.workspace = true +sqruff-lib = { git = "https://github.com/quarylabs/sqruff", version = "0.18.2" } +thiserror.workspace = true +tokio.workspace = true toml.workspace = true +types.workspace = true url.workspace = true -thiserror.workspace = true -zksync_config.workspace = true -slugify-rs.workspace = true +xshell.workspace = true zksync_basic_types.workspace = true -clap-markdown.workspace = true +zksync_config.workspace = true zksync_consensus_roles.workspace = true zksync_consensus_crypto.workspace = true -secrecy.workspace = true [build-dependencies] eyre.workspace = true diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/clean/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/clean/mod.rs new file mode 100644 index 000000000000..4cb419ce7a46 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/clean/mod.rs @@ -0,0 +1,97 @@ +use anyhow::Context; +use clap::Subcommand; +use common::{docker, logger}; +use config::{EcosystemConfig, DOCKER_COMPOSE_FILE}; +use xshell::Shell; + +use crate::commands::dev::messages::{ + MSG_CONTRACTS_CLEANING, MSG_CONTRACTS_CLEANING_FINISHED, MSG_DOCKER_COMPOSE_CLEANED, + MSG_DOCKER_COMPOSE_DOWN, MSG_DOCKER_COMPOSE_REMOVE_VOLUMES, +}; + +#[derive(Subcommand, Debug)] +pub enum CleanCommands { + /// Remove containers and contracts cache + All, + /// Remove containers and docker volumes + Containers, + /// Remove contracts caches + ContractsCache, +} + +pub fn run(shell: &Shell, args: CleanCommands) -> anyhow::Result<()> { + let ecosystem = EcosystemConfig::from_file(shell)?; + match args { + CleanCommands::All => { + containers(shell)?; + contracts(shell, &ecosystem)?; + } + CleanCommands::Containers => containers(shell)?, + CleanCommands::ContractsCache => contracts(shell, &ecosystem)?, + } + Ok(()) +} + +pub fn containers(shell: &Shell) -> anyhow::Result<()> { + logger::info(MSG_DOCKER_COMPOSE_DOWN); + docker::down(shell, DOCKER_COMPOSE_FILE)?; + logger::info(MSG_DOCKER_COMPOSE_REMOVE_VOLUMES); + shell.remove_path("volumes")?; + logger::info(MSG_DOCKER_COMPOSE_CLEANED); + Ok(()) +} + +pub fn contracts(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { + let path_to_foundry = ecosystem_config.path_to_foundry(); + let contracts_path = ecosystem_config.link_to_code.join("contracts"); + logger::info(MSG_CONTRACTS_CLEANING); + shell + .remove_path(path_to_foundry.join("broadcast")) + .context("broadcast")?; + shell + .remove_path(path_to_foundry.join("artifacts")) + .context("artifacts")?; + shell + .remove_path(path_to_foundry.join("cache")) + .context("cache")?; + shell + .remove_path(path_to_foundry.join("cache-forge")) + .context("cache-forge")?; + shell + .remove_path(path_to_foundry.join("out")) + .context("out")?; + shell + .remove_path(path_to_foundry.join("typechain")) + .context("typechain")?; + shell + .remove_path(contracts_path.join("l2-contracts/cache-forge")) + .context("l2-contracts/cache-forge")?; + shell + .remove_path(contracts_path.join("l2-contracts/zkout")) + .context("l2-contracts/zkout")?; + shell + .remove_path(contracts_path.join("system-contracts/cache-forge")) + .context("system-contracts/cache-forge")?; + shell + .remove_path(contracts_path.join("system-contracts/zkout")) + .context("system-contracts/zkout")?; + shell + .remove_path(contracts_path.join("system-contracts/contracts-preprocessed")) + .context("system-contracts/contracts-preprocessed")?; + shell + .remove_path(path_to_foundry.join("script-config")) + .context("remove script-config")?; + shell + .create_dir(path_to_foundry.join("script-config")) + .context("create script-config")?; + shell.write_file(path_to_foundry.join("script-config/.gitkeep"), "")?; + shell + .remove_path(path_to_foundry.join("script-out")) + .context("remove script-out")?; + shell + .create_dir(path_to_foundry.join("script-out")) + .context("create script-out")?; + shell.write_file(path_to_foundry.join("script-out/.gitkeep"), "")?; + logger::info(MSG_CONTRACTS_CLEANING_FINISHED); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/config_writer.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/config_writer.rs new file mode 100644 index 000000000000..70238ed15f32 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/config_writer.rs @@ -0,0 +1,35 @@ +use anyhow::Context; +use clap::Parser; +use common::{logger, Prompt}; +use config::{override_config, EcosystemConfig}; +use xshell::Shell; + +use crate::commands::dev::messages::{ + msg_overriding_config, MSG_CHAIN_NOT_FOUND_ERR, MSG_OVERRIDE_CONFIG_PATH_HELP, + MSG_OVERRIDE_SUCCESS, MSG_OVERRRIDE_CONFIG_PATH_PROMPT, +}; + +#[derive(Debug, Parser)] +pub struct ConfigWriterArgs { + #[clap(long, short, help = MSG_OVERRIDE_CONFIG_PATH_HELP)] + pub path: Option, +} + +impl ConfigWriterArgs { + pub fn get_config_path(self) -> String { + self.path + .unwrap_or_else(|| Prompt::new(MSG_OVERRRIDE_CONFIG_PATH_PROMPT).ask()) + } +} + +pub fn run(shell: &Shell, args: ConfigWriterArgs) -> anyhow::Result<()> { + let path = args.get_config_path().into(); + let ecosystem = EcosystemConfig::from_file(shell)?; + let chain = ecosystem + .load_current_chain() + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + logger::step(msg_overriding_config(chain.name.clone())); + override_config(shell, path, &chain)?; + logger::outro(MSG_OVERRIDE_SUCCESS); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/contracts.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/contracts.rs new file mode 100644 index 000000000000..6f420e66ba03 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/contracts.rs @@ -0,0 +1,147 @@ +use std::path::PathBuf; + +use clap::Parser; +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use crate::commands::dev::messages::{ + MSG_BUILDING_CONTRACTS, MSG_BUILDING_CONTRACTS_SUCCESS, MSG_BUILDING_L1_CONTRACTS_SPINNER, + MSG_BUILDING_L2_CONTRACTS_SPINNER, MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER, + MSG_BUILDING_TEST_CONTRACTS_SPINNER, MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, + MSG_BUILD_SYSTEM_CONTRACTS_HELP, MSG_BUILD_TEST_CONTRACTS_HELP, MSG_CONTRACTS_DEPS_SPINNER, + MSG_NOTHING_TO_BUILD_MSG, +}; + +#[derive(Debug, Parser)] +pub struct ContractsArgs { + #[clap(long, alias = "l1", help = MSG_BUILD_L1_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] + pub l1_contracts: Option, + #[clap(long, alias = "l2", help = MSG_BUILD_L2_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] + pub l2_contracts: Option, + #[clap(long, alias = "sc", help = MSG_BUILD_SYSTEM_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] + pub system_contracts: Option, + #[clap(long, alias = "test", help = MSG_BUILD_TEST_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] + pub test_contracts: Option, +} + +impl ContractsArgs { + fn contracts(&self) -> Vec { + if self.l1_contracts.is_none() + && self.l2_contracts.is_none() + && self.system_contracts.is_none() + && self.test_contracts.is_none() + { + return vec![ + ContractType::L1, + ContractType::L2, + ContractType::SystemContracts, + ContractType::TestContracts, + ]; + } + + let mut contracts = vec![]; + + if self.l1_contracts.unwrap_or(false) { + contracts.push(ContractType::L1); + } + if self.l2_contracts.unwrap_or(false) { + contracts.push(ContractType::L2); + } + if self.system_contracts.unwrap_or(false) { + contracts.push(ContractType::SystemContracts); + } + if self.test_contracts.unwrap_or(false) { + contracts.push(ContractType::TestContracts); + } + + contracts + } +} + +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum ContractType { + L1, + L2, + SystemContracts, + TestContracts, +} + +#[derive(Debug)] +struct ContractBuilder { + dir: PathBuf, + cmd: String, + msg: String, +} + +impl ContractBuilder { + fn new(ecosystem: &EcosystemConfig, contract_type: ContractType) -> Self { + match contract_type { + ContractType::L1 => Self { + dir: ecosystem.path_to_foundry(), + cmd: "forge build".to_string(), + msg: MSG_BUILDING_L1_CONTRACTS_SPINNER.to_string(), + }, + ContractType::L2 => Self { + dir: ecosystem.link_to_code.clone(), + cmd: "yarn l2-contracts build".to_string(), + msg: MSG_BUILDING_L2_CONTRACTS_SPINNER.to_string(), + }, + ContractType::SystemContracts => Self { + dir: ecosystem.link_to_code.join("contracts"), + cmd: "yarn sc build".to_string(), + msg: MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER.to_string(), + }, + ContractType::TestContracts => Self { + dir: ecosystem.link_to_code.join("etc/contracts-test-data"), + cmd: "yarn build".to_string(), + msg: MSG_BUILDING_TEST_CONTRACTS_SPINNER.to_string(), + }, + } + } + + fn build(&self, shell: &Shell) -> anyhow::Result<()> { + let spinner = Spinner::new(&self.msg); + let _dir_guard = shell.push_dir(&self.dir); + + let mut args = self.cmd.split_whitespace().collect::>(); + let command = args.remove(0); // It's safe to unwrap here because we know that the vec is not empty + let mut cmd = cmd!(shell, "{command}"); + + for arg in args { + cmd = cmd.arg(arg); + } + + Cmd::new(cmd).run()?; + + spinner.finish(); + Ok(()) + } +} + +pub fn run(shell: &Shell, args: ContractsArgs) -> anyhow::Result<()> { + let contracts = args.contracts(); + if contracts.is_empty() { + logger::outro(MSG_NOTHING_TO_BUILD_MSG); + return Ok(()); + } + + logger::info(MSG_BUILDING_CONTRACTS); + + let ecosystem = EcosystemConfig::from_file(shell)?; + let link_to_code = ecosystem.link_to_code.clone(); + + let spinner = Spinner::new(MSG_CONTRACTS_DEPS_SPINNER); + let _dir_guard = shell.push_dir(&link_to_code); + Cmd::new(cmd!(shell, "yarn install")).run()?; + spinner.finish(); + + contracts + .iter() + .map(|contract| ContractBuilder::new(&ecosystem, *contract)) + .try_for_each(|builder| builder.build(shell))?; + + logger::outro(MSG_BUILDING_CONTRACTS_SUCCESS); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/mod.rs new file mode 100644 index 000000000000..f05e3ee1c0e0 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/mod.rs @@ -0,0 +1,67 @@ +use clap::Parser; + +use crate::commands::dev::{ + dals::SelectedDals, + messages::{ + MSG_DATABASE_COMMON_CORE_HELP, MSG_DATABASE_COMMON_CORE_URL_HELP, + MSG_DATABASE_COMMON_PROVER_HELP, MSG_DATABASE_COMMON_PROVER_URL_HELP, + }, +}; + +pub mod new_migration; + +#[derive(Debug, Parser)] +pub struct DatabaseCommonArgs { + #[clap( + short, long, default_missing_value = "true", num_args = 0..=1, help = MSG_DATABASE_COMMON_PROVER_HELP + )] + pub prover: Option, + #[clap(long, help = MSG_DATABASE_COMMON_PROVER_URL_HELP)] + pub prover_url: Option, + #[clap( + short, long, default_missing_value = "true", num_args = 0..=1, help = MSG_DATABASE_COMMON_CORE_HELP + )] + pub core: Option, + #[clap(long, help = MSG_DATABASE_COMMON_CORE_URL_HELP)] + pub core_url: Option, +} + +impl DatabaseCommonArgs { + pub fn parse(self) -> DatabaseCommonArgsFinal { + if self.prover.is_none() && self.core.is_none() { + return DatabaseCommonArgsFinal { + selected_dals: SelectedDals { + prover: true, + core: true, + }, + urls: DalUrls { + prover: self.prover_url, + core: self.core_url, + }, + }; + } + + DatabaseCommonArgsFinal { + selected_dals: SelectedDals { + prover: self.prover.unwrap_or(false), + core: self.core.unwrap_or(false), + }, + urls: DalUrls { + prover: self.prover_url, + core: self.core_url, + }, + } + } +} + +#[derive(Debug, Clone)] +pub struct DalUrls { + pub prover: Option, + pub core: Option, +} + +#[derive(Debug)] +pub struct DatabaseCommonArgsFinal { + pub selected_dals: SelectedDals, + pub urls: DalUrls, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/new_migration.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/new_migration.rs new file mode 100644 index 000000000000..b91b048be784 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/new_migration.rs @@ -0,0 +1,48 @@ +use clap::{Parser, ValueEnum}; +use common::{Prompt, PromptSelect}; +use strum::{Display, EnumIter, IntoEnumIterator}; + +use crate::commands::dev::messages::{ + MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP, MSG_DATABASE_NEW_MIGRATION_DB_PROMPT, + MSG_DATABASE_NEW_MIGRATION_NAME_HELP, MSG_DATABASE_NEW_MIGRATION_NAME_PROMPT, +}; + +#[derive(Debug, Parser)] +pub struct DatabaseNewMigrationArgs { + #[clap(long, help = MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP)] + pub database: Option, + #[clap(long, help = MSG_DATABASE_NEW_MIGRATION_NAME_HELP)] + pub name: Option, +} + +impl DatabaseNewMigrationArgs { + pub fn fill_values_with_prompt(self) -> DatabaseNewMigrationArgsFinal { + let selected_database = self.database.unwrap_or_else(|| { + PromptSelect::new( + MSG_DATABASE_NEW_MIGRATION_DB_PROMPT, + SelectedDatabase::iter(), + ) + .ask() + }); + let name = self + .name + .unwrap_or_else(|| Prompt::new(MSG_DATABASE_NEW_MIGRATION_NAME_PROMPT).ask()); + + DatabaseNewMigrationArgsFinal { + selected_database, + name, + } + } +} + +#[derive(Debug)] +pub struct DatabaseNewMigrationArgsFinal { + pub selected_database: SelectedDatabase, + pub name: String, +} + +#[derive(Debug, Clone, ValueEnum, EnumIter, PartialEq, Eq, Display)] +pub enum SelectedDatabase { + Prover, + Core, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/check_sqlx_data.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/check_sqlx_data.rs new file mode 100644 index 000000000000..990fca78641f --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/check_sqlx_data.rs @@ -0,0 +1,59 @@ +use std::path::Path; + +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::args::DatabaseCommonArgs; +use crate::commands::dev::{ + dals::{get_dals, Dal}, + messages::{ + msg_database_info, msg_database_loading, msg_database_success, + MSG_DATABASE_CHECK_SQLX_DATA_GERUND, MSG_DATABASE_CHECK_SQLX_DATA_PAST, + MSG_NO_DATABASES_SELECTED, + }, +}; + +pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { + let args = args.parse(); + if args.selected_dals.none() { + logger::outro(MSG_NO_DATABASES_SELECTED); + return Ok(()); + } + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + logger::info(msg_database_info(MSG_DATABASE_CHECK_SQLX_DATA_GERUND)); + + let dals = get_dals(shell, &args.selected_dals, &args.urls)?; + for dal in dals { + check_sqlx_data(shell, &ecosystem_config.link_to_code, dal)?; + } + + logger::outro(msg_database_success(MSG_DATABASE_CHECK_SQLX_DATA_PAST)); + + Ok(()) +} + +pub fn check_sqlx_data( + shell: &Shell, + link_to_code: impl AsRef, + dal: Dal, +) -> anyhow::Result<()> { + let dir = link_to_code.as_ref().join(&dal.path); + let _dir_guard = shell.push_dir(dir); + let url = dal.url.as_str(); + + let spinner = Spinner::new(&msg_database_loading( + MSG_DATABASE_CHECK_SQLX_DATA_GERUND, + &dal.path, + )); + Cmd::new(cmd!( + shell, + "cargo sqlx prepare --check --database-url {url} -- --tests" + )) + .run()?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/drop.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/drop.rs new file mode 100644 index 000000000000..a5578d41f77a --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/drop.rs @@ -0,0 +1,42 @@ +use common::{ + db::{drop_db_if_exists, DatabaseConfig}, + logger, + spinner::Spinner, +}; +use xshell::Shell; + +use super::args::DatabaseCommonArgs; +use crate::commands::dev::{ + dals::{get_dals, Dal}, + messages::{ + msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_DROP_GERUND, + MSG_DATABASE_DROP_PAST, MSG_NO_DATABASES_SELECTED, + }, +}; + +pub async fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { + let args = args.parse(); + if args.selected_dals.none() { + logger::outro(MSG_NO_DATABASES_SELECTED); + return Ok(()); + } + + logger::info(msg_database_info(MSG_DATABASE_DROP_GERUND)); + + let dals = get_dals(shell, &args.selected_dals, &args.urls)?; + for dal in dals { + drop_database(dal).await?; + } + + logger::outro(msg_database_success(MSG_DATABASE_DROP_PAST)); + + Ok(()) +} + +pub async fn drop_database(dal: Dal) -> anyhow::Result<()> { + let spinner = Spinner::new(&msg_database_loading(MSG_DATABASE_DROP_GERUND, &dal.path)); + let db = DatabaseConfig::from_url(&dal.url)?; + drop_db_if_exists(&db).await?; + spinner.finish(); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/migrate.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/migrate.rs new file mode 100644 index 000000000000..fd22f769742e --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/migrate.rs @@ -0,0 +1,54 @@ +use std::path::Path; + +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::args::DatabaseCommonArgs; +use crate::commands::dev::{ + dals::{get_dals, Dal}, + messages::{ + msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_MIGRATE_GERUND, + MSG_DATABASE_MIGRATE_PAST, MSG_NO_DATABASES_SELECTED, + }, +}; + +pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { + let args = args.parse(); + if args.selected_dals.none() { + logger::outro(MSG_NO_DATABASES_SELECTED); + return Ok(()); + } + + logger::info(msg_database_info(MSG_DATABASE_MIGRATE_GERUND)); + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + let dals = get_dals(shell, &args.selected_dals, &args.urls)?; + for dal in dals { + migrate_database(shell, &ecosystem_config.link_to_code, dal)?; + } + + logger::outro(msg_database_success(MSG_DATABASE_MIGRATE_PAST)); + + Ok(()) +} + +fn migrate_database(shell: &Shell, link_to_code: impl AsRef, dal: Dal) -> anyhow::Result<()> { + let dir = link_to_code.as_ref().join(&dal.path); + let _dir_guard = shell.push_dir(dir); + let url = dal.url.as_str(); + + let spinner = Spinner::new(&msg_database_loading( + MSG_DATABASE_MIGRATE_GERUND, + &dal.path, + )); + Cmd::new(cmd!( + shell, + "cargo sqlx database create --database-url {url}" + )) + .run()?; + Cmd::new(cmd!(shell, "cargo sqlx migrate run --database-url {url}")).run()?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/mod.rs new file mode 100644 index 000000000000..ed039fc65019 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/mod.rs @@ -0,0 +1,48 @@ +use clap::Subcommand; +use xshell::Shell; + +use self::args::{new_migration::DatabaseNewMigrationArgs, DatabaseCommonArgs}; +use crate::commands::dev::messages::{ + MSG_DATABASE_CHECK_SQLX_DATA_ABOUT, MSG_DATABASE_DROP_ABOUT, MSG_DATABASE_MIGRATE_ABOUT, + MSG_DATABASE_NEW_MIGRATION_ABOUT, MSG_DATABASE_PREPARE_ABOUT, MSG_DATABASE_RESET_ABOUT, + MSG_DATABASE_SETUP_ABOUT, +}; + +pub mod args; +mod check_sqlx_data; +mod drop; +mod migrate; +mod new_migration; +mod prepare; +pub mod reset; +mod setup; + +#[derive(Subcommand, Debug)] +pub enum DatabaseCommands { + #[clap(about = MSG_DATABASE_CHECK_SQLX_DATA_ABOUT)] + CheckSqlxData(DatabaseCommonArgs), + #[clap(about = MSG_DATABASE_DROP_ABOUT)] + Drop(DatabaseCommonArgs), + #[clap(about = MSG_DATABASE_MIGRATE_ABOUT)] + Migrate(DatabaseCommonArgs), + #[clap(about = MSG_DATABASE_NEW_MIGRATION_ABOUT)] + NewMigration(DatabaseNewMigrationArgs), + #[clap(about = MSG_DATABASE_PREPARE_ABOUT)] + Prepare(DatabaseCommonArgs), + #[clap(about = MSG_DATABASE_RESET_ABOUT)] + Reset(DatabaseCommonArgs), + #[clap(about = MSG_DATABASE_SETUP_ABOUT)] + Setup(DatabaseCommonArgs), +} + +pub async fn run(shell: &Shell, args: DatabaseCommands) -> anyhow::Result<()> { + match args { + DatabaseCommands::CheckSqlxData(args) => check_sqlx_data::run(shell, args), + DatabaseCommands::Drop(args) => drop::run(shell, args).await, + DatabaseCommands::Migrate(args) => migrate::run(shell, args), + DatabaseCommands::NewMigration(args) => new_migration::run(shell, args), + DatabaseCommands::Prepare(args) => prepare::run(shell, args), + DatabaseCommands::Reset(args) => reset::run(shell, args).await, + DatabaseCommands::Setup(args) => setup::run(shell, args), + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/new_migration.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/new_migration.rs new file mode 100644 index 000000000000..2d9fa1030538 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/new_migration.rs @@ -0,0 +1,43 @@ +use std::path::Path; + +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::args::new_migration::{DatabaseNewMigrationArgs, SelectedDatabase}; +use crate::commands::dev::{ + dals::{get_core_dal, get_prover_dal, Dal}, + messages::{msg_database_new_migration_loading, MSG_DATABASE_NEW_MIGRATION_SUCCESS}, +}; + +pub fn run(shell: &Shell, args: DatabaseNewMigrationArgs) -> anyhow::Result<()> { + let args = args.fill_values_with_prompt(); + + let dal = match args.selected_database { + SelectedDatabase::Core => get_core_dal(shell, None)?, + SelectedDatabase::Prover => get_prover_dal(shell, None)?, + }; + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + generate_migration(shell, ecosystem_config.link_to_code, dal, args.name)?; + + logger::outro(MSG_DATABASE_NEW_MIGRATION_SUCCESS); + + Ok(()) +} + +fn generate_migration( + shell: &Shell, + link_to_code: impl AsRef, + dal: Dal, + name: String, +) -> anyhow::Result<()> { + let dir = link_to_code.as_ref().join(&dal.path); + let _dir_guard = shell.push_dir(dir); + + let spinner = Spinner::new(&msg_database_new_migration_loading(&dal.path)); + Cmd::new(cmd!(shell, "cargo sqlx migrate add -r {name}")).run()?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/prepare.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/prepare.rs new file mode 100644 index 000000000000..288a68452fd5 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/prepare.rs @@ -0,0 +1,58 @@ +use std::path::Path; + +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::args::DatabaseCommonArgs; +use crate::commands::dev::{ + dals::{get_dals, Dal}, + messages::{ + msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_PREPARE_GERUND, + MSG_DATABASE_PREPARE_PAST, MSG_NO_DATABASES_SELECTED, + }, +}; + +pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { + let args = args.parse(); + if args.selected_dals.none() { + logger::outro(MSG_NO_DATABASES_SELECTED); + return Ok(()); + } + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + logger::info(msg_database_info(MSG_DATABASE_PREPARE_GERUND)); + + let dals = get_dals(shell, &args.selected_dals, &args.urls)?; + for dal in dals { + prepare_sqlx_data(shell, &ecosystem_config.link_to_code, dal)?; + } + + logger::outro(msg_database_success(MSG_DATABASE_PREPARE_PAST)); + + Ok(()) +} + +pub fn prepare_sqlx_data( + shell: &Shell, + link_to_code: impl AsRef, + dal: Dal, +) -> anyhow::Result<()> { + let dir = link_to_code.as_ref().join(&dal.path); + let _dir_guard = shell.push_dir(dir); + let url = dal.url.as_str(); + + let spinner = Spinner::new(&msg_database_loading( + MSG_DATABASE_PREPARE_GERUND, + &dal.path, + )); + Cmd::new(cmd!( + shell, + "cargo sqlx prepare --database-url {url} -- --tests" + )) + .run()?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/reset.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/reset.rs new file mode 100644 index 000000000000..55d5ab1cbfcb --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/reset.rs @@ -0,0 +1,46 @@ +use std::path::Path; + +use common::logger; +use config::EcosystemConfig; +use xshell::Shell; + +use super::{args::DatabaseCommonArgs, drop::drop_database, setup::setup_database}; +use crate::commands::dev::{ + dals::{get_dals, Dal}, + messages::{ + msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_RESET_GERUND, + MSG_DATABASE_RESET_PAST, MSG_NO_DATABASES_SELECTED, + }, +}; + +pub async fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { + let args = args.parse(); + if args.selected_dals.none() { + logger::outro(MSG_NO_DATABASES_SELECTED); + return Ok(()); + } + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + logger::info(msg_database_info(MSG_DATABASE_RESET_GERUND)); + + let dals = get_dals(shell, &args.selected_dals, &args.urls)?; + for dal in dals { + logger::info(msg_database_loading(MSG_DATABASE_RESET_GERUND, &dal.path)); + reset_database(shell, ecosystem_config.link_to_code.clone(), dal).await?; + } + + logger::outro(msg_database_success(MSG_DATABASE_RESET_PAST)); + + Ok(()) +} + +pub async fn reset_database( + shell: &Shell, + link_to_code: impl AsRef, + dal: Dal, +) -> anyhow::Result<()> { + drop_database(dal.clone()).await?; + setup_database(shell, link_to_code, dal)?; + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/setup.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/setup.rs new file mode 100644 index 000000000000..74ade66ba481 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/setup.rs @@ -0,0 +1,56 @@ +use std::path::Path; + +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::args::DatabaseCommonArgs; +use crate::commands::dev::{ + dals::{get_dals, Dal}, + messages::{ + msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_SETUP_GERUND, + MSG_DATABASE_SETUP_PAST, MSG_NO_DATABASES_SELECTED, + }, +}; + +pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { + let args = args.parse(); + if args.selected_dals.none() { + logger::outro(MSG_NO_DATABASES_SELECTED); + return Ok(()); + } + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + logger::info(msg_database_info(MSG_DATABASE_SETUP_GERUND)); + + let dals = get_dals(shell, &args.selected_dals, &args.urls)?; + for dal in dals { + setup_database(shell, &ecosystem_config.link_to_code, dal)?; + } + + logger::outro(msg_database_success(MSG_DATABASE_SETUP_PAST)); + + Ok(()) +} + +pub fn setup_database( + shell: &Shell, + link_to_code: impl AsRef, + dal: Dal, +) -> anyhow::Result<()> { + let dir = link_to_code.as_ref().join(&dal.path); + let _dir_guard = shell.push_dir(dir); + let url = dal.url.as_str(); + + let spinner = Spinner::new(&msg_database_loading(MSG_DATABASE_SETUP_GERUND, &dal.path)); + Cmd::new(cmd!( + shell, + "cargo sqlx database create --database-url {url}" + )) + .run()?; + Cmd::new(cmd!(shell, "cargo sqlx migrate run --database-url {url}")).run()?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/fmt.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/fmt.rs new file mode 100644 index 000000000000..1a64327fcda3 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/fmt.rs @@ -0,0 +1,129 @@ +use std::path::PathBuf; + +use clap::Parser; +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::sql_fmt::format_sql; +use crate::commands::dev::{ + commands::lint_utils::{get_unignored_files, Target}, + messages::{ + msg_running_fmt_for_extension_spinner, msg_running_fmt_for_extensions_spinner, + msg_running_rustfmt_for_dir_spinner, MSG_RUNNING_CONTRACTS_FMT_SPINNER, + }, +}; + +async fn prettier(shell: Shell, target: Target, check: bool) -> anyhow::Result<()> { + let spinner = Spinner::new(&msg_running_fmt_for_extension_spinner(target)); + let files = get_unignored_files(&shell, &target, None)?; + + if files.is_empty() { + logger::info(format!("No files for {target} found")); + return Ok(()); + } + + spinner.freeze(); + let mode = if check { "--check" } else { "--write" }; + let config = format!("etc/prettier-config/{target}.js"); + Ok( + Cmd::new(cmd!(shell, "yarn --silent prettier {mode} --config {config}").args(files)) + .run()?, + ) +} + +async fn prettier_contracts(shell: Shell, check: bool) -> anyhow::Result<()> { + let spinner = Spinner::new(MSG_RUNNING_CONTRACTS_FMT_SPINNER); + spinner.freeze(); + let prettier_command = cmd!(shell, "yarn --silent --cwd contracts") + .arg(format!("prettier:{}", if check { "check" } else { "fix" })); + + Ok(Cmd::new(prettier_command).run()?) +} + +async fn rustfmt(shell: Shell, check: bool, link_to_code: PathBuf) -> anyhow::Result<()> { + for dir in [".", "prover", "zk_toolbox"] { + let spinner = Spinner::new(&msg_running_rustfmt_for_dir_spinner(dir)); + let _dir = shell.push_dir(link_to_code.join(dir)); + let mut cmd = cmd!(shell, "cargo fmt -- --config imports_granularity=Crate --config group_imports=StdExternalCrate"); + if check { + cmd = cmd.arg("--check"); + } + spinner.freeze(); + Cmd::new(cmd).run()?; + } + Ok(()) +} + +async fn run_all_rust_formatters( + shell: Shell, + check: bool, + link_to_code: PathBuf, +) -> anyhow::Result<()> { + format_sql(shell.clone(), check).await?; + rustfmt(shell.clone(), check, link_to_code).await?; + Ok(()) +} + +#[derive(Debug, Parser)] +pub enum Formatter { + Rustfmt, + Contract, + Prettier { + #[arg(short, long)] + targets: Vec, + }, +} + +#[derive(Debug, Parser)] +pub struct FmtArgs { + #[clap(long, short = 'c')] + pub check: bool, + #[clap(subcommand)] + pub formatter: Option, +} + +pub async fn run(shell: Shell, args: FmtArgs) -> anyhow::Result<()> { + let ecosystem = EcosystemConfig::from_file(&shell)?; + match args.formatter { + None => { + let mut tasks = vec![]; + let extensions: Vec<_> = vec![Target::Js, Target::Ts, Target::Md, Target::Sol]; + let spinner = Spinner::new(&msg_running_fmt_for_extensions_spinner(&extensions)); + spinner.freeze(); + for ext in extensions { + tasks.push(tokio::spawn(prettier(shell.clone(), ext, args.check))); + } + tasks.push(tokio::spawn(run_all_rust_formatters( + shell.clone(), + args.check, + ecosystem.link_to_code, + ))); + tasks.push(tokio::spawn(prettier_contracts(shell.clone(), args.check))); + + futures::future::join_all(tasks) + .await + .iter() + .for_each(|res| { + if let Err(err) = res { + logger::error(err) + } + }); + } + Some(Formatter::Prettier { mut targets }) => { + if targets.is_empty() { + targets = vec![Target::Js, Target::Ts, Target::Md, Target::Sol]; + } + let spinner = Spinner::new(&msg_running_fmt_for_extensions_spinner(&targets)); + for target in targets { + prettier(shell.clone(), target, args.check).await? + } + spinner.finish() + } + Some(Formatter::Rustfmt) => { + run_all_rust_formatters(shell.clone(), args.check, ".".into()).await? + } + Some(Formatter::Contract) => prettier_contracts(shell.clone(), args.check).await?, + } + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint.rs new file mode 100644 index 000000000000..f2e97c3ddfab --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint.rs @@ -0,0 +1,135 @@ +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, + }, +}; + +const CONFIG_PATH: &str = "etc/lint-config"; + +#[derive(Debug, Parser)] +pub struct LintArgs { + #[clap(long, short = 'c')] + pub check: bool, + #[clap(long, short = 't')] + pub targets: Vec, +} + +pub fn run(shell: &Shell, args: LintArgs) -> anyhow::Result<()> { + let targets = if args.targets.is_empty() { + vec![ + Target::Rs, + Target::Md, + Target::Sol, + Target::Js, + Target::Ts, + Target::Contracts, + ] + } else { + args.targets.clone() + }; + + logger::info(msg_running_linters_for_files(&targets)); + + let ecosystem = EcosystemConfig::from_file(shell)?; + + for target in targets { + match target { + Target::Rs => lint_rs(shell, &ecosystem, args.check)?, + Target::Contracts => lint_contracts(shell, &ecosystem, args.check)?, + ext => lint(shell, &ecosystem, &ext, args.check)?, + } + } + + Ok(()) +} + +fn lint_rs(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> anyhow::Result<()> { + let spinner = Spinner::new(&msg_running_linter_for_extension_spinner(&Target::Rs)); + + let link_to_code = &ecosystem.link_to_code; + let lint_to_prover = &ecosystem.link_to_code.join("prover"); + let link_to_toolbox = &ecosystem.link_to_code.join("zk_toolbox"); + let paths = vec![link_to_code, lint_to_prover, link_to_toolbox]; + + spinner.freeze(); + for path in paths { + let _dir_guard = shell.push_dir(path); + let mut cmd = cmd!(shell, "cargo clippy"); + let common_args = &["--locked", "--", "-D", "warnings"]; + if !check { + cmd = cmd.args(&["--fix", "--allow-dirty"]); + } + cmd = cmd.args(common_args); + Cmd::new(cmd).with_force_run().run()?; + } + + Ok(()) +} + +fn get_linter(target: &Target) -> Vec { + match target { + Target::Rs => vec!["cargo".to_string(), "clippy".to_string()], + Target::Md => vec!["markdownlint".to_string()], + Target::Sol => vec!["solhint".to_string()], + Target::Js => vec!["eslint".to_string()], + Target::Ts => vec!["eslint".to_string(), "--ext".to_string(), "ts".to_string()], + Target::Contracts => vec![], + } +} + +fn lint( + shell: &Shell, + ecosystem: &EcosystemConfig, + target: &Target, + check: bool, +) -> anyhow::Result<()> { + let spinner = Spinner::new(&msg_running_linter_for_extension_spinner(target)); + let _dir_guard = shell.push_dir(&ecosystem.link_to_code); + let files = get_unignored_files(shell, target, None)?; + let cmd = cmd!(shell, "yarn"); + let config_path = ecosystem.link_to_code.join(CONFIG_PATH); + let config_path = config_path.join(format!("{}.js", target)); + let config_path = config_path + .to_str() + .expect(MSG_LINT_CONFIG_PATH_ERR) + .to_string(); + + let linter = get_linter(target); + + let fix_option = if check { + vec![] + } else { + vec!["--fix".to_string()] + }; + + let args = [ + linter.as_slice(), + &fix_option, + &["--config".to_string(), config_path], + files.as_slice(), + ] + .concat(); + + Cmd::new(cmd.args(&args)).run()?; + spinner.finish(); + Ok(()) +} + +fn lint_contracts(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> anyhow::Result<()> { + let spinner = Spinner::new(MSG_RUNNING_CONTRACTS_LINTER_SPINNER); + let _dir_guard = shell.push_dir(&ecosystem.link_to_code); + let cmd = cmd!(shell, "yarn"); + let linter = if check { "lint:check" } else { "lint:fix" }; + let args = ["--cwd", "contracts", linter]; + Cmd::new(cmd.args(&args)).run()?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint_utils.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint_utils.rs new file mode 100644 index 000000000000..9095e445384b --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint_utils.rs @@ -0,0 +1,55 @@ +use clap::ValueEnum; +use serde::{Deserialize, Serialize}; +use strum::EnumIter; +use xshell::{cmd, Shell}; + +const IGNORE_FILE: &str = "etc/lint-config/ignore.yaml"; + +#[derive(Debug, ValueEnum, EnumIter, strum::Display, PartialEq, Eq, Clone, Copy)] +#[strum(serialize_all = "lowercase")] +pub enum Target { + Md, + Sol, + Js, + Ts, + Rs, + Contracts, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct IgnoredData { + pub files: Vec, + pub dirs: Vec, +} + +impl IgnoredData { + pub fn merge(&mut self, other: &IgnoredData) { + self.files.extend(other.files.clone()); + self.dirs.extend(other.dirs.clone()); + } +} + +pub fn get_unignored_files( + shell: &Shell, + target: &Target, + ignored_data: Option, +) -> anyhow::Result> { + let mut files = Vec::new(); + let mut ignored_files: IgnoredData = serde_yaml::from_str(&shell.read_file(IGNORE_FILE)?)?; + if let Some(ignored_data) = ignored_data { + ignored_files.merge(&ignored_data); + } + let output = cmd!(shell, "git ls-files --recurse-submodules").read()?; + + for line in output.lines() { + let path = line.to_string(); + if !ignored_files.dirs.iter().any(|dir| path.contains(dir)) + && !ignored_files.files.contains(&path) + && path.ends_with(&format!(".{}", target)) + { + files.push(path); + } + } + + Ok(files) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/mod.rs new file mode 100644 index 000000000000..38ec586e7451 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/mod.rs @@ -0,0 +1,12 @@ +pub mod clean; +pub mod config_writer; +pub mod contracts; +pub mod database; +pub mod fmt; +pub mod lint; +pub(crate) mod lint_utils; +pub mod prover; +pub mod send_transactions; +pub mod snapshot; +pub(crate) mod sql_fmt; +pub mod test; diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_batch.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_batch.rs new file mode 100644 index 000000000000..e837bbe9eb86 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_batch.rs @@ -0,0 +1,40 @@ +use clap::Parser; + +#[derive(Debug, Parser)] +pub struct InsertBatchArgs { + #[clap(long)] + pub number: Option, + #[clap(long, default_value = "false")] + pub default: bool, + #[clap(long)] + pub version: Option, +} + +#[derive(Debug)] +pub struct InsertBatchArgsFinal { + pub number: u32, + pub version: String, +} + +impl InsertBatchArgs { + pub(crate) fn fill_values_with_prompts(self, era_version: String) -> InsertBatchArgsFinal { + let number = self.number.unwrap_or_else(|| { + common::Prompt::new("Enter the number of the batch to insert").ask() + }); + + if self.default { + return InsertBatchArgsFinal { + number, + version: era_version, + }; + } + + let version = self.version.unwrap_or_else(|| { + common::Prompt::new("Enter the version of the batch to insert") + .default(&era_version) + .ask() + }); + + InsertBatchArgsFinal { number, version } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_version.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_version.rs new file mode 100644 index 000000000000..97e60fb38f8c --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_version.rs @@ -0,0 +1,49 @@ +use clap::Parser; + +#[derive(Debug, Parser)] +pub struct InsertVersionArgs { + #[clap(long, default_value = "false")] + pub default: bool, + #[clap(long)] + pub version: Option, + #[clap(long)] + pub snark_wrapper: Option, +} + +#[derive(Debug)] +pub struct InsertVersionArgsFinal { + pub snark_wrapper: String, + pub version: String, +} + +impl InsertVersionArgs { + pub(crate) fn fill_values_with_prompts( + self, + era_version: String, + snark_wrapper: String, + ) -> InsertVersionArgsFinal { + if self.default { + return InsertVersionArgsFinal { + snark_wrapper, + version: era_version, + }; + } + + let version = self.version.unwrap_or_else(|| { + common::Prompt::new("Enter the version of the protocol to insert") + .default(&era_version) + .ask() + }); + + let snark_wrapper = self.snark_wrapper.unwrap_or_else(|| { + common::Prompt::new("Enter the snark wrapper of the protocol to insert") + .default(&snark_wrapper) + .ask() + }); + + InsertVersionArgsFinal { + snark_wrapper, + version, + } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/mod.rs new file mode 100644 index 000000000000..0984546136c9 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/mod.rs @@ -0,0 +1,2 @@ +pub mod insert_batch; +pub mod insert_version; diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/info.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/info.rs new file mode 100644 index 000000000000..84873e931b3e --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/info.rs @@ -0,0 +1,95 @@ +use std::{ + fs, + path::{Path, PathBuf}, +}; + +use anyhow::Context as _; +use common::logger; +use config::{ChainConfig, EcosystemConfig}; +use xshell::{cmd, Shell}; + +use crate::commands::dev::messages::MSG_CHAIN_NOT_FOUND_ERR; + +pub async fn run(shell: &Shell) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_current_chain() + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + let link_to_code = ecosystem_config.link_to_code; + let link_to_prover = link_to_code.join("prover"); + + let protocol_version = get_protocol_version(shell, &link_to_prover).await?; + let snark_wrapper = get_snark_wrapper(&link_to_prover).await?; + let prover_url = get_database_url(&chain_config).await?; + + logger::info(format!( + " +=============================== \n +Current prover setup information: \n +Protocol version: {} \n +Snark wrapper: {} \n +Database URL: {}\n +===============================", + protocol_version, snark_wrapper, prover_url + )); + + Ok(()) +} + +pub(crate) async fn get_protocol_version( + shell: &Shell, + link_to_prover: &PathBuf, +) -> anyhow::Result { + shell.change_dir(link_to_prover); + let protocol_version = cmd!(shell, "cargo run --release --bin prover_version").read()?; + + Ok(protocol_version) +} + +pub(crate) async fn get_snark_wrapper(link_to_prover: &Path) -> anyhow::Result { + let path = link_to_prover.join("data/keys/commitments.json"); + let file = fs::File::open(path).expect("Could not find commitments file in zksync-era"); + let json: serde_json::Value = + serde_json::from_reader(file).expect("Could not parse commitments.json"); + + let snark_wrapper = json + .get("snark_wrapper") + .expect("Could not find snark_wrapper in commitments.json"); + + let mut snark_wrapper = snark_wrapper.to_string(); + snark_wrapper.pop(); + snark_wrapper.remove(0); + + Ok(snark_wrapper) +} + +pub(crate) async fn get_database_url(chain: &ChainConfig) -> anyhow::Result { + let prover_url = chain + .get_secrets_config()? + .database + .context("Database secrets not found")? + .prover_url()? + .expose_url() + .to_string(); + Ok(prover_url) +} + +pub fn parse_version(version: &str) -> anyhow::Result<(&str, &str)> { + let splitted: Vec<&str> = version.split(".").collect(); + + assert_eq!(splitted.len(), 3, "Invalid version format"); + assert_eq!(splitted[0], "0", "Invalid major version, expected 0"); + + splitted[1] + .parse::() + .context("Could not parse minor version")?; + splitted[2] + .parse::() + .context("Could not parse patch version")?; + + let minor = splitted[1]; + let patch = splitted[2]; + + Ok((minor, patch)) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_batch.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_batch.rs new file mode 100644 index 000000000000..0e0c0ba33af4 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_batch.rs @@ -0,0 +1,44 @@ +use common::{check_prerequisites, cmd::Cmd, logger, PROVER_CLI_PREREQUISITE}; +use config::{get_link_to_prover, EcosystemConfig}; +use xshell::{cmd, Shell}; + +use crate::commands::dev::{ + commands::prover::{ + args::insert_batch::{InsertBatchArgs, InsertBatchArgsFinal}, + info, + }, + messages::MSG_CHAIN_NOT_FOUND_ERR, +}; + +pub async fn run(shell: &Shell, args: InsertBatchArgs) -> anyhow::Result<()> { + check_prerequisites(shell, &PROVER_CLI_PREREQUISITE, false); + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_current_chain() + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + let version = info::get_protocol_version(shell, &get_link_to_prover(&ecosystem_config)).await?; + let prover_url = info::get_database_url(&chain_config).await?; + + let InsertBatchArgsFinal { number, version } = args.fill_values_with_prompts(version); + + let (minor, patch) = info::parse_version(&version)?; + + logger::info(format!( + "Inserting protocol version {}, batch number {} into the database", + version, number + )); + + let number = number.to_string(); + + let cmd = Cmd::new(cmd!( + shell, + "prover_cli {prover_url} insert-batch --version={minor} --patch={patch} --number={number}" + )); + cmd.run()?; + + logger::info("Done."); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_version.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_version.rs new file mode 100644 index 000000000000..f7bd175f577a --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_version.rs @@ -0,0 +1,44 @@ +use common::{check_prerequisites, cmd::Cmd, logger, PROVER_CLI_PREREQUISITE}; +use config::{get_link_to_prover, EcosystemConfig}; +use xshell::{cmd, Shell}; + +use crate::commands::dev::{ + commands::prover::{ + args::insert_version::{InsertVersionArgs, InsertVersionArgsFinal}, + info, + }, + messages::MSG_CHAIN_NOT_FOUND_ERR, +}; + +pub async fn run(shell: &Shell, args: InsertVersionArgs) -> anyhow::Result<()> { + check_prerequisites(shell, &PROVER_CLI_PREREQUISITE, false); + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_current_chain() + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + let version = info::get_protocol_version(shell, &get_link_to_prover(&ecosystem_config)).await?; + let snark_wrapper = info::get_snark_wrapper(&get_link_to_prover(&ecosystem_config)).await?; + + let prover_url = info::get_database_url(&chain_config).await?; + + let InsertVersionArgsFinal { + version, + snark_wrapper, + } = args.fill_values_with_prompts(version, snark_wrapper); + + let (minor, patch) = info::parse_version(&version)?; + + logger::info(format!( + "Inserting protocol version {}, snark wrapper {} into the database", + version, snark_wrapper + )); + + let cmd = Cmd::new(cmd!(shell, "prover_cli {prover_url} insert-version --version={minor} --patch={patch} --snark-wrapper={snark_wrapper}")); + cmd.run()?; + + logger::info("Done."); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/mod.rs new file mode 100644 index 000000000000..364f8fe93efc --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/mod.rs @@ -0,0 +1,22 @@ +use clap::Subcommand; +use xshell::Shell; + +mod args; +pub mod info; +pub mod insert_batch; +pub mod insert_version; + +#[derive(Subcommand, Debug)] +pub enum ProverCommands { + Info, + InsertBatch(args::insert_batch::InsertBatchArgs), + InsertVersion(args::insert_version::InsertVersionArgs), +} + +pub async fn run(shell: &Shell, args: ProverCommands) -> anyhow::Result<()> { + match args { + ProverCommands::Info => info::run(shell).await, + ProverCommands::InsertBatch(args) => insert_batch::run(shell, args).await, + ProverCommands::InsertVersion(args) => insert_version::run(shell, args).await, + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/args/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/args/mod.rs new file mode 100644 index 000000000000..03d9ec9b7360 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/args/mod.rs @@ -0,0 +1,69 @@ +use std::path::PathBuf; + +use clap::Parser; +use common::Prompt; +use url::Url; + +use crate::commands::dev::{ + defaults::LOCAL_RPC_URL, + messages::{ + MSG_INVALID_L1_RPC_URL_ERR, MSG_PROMPT_L1_RPC_URL, MSG_PROMPT_SECRET_KEY, + MSG_PROMPT_TRANSACTION_FILE, + }, +}; + +const DEFAULT_TRANSACTION_CONFIRMATIONS: usize = 2; + +#[derive(Debug, Parser)] +pub struct SendTransactionsArgs { + #[clap(long)] + pub file: Option, + #[clap(long)] + pub private_key: Option, + #[clap(long)] + pub l1_rpc_url: Option, + #[clap(long)] + pub confirmations: Option, +} + +#[derive(Debug)] +pub struct SendTransactionsArgsFinal { + pub file: PathBuf, + pub private_key: String, + pub l1_rpc_url: String, + pub confirmations: usize, +} + +impl SendTransactionsArgs { + pub fn fill_values_with_prompt(self) -> SendTransactionsArgsFinal { + let file = self + .file + .unwrap_or_else(|| Prompt::new(MSG_PROMPT_TRANSACTION_FILE).ask()); + + let private_key = self + .private_key + .unwrap_or_else(|| Prompt::new(MSG_PROMPT_SECRET_KEY).ask()); + + let l1_rpc_url = self.l1_rpc_url.unwrap_or_else(|| { + Prompt::new(MSG_PROMPT_L1_RPC_URL) + .default(LOCAL_RPC_URL) + .validate_with(|val: &String| -> Result<(), String> { + Url::parse(val) + .map(|_| ()) + .map_err(|_| MSG_INVALID_L1_RPC_URL_ERR.to_string()) + }) + .ask() + }); + + let confirmations = self + .confirmations + .unwrap_or(DEFAULT_TRANSACTION_CONFIRMATIONS); + + SendTransactionsArgsFinal { + file, + private_key, + l1_rpc_url, + confirmations, + } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/mod.rs new file mode 100644 index 000000000000..2f54579ade9e --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/mod.rs @@ -0,0 +1,132 @@ +use std::{ + fs::{File, OpenOptions}, + io::{Read, Write}, + ops::Add, + path::PathBuf, + time::Duration, +}; + +use anyhow::Context; +use args::SendTransactionsArgs; +use chrono::Local; +use common::{ethereum::create_ethers_client, logger}; +use config::EcosystemConfig; +use ethers::{abi::Bytes, providers::Middleware, types::TransactionRequest, utils::hex}; +use serde::Deserialize; +use tokio::time::sleep; +use xshell::Shell; +use zksync_basic_types::{H160, U256}; + +use crate::commands::dev::{ + consts::DEFAULT_UNSIGNED_TRANSACTIONS_DIR, + messages::{ + msg_send_txns_outro, MSG_FAILED_TO_SEND_TXN_ERR, MSG_UNABLE_TO_OPEN_FILE_ERR, + MSG_UNABLE_TO_READ_FILE_ERR, MSG_UNABLE_TO_READ_PARSE_JSON_ERR, + MSG_UNABLE_TO_WRITE_FILE_ERR, + }, +}; + +pub mod args; + +const MAX_ATTEMPTS: u32 = 3; + +#[derive(Deserialize)] +struct Transaction { + from: String, + gas: String, + input: String, +} + +#[derive(Deserialize)] +struct Txn { + #[serde(rename = "contractAddress")] + contract_address: String, + transaction: Transaction, +} + +#[derive(Deserialize)] +struct Txns { + transactions: Vec, +} + +pub async fn run(shell: &Shell, args: SendTransactionsArgs) -> anyhow::Result<()> { + let args = args.fill_values_with_prompt(); + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_id = ecosystem_config.l1_network.chain_id(); + + // Read the JSON file + let mut file = File::open(args.file).context(MSG_UNABLE_TO_OPEN_FILE_ERR)?; + let mut data = String::new(); + file.read_to_string(&mut data) + .context(MSG_UNABLE_TO_READ_FILE_ERR)?; + + // Parse the JSON file + let txns: Txns = serde_json::from_str(&data).context(MSG_UNABLE_TO_READ_PARSE_JSON_ERR)?; + + let timestamp = Local::now().format("%Y%m%d_%H%M%S").to_string(); + let log_file = ecosystem_config + .link_to_code + .join(DEFAULT_UNSIGNED_TRANSACTIONS_DIR) + .join(format!("{}_receipt.log", timestamp)); + + let client = create_ethers_client(args.private_key.parse()?, args.l1_rpc_url, Some(chain_id))?; + let mut nonce = client.get_transaction_count(client.address(), None).await?; + let gas_price = client.get_gas_price().await?; + + for txn in txns.transactions { + let to: H160 = txn.contract_address.parse()?; + let from: H160 = txn.transaction.from.parse()?; + let gas_limit: U256 = txn.transaction.gas.parse()?; + let input_data: Bytes = hex::decode(txn.transaction.input)?; + + let tx = TransactionRequest::new() + .to(to) + .from(from) + .gas(gas_limit) + .gas_price(gas_price) + .nonce(nonce) + .data(input_data) + .chain_id(chain_id); + + nonce = nonce.add(1); + + let mut attempts = 0; + let receipt = loop { + attempts += 1; + match client + .send_transaction(tx.clone(), None) + .await? + .confirmations(args.confirmations) + .interval(Duration::from_millis(30)) + .await + { + Ok(receipt) => break receipt, + Err(e) if attempts < MAX_ATTEMPTS => { + logger::info(format!("Attempt {} failed: {:?}", attempts, e).as_str()); + sleep(Duration::from_secs(1)).await; + continue; + } + Err(e) => return Err(e).context(MSG_FAILED_TO_SEND_TXN_ERR)?, + } + }; + + log_receipt(&log_file, format!("{:?}", receipt).as_str())?; + } + + logger::outro(msg_send_txns_outro(log_file.to_string_lossy().as_ref())); + + Ok(()) +} + +fn log_receipt(path: &PathBuf, receipt: &str) -> anyhow::Result<()> { + let mut file = OpenOptions::new() + .append(true) + .create(true) + .open(path) + .context(MSG_UNABLE_TO_OPEN_FILE_ERR)?; + + writeln!(file, "{}", receipt).context(MSG_UNABLE_TO_WRITE_FILE_ERR)?; + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/snapshot.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/snapshot.rs new file mode 100644 index 000000000000..8e4c7183cb55 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/snapshot.rs @@ -0,0 +1,40 @@ +use anyhow::Context; +use clap::Subcommand; +use common::{cmd::Cmd, logger}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use crate::commands::dev::messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_RUNNING_SNAPSHOT_CREATOR}; + +#[derive(Subcommand, Debug)] +pub enum SnapshotCommands { + Create, +} + +pub(crate) async fn run(shell: &Shell, args: SnapshotCommands) -> anyhow::Result<()> { + match args { + SnapshotCommands::Create => { + create(shell).await?; + } + } + + Ok(()) +} + +async fn create(shell: &Shell) -> anyhow::Result<()> { + let ecosystem = EcosystemConfig::from_file(shell)?; + let chain = ecosystem + .load_current_chain() + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + + let config_path = chain.path_to_general_config(); + let secrets_path = chain.path_to_secrets_config(); + + logger::info(MSG_RUNNING_SNAPSHOT_CREATOR); + + let mut cmd = Cmd::new(cmd!(shell, "cargo run --bin snapshots_creator --release -- --config-path={config_path} --secrets-path={secrets_path}")) + .env("RUST_LOG", "snapshots_creator=debug"); + + cmd = cmd.with_force_run(); + cmd.run().context("Snapshot") +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/sql_fmt.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/sql_fmt.rs new file mode 100644 index 000000000000..c5faf70f07c0 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/sql_fmt.rs @@ -0,0 +1,149 @@ +use std::mem::take; + +use anyhow::{bail, Result}; +use common::spinner::Spinner; +use sqruff_lib::{api::simple::get_simple_config, core::linter::core::Linter}; +use xshell::Shell; + +use super::lint_utils::{get_unignored_files, IgnoredData, Target}; +use crate::commands::dev::messages::{msg_file_is_not_formatted, MSG_RUNNING_SQL_FMT_SPINNER}; + +fn format_query(query: &str) -> anyhow::Result { + let exclude_rules = vec!["LT12".to_string()]; // avoid adding newline before `$` character + let cfg = get_simple_config(Some("postgres".into()), None, Some(exclude_rules), None).unwrap(); + let mut linter = Linter::new(cfg, None, None); + let mut result = linter.lint_string_wrapped(query, None, true); + let formatted_query = take(&mut result.paths[0].files[0]).fix_string(); + // Remove first empty line + let formatted_query = formatted_query + .lines() + .skip(1) + .collect::>() + .join("\n"); + + Ok(formatted_query) +} + +fn extract_query_from_rust_string(query: &str, is_raw: bool) -> String { + let mut query = query.trim().to_string(); + if query.ends_with(',') { + query.pop(); + } + // Removing quotes + if !is_raw { + query = query[1..query.len() - 1].to_string(); + } else { + query = query[3..query.len() - 2].to_string(); + } + + // Remove all escape characters + if !is_raw { + query = query.replace(r#"\""#, "\""); + } + + query +} + +fn embed_text_inside_rust_string(query: &str) -> String { + format!("r#\"\n{}\n\"#", query) +} + +fn add_indent(query: &str, indent: usize) -> String { + query + .lines() + .map(|line| format!("{:indent$}{}", "", line)) + .collect::>() + .join("\n") +} + +fn format_rust_string_query(query: &str, is_raw: bool) -> anyhow::Result { + let base_indent = query.find(|c: char| !c.is_whitespace()).unwrap_or(0); + let raw_query = extract_query_from_rust_string(query, is_raw); + let formatted_query = format_query(&raw_query)?; + let reconstructed_rust_string = embed_text_inside_rust_string(&formatted_query); + Ok(add_indent(&reconstructed_rust_string, base_indent)) +} + +fn fmt_file(shell: &Shell, file_path: &str, check: bool) -> Result<()> { + let content = shell.read_file(file_path)?; + let mut modified_file = String::new(); + + let mut lines_to_query: Option = None; + let mut is_inside_query = false; + let mut is_raw_string = false; + let mut built_query = String::new(); + + for line in content.lines() { + if line.ends_with("sqlx::query!(") { + lines_to_query = Some(1); + is_raw_string = false; + built_query.clear(); + } else if line.ends_with("sqlx::query_as!(") { + lines_to_query = Some(2); + is_raw_string = false; + built_query.clear(); + } + + if let Some(ref mut count) = lines_to_query { + if *count == 0 { + is_inside_query = true; + lines_to_query = None; + if line.contains("r#\"") { + is_raw_string = true; + } + } else { + *count -= 1; + } + } + + if is_inside_query { + let query_not_empty = !built_query.is_empty() || line.trim().len() > 1; + let raw_string_query_ended = line.ends_with("\"#,") || line.ends_with("\"#"); + let regular_string_query_ended = + (line.ends_with("\",") || line.ends_with('"')) && query_not_empty; + built_query.push_str(line); + built_query.push('\n'); + + let line_end_is_not_escape = !line.ends_with("\\\"") && !line.ends_with("\\\","); + if (is_raw_string && raw_string_query_ended) + || (!is_raw_string && regular_string_query_ended && line_end_is_not_escape) + { + is_inside_query = false; + let ended_with_comma = built_query.trim_end().ends_with(','); + modified_file + .push_str(format_rust_string_query(&built_query, is_raw_string)?.trim_end()); + if ended_with_comma { + modified_file.push(','); + } + modified_file.push('\n'); + } + } else { + modified_file.push_str(line); + modified_file.push('\n'); + } + } + + if content != modified_file { + if check { + bail!(msg_file_is_not_formatted(file_path)); + } else { + shell.write_file(file_path, &modified_file)?; + } + } + + Ok(()) +} + +pub async fn format_sql(shell: Shell, check: bool) -> anyhow::Result<()> { + let spinner = Spinner::new(MSG_RUNNING_SQL_FMT_SPINNER); + let ignored_data = Some(IgnoredData { + files: vec![], + dirs: vec!["zk_toolbox".to_string()], + }); + let rust_files = get_unignored_files(&shell, &Target::Rs, ignored_data)?; + for file in rust_files { + fmt_file(&shell, &file, check)?; + } + spinner.finish(); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/fees.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/fees.rs new file mode 100644 index 000000000000..83d505aa5753 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/fees.rs @@ -0,0 +1,12 @@ +use clap::Parser; +use serde::{Deserialize, Serialize}; + +use crate::commands::dev::messages::{MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP}; + +#[derive(Debug, Serialize, Deserialize, Parser)] +pub struct FeesArgs { + #[clap(short, long, help = MSG_NO_DEPS_HELP)] + pub no_deps: bool, + #[clap(short, long, help = MSG_NO_KILL_HELP)] + pub no_kill: bool, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/integration.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/integration.rs new file mode 100644 index 000000000000..6a1a8c5495e6 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/integration.rs @@ -0,0 +1,16 @@ +use clap::Parser; +use serde::{Deserialize, Serialize}; + +use crate::commands::dev::messages::{ + MSG_NO_DEPS_HELP, MSG_TESTS_EXTERNAL_NODE_HELP, MSG_TEST_PATTERN_HELP, +}; + +#[derive(Debug, Serialize, Deserialize, Parser)] +pub struct IntegrationArgs { + #[clap(short, long, help = MSG_TESTS_EXTERNAL_NODE_HELP)] + pub external_node: bool, + #[clap(short, long, help = MSG_NO_DEPS_HELP)] + pub no_deps: bool, + #[clap(short, long, help = MSG_TEST_PATTERN_HELP)] + pub test_pattern: Option, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/mod.rs new file mode 100644 index 000000000000..b951608e7683 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/mod.rs @@ -0,0 +1,6 @@ +pub mod fees; +pub mod integration; +pub mod recovery; +pub mod revert; +pub mod rust; +pub mod upgrade; diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs new file mode 100644 index 000000000000..c49c714aea9a --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs @@ -0,0 +1,14 @@ +use clap::Parser; +use serde::{Deserialize, Serialize}; + +use crate::commands::dev::messages::{MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_TESTS_RECOVERY_SNAPSHOT_HELP}; + +#[derive(Debug, Serialize, Deserialize, Parser)] +pub struct RecoveryArgs { + #[clap(short, long, help = MSG_TESTS_RECOVERY_SNAPSHOT_HELP)] + pub snapshot: bool, + #[clap(short, long, help = MSG_NO_DEPS_HELP)] + pub no_deps: bool, + #[clap(short, long, help = MSG_NO_KILL_HELP)] + pub no_kill: bool, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/revert.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/revert.rs new file mode 100644 index 000000000000..e4fb7fba2a97 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/revert.rs @@ -0,0 +1,18 @@ +use clap::Parser; + +use crate::commands::dev::messages::{ + MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP, + MSG_TESTS_EXTERNAL_NODE_HELP, +}; + +#[derive(Debug, Parser)] +pub struct RevertArgs { + #[clap(long, help = MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP)] + pub enable_consensus: bool, + #[clap(short, long, help = MSG_TESTS_EXTERNAL_NODE_HELP)] + pub external_node: bool, + #[clap(short, long, help = MSG_NO_DEPS_HELP)] + pub no_deps: bool, + #[clap(short, long, help = MSG_NO_KILL_HELP)] + pub no_kill: bool, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/rust.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/rust.rs new file mode 100644 index 000000000000..6ca277f6a2fc --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/rust.rs @@ -0,0 +1,9 @@ +use clap::Parser; + +use crate::commands::dev::messages::MSG_TEST_RUST_OPTIONS_HELP; + +#[derive(Debug, Parser)] +pub struct RustArgs { + #[clap(long, help = MSG_TEST_RUST_OPTIONS_HELP)] + pub options: Option, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/upgrade.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/upgrade.rs new file mode 100644 index 000000000000..7b631b91e9a5 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/upgrade.rs @@ -0,0 +1,9 @@ +use clap::Parser; + +use crate::commands::dev::messages::MSG_NO_DEPS_HELP; + +#[derive(Debug, Parser)] +pub struct UpgradeArgs { + #[clap(short, long, help = MSG_NO_DEPS_HELP)] + pub no_deps: bool, +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/build.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/build.rs new file mode 100644 index 000000000000..f48967f59738 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/build.rs @@ -0,0 +1,13 @@ +use config::EcosystemConfig; +use xshell::Shell; + +use super::utils::{build_contracts, install_and_build_dependencies}; + +pub fn run(shell: &Shell) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + build_contracts(shell, &ecosystem_config)?; + install_and_build_dependencies(shell, &ecosystem_config)?; + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/db.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/db.rs new file mode 100644 index 000000000000..a2a0eb99225f --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/db.rs @@ -0,0 +1,34 @@ +use std::path::Path; + +use common::{cmd::Cmd, db::wait_for_db, logger}; +use xshell::{cmd, Shell}; + +use crate::commands::dev::{commands::database, dals::Dal, messages::MSG_RESETTING_TEST_DATABASES}; + +pub async fn reset_test_databases( + shell: &Shell, + link_to_code: &Path, + dals: Vec, +) -> anyhow::Result<()> { + logger::info(MSG_RESETTING_TEST_DATABASES); + + Cmd::new(cmd!( + shell, + "docker compose -f docker-compose-unit-tests.yml down" + )) + .run()?; + Cmd::new(cmd!( + shell, + "docker compose -f docker-compose-unit-tests.yml up -d" + )) + .run()?; + + for dal in dals { + let mut url = dal.url.clone(); + url.set_path(""); + wait_for_db(&url, 3).await?; + database::reset::reset_database(shell, link_to_code, dal.clone()).await?; + } + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/fees.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/fees.rs new file mode 100644 index 000000000000..e58a70e6b7cb --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/fees.rs @@ -0,0 +1,65 @@ +use std::path::PathBuf; + +use anyhow::Context; +use common::{cmd::Cmd, config::global_config, logger}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::{ + args::fees::FeesArgs, + utils::{build_contracts, install_and_build_dependencies, TS_INTEGRATION_PATH}, +}; +use crate::commands::dev::{ + commands::test::utils::{TestWallets, TEST_WALLETS_PATH}, + messages::{ + MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, + MSG_INTEGRATION_TESTS_RUN_SUCCESS, + }, +}; + +pub async fn run(shell: &Shell, args: FeesArgs) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + shell.change_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); + let chain_config = ecosystem_config + .load_current_chain() + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + if !args.no_deps { + logger::info("Installing dependencies"); + build_contracts(shell, &ecosystem_config)?; + install_and_build_dependencies(shell, &ecosystem_config)?; + } + + logger::info(format!( + "Running fees tests on chain: {}", + ecosystem_config.current_chain() + )); + + let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); + let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) + .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; + + wallets + .init_test_wallet(&ecosystem_config, &chain_config) + .await?; + + let mut command = cmd!(shell, "yarn jest fees.test.ts --testTimeout 240000") + .env("SPAWN_NODE", "1") + .env("RUN_FEE_TEST", "1") + .env("NO_KILL", args.no_kill.to_string()) + .env("CHAIN_NAME", ecosystem_config.current_chain()) + .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); + + if global_config().verbose { + command = command.env( + "ZKSYNC_DEBUG_LOGS", + format!("{:?}", global_config().verbose), + ) + } + + Cmd::new(command).with_force_run().run()?; + + logger::outro(MSG_INTEGRATION_TESTS_RUN_SUCCESS); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/integration.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/integration.rs new file mode 100644 index 000000000000..3bc3093bf936 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/integration.rs @@ -0,0 +1,67 @@ +use std::path::PathBuf; + +use anyhow::Context; +use common::{cmd::Cmd, config::global_config, logger}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::{ + args::integration::IntegrationArgs, + utils::{ + build_contracts, install_and_build_dependencies, TestWallets, TEST_WALLETS_PATH, + TS_INTEGRATION_PATH, + }, +}; +use crate::commands::dev::messages::{ + msg_integration_tests_run, MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, + MSG_INTEGRATION_TESTS_RUN_SUCCESS, +}; + +pub async fn run(shell: &Shell, args: IntegrationArgs) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + let chain_config = ecosystem_config + .load_current_chain() + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + shell.change_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); + + logger::info(msg_integration_tests_run(args.external_node)); + + if !args.no_deps { + build_contracts(shell, &ecosystem_config)?; + install_and_build_dependencies(shell, &ecosystem_config)?; + } + + let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); + let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) + .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; + + wallets + .init_test_wallet(&ecosystem_config, &chain_config) + .await?; + + let test_pattern = args.test_pattern; + let mut command = cmd!( + shell, + "yarn jest --forceExit --testTimeout 120000 -t {test_pattern...}" + ) + .env("CHAIN_NAME", ecosystem_config.current_chain()) + .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); + + if args.external_node { + command = command.env("EXTERNAL_NODE", format!("{:?}", args.external_node)) + } + + if global_config().verbose { + command = command.env( + "ZKSYNC_DEBUG_LOGS", + format!("{:?}", global_config().verbose), + ) + } + + Cmd::new(command).with_force_run().run()?; + + logger::outro(MSG_INTEGRATION_TESTS_RUN_SUCCESS); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/l1_contracts.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/l1_contracts.rs new file mode 100644 index 000000000000..7d163daed671 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/l1_contracts.rs @@ -0,0 +1,18 @@ +use common::{cmd::Cmd, logger}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use crate::commands::dev::messages::MSG_L1_CONTRACTS_TEST_SUCCESS; + +pub fn run(shell: &Shell) -> anyhow::Result<()> { + let ecosystem = EcosystemConfig::from_file(shell)?; + let _dir_guard = shell.push_dir(&ecosystem.link_to_code); + + Cmd::new(cmd!(shell, "yarn l1-contracts test")) + .with_force_run() + .run()?; + + logger::outro(MSG_L1_CONTRACTS_TEST_SUCCESS); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/loadtest.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/loadtest.rs new file mode 100644 index 000000000000..72a8f97ff97d --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/loadtest.rs @@ -0,0 +1,52 @@ +use anyhow::Context; +use common::{cmd::Cmd, config::global_config, logger}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use crate::commands::dev::messages::MSG_CHAIN_NOT_FOUND_ERR; + +pub fn run(shell: &Shell) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + let chain_config = ecosystem_config + .load_current_chain() + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + + let general_api = chain_config + .get_general_config()? + .api_config + .context("API config is not found")?; + + let mut command = cmd!(shell, "cargo run --release --bin loadnext") + .env( + "L2_CHAIN_ID", + chain_config + .get_genesis_config()? + .l2_chain_id + .as_u64() + .to_string(), + ) + .env( + "MAIN_TOKEN", + format!( + "{:?}", + ecosystem_config + .get_erc20_tokens() + .first() + .context("NO Erc20 tokens were deployed")? + .address + ), + ) + .env("L2_RPC_ADDRESS", general_api.web3_json_rpc.http_url) + .env("L2_WS_RPC_ADDRESS", general_api.web3_json_rpc.ws_url); + + if global_config().verbose { + command = command.env("RUST_LOG", "loadnext=info") + } + + Cmd::new(command).with_force_run().run()?; + + logger::outro("Loadtest success"); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/mod.rs new file mode 100644 index 000000000000..3f63475180e2 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/mod.rs @@ -0,0 +1,69 @@ +use args::{ + fees::FeesArgs, integration::IntegrationArgs, recovery::RecoveryArgs, revert::RevertArgs, + rust::RustArgs, upgrade::UpgradeArgs, +}; +use clap::Subcommand; +use xshell::Shell; + +use crate::commands::dev::messages::{ + MSG_BUILD_ABOUT, MSG_INTEGRATION_TESTS_ABOUT, MSG_L1_CONTRACTS_ABOUT, MSG_LOADTEST_ABOUT, + MSG_PROVER_TEST_ABOUT, MSG_RECOVERY_TEST_ABOUT, MSG_REVERT_TEST_ABOUT, MSG_RUST_TEST_ABOUT, + MSG_TEST_WALLETS_INFO, MSG_UPGRADE_TEST_ABOUT, +}; + +mod args; +mod build; +mod db; +mod fees; +mod integration; +mod l1_contracts; +mod loadtest; +mod prover; +mod recovery; +mod revert; +mod rust; +mod upgrade; +mod utils; +mod wallet; + +#[derive(Subcommand, Debug)] +pub enum TestCommands { + #[clap(about = MSG_INTEGRATION_TESTS_ABOUT, alias = "i")] + Integration(IntegrationArgs), + #[clap(about = "Run fees test", alias = "i")] + Fees(FeesArgs), + #[clap(about = MSG_REVERT_TEST_ABOUT, alias = "r")] + Revert(RevertArgs), + #[clap(about = MSG_RECOVERY_TEST_ABOUT, alias = "rec")] + Recovery(RecoveryArgs), + #[clap(about = MSG_UPGRADE_TEST_ABOUT, alias = "u")] + Upgrade(UpgradeArgs), + #[clap(about = MSG_BUILD_ABOUT)] + Build, + #[clap(about = MSG_RUST_TEST_ABOUT, alias = "unit")] + Rust(RustArgs), + #[clap(about = MSG_L1_CONTRACTS_ABOUT, alias = "l1")] + L1Contracts, + #[clap(about = MSG_PROVER_TEST_ABOUT, alias = "p")] + Prover, + #[clap(about = MSG_TEST_WALLETS_INFO)] + Wallet, + #[clap(about = MSG_LOADTEST_ABOUT)] + Loadtest, +} + +pub async fn run(shell: &Shell, args: TestCommands) -> anyhow::Result<()> { + match args { + TestCommands::Integration(args) => integration::run(shell, args).await, + TestCommands::Fees(args) => fees::run(shell, args).await, + TestCommands::Revert(args) => revert::run(shell, args).await, + TestCommands::Recovery(args) => recovery::run(shell, args).await, + TestCommands::Upgrade(args) => upgrade::run(shell, args), + TestCommands::Build => build::run(shell), + TestCommands::Rust(args) => rust::run(shell, args).await, + TestCommands::L1Contracts => l1_contracts::run(shell), + TestCommands::Prover => prover::run(shell).await, + TestCommands::Wallet => wallet::run(shell), + TestCommands::Loadtest => loadtest::run(shell), + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/prover.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/prover.rs new file mode 100644 index 000000000000..200baf57215c --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/prover.rs @@ -0,0 +1,31 @@ +use std::str::FromStr; + +use common::{cmd::Cmd, logger}; +use config::EcosystemConfig; +use url::Url; +use xshell::{cmd, Shell}; + +use crate::commands::dev::{ + commands::test::db::reset_test_databases, + dals::{Dal, PROVER_DAL_PATH}, + defaults::TEST_DATABASE_PROVER_URL, + messages::MSG_PROVER_TEST_SUCCESS, +}; + +pub async fn run(shell: &Shell) -> anyhow::Result<()> { + let ecosystem = EcosystemConfig::from_file(shell)?; + let dals = vec![Dal { + url: Url::from_str(TEST_DATABASE_PROVER_URL)?, + path: PROVER_DAL_PATH.to_string(), + }]; + reset_test_databases(shell, &ecosystem.link_to_code, dals).await?; + + let _dir_guard = shell.push_dir(ecosystem.link_to_code.join("prover")); + Cmd::new(cmd!(shell, "cargo test --release --workspace --locked")) + .with_force_run() + .env("TEST_DATABASE_PROVER_URL", TEST_DATABASE_PROVER_URL) + .run()?; + + logger::outro(MSG_PROVER_TEST_SUCCESS); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/recovery.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/recovery.rs new file mode 100644 index 000000000000..ae889969fd2c --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/recovery.rs @@ -0,0 +1,68 @@ +use std::path::PathBuf; + +use anyhow::Context; +use common::{cmd::Cmd, logger, server::Server, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::{ + args::recovery::RecoveryArgs, + utils::{install_and_build_dependencies, TestWallets, TEST_WALLETS_PATH}, +}; +use crate::commands::dev::messages::{ + MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, MSG_RECOVERY_TEST_RUN_INFO, + MSG_RECOVERY_TEST_RUN_SUCCESS, +}; + +const RECOVERY_TESTS_PATH: &str = "core/tests/recovery-test"; + +pub async fn run(shell: &Shell, args: RecoveryArgs) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + shell.change_dir(ecosystem_config.link_to_code.join(RECOVERY_TESTS_PATH)); + + logger::info(MSG_RECOVERY_TEST_RUN_INFO); + Server::new(None, ecosystem_config.link_to_code.clone(), false).build(shell)?; + + if !args.no_deps { + install_and_build_dependencies(shell, &ecosystem_config)?; + } + + run_test(shell, &args, &ecosystem_config).await?; + logger::outro(MSG_RECOVERY_TEST_RUN_SUCCESS); + + Ok(()) +} + +async fn run_test( + shell: &Shell, + args: &RecoveryArgs, + ecosystem_config: &EcosystemConfig, +) -> anyhow::Result<()> { + Spinner::new("Running test...").freeze(); + let chain_config = ecosystem_config + .load_current_chain() + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + + let cmd = if args.snapshot { + cmd!(shell, "yarn mocha tests/snapshot-recovery.test.ts") + } else { + cmd!(shell, "yarn mocha tests/genesis-recovery.test.ts") + }; + + let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); + let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) + .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; + + wallets + .init_test_wallet(ecosystem_config, &chain_config) + .await?; + + let cmd = Cmd::new(cmd) + .env("CHAIN_NAME", ecosystem_config.current_chain()) + .env("NO_KILL", args.no_kill.to_string()) + .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); + + cmd.with_force_run().run()?; + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/revert.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/revert.rs new file mode 100644 index 000000000000..dc95c88db205 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/revert.rs @@ -0,0 +1,70 @@ +use std::path::PathBuf; + +use anyhow::Context; +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::{ + args::revert::RevertArgs, + utils::{install_and_build_dependencies, TestWallets, TEST_WALLETS_PATH}, +}; +use crate::commands::dev::messages::{ + msg_revert_tests_run, MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, + MSG_REVERT_TEST_RUN_INFO, MSG_REVERT_TEST_RUN_SUCCESS, +}; + +const REVERT_TESTS_PATH: &str = "core/tests/revert-test"; + +pub async fn run(shell: &Shell, args: RevertArgs) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + shell.change_dir(ecosystem_config.link_to_code.join(REVERT_TESTS_PATH)); + + logger::info(MSG_REVERT_TEST_RUN_INFO); + + if !args.no_deps { + install_and_build_dependencies(shell, &ecosystem_config)?; + } + + run_test(shell, &args, &ecosystem_config).await?; + logger::outro(MSG_REVERT_TEST_RUN_SUCCESS); + + Ok(()) +} + +async fn run_test( + shell: &Shell, + args: &RevertArgs, + ecosystem_config: &EcosystemConfig, +) -> anyhow::Result<()> { + Spinner::new(&msg_revert_tests_run(args.external_node)).freeze(); + + let chain_config = ecosystem_config + .load_current_chain() + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + + let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); + let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) + .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; + + wallets + .init_test_wallet(ecosystem_config, &chain_config) + .await?; + + let cmd = if args.external_node { + cmd!(shell, "yarn mocha tests/revert-and-restart-en.test.ts") + } else { + cmd!(shell, "yarn mocha tests/revert-and-restart.test.ts") + }; + + let mut cmd = Cmd::new(cmd) + .env("CHAIN_NAME", ecosystem_config.current_chain()) + .env("NO_KILL", args.no_kill.to_string()) + .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); + if args.enable_consensus { + cmd = cmd.env("ENABLE_CONSENSUS", "true"); + } + cmd.with_force_run().run()?; + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/rust.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/rust.rs new file mode 100644 index 000000000000..68657061f2d8 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/rust.rs @@ -0,0 +1,86 @@ +use std::str::FromStr; + +use anyhow::Context; +use common::{cmd::Cmd, logger}; +use config::EcosystemConfig; +use url::Url; +use xshell::{cmd, Shell}; + +use super::args::rust::RustArgs; +use crate::commands::dev::{ + commands::test::db::reset_test_databases, + dals::{Dal, CORE_DAL_PATH, PROVER_DAL_PATH}, + defaults::{TEST_DATABASE_PROVER_URL, TEST_DATABASE_SERVER_URL}, + messages::{ + MSG_CHAIN_NOT_FOUND_ERR, MSG_POSTGRES_CONFIG_NOT_FOUND_ERR, MSG_UNIT_TESTS_RUN_SUCCESS, + MSG_USING_CARGO_NEXTEST, + }, +}; + +pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { + let ecosystem = EcosystemConfig::from_file(shell)?; + let chain = ecosystem + .clone() + .load_chain(Some(ecosystem.default_chain)) + .context(MSG_CHAIN_NOT_FOUND_ERR)?; + let general_config = chain.get_general_config(); + let link_to_code = ecosystem.link_to_code; + + let (test_server_url, test_prover_url) = if let Ok(general_config) = general_config { + let postgres = general_config + .postgres_config + .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?; + + ( + postgres + .test_server_url + .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, + postgres + .test_prover_url + .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, + ) + } else { + ( + TEST_DATABASE_SERVER_URL.to_string(), + TEST_DATABASE_PROVER_URL.to_string(), + ) + }; + + let dals = vec![ + Dal { + url: Url::from_str(&test_server_url.clone())?, + path: CORE_DAL_PATH.to_string(), + }, + Dal { + url: Url::from_str(&test_prover_url.clone())?, + path: PROVER_DAL_PATH.to_string(), + }, + ]; + + reset_test_databases(shell, &link_to_code, dals).await?; + + let _dir_guard = shell.push_dir(&link_to_code); + + logger::info(MSG_USING_CARGO_NEXTEST); + let cmd = cmd!(shell, "cargo nextest run --release"); + + let cmd = if let Some(options) = args.options { + Cmd::new(cmd.args(options.split_whitespace())).with_force_run() + } else { + Cmd::new(cmd).with_force_run() + }; + + let cmd = cmd + .env("TEST_DATABASE_URL", test_server_url) + .env("TEST_PROVER_DATABASE_URL", test_prover_url); + cmd.run()?; + + // Run unit tests for zk_toolbox + let _dir_guard = shell.push_dir(link_to_code.join("zk_toolbox")); + Cmd::new(cmd!(shell, "cargo nextest run --release")) + .with_force_run() + .run()?; + + logger::outro(MSG_UNIT_TESTS_RUN_SUCCESS); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/upgrade.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/upgrade.rs new file mode 100644 index 000000000000..707e0086ed15 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/upgrade.rs @@ -0,0 +1,33 @@ +use common::{cmd::Cmd, logger, spinner::Spinner}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::{args::upgrade::UpgradeArgs, utils::install_and_build_dependencies}; +use crate::commands::dev::messages::{MSG_UPGRADE_TEST_RUN_INFO, MSG_UPGRADE_TEST_RUN_SUCCESS}; + +const UPGRADE_TESTS_PATH: &str = "core/tests/upgrade-test"; + +pub fn run(shell: &Shell, args: UpgradeArgs) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + shell.change_dir(ecosystem_config.link_to_code.join(UPGRADE_TESTS_PATH)); + + logger::info(MSG_UPGRADE_TEST_RUN_INFO); + + if !args.no_deps { + install_and_build_dependencies(shell, &ecosystem_config)?; + } + + run_test(shell, &ecosystem_config)?; + logger::outro(MSG_UPGRADE_TEST_RUN_SUCCESS); + + Ok(()) +} + +fn run_test(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { + Spinner::new(MSG_UPGRADE_TEST_RUN_INFO).freeze(); + let cmd = Cmd::new(cmd!(shell, "yarn mocha tests/upgrade.test.ts")) + .env("CHAIN_NAME", ecosystem_config.current_chain()); + cmd.with_force_run().run()?; + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/utils.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/utils.rs new file mode 100644 index 000000000000..302ab55d3b6c --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/utils.rs @@ -0,0 +1,111 @@ +use std::collections::HashMap; + +use anyhow::Context; +use common::{cmd::Cmd, spinner::Spinner, wallets::Wallet}; +use config::{ChainConfig, EcosystemConfig}; +use ethers::{ + providers::{Http, Middleware, Provider}, + utils::hex::ToHex, +}; +use serde::Deserialize; +use xshell::{cmd, Shell}; + +use crate::commands::dev::messages::{ + MSG_INTEGRATION_TESTS_BUILDING_CONTRACTS, MSG_INTEGRATION_TESTS_BUILDING_DEPENDENCIES, +}; + +pub const TEST_WALLETS_PATH: &str = "etc/test_config/constant/eth.json"; +const AMOUNT_FOR_DISTRIBUTION_TO_WALLETS: u128 = 1000000000000000000000; + +pub const TS_INTEGRATION_PATH: &str = "core/tests/ts-integration"; +const CONTRACTS_TEST_DATA_PATH: &str = "etc/contracts-test-data"; + +#[derive(Deserialize)] +pub struct TestWallets { + base_path: String, + #[serde(flatten)] + wallets: HashMap, +} + +impl TestWallets { + fn get(&self, id: u32) -> anyhow::Result { + let mnemonic = self.wallets.get("test_mnemonic").unwrap().as_str(); + + Wallet::from_mnemonic(mnemonic, &self.base_path, id) + } + + pub fn get_main_wallet(&self) -> anyhow::Result { + self.get(0) + } + + pub fn get_test_wallet(&self, chain_config: &ChainConfig) -> anyhow::Result { + self.get(chain_config.id) + } + + pub fn get_test_pk(&self, chain_config: &ChainConfig) -> anyhow::Result { + self.get_test_wallet(chain_config)? + .private_key + .ok_or(anyhow::Error::msg("Private key not found")) + .map(|pk| pk.encode_hex::()) + } + + pub async fn init_test_wallet( + &self, + ecosystem_config: &EcosystemConfig, + chain_config: &ChainConfig, + ) -> anyhow::Result<()> { + let wallet = self.get_test_wallet(chain_config)?; + + let l1_rpc = chain_config + .get_secrets_config()? + .l1 + .context("No L1 secrets available")? + .l1_rpc_url + .expose_str() + .to_owned(); + + let provider = Provider::::try_from(l1_rpc.clone())?; + let balance = provider.get_balance(wallet.address, None).await?; + + if balance.is_zero() { + common::ethereum::distribute_eth( + self.get_main_wallet()?, + vec![wallet.address], + l1_rpc, + ecosystem_config.l1_network.chain_id(), + AMOUNT_FOR_DISTRIBUTION_TO_WALLETS, + ) + .await? + } + + Ok(()) + } +} + +pub fn build_contracts(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { + shell.change_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); + let spinner = Spinner::new(MSG_INTEGRATION_TESTS_BUILDING_CONTRACTS); + + Cmd::new(cmd!(shell, "yarn build")).run()?; + Cmd::new(cmd!(shell, "yarn build-yul")).run()?; + + let _dir_guard = shell.push_dir(ecosystem_config.link_to_code.join(CONTRACTS_TEST_DATA_PATH)); + Cmd::new(cmd!(shell, "yarn build")).run()?; + + spinner.finish(); + Ok(()) +} + +pub fn install_and_build_dependencies( + shell: &Shell, + ecosystem_config: &EcosystemConfig, +) -> anyhow::Result<()> { + let _dir_guard = shell.push_dir(&ecosystem_config.link_to_code); + let spinner = Spinner::new(MSG_INTEGRATION_TESTS_BUILDING_DEPENDENCIES); + + Cmd::new(cmd!(shell, "yarn install")).run()?; + Cmd::new(cmd!(shell, "yarn utils build")).run()?; + + spinner.finish(); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/wallet.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/wallet.rs new file mode 100644 index 000000000000..6953014bf92b --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/wallet.rs @@ -0,0 +1,35 @@ +use std::path::PathBuf; + +use anyhow::Context; +use common::logger; +use config::EcosystemConfig; +use xshell::Shell; + +use super::utils::{TestWallets, TEST_WALLETS_PATH}; +use crate::commands::dev::messages::{ + MSG_DESERIALIZE_TEST_WALLETS_ERR, MSG_TEST_WALLETS_INFO, MSG_WALLETS_TEST_SUCCESS, +}; + +pub fn run(shell: &Shell) -> anyhow::Result<()> { + logger::info(MSG_TEST_WALLETS_INFO); + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + let chain_config = ecosystem_config + .load_current_chain() + .context("Chain not found")?; + + let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); + let wallets: TestWallets = serde_json::from_str(shell.read_file(wallets_path)?.as_ref()) + .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; + + logger::info(format!("Main: {:#?}", wallets.get_main_wallet()?)); + logger::info(format!( + "Chain: {:#?}", + wallets.get_test_wallet(&chain_config)? + )); + + logger::outro(MSG_WALLETS_TEST_SUCCESS); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/consts.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/consts.rs new file mode 100644 index 000000000000..66f00c7553b5 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/consts.rs @@ -0,0 +1 @@ +pub const DEFAULT_UNSIGNED_TRANSACTIONS_DIR: &str = "transactions"; diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/dals.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/dals.rs new file mode 100644 index 000000000000..8d0a8f71ca9b --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/dals.rs @@ -0,0 +1,98 @@ +use anyhow::{anyhow, Context}; +use config::{EcosystemConfig, SecretsConfig}; +use url::Url; +use xshell::Shell; + +use super::{ + commands::database::args::DalUrls, + messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_DATABASE_MUST_BE_PRESENTED}, +}; + +pub const CORE_DAL_PATH: &str = "core/lib/dal"; +pub const PROVER_DAL_PATH: &str = "prover/crates/lib/prover_dal"; + +#[derive(Debug, Clone)] +pub struct SelectedDals { + pub prover: bool, + pub core: bool, +} + +impl SelectedDals { + /// Returns true if no databases are selected + pub fn none(&self) -> bool { + !self.prover && !self.core + } +} + +#[derive(Debug, Clone)] +pub struct Dal { + pub path: String, + pub url: Url, +} + +pub fn get_dals( + shell: &Shell, + selected_dals: &SelectedDals, + urls: &DalUrls, +) -> anyhow::Result> { + let mut dals = vec![]; + + if selected_dals.prover { + dals.push(get_prover_dal(shell, urls.prover.clone())?); + } + if selected_dals.core { + dals.push(get_core_dal(shell, urls.core.clone())?); + } + + Ok(dals) +} + +pub fn get_prover_dal(shell: &Shell, url: Option) -> anyhow::Result { + let url = if let Some(url) = url { + Url::parse(&url)? + } else { + let secrets = get_secrets(shell)?; + secrets + .database + .as_ref() + .context(MSG_DATABASE_MUST_BE_PRESENTED)? + .prover_url()? + .expose_url() + .clone() + }; + + Ok(Dal { + path: PROVER_DAL_PATH.to_string(), + url, + }) +} + +pub fn get_core_dal(shell: &Shell, url: Option) -> anyhow::Result { + let url = if let Some(url) = url { + Url::parse(&url)? + } else { + let secrets = get_secrets(shell)?; + secrets + .database + .as_ref() + .context(MSG_DATABASE_MUST_BE_PRESENTED)? + .master_url()? + .expose_url() + .clone() + }; + + Ok(Dal { + path: CORE_DAL_PATH.to_string(), + url, + }) +} + +fn get_secrets(shell: &Shell) -> anyhow::Result { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_current_chain() + .ok_or(anyhow!(MSG_CHAIN_NOT_FOUND_ERR))?; + let secrets = chain_config.get_secrets_config()?; + + Ok(secrets) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/defaults.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/defaults.rs new file mode 100644 index 000000000000..d9325402f533 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/defaults.rs @@ -0,0 +1,5 @@ +pub const TEST_DATABASE_SERVER_URL: &str = + "postgres://postgres:notsecurepassword@localhost:5433/zksync_local_test"; +pub const TEST_DATABASE_PROVER_URL: &str = + "postgres://postgres:notsecurepassword@localhost:5433/prover_local_test"; +pub const LOCAL_RPC_URL: &str = "http://127.0.0.1:8545"; diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/messages.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/messages.rs new file mode 100644 index 000000000000..00617e26064f --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/messages.rs @@ -0,0 +1,232 @@ +use super::commands::lint_utils::Target; + +// Ecosystem related messages +pub(super) const MSG_CHAIN_NOT_FOUND_ERR: &str = "Chain not found"; + +// Subcommands help +pub(super) const MSG_PROVER_VERSION_ABOUT: &str = "Protocol version used by provers"; +pub(super) const MSG_SUBCOMMAND_DATABASE_ABOUT: &str = "Database related commands"; +pub(super) const MSG_SUBCOMMAND_TESTS_ABOUT: &str = "Run tests"; +pub(super) const MSG_SUBCOMMAND_CLEAN: &str = "Clean artifacts"; +pub(super) const MSG_SUBCOMMAND_LINT_ABOUT: &str = "Lint code"; +pub(super) const MSG_CONTRACTS_ABOUT: &str = "Build contracts"; +pub(super) const MSG_CONFIG_WRITER_ABOUT: &str = "Overwrite general config"; + +pub(super) const MSG_SUBCOMMAND_FMT_ABOUT: &str = "Format code"; + +pub(super) const MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT: &str = "Snapshots creator"; + +// Database related messages +pub(super) const MSG_NO_DATABASES_SELECTED: &str = "No databases selected"; + +pub(super) fn msg_database_info(gerund_verb: &str) -> String { + format!("{gerund_verb} databases") +} + +pub(super) fn msg_database_success(past_verb: &str) -> String { + format!("Databases {past_verb} successfully") +} + +pub(super) fn msg_database_loading(gerund_verb: &str, dal: &str) -> String { + format!("{gerund_verb} database for dal {dal}...") +} + +pub(super) const MSG_DATABASE_CHECK_SQLX_DATA_GERUND: &str = "Checking"; +pub(super) const MSG_DATABASE_CHECK_SQLX_DATA_PAST: &str = "checked"; +pub(super) const MSG_DATABASE_DROP_GERUND: &str = "Dropping"; +pub(super) const MSG_DATABASE_DROP_PAST: &str = "dropped"; +pub(super) const MSG_DATABASE_MIGRATE_GERUND: &str = "Migrating"; +pub(super) const MSG_DATABASE_MIGRATE_PAST: &str = "migrated"; +pub(super) const MSG_DATABASE_PREPARE_GERUND: &str = "Preparing"; +pub(super) const MSG_DATABASE_PREPARE_PAST: &str = "prepared"; +pub(super) const MSG_DATABASE_RESET_GERUND: &str = "Resetting"; +pub(super) const MSG_DATABASE_RESET_PAST: &str = "reset"; +pub(super) const MSG_DATABASE_SETUP_GERUND: &str = "Setting up"; +pub(super) const MSG_DATABASE_SETUP_PAST: &str = "set up"; +pub(super) const MSG_DATABASE_MUST_BE_PRESENTED: &str = "Database config must be presented"; +pub(super) const MSG_DATABASE_COMMON_PROVER_HELP: &str = "Prover database"; +pub(super) const MSG_DATABASE_COMMON_PROVER_URL_HELP: &str = + "URL of the Prover database. If not specified, it is used from the current chain's secrets"; +pub(super) const MSG_DATABASE_COMMON_CORE_URL_HELP: &str = + "URL of the Core database. If not specified, it is used from the current chain's secrets."; +pub(super) const MSG_DATABASE_COMMON_CORE_HELP: &str = "Core database"; +pub(super) const MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP: &str = + "Database to create new migration for"; +pub(super) const MSG_DATABASE_NEW_MIGRATION_NAME_HELP: &str = "Migration name"; + +pub(super) const MSG_DATABASE_CHECK_SQLX_DATA_ABOUT: &str = "Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked."; +pub(super) const MSG_DATABASE_DROP_ABOUT: &str = + "Drop databases. If no databases are selected, all databases will be dropped."; +pub(super) const MSG_DATABASE_MIGRATE_ABOUT: &str = + "Migrate databases. If no databases are selected, all databases will be migrated."; +pub(super) const MSG_DATABASE_NEW_MIGRATION_ABOUT: &str = "Create new migration"; +pub(super) const MSG_DATABASE_PREPARE_ABOUT: &str = + "Prepare sqlx-data.json. If no databases are selected, all databases will be prepared."; +pub(super) const MSG_DATABASE_RESET_ABOUT: &str = + "Reset databases. If no databases are selected, all databases will be reset."; +pub(super) const MSG_DATABASE_SETUP_ABOUT: &str = + "Setup databases. If no databases are selected, all databases will be setup."; + +// Database new_migration messages +pub(super) const MSG_DATABASE_NEW_MIGRATION_DB_PROMPT: &str = + "What database do you want to create a new migration for?"; +pub(super) const MSG_DATABASE_NEW_MIGRATION_NAME_PROMPT: &str = + "How do you want to name the migration?"; + +pub(super) fn msg_database_new_migration_loading(dal: &str) -> String { + format!("Creating new database migration for dal {}...", dal) +} + +pub(super) const MSG_DATABASE_NEW_MIGRATION_SUCCESS: &str = "Migration created successfully"; + +// Tests related messages +pub(super) const MSG_INTEGRATION_TESTS_ABOUT: &str = "Run integration tests"; +pub(super) const MSG_REVERT_TEST_ABOUT: &str = "Run revert tests"; +pub(super) const MSG_RECOVERY_TEST_ABOUT: &str = "Run recovery tests"; +pub(super) const MSG_UPGRADE_TEST_ABOUT: &str = "Run upgrade tests"; +pub(super) const MSG_RUST_TEST_ABOUT: &str = "Run unit-tests, accepts optional cargo test flags"; +pub(super) const MSG_TEST_RUST_OPTIONS_HELP: &str = "Cargo test flags"; +pub(super) const MSG_BUILD_ABOUT: &str = "Build all test dependencies"; +pub(super) const MSG_TESTS_EXTERNAL_NODE_HELP: &str = "Run tests for external node"; +pub(super) const MSG_NO_DEPS_HELP: &str = "Do not install or build dependencies"; +pub(super) const MSG_TEST_PATTERN_HELP: &str = + "Run just the tests matching a pattern. Same as the -t flag on jest."; +pub(super) const MSG_NO_KILL_HELP: &str = "The test will not kill all the nodes during execution"; +pub(super) const MSG_TESTS_RECOVERY_SNAPSHOT_HELP: &str = + "Run recovery from a snapshot instead of genesis"; +pub(super) const MSG_UNIT_TESTS_RUN_SUCCESS: &str = "Unit tests ran successfully"; +pub(super) const MSG_USING_CARGO_NEXTEST: &str = "Using cargo-nextest for running tests"; +pub(super) const MSG_L1_CONTRACTS_ABOUT: &str = "Run L1 contracts tests"; +pub(super) const MSG_L1_CONTRACTS_TEST_SUCCESS: &str = "L1 contracts tests ran successfully"; +pub(super) const MSG_PROVER_TEST_ABOUT: &str = "Run prover tests"; +pub(super) const MSG_PROVER_TEST_SUCCESS: &str = "Prover tests ran successfully"; +pub(super) const MSG_POSTGRES_CONFIG_NOT_FOUND_ERR: &str = "Postgres config not found"; +pub(super) const MSG_RESETTING_TEST_DATABASES: &str = "Resetting test databases"; + +// Contract building related messages +pub(super) const MSG_NOTHING_TO_BUILD_MSG: &str = "Nothing to build!"; +pub(super) const MSG_BUILDING_CONTRACTS: &str = "Building contracts"; +pub(super) const MSG_CONTRACTS_DEPS_SPINNER: &str = "Installing dependencies.."; +pub(super) const MSG_BUILDING_L2_CONTRACTS_SPINNER: &str = "Building L2 contracts.."; +pub(super) const MSG_BUILDING_L1_CONTRACTS_SPINNER: &str = "Building L1 contracts.."; +pub(super) const MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER: &str = "Building system contracts.."; +pub(super) const MSG_BUILDING_TEST_CONTRACTS_SPINNER: &str = "Building test contracts.."; +pub(super) const MSG_BUILDING_CONTRACTS_SUCCESS: &str = "Contracts built successfully"; +pub(super) const MSG_BUILD_L1_CONTRACTS_HELP: &str = "Build L1 contracts"; +pub(super) const MSG_BUILD_L2_CONTRACTS_HELP: &str = "Build L2 contracts"; +pub(super) const MSG_BUILD_SYSTEM_CONTRACTS_HELP: &str = "Build system contracts"; +pub(super) const MSG_BUILD_TEST_CONTRACTS_HELP: &str = "Build test contracts"; + +// Integration tests related messages +pub(super) fn msg_integration_tests_run(external_node: bool) -> String { + let base = "Running integration tests"; + if external_node { + format!("{} for external node", base) + } else { + format!("{} for main server", base) + } +} + +pub(super) const MSG_INTEGRATION_TESTS_RUN_SUCCESS: &str = "Integration tests ran successfully"; +pub(super) const MSG_INTEGRATION_TESTS_BUILDING_DEPENDENCIES: &str = + "Building repository dependencies..."; +pub(super) const MSG_INTEGRATION_TESTS_BUILDING_CONTRACTS: &str = "Building test contracts..."; + +// Revert tests related messages +pub(super) const MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP: &str = "Enable consensus"; +pub(super) const MSG_REVERT_TEST_RUN_INFO: &str = "Running revert and restart test"; + +pub(super) fn msg_revert_tests_run(external_node: bool) -> String { + let base = "Running integration tests"; + if external_node { + format!("{} for external node", base) + } else { + format!("{} for main server", base) + } +} + +pub(super) const MSG_REVERT_TEST_RUN_SUCCESS: &str = "Revert and restart test ran successfully"; + +// Recovery tests related messages +pub(super) const MSG_RECOVERY_TEST_RUN_INFO: &str = "Running recovery test"; +pub(super) const MSG_RECOVERY_TEST_RUN_SUCCESS: &str = "Recovery test ran successfully"; + +// Upgrade tests related messages +pub(super) const MSG_UPGRADE_TEST_RUN_INFO: &str = "Running upgrade test"; +pub(super) const MSG_UPGRADE_TEST_RUN_SUCCESS: &str = "Upgrade test ran successfully"; + +// Cleaning related messages +pub(super) const MSG_DOCKER_COMPOSE_DOWN: &str = "docker compose down"; +pub(super) const MSG_DOCKER_COMPOSE_REMOVE_VOLUMES: &str = "docker compose remove volumes"; +pub(super) const MSG_DOCKER_COMPOSE_CLEANED: &str = "docker compose network cleaned"; +pub(super) const MSG_CONTRACTS_CLEANING: &str = + "Removing contracts building and deployment artifacts"; +pub(super) const MSG_CONTRACTS_CLEANING_FINISHED: &str = + "Contracts building and deployment artifacts are cleaned up"; + +/// Snapshot creator related messages +pub(super) const MSG_RUNNING_SNAPSHOT_CREATOR: &str = "Running snapshot creator"; + +// Lint related messages +pub(super) fn msg_running_linters_for_files(targets: &[Target]) -> String { + let targets: Vec = targets.iter().map(|e| format!(".{}", e)).collect(); + format!("Running linters for targets: {:?}", targets) +} + +pub(super) fn msg_running_linter_for_extension_spinner(target: &Target) -> String { + format!("Running linter for files with extension: .{}", target) +} + +pub(super) fn msg_running_fmt_for_extension_spinner(target: Target) -> String { + format!("Running prettier for: {target:?}") +} + +pub(super) fn msg_running_rustfmt_for_dir_spinner(dir: &str) -> String { + format!("Running rustfmt for: {dir:?}") +} + +pub(super) fn msg_running_fmt_for_extensions_spinner(targets: &[Target]) -> String { + format!("Running prettier for: {targets:?} and rustfmt") +} + +pub(super) const MSG_LINT_CONFIG_PATH_ERR: &str = "Lint config path error"; +pub(super) const MSG_RUNNING_CONTRACTS_LINTER_SPINNER: &str = "Running contracts linter.."; +pub(super) const MSG_RUNNING_CONTRACTS_FMT_SPINNER: &str = "Running prettier for contracts.."; + +pub(super) const MSG_RUNNING_SQL_FMT_SPINNER: &str = "Running SQL formatter.."; + +pub(super) fn msg_file_is_not_formatted(file: &str) -> String { + format!("File {} is not formatted", file) +} + +// Test wallets related messages +pub(super) const MSG_TEST_WALLETS_INFO: &str = "Print test wallets information"; +pub(super) const MSG_DESERIALIZE_TEST_WALLETS_ERR: &str = "Impossible to deserialize test wallets"; +pub(super) const MSG_WALLETS_TEST_SUCCESS: &str = "Wallets test success"; + +pub(super) const MSG_LOADTEST_ABOUT: &str = "Run loadtest"; + +pub(super) const MSG_OVERRIDE_CONFIG_PATH_HELP: &str = "Path to the config file to override"; +pub(super) const MSG_OVERRRIDE_CONFIG_PATH_PROMPT: &str = + "Provide path to the config file to override"; +pub(super) const MSG_OVERRIDE_SUCCESS: &str = "Config was overridden successfully"; + +pub(super) fn msg_overriding_config(chain: String) -> String { + format!("Overriding general config for chain {}", chain) +} + +// Send transactions related messages +pub(super) const MSG_SEND_TXNS_ABOUT: &str = "Send transactions from file"; +pub(super) const MSG_PROMPT_TRANSACTION_FILE: &str = "Path to transactions file"; +pub(super) const MSG_PROMPT_SECRET_KEY: &str = "Secret key of the sender"; +pub(super) const MSG_PROMPT_L1_RPC_URL: &str = "L1 RPC URL"; +pub(super) fn msg_send_txns_outro(log_file: &str) -> String { + format!("Transaction receipts logged to: {}", log_file) +} + +pub(super) const MSG_UNABLE_TO_OPEN_FILE_ERR: &str = "Unable to open file"; +pub(super) const MSG_UNABLE_TO_READ_FILE_ERR: &str = "Unable to read file"; +pub(super) const MSG_UNABLE_TO_WRITE_FILE_ERR: &str = "Unable to write data to file"; +pub(super) const MSG_UNABLE_TO_READ_PARSE_JSON_ERR: &str = "Unable to parse JSON"; +pub(super) const MSG_FAILED_TO_SEND_TXN_ERR: &str = "Failed to send transaction"; +pub(super) const MSG_INVALID_L1_RPC_URL_ERR: &str = "Invalid L1 RPC URL"; diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs new file mode 100644 index 000000000000..b31dbc24444a --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs @@ -0,0 +1,62 @@ +use self::commands::{ + config_writer::ConfigWriterArgs, contracts::ContractsArgs, database::DatabaseCommands, + lint::LintArgs, prover::ProverCommands, send_transactions::args::SendTransactionsArgs, + snapshot::SnapshotCommands, test::TestCommands, +}; +use crate::commands::dev::messages::{ + MSG_CONFIG_WRITER_ABOUT, MSG_CONTRACTS_ABOUT, MSG_PROVER_VERSION_ABOUT, MSG_SEND_TXNS_ABOUT, + MSG_SUBCOMMAND_CLEAN, MSG_SUBCOMMAND_DATABASE_ABOUT, MSG_SUBCOMMAND_FMT_ABOUT, + MSG_SUBCOMMAND_LINT_ABOUT, MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT, MSG_SUBCOMMAND_TESTS_ABOUT, +}; +use clap::Subcommand; +use xshell::Shell; + +use self::commands::{clean::CleanCommands, fmt::FmtArgs}; + +mod commands; +mod consts; +mod dals; +mod defaults; +mod messages; + +#[derive(Subcommand, Debug)] +pub enum DevCommands { + #[command(subcommand, about = MSG_SUBCOMMAND_DATABASE_ABOUT, alias = "db")] + Database(DatabaseCommands), + #[command(subcommand, about = MSG_SUBCOMMAND_TESTS_ABOUT, alias = "t")] + Test(TestCommands), + #[command(subcommand, about = MSG_SUBCOMMAND_CLEAN)] + Clean(CleanCommands), + #[command(subcommand, about = MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT)] + Snapshot(SnapshotCommands), + #[command(about = MSG_SUBCOMMAND_LINT_ABOUT, alias = "l")] + Lint(LintArgs), + #[command(about = MSG_SUBCOMMAND_FMT_ABOUT)] + Fmt(FmtArgs), + #[command(subcommand, about = MSG_PROVER_VERSION_ABOUT)] + Prover(ProverCommands), + #[command(about = MSG_CONTRACTS_ABOUT)] + Contracts(ContractsArgs), + #[command(about = MSG_CONFIG_WRITER_ABOUT, alias = "o")] + ConfigWriter(ConfigWriterArgs), + #[command(about = MSG_SEND_TXNS_ABOUT)] + SendTransactions(SendTransactionsArgs), +} + +pub async fn run(shell: &Shell, args: DevCommands) -> anyhow::Result<()> { + match args { + DevCommands::Database(command) => commands::database::run(shell, command).await?, + DevCommands::Test(command) => commands::test::run(shell, command).await?, + DevCommands::Clean(command) => commands::clean::run(shell, command)?, + DevCommands::Snapshot(command) => commands::snapshot::run(shell, command).await?, + DevCommands::Lint(args) => commands::lint::run(shell, args)?, + DevCommands::Fmt(args) => commands::fmt::run(shell.clone(), args).await?, + DevCommands::Prover(command) => commands::prover::run(shell, command).await?, + DevCommands::Contracts(args) => commands::contracts::run(shell, args)?, + DevCommands::ConfigWriter(args) => commands::config_writer::run(shell, args)?, + DevCommands::SendTransactions(args) => { + commands::send_transactions::run(shell, args).await? + } + } + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/mod.rs index 78a46797602f..c46400cc8657 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/mod.rs @@ -3,6 +3,7 @@ pub mod chain; pub mod consensus; pub mod containers; pub mod contract_verifier; +pub mod dev; pub mod ecosystem; pub mod explorer; pub mod external_node; diff --git a/zk_toolbox/crates/zk_inception/src/main.rs b/zk_toolbox/crates/zk_inception/src/main.rs index 0af9922d0c41..7a70fa16f21a 100644 --- a/zk_toolbox/crates/zk_inception/src/main.rs +++ b/zk_toolbox/crates/zk_inception/src/main.rs @@ -2,6 +2,7 @@ use clap::{command, Parser, Subcommand}; use commands::{ args::{ContainersArgs, UpdateArgs}, contract_verifier::ContractVerifierCommands, + dev::DevCommands, }; use common::{ check_general_prerequisites, @@ -46,6 +47,9 @@ pub enum InceptionSubcommands { /// Chain related commands #[command(subcommand, alias = "c")] Chain(ChainCommands), + /// Chain related commands + #[command(subcommand)] + Dev(DevCommands), /// Prover related commands #[command(subcommand, alias = "p")] Prover(ProverCommands), @@ -123,6 +127,7 @@ async fn run_subcommand(inception_args: Inception, shell: &Shell) -> anyhow::Res match inception_args.command { InceptionSubcommands::Ecosystem(args) => commands::ecosystem::run(shell, args).await?, InceptionSubcommands::Chain(args) => commands::chain::run(shell, args).await?, + InceptionSubcommands::Dev(args) => commands::dev::run(shell, args).await?, InceptionSubcommands::Prover(args) => commands::prover::run(shell, args).await?, InceptionSubcommands::Server(args) => commands::server::run(shell, args)?, InceptionSubcommands::Containers(args) => commands::containers::run(shell, args)?, From 827e2813ce916e89f05be5171c5b72f60631b824 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 16:52:40 +0200 Subject: [PATCH 002/103] style: format code --- .../dev/commands/test/args/recovery.rs | 6 ++++-- .../zk_inception/src/commands/dev/mod.rs | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs index c49c714aea9a..1eb7e59371a7 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs @@ -1,8 +1,10 @@ +use crate::commands::dev::messages::{ + MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_TESTS_RECOVERY_SNAPSHOT_HELP, +}; + use clap::Parser; use serde::{Deserialize, Serialize}; -use crate::commands::dev::messages::{MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_TESTS_RECOVERY_SNAPSHOT_HELP}; - #[derive(Debug, Serialize, Deserialize, Parser)] pub struct RecoveryArgs { #[clap(short, long, help = MSG_TESTS_RECOVERY_SNAPSHOT_HELP)] diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs index b31dbc24444a..451d772324ea 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs @@ -1,17 +1,22 @@ +use clap::Subcommand; +use xshell::Shell; + use self::commands::{ - config_writer::ConfigWriterArgs, contracts::ContractsArgs, database::DatabaseCommands, - lint::LintArgs, prover::ProverCommands, send_transactions::args::SendTransactionsArgs, - snapshot::SnapshotCommands, test::TestCommands, + config_writer::ConfigWriterArgs, + contracts::ContractsArgs, + database::DatabaseCommands, + lint::LintArgs, + prover::ProverCommands, + send_transactions::args::SendTransactionsArgs, + snapshot::SnapshotCommands, + test::TestCommands, + {clean::CleanCommands, fmt::FmtArgs}, }; use crate::commands::dev::messages::{ MSG_CONFIG_WRITER_ABOUT, MSG_CONTRACTS_ABOUT, MSG_PROVER_VERSION_ABOUT, MSG_SEND_TXNS_ABOUT, MSG_SUBCOMMAND_CLEAN, MSG_SUBCOMMAND_DATABASE_ABOUT, MSG_SUBCOMMAND_FMT_ABOUT, MSG_SUBCOMMAND_LINT_ABOUT, MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT, MSG_SUBCOMMAND_TESTS_ABOUT, }; -use clap::Subcommand; -use xshell::Shell; - -use self::commands::{clean::CleanCommands, fmt::FmtArgs}; mod commands; mod consts; From 4585320a40ead9dd732cd5da458aafcf81c052d0 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 17:03:05 +0200 Subject: [PATCH 003/103] style: format imports --- .../src/commands/dev/commands/test/args/recovery.rs | 6 +++--- .../crates/zk_inception/src/commands/dev/mod.rs | 12 +++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs index 1eb7e59371a7..cf4734fd82e7 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs @@ -1,10 +1,10 @@ +use clap::Parser; +use serde::{Deserialize, Serialize}; + use crate::commands::dev::messages::{ MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_TESTS_RECOVERY_SNAPSHOT_HELP, }; -use clap::Parser; -use serde::{Deserialize, Serialize}; - #[derive(Debug, Serialize, Deserialize, Parser)] pub struct RecoveryArgs { #[clap(short, long, help = MSG_TESTS_RECOVERY_SNAPSHOT_HELP)] diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs index 451d772324ea..e8d23f15b699 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs @@ -2,15 +2,9 @@ use clap::Subcommand; use xshell::Shell; use self::commands::{ - config_writer::ConfigWriterArgs, - contracts::ContractsArgs, - database::DatabaseCommands, - lint::LintArgs, - prover::ProverCommands, - send_transactions::args::SendTransactionsArgs, - snapshot::SnapshotCommands, - test::TestCommands, - {clean::CleanCommands, fmt::FmtArgs}, + clean::CleanCommands, config_writer::ConfigWriterArgs, contracts::ContractsArgs, + database::DatabaseCommands, fmt::FmtArgs, lint::LintArgs, prover::ProverCommands, + send_transactions::args::SendTransactionsArgs, snapshot::SnapshotCommands, test::TestCommands, }; use crate::commands::dev::messages::{ MSG_CONFIG_WRITER_ABOUT, MSG_CONTRACTS_ABOUT, MSG_PROVER_VERSION_ABOUT, MSG_SEND_TXNS_ABOUT, From 8e03c161c0ed27afb35d57bf598e4f859cd795dc Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 17:26:35 +0200 Subject: [PATCH 004/103] refactor: use `zki dev` instead of `zks` in CI --- .github/pull_request_template.md | 2 +- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++--- .github/workflows/ci-core-reusable.yml | 64 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 13 files changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a712db9f75b4..fcfd699f0df7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,4 +17,4 @@ - [ ] 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 `zk_supervisor fmt` and `zk_supervisor lint`. +- [ ] Code has been formatted via `zk_inception dev fmt` and `zk_inception dev lint`. diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index bb385b2797b2..1e49627dae5d 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -121,7 +121,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zk_supervisor contracts + ci_run zk_inception dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 9d00f98b1816..71fff88add53 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -130,7 +130,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zk_supervisor contracts + ci_run zk_inception dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index f664bfaaa00a..37427b8a6afa 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -63,7 +63,7 @@ jobs: ci_run zk ci_run zkt ci_run cp etc/tokens/{test,localhost}.json - ci_run zk_supervisor contracts + ci_run zk_inception dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 2f51229aeaf9..e8f19207b180 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -37,5 +37,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zk_supervisor lint -t rs --check + run: ci_run zk_inception dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 6d0785fe46f1..e7ce12950a5a 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -32,18 +32,18 @@ jobs: ci_run ./bin/zkt ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync - ci_run zk_supervisor db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zk_inception dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zk_supervisor fmt --check - ci_run zk_supervisor lint -t md --check - ci_run zk_supervisor lint -t sol --check - ci_run zk_supervisor lint -t js --check - ci_run zk_supervisor lint -t ts --check - ci_run zk_supervisor lint -t rs --check + ci_run zk_inception dev fmt --check + ci_run zk_inception dev lint -t md --check + ci_run zk_inception dev lint -t sol --check + ci_run zk_inception dev lint -t js --check + ci_run zk_inception dev lint -t ts --check + ci_run zk_inception dev lint -t rs --check - name: Check Database run: | - ci_run zk_supervisor database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zk_inception dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 9dbd4202afd3..29a30e304853 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -57,14 +57,14 @@ jobs: run: | ci_run run_retried rustup show ci_run ./bin/zkt - ci_run zk_supervisor contracts + ci_run zk_inception dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zk_supervisor test rust + ci_run zk_inception dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -128,17 +128,17 @@ jobs: --legacy-bridge ci_run zk_inception ecosystem init --dev --verbose - ci_run zk_supervisor contracts --test-contracts + ci_run zk_inception dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zk_supervisor config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zk_inception dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy ci_run zk_inception server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zk_supervisor t loadtest -v --chain=legacy + run: ci_run zk_inception dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -291,7 +291,7 @@ jobs: governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zk_supervisor send-transactions \ + ci_run zk_inception dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -333,7 +333,7 @@ jobs: - name: Build test dependencies run: | - ci_run zk_supervisor test build + ci_run zk_inception dev test build - name: Initialize Contract verifier run: | @@ -358,16 +358,16 @@ jobs: - name: Run integration tests run: | PASSED_ENV_VARS="RUN_CONTRACT_VERIFICATION_TEST" \ - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -396,16 +396,16 @@ jobs: - name: Run recovery tests (from snapshot) run: | - ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & + ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -415,16 +415,16 @@ jobs: - name: Run recovery tests (from genesis) run: | - ci_run zk_supervisor test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_supervisor test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & + ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_supervisor test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_supervisor test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -441,16 +441,16 @@ jobs: - name: Run integration tests en run: | - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & + ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -462,16 +462,16 @@ jobs: run: | ci_run killall -INT zksync_server || true - ci_run zk_supervisor test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & + ci_run zk_inception dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & PID1=$! - ci_run zk_supervisor test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & + ci_run zk_inception dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_supervisor test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & + ci_run zk_inception dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_supervisor test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & + ci_run zk_inception dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -484,16 +484,16 @@ jobs: ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run zk_supervisor test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & + ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_supervisor test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & + ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_supervisor test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & + ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_supervisor test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & + ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -507,7 +507,7 @@ jobs: # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zk_supervisor test upgrade --no-deps --chain era + ci_run zk_inception dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 5b1d5a9bcdfa..420b9656ee3c 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -35,4 +35,4 @@ jobs: - name: Lints run: | - ci_run zk_supervisor lint -t md --check + ci_run zk_inception dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 3f842b23488e..4a90d7f93743 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Init run: | ci_run zkt - ci_run zk_supervisor db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zk_inception dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -73,4 +73,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zk_supervisor test prover + ci_run zk_inception dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 42791eab6669..c8710160072d 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -134,7 +134,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zk_supervisor contracts + zk_inception dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index fba6a68b8eec..51486acf43f9 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -139,7 +139,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zk_supervisor contracts + zk_inception dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 6e044287ad3d..992483955051 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: shell: bash run: | ci_run zkt - ci_run zk_supervisor contracts --system-contracts + ci_run zk_inception dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: shell: bash run: | ci_run zkt - ci_run zk_supervisor contracts --system-contracts + ci_run zk_inception dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 4c8c90a0d8f2..77024ffe83b9 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -34,7 +34,7 @@ jobs: run_retried docker compose pull zk docker compose up -d zk ci_run zkt - ci_run zk_supervisor contracts + ci_run zk_inception dev contracts - name: run benchmarks run: | From 3c9ff945e8526bb545066d86d7a1a137c581eaf8 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 17:54:21 +0200 Subject: [PATCH 005/103] refactor: remove zk_supervisor crate --- zk_toolbox/Cargo.lock | 25 -- zk_toolbox/Cargo.toml | 1 - zk_toolbox/crates/zk_supervisor/Cargo.toml | 32 -- zk_toolbox/crates/zk_supervisor/README.md | 386 ------------------ .../zk_supervisor/src/commands/clean/mod.rs | 97 ----- .../src/commands/config_writer.rs | 35 -- .../zk_supervisor/src/commands/contracts.rs | 147 ------- .../src/commands/database/args/mod.rs | 67 --- .../commands/database/args/new_migration.rs | 48 --- .../src/commands/database/check_sqlx_data.rs | 59 --- .../src/commands/database/drop.rs | 42 -- .../src/commands/database/migrate.rs | 54 --- .../src/commands/database/mod.rs | 48 --- .../src/commands/database/new_migration.rs | 43 -- .../src/commands/database/prepare.rs | 58 --- .../src/commands/database/reset.rs | 46 --- .../src/commands/database/setup.rs | 56 --- .../crates/zk_supervisor/src/commands/fmt.rs | 129 ------ .../crates/zk_supervisor/src/commands/lint.rs | 135 ------ .../zk_supervisor/src/commands/lint_utils.rs | 55 --- .../crates/zk_supervisor/src/commands/mod.rs | 12 - .../src/commands/prover/args/insert_batch.rs | 40 -- .../commands/prover/args/insert_version.rs | 49 --- .../src/commands/prover/args/mod.rs | 2 - .../zk_supervisor/src/commands/prover/info.rs | 95 ----- .../src/commands/prover/insert_batch.rs | 44 -- .../src/commands/prover/insert_version.rs | 44 -- .../zk_supervisor/src/commands/prover/mod.rs | 22 - .../commands/send_transactions/args/mod.rs | 69 ---- .../src/commands/send_transactions/mod.rs | 132 ------ .../zk_supervisor/src/commands/snapshot.rs | 40 -- .../zk_supervisor/src/commands/sql_fmt.rs | 149 ------- .../src/commands/test/args/fees.rs | 12 - .../src/commands/test/args/integration.rs | 14 - .../src/commands/test/args/mod.rs | 6 - .../src/commands/test/args/recovery.rs | 14 - .../src/commands/test/args/revert.rs | 18 - .../src/commands/test/args/rust.rs | 9 - .../src/commands/test/args/upgrade.rs | 9 - .../zk_supervisor/src/commands/test/build.rs | 13 - .../zk_supervisor/src/commands/test/db.rs | 34 -- .../zk_supervisor/src/commands/test/fees.rs | 65 --- .../src/commands/test/integration.rs | 67 --- .../src/commands/test/l1_contracts.rs | 18 - .../src/commands/test/loadtest.rs | 52 --- .../zk_supervisor/src/commands/test/mod.rs | 69 ---- .../zk_supervisor/src/commands/test/prover.rs | 31 -- .../src/commands/test/recovery.rs | 68 --- .../zk_supervisor/src/commands/test/revert.rs | 70 ---- .../zk_supervisor/src/commands/test/rust.rs | 86 ---- .../src/commands/test/upgrade.rs | 33 -- .../zk_supervisor/src/commands/test/utils.rs | 111 ----- .../zk_supervisor/src/commands/test/wallet.rs | 35 -- zk_toolbox/crates/zk_supervisor/src/consts.rs | 1 - zk_toolbox/crates/zk_supervisor/src/dals.rs | 98 ----- .../crates/zk_supervisor/src/defaults.rs | 5 - zk_toolbox/crates/zk_supervisor/src/main.rs | 151 ------- .../crates/zk_supervisor/src/messages.rs | 236 ----------- 58 files changed, 3586 deletions(-) delete mode 100644 zk_toolbox/crates/zk_supervisor/Cargo.toml delete mode 100644 zk_toolbox/crates/zk_supervisor/README.md delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/config_writer.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/args/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/check_sqlx_data.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/migrate.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/new_migration.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/prepare.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/database/setup.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/lint.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/args/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/snapshot.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/fees.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/recovery.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/revert.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/rust.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/args/upgrade.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/build.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/db.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/fees.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/l1_contracts.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/prover.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/revert.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/upgrade.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/commands/test/wallet.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/consts.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/dals.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/defaults.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/main.rs delete mode 100644 zk_toolbox/crates/zk_supervisor/src/messages.rs diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index e2be9a190c26..4292231e452b 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -6715,31 +6715,6 @@ dependencies = [ "zksync_consensus_roles", ] -[[package]] -name = "zk_supervisor" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "clap", - "clap-markdown", - "common", - "config", - "ethers", - "futures", - "human-panic", - "serde", - "serde_json", - "serde_yaml", - "sqruff-lib", - "strum", - "tokio", - "types", - "url", - "xshell", - "zksync_basic_types", -] - [[package]] name = "zkevm_opcode_defs" version = "0.132.0" diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index e6aec659bd60..36acade94355 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -4,7 +4,6 @@ members = [ "crates/config", "crates/types", "crates/zk_inception", - "crates/zk_supervisor", "crates/git_version_macro", ] resolver = "2" diff --git a/zk_toolbox/crates/zk_supervisor/Cargo.toml b/zk_toolbox/crates/zk_supervisor/Cargo.toml deleted file mode 100644 index 158abe4e2ec6..000000000000 --- a/zk_toolbox/crates/zk_supervisor/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "zk_supervisor" -version = "0.1.0" -edition.workspace = true -homepage.workspace = true -license.workspace = true -authors.workspace = true -exclude.workspace = true -repository.workspace = true -description.workspace = true -keywords.workspace = true - -[dependencies] -anyhow.workspace = true -clap.workspace = true -common.workspace = true -config.workspace = true -chrono.workspace = true -ethers.workspace = true -human-panic.workspace = true -strum.workspace = true -tokio.workspace = true -url.workspace = true -xshell.workspace = true -serde.workspace = true -serde_json.workspace = true -clap-markdown.workspace = true -futures.workspace = true -types.workspace = true -serde_yaml.workspace = true -zksync_basic_types.workspace = true -sqruff-lib = { git = "https://github.com/quarylabs/sqruff", version = "0.18.2" } diff --git a/zk_toolbox/crates/zk_supervisor/README.md b/zk_toolbox/crates/zk_supervisor/README.md deleted file mode 100644 index 865bd2f0d579..000000000000 --- a/zk_toolbox/crates/zk_supervisor/README.md +++ /dev/null @@ -1,386 +0,0 @@ -# Command-Line Help for `zk_supervisor` - -This document contains the help content for the `zk_supervisor` command-line program. - -**Command Overview:** - -- [`zk_supervisor`↴](#zk_supervisor) -- [`zk_supervisor database`↴](#zk_supervisor-database) -- [`zk_supervisor database check-sqlx-data`↴](#zk_supervisor-database-check-sqlx-data) -- [`zk_supervisor database drop`↴](#zk_supervisor-database-drop) -- [`zk_supervisor database migrate`↴](#zk_supervisor-database-migrate) -- [`zk_supervisor database new-migration`↴](#zk_supervisor-database-new-migration) -- [`zk_supervisor database prepare`↴](#zk_supervisor-database-prepare) -- [`zk_supervisor database reset`↴](#zk_supervisor-database-reset) -- [`zk_supervisor database setup`↴](#zk_supervisor-database-setup) -- [`zk_supervisor test`↴](#zk_supervisor-test) -- [`zk_supervisor test integration`↴](#zk_supervisor-test-integration) -- [`zk_supervisor test revert`↴](#zk_supervisor-test-revert) -- [`zk_supervisor test recovery`↴](#zk_supervisor-test-recovery) -- [`zk_supervisor test upgrade`↴](#zk_supervisor-test-upgrade) -- [`zk_supervisor test rust`↴](#zk_supervisor-test-rust) -- [`zk_supervisor test l1-contracts`↴](#zk_supervisor-test-l1-contracts) -- [`zk_supervisor test prover`↴](#zk_supervisor-test-prover) -- [`zk_supervisor clean`↴](#zk_supervisor-clean) -- [`zk_supervisor clean all`↴](#zk_supervisor-clean-all) -- [`zk_supervisor clean containers`↴](#zk_supervisor-clean-containers) -- [`zk_supervisor clean contracts-cache`↴](#zk_supervisor-clean-contracts-cache) -- [`zk_supervisor snapshot`↴](#zk_supervisor-snapshot) -- [`zk_supervisor snapshot create`↴](#zk_supervisor-snapshot-create) -- [`zk_supervisor lint`↴](#zk_supervisor-lint) -- [`zk_supervisor fmt`↴](#zk_supervisor-fmt) -- [`zk_supervisor fmt rustfmt`↴](#zk_supervisor-fmt-rustfmt) -- [`zk_supervisor fmt contract`↴](#zk_supervisor-fmt-contract) -- [`zk_supervisor fmt prettier`↴](#zk_supervisor-fmt-prettier) -- [`zk_supervisor prover info`↴](#zk_supervisor-prover-info) -- [`zk_supervisor prover insert-version`↴](#zk_supervisor-prover-insert-version) -- [`zk_supervisor prover insert-batch`↴](#zk_supervisor-prover-insert-batch) - -## `zk_supervisor` - -ZK Toolbox is a set of tools for working with zk stack. - -**Usage:** `zk_supervisor [OPTIONS] ` - -###### **Subcommands:** - -- `database` — Database related commands -- `test` — Run tests -- `clean` — Clean artifacts -- `snapshot` — Snapshots creator -- `lint` — Lint code -- `fmt` — Format code -- `prover-version` — Protocol version used by provers - -###### **Options:** - -- `-v`, `--verbose` — Verbose mode -- `--chain ` — Chain to use -- `--ignore-prerequisites` — Ignores prerequisites checks - -## `zk_supervisor database` - -Database related commands - -**Usage:** `zk_supervisor database ` - -###### **Subcommands:** - -- `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. - -## `zk_supervisor database check-sqlx-data` - -Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked. - -**Usage:** `zk_supervisor database check-sqlx-data [OPTIONS]` - -###### **Options:** - -- `-p`, `--prover ` — Prover database - - Possible values: `true`, `false` - -- `-c`, `--core ` — Core database - - Possible values: `true`, `false` - -## `zk_supervisor database drop` - -Drop databases. If no databases are selected, all databases will be dropped. - -**Usage:** `zk_supervisor database drop [OPTIONS]` - -###### **Options:** - -- `-p`, `--prover ` — Prover database - - Possible values: `true`, `false` - -- `-c`, `--core ` — Core database - - Possible values: `true`, `false` - -## `zk_supervisor database migrate` - -Migrate databases. If no databases are selected, all databases will be migrated. - -**Usage:** `zk_supervisor database migrate [OPTIONS]` - -###### **Options:** - -- `-p`, `--prover ` — Prover database - - Possible values: `true`, `false` - -- `-c`, `--core ` — Core database - - Possible values: `true`, `false` - -## `zk_supervisor database new-migration` - -Create new migration - -**Usage:** `zk_supervisor database new-migration [OPTIONS]` - -###### **Options:** - -- `--database ` — Database to create new migration for - - Possible values: `prover`, `core` - -- `--name ` — Migration name - -## `zk_supervisor database prepare` - -Prepare sqlx-data.json. If no databases are selected, all databases will be prepared. - -**Usage:** `zk_supervisor database prepare [OPTIONS]` - -###### **Options:** - -- `-p`, `--prover ` — Prover database - - Possible values: `true`, `false` - -- `-c`, `--core ` — Core database - - Possible values: `true`, `false` - -## `zk_supervisor database reset` - -Reset databases. If no databases are selected, all databases will be reset. - -**Usage:** `zk_supervisor database reset [OPTIONS]` - -###### **Options:** - -- `-p`, `--prover ` — Prover database - - Possible values: `true`, `false` - -- `-c`, `--core ` — Core database - - Possible values: `true`, `false` - -## `zk_supervisor database setup` - -Setup databases. If no databases are selected, all databases will be setup. - -**Usage:** `zk_supervisor database setup [OPTIONS]` - -###### **Options:** - -- `-p`, `--prover ` — Prover database - - Possible values: `true`, `false` - -- `-c`, `--core ` — Core database - - Possible values: `true`, `false` - -## `zk_supervisor test` - -Run tests - -**Usage:** `zk_supervisor test ` - -###### **Subcommands:** - -- `integration` — Run integration tests -- `revert` — Run revert tests -- `recovery` — Run recovery tests -- `upgrade` — Run upgrade tests -- `rust` — Run unit-tests, accepts optional cargo test flags -- `l1-contracts` — Run L1 contracts tests -- `prover` — Run prover tests - -## `zk_supervisor test integration` - -Run integration tests - -**Usage:** `zk_supervisor test integration [OPTIONS]` - -###### **Options:** - -- `-e`, `--external-node` — Run tests for external node - -## `zk_supervisor test revert` - -Run revert tests - -**Usage:** `zk_supervisor test revert [OPTIONS]` - -###### **Options:** - -- `--enable-consensus` — Enable consensus -- `-e`, `--external-node` — Run tests for external node - -## `zk_supervisor test recovery` - -Run recovery tests - -**Usage:** `zk_supervisor test recovery [OPTIONS]` - -###### **Options:** - -- `-s`, `--snapshot` — Run recovery from a snapshot instead of genesis - -## `zk_supervisor test upgrade` - -Run upgrade tests - -**Usage:** `zk_supervisor test upgrade` - -## `zk_supervisor test rust` - -Run unit-tests, accepts optional cargo test flags - -**Usage:** `zk_supervisor test rust [OPTIONS]` - -###### **Options:** - -- `--options ` — Cargo test flags - -## `zk_supervisor test l1-contracts` - -Run L1 contracts tests - -**Usage:** `zk_supervisor test l1-contracts` - -## `zk_supervisor test prover` - -Run prover tests - -**Usage:** `zk_supervisor test prover` - -## `zk_supervisor clean` - -Clean artifacts - -**Usage:** `zk_supervisor clean ` - -###### **Subcommands:** - -- `all` — Remove containers and contracts cache -- `containers` — Remove containers and docker volumes -- `contracts-cache` — Remove contracts caches - -## `zk_supervisor clean all` - -Remove containers and contracts cache - -**Usage:** `zk_supervisor clean all` - -## `zk_supervisor clean containers` - -Remove containers and docker volumes - -**Usage:** `zk_supervisor clean containers` - -## `zk_supervisor clean contracts-cache` - -Remove contracts caches - -**Usage:** `zk_supervisor clean contracts-cache` - -## `zk_supervisor snapshot` - -Snapshots creator - -**Usage:** `zk_supervisor snapshot ` - -###### **Subcommands:** - -- `create` — - -## `zk_supervisor snapshot create` - -**Usage:** `zk_supervisor snapshot create` - -## `zk_supervisor lint` - -Lint code - -**Usage:** `zk_supervisor lint [OPTIONS]` - -###### **Options:** - -- `-c`, `--check` -- `-e`, `--extensions ` - - Possible values: `md`, `sol`, `js`, `ts`, `rs` - -## `zk_supervisor fmt` - -Format code - -**Usage:** `zk_supervisor fmt [OPTIONS] [COMMAND]` - -###### **Subcommands:** - -- `rustfmt` — -- `contract` — -- `prettier` — - -###### **Options:** - -- `-c`, `--check` - -## `zk_supervisor fmt rustfmt` - -**Usage:** `zk_supervisor fmt rustfmt` - -## `zk_supervisor fmt contract` - -**Usage:** `zk_supervisor fmt contract` - -## `zk_supervisor fmt prettier` - -**Usage:** `zk_supervisor fmt prettier [OPTIONS]` - -###### **Options:** - -- `-e`, `--extensions ` - - Possible values: `md`, `sol`, `js`, `ts`, `rs` - -## `zk_supervisor prover info` - -Prints prover protocol version, snark wrapper and prover database URL - -**Usage:** `zk_supervisor prover info` - -## `zk_supervisor prover insert-version` - -Inserts protocol version into prover database. - -**Usage:** `zk_supervisor prover insert-version [OPTIONS]` - -###### **Options:** - -- `--version ` — Protocol version in semantic format(`x.y.z`). Major version should be 0. -- `--snark-wrapper ` — Snark wrapper hash. -- `--default` - use default values for protocol version and snark wrapper hash (the ones found in zksync-era). - -## `zk_supervisor prover insert-batch` - -Inserts batch into prover database. - -**Usage:** `zk_supervisor prover insert-batch` - -###### **Options:** - -- `--number ` — Number of the batch to insert. -- `--version ` — Protocol version in semantic format(`x.y.z`). Major version should be 0. -- `--default` - use default value for protocol version (the one found in zksync-era). - -
- - This document was generated automatically by -clap-markdown. diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs deleted file mode 100644 index 803e962c0ff8..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs +++ /dev/null @@ -1,97 +0,0 @@ -use anyhow::Context; -use clap::Subcommand; -use common::{docker, logger}; -use config::{EcosystemConfig, DOCKER_COMPOSE_FILE}; -use xshell::Shell; - -use crate::messages::{ - MSG_CONTRACTS_CLEANING, MSG_CONTRACTS_CLEANING_FINISHED, MSG_DOCKER_COMPOSE_CLEANED, - MSG_DOCKER_COMPOSE_DOWN, MSG_DOCKER_COMPOSE_REMOVE_VOLUMES, -}; - -#[derive(Subcommand, Debug)] -pub enum CleanCommands { - /// Remove containers and contracts cache - All, - /// Remove containers and docker volumes - Containers, - /// Remove contracts caches - ContractsCache, -} - -pub fn run(shell: &Shell, args: CleanCommands) -> anyhow::Result<()> { - let ecosystem = EcosystemConfig::from_file(shell)?; - match args { - CleanCommands::All => { - containers(shell)?; - contracts(shell, &ecosystem)?; - } - CleanCommands::Containers => containers(shell)?, - CleanCommands::ContractsCache => contracts(shell, &ecosystem)?, - } - Ok(()) -} - -pub fn containers(shell: &Shell) -> anyhow::Result<()> { - logger::info(MSG_DOCKER_COMPOSE_DOWN); - docker::down(shell, DOCKER_COMPOSE_FILE)?; - logger::info(MSG_DOCKER_COMPOSE_REMOVE_VOLUMES); - shell.remove_path("volumes")?; - logger::info(MSG_DOCKER_COMPOSE_CLEANED); - Ok(()) -} - -pub fn contracts(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { - let path_to_foundry = ecosystem_config.path_to_foundry(); - let contracts_path = ecosystem_config.link_to_code.join("contracts"); - logger::info(MSG_CONTRACTS_CLEANING); - shell - .remove_path(path_to_foundry.join("broadcast")) - .context("broadcast")?; - shell - .remove_path(path_to_foundry.join("artifacts")) - .context("artifacts")?; - shell - .remove_path(path_to_foundry.join("cache")) - .context("cache")?; - shell - .remove_path(path_to_foundry.join("cache-forge")) - .context("cache-forge")?; - shell - .remove_path(path_to_foundry.join("out")) - .context("out")?; - shell - .remove_path(path_to_foundry.join("typechain")) - .context("typechain")?; - shell - .remove_path(contracts_path.join("l2-contracts/cache-forge")) - .context("l2-contracts/cache-forge")?; - shell - .remove_path(contracts_path.join("l2-contracts/zkout")) - .context("l2-contracts/zkout")?; - shell - .remove_path(contracts_path.join("system-contracts/cache-forge")) - .context("system-contracts/cache-forge")?; - shell - .remove_path(contracts_path.join("system-contracts/zkout")) - .context("system-contracts/zkout")?; - shell - .remove_path(contracts_path.join("system-contracts/contracts-preprocessed")) - .context("system-contracts/contracts-preprocessed")?; - shell - .remove_path(path_to_foundry.join("script-config")) - .context("remove script-config")?; - shell - .create_dir(path_to_foundry.join("script-config")) - .context("create script-config")?; - shell.write_file(path_to_foundry.join("script-config/.gitkeep"), "")?; - shell - .remove_path(path_to_foundry.join("script-out")) - .context("remove script-out")?; - shell - .create_dir(path_to_foundry.join("script-out")) - .context("create script-out")?; - shell.write_file(path_to_foundry.join("script-out/.gitkeep"), "")?; - logger::info(MSG_CONTRACTS_CLEANING_FINISHED); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/config_writer.rs b/zk_toolbox/crates/zk_supervisor/src/commands/config_writer.rs deleted file mode 100644 index 04e019936e17..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/config_writer.rs +++ /dev/null @@ -1,35 +0,0 @@ -use anyhow::Context; -use clap::Parser; -use common::{logger, Prompt}; -use config::{override_config, EcosystemConfig}; -use xshell::Shell; - -use crate::messages::{ - msg_overriding_config, MSG_CHAIN_NOT_FOUND_ERR, MSG_OVERRIDE_CONFIG_PATH_HELP, - MSG_OVERRIDE_SUCCESS, MSG_OVERRRIDE_CONFIG_PATH_PROMPT, -}; - -#[derive(Debug, Parser)] -pub struct ConfigWriterArgs { - #[clap(long, short, help = MSG_OVERRIDE_CONFIG_PATH_HELP)] - pub path: Option, -} - -impl ConfigWriterArgs { - pub fn get_config_path(self) -> String { - self.path - .unwrap_or_else(|| Prompt::new(MSG_OVERRRIDE_CONFIG_PATH_PROMPT).ask()) - } -} - -pub fn run(shell: &Shell, args: ConfigWriterArgs) -> anyhow::Result<()> { - let path = args.get_config_path().into(); - let ecosystem = EcosystemConfig::from_file(shell)?; - let chain = ecosystem - .load_current_chain() - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - logger::step(msg_overriding_config(chain.name.clone())); - override_config(shell, path, &chain)?; - logger::outro(MSG_OVERRIDE_SUCCESS); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs b/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs deleted file mode 100644 index bab4205cd66f..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs +++ /dev/null @@ -1,147 +0,0 @@ -use std::path::PathBuf; - -use clap::Parser; -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use crate::messages::{ - MSG_BUILDING_CONTRACTS, MSG_BUILDING_CONTRACTS_SUCCESS, MSG_BUILDING_L1_CONTRACTS_SPINNER, - MSG_BUILDING_L2_CONTRACTS_SPINNER, MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER, - MSG_BUILDING_TEST_CONTRACTS_SPINNER, MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, - MSG_BUILD_SYSTEM_CONTRACTS_HELP, MSG_BUILD_TEST_CONTRACTS_HELP, MSG_CONTRACTS_DEPS_SPINNER, - MSG_NOTHING_TO_BUILD_MSG, -}; - -#[derive(Debug, Parser)] -pub struct ContractsArgs { - #[clap(long, alias = "l1", help = MSG_BUILD_L1_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] - pub l1_contracts: Option, - #[clap(long, alias = "l2", help = MSG_BUILD_L2_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] - pub l2_contracts: Option, - #[clap(long, alias = "sc", help = MSG_BUILD_SYSTEM_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] - pub system_contracts: Option, - #[clap(long, alias = "test", help = MSG_BUILD_TEST_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] - pub test_contracts: Option, -} - -impl ContractsArgs { - fn contracts(&self) -> Vec { - if self.l1_contracts.is_none() - && self.l2_contracts.is_none() - && self.system_contracts.is_none() - && self.test_contracts.is_none() - { - return vec![ - ContractType::L1, - ContractType::L2, - ContractType::SystemContracts, - ContractType::TestContracts, - ]; - } - - let mut contracts = vec![]; - - if self.l1_contracts.unwrap_or(false) { - contracts.push(ContractType::L1); - } - if self.l2_contracts.unwrap_or(false) { - contracts.push(ContractType::L2); - } - if self.system_contracts.unwrap_or(false) { - contracts.push(ContractType::SystemContracts); - } - if self.test_contracts.unwrap_or(false) { - contracts.push(ContractType::TestContracts); - } - - contracts - } -} - -#[derive(Debug, PartialEq, Eq, Clone, Copy)] -pub enum ContractType { - L1, - L2, - SystemContracts, - TestContracts, -} - -#[derive(Debug)] -struct ContractBuilder { - dir: PathBuf, - cmd: String, - msg: String, -} - -impl ContractBuilder { - fn new(ecosystem: &EcosystemConfig, contract_type: ContractType) -> Self { - match contract_type { - ContractType::L1 => Self { - dir: ecosystem.path_to_foundry(), - cmd: "forge build".to_string(), - msg: MSG_BUILDING_L1_CONTRACTS_SPINNER.to_string(), - }, - ContractType::L2 => Self { - dir: ecosystem.link_to_code.clone(), - cmd: "yarn l2-contracts build".to_string(), - msg: MSG_BUILDING_L2_CONTRACTS_SPINNER.to_string(), - }, - ContractType::SystemContracts => Self { - dir: ecosystem.link_to_code.join("contracts"), - cmd: "yarn sc build".to_string(), - msg: MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER.to_string(), - }, - ContractType::TestContracts => Self { - dir: ecosystem.link_to_code.join("etc/contracts-test-data"), - cmd: "yarn build".to_string(), - msg: MSG_BUILDING_TEST_CONTRACTS_SPINNER.to_string(), - }, - } - } - - fn build(&self, shell: &Shell) -> anyhow::Result<()> { - let spinner = Spinner::new(&self.msg); - let _dir_guard = shell.push_dir(&self.dir); - - let mut args = self.cmd.split_whitespace().collect::>(); - let command = args.remove(0); // It's safe to unwrap here because we know that the vec is not empty - let mut cmd = cmd!(shell, "{command}"); - - for arg in args { - cmd = cmd.arg(arg); - } - - Cmd::new(cmd).run()?; - - spinner.finish(); - Ok(()) - } -} - -pub fn run(shell: &Shell, args: ContractsArgs) -> anyhow::Result<()> { - let contracts = args.contracts(); - if contracts.is_empty() { - logger::outro(MSG_NOTHING_TO_BUILD_MSG); - return Ok(()); - } - - logger::info(MSG_BUILDING_CONTRACTS); - - let ecosystem = EcosystemConfig::from_file(shell)?; - let link_to_code = ecosystem.link_to_code.clone(); - - let spinner = Spinner::new(MSG_CONTRACTS_DEPS_SPINNER); - let _dir_guard = shell.push_dir(&link_to_code); - Cmd::new(cmd!(shell, "yarn install")).run()?; - spinner.finish(); - - contracts - .iter() - .map(|contract| ContractBuilder::new(&ecosystem, *contract)) - .try_for_each(|builder| builder.build(shell))?; - - logger::outro(MSG_BUILDING_CONTRACTS_SUCCESS); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/args/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/args/mod.rs deleted file mode 100644 index cf9dfc2834a8..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/args/mod.rs +++ /dev/null @@ -1,67 +0,0 @@ -use clap::Parser; - -use crate::{ - dals::SelectedDals, - messages::{ - MSG_DATABASE_COMMON_CORE_HELP, MSG_DATABASE_COMMON_CORE_URL_HELP, - MSG_DATABASE_COMMON_PROVER_HELP, MSG_DATABASE_COMMON_PROVER_URL_HELP, - }, -}; - -pub mod new_migration; - -#[derive(Debug, Parser)] -pub struct DatabaseCommonArgs { - #[clap( - short, long, default_missing_value = "true", num_args = 0..=1, help = MSG_DATABASE_COMMON_PROVER_HELP - )] - pub prover: Option, - #[clap(long, help = MSG_DATABASE_COMMON_PROVER_URL_HELP)] - pub prover_url: Option, - #[clap( - short, long, default_missing_value = "true", num_args = 0..=1, help = MSG_DATABASE_COMMON_CORE_HELP - )] - pub core: Option, - #[clap(long, help = MSG_DATABASE_COMMON_CORE_URL_HELP)] - pub core_url: Option, -} - -impl DatabaseCommonArgs { - pub fn parse(self) -> DatabaseCommonArgsFinal { - if self.prover.is_none() && self.core.is_none() { - return DatabaseCommonArgsFinal { - selected_dals: SelectedDals { - prover: true, - core: true, - }, - urls: DalUrls { - prover: self.prover_url, - core: self.core_url, - }, - }; - } - - DatabaseCommonArgsFinal { - selected_dals: SelectedDals { - prover: self.prover.unwrap_or(false), - core: self.core.unwrap_or(false), - }, - urls: DalUrls { - prover: self.prover_url, - core: self.core_url, - }, - } - } -} - -#[derive(Debug, Clone)] -pub struct DalUrls { - pub prover: Option, - pub core: Option, -} - -#[derive(Debug)] -pub struct DatabaseCommonArgsFinal { - pub selected_dals: SelectedDals, - pub urls: DalUrls, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs deleted file mode 100644 index 64b7a507abea..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs +++ /dev/null @@ -1,48 +0,0 @@ -use clap::{Parser, ValueEnum}; -use common::{Prompt, PromptSelect}; -use strum::{Display, EnumIter, IntoEnumIterator}; - -use crate::messages::{ - MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP, MSG_DATABASE_NEW_MIGRATION_DB_PROMPT, - MSG_DATABASE_NEW_MIGRATION_NAME_HELP, MSG_DATABASE_NEW_MIGRATION_NAME_PROMPT, -}; - -#[derive(Debug, Parser)] -pub struct DatabaseNewMigrationArgs { - #[clap(long, help = MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP)] - pub database: Option, - #[clap(long, help = MSG_DATABASE_NEW_MIGRATION_NAME_HELP)] - pub name: Option, -} - -impl DatabaseNewMigrationArgs { - pub fn fill_values_with_prompt(self) -> DatabaseNewMigrationArgsFinal { - let selected_database = self.database.unwrap_or_else(|| { - PromptSelect::new( - MSG_DATABASE_NEW_MIGRATION_DB_PROMPT, - SelectedDatabase::iter(), - ) - .ask() - }); - let name = self - .name - .unwrap_or_else(|| Prompt::new(MSG_DATABASE_NEW_MIGRATION_NAME_PROMPT).ask()); - - DatabaseNewMigrationArgsFinal { - selected_database, - name, - } - } -} - -#[derive(Debug)] -pub struct DatabaseNewMigrationArgsFinal { - pub selected_database: SelectedDatabase, - pub name: String, -} - -#[derive(Debug, Clone, ValueEnum, EnumIter, PartialEq, Eq, Display)] -pub enum SelectedDatabase { - Prover, - Core, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/check_sqlx_data.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/check_sqlx_data.rs deleted file mode 100644 index 0c401595690e..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/check_sqlx_data.rs +++ /dev/null @@ -1,59 +0,0 @@ -use std::path::Path; - -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::args::DatabaseCommonArgs; -use crate::{ - dals::{get_dals, Dal}, - messages::{ - msg_database_info, msg_database_loading, msg_database_success, - MSG_DATABASE_CHECK_SQLX_DATA_GERUND, MSG_DATABASE_CHECK_SQLX_DATA_PAST, - MSG_NO_DATABASES_SELECTED, - }, -}; - -pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { - let args = args.parse(); - if args.selected_dals.none() { - logger::outro(MSG_NO_DATABASES_SELECTED); - return Ok(()); - } - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - logger::info(msg_database_info(MSG_DATABASE_CHECK_SQLX_DATA_GERUND)); - - let dals = get_dals(shell, &args.selected_dals, &args.urls)?; - for dal in dals { - check_sqlx_data(shell, &ecosystem_config.link_to_code, dal)?; - } - - logger::outro(msg_database_success(MSG_DATABASE_CHECK_SQLX_DATA_PAST)); - - Ok(()) -} - -pub fn check_sqlx_data( - shell: &Shell, - link_to_code: impl AsRef, - dal: Dal, -) -> anyhow::Result<()> { - let dir = link_to_code.as_ref().join(&dal.path); - let _dir_guard = shell.push_dir(dir); - let url = dal.url.as_str(); - - let spinner = Spinner::new(&msg_database_loading( - MSG_DATABASE_CHECK_SQLX_DATA_GERUND, - &dal.path, - )); - Cmd::new(cmd!( - shell, - "cargo sqlx prepare --check --database-url {url} -- --tests" - )) - .run()?; - spinner.finish(); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs deleted file mode 100644 index 94bf325a2c6c..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs +++ /dev/null @@ -1,42 +0,0 @@ -use common::{ - db::{drop_db_if_exists, DatabaseConfig}, - logger, - spinner::Spinner, -}; -use xshell::Shell; - -use super::args::DatabaseCommonArgs; -use crate::{ - dals::{get_dals, Dal}, - messages::{ - msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_DROP_GERUND, - MSG_DATABASE_DROP_PAST, MSG_NO_DATABASES_SELECTED, - }, -}; - -pub async fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { - let args = args.parse(); - if args.selected_dals.none() { - logger::outro(MSG_NO_DATABASES_SELECTED); - return Ok(()); - } - - logger::info(msg_database_info(MSG_DATABASE_DROP_GERUND)); - - let dals = get_dals(shell, &args.selected_dals, &args.urls)?; - for dal in dals { - drop_database(dal).await?; - } - - logger::outro(msg_database_success(MSG_DATABASE_DROP_PAST)); - - Ok(()) -} - -pub async fn drop_database(dal: Dal) -> anyhow::Result<()> { - let spinner = Spinner::new(&msg_database_loading(MSG_DATABASE_DROP_GERUND, &dal.path)); - let db = DatabaseConfig::from_url(&dal.url)?; - drop_db_if_exists(&db).await?; - spinner.finish(); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/migrate.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/migrate.rs deleted file mode 100644 index 1d648965c244..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/migrate.rs +++ /dev/null @@ -1,54 +0,0 @@ -use std::path::Path; - -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::args::DatabaseCommonArgs; -use crate::{ - dals::{get_dals, Dal}, - messages::{ - msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_MIGRATE_GERUND, - MSG_DATABASE_MIGRATE_PAST, MSG_NO_DATABASES_SELECTED, - }, -}; - -pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { - let args = args.parse(); - if args.selected_dals.none() { - logger::outro(MSG_NO_DATABASES_SELECTED); - return Ok(()); - } - - logger::info(msg_database_info(MSG_DATABASE_MIGRATE_GERUND)); - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - let dals = get_dals(shell, &args.selected_dals, &args.urls)?; - for dal in dals { - migrate_database(shell, &ecosystem_config.link_to_code, dal)?; - } - - logger::outro(msg_database_success(MSG_DATABASE_MIGRATE_PAST)); - - Ok(()) -} - -fn migrate_database(shell: &Shell, link_to_code: impl AsRef, dal: Dal) -> anyhow::Result<()> { - let dir = link_to_code.as_ref().join(&dal.path); - let _dir_guard = shell.push_dir(dir); - let url = dal.url.as_str(); - - let spinner = Spinner::new(&msg_database_loading( - MSG_DATABASE_MIGRATE_GERUND, - &dal.path, - )); - Cmd::new(cmd!( - shell, - "cargo sqlx database create --database-url {url}" - )) - .run()?; - Cmd::new(cmd!(shell, "cargo sqlx migrate run --database-url {url}")).run()?; - spinner.finish(); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/mod.rs deleted file mode 100644 index 415b81879f1b..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/mod.rs +++ /dev/null @@ -1,48 +0,0 @@ -use clap::Subcommand; -use xshell::Shell; - -use self::args::{new_migration::DatabaseNewMigrationArgs, DatabaseCommonArgs}; -use crate::messages::{ - MSG_DATABASE_CHECK_SQLX_DATA_ABOUT, MSG_DATABASE_DROP_ABOUT, MSG_DATABASE_MIGRATE_ABOUT, - MSG_DATABASE_NEW_MIGRATION_ABOUT, MSG_DATABASE_PREPARE_ABOUT, MSG_DATABASE_RESET_ABOUT, - MSG_DATABASE_SETUP_ABOUT, -}; - -pub mod args; -mod check_sqlx_data; -mod drop; -mod migrate; -mod new_migration; -mod prepare; -pub mod reset; -mod setup; - -#[derive(Subcommand, Debug)] -pub enum DatabaseCommands { - #[clap(about = MSG_DATABASE_CHECK_SQLX_DATA_ABOUT)] - CheckSqlxData(DatabaseCommonArgs), - #[clap(about = MSG_DATABASE_DROP_ABOUT)] - Drop(DatabaseCommonArgs), - #[clap(about = MSG_DATABASE_MIGRATE_ABOUT)] - Migrate(DatabaseCommonArgs), - #[clap(about = MSG_DATABASE_NEW_MIGRATION_ABOUT)] - NewMigration(DatabaseNewMigrationArgs), - #[clap(about = MSG_DATABASE_PREPARE_ABOUT)] - Prepare(DatabaseCommonArgs), - #[clap(about = MSG_DATABASE_RESET_ABOUT)] - Reset(DatabaseCommonArgs), - #[clap(about = MSG_DATABASE_SETUP_ABOUT)] - Setup(DatabaseCommonArgs), -} - -pub async fn run(shell: &Shell, args: DatabaseCommands) -> anyhow::Result<()> { - match args { - DatabaseCommands::CheckSqlxData(args) => check_sqlx_data::run(shell, args), - DatabaseCommands::Drop(args) => drop::run(shell, args).await, - DatabaseCommands::Migrate(args) => migrate::run(shell, args), - DatabaseCommands::NewMigration(args) => new_migration::run(shell, args), - DatabaseCommands::Prepare(args) => prepare::run(shell, args), - DatabaseCommands::Reset(args) => reset::run(shell, args).await, - DatabaseCommands::Setup(args) => setup::run(shell, args), - } -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/new_migration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/new_migration.rs deleted file mode 100644 index e21b7cde47ba..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/new_migration.rs +++ /dev/null @@ -1,43 +0,0 @@ -use std::path::Path; - -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::args::new_migration::{DatabaseNewMigrationArgs, SelectedDatabase}; -use crate::{ - dals::{get_core_dal, get_prover_dal, Dal}, - messages::{msg_database_new_migration_loading, MSG_DATABASE_NEW_MIGRATION_SUCCESS}, -}; - -pub fn run(shell: &Shell, args: DatabaseNewMigrationArgs) -> anyhow::Result<()> { - let args = args.fill_values_with_prompt(); - - let dal = match args.selected_database { - SelectedDatabase::Core => get_core_dal(shell, None)?, - SelectedDatabase::Prover => get_prover_dal(shell, None)?, - }; - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - generate_migration(shell, ecosystem_config.link_to_code, dal, args.name)?; - - logger::outro(MSG_DATABASE_NEW_MIGRATION_SUCCESS); - - Ok(()) -} - -fn generate_migration( - shell: &Shell, - link_to_code: impl AsRef, - dal: Dal, - name: String, -) -> anyhow::Result<()> { - let dir = link_to_code.as_ref().join(&dal.path); - let _dir_guard = shell.push_dir(dir); - - let spinner = Spinner::new(&msg_database_new_migration_loading(&dal.path)); - Cmd::new(cmd!(shell, "cargo sqlx migrate add -r {name}")).run()?; - spinner.finish(); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/prepare.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/prepare.rs deleted file mode 100644 index 82ec12f94129..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/prepare.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::path::Path; - -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::args::DatabaseCommonArgs; -use crate::{ - dals::{get_dals, Dal}, - messages::{ - msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_PREPARE_GERUND, - MSG_DATABASE_PREPARE_PAST, MSG_NO_DATABASES_SELECTED, - }, -}; - -pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { - let args = args.parse(); - if args.selected_dals.none() { - logger::outro(MSG_NO_DATABASES_SELECTED); - return Ok(()); - } - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - logger::info(msg_database_info(MSG_DATABASE_PREPARE_GERUND)); - - let dals = get_dals(shell, &args.selected_dals, &args.urls)?; - for dal in dals { - prepare_sqlx_data(shell, &ecosystem_config.link_to_code, dal)?; - } - - logger::outro(msg_database_success(MSG_DATABASE_PREPARE_PAST)); - - Ok(()) -} - -pub fn prepare_sqlx_data( - shell: &Shell, - link_to_code: impl AsRef, - dal: Dal, -) -> anyhow::Result<()> { - let dir = link_to_code.as_ref().join(&dal.path); - let _dir_guard = shell.push_dir(dir); - let url = dal.url.as_str(); - - let spinner = Spinner::new(&msg_database_loading( - MSG_DATABASE_PREPARE_GERUND, - &dal.path, - )); - Cmd::new(cmd!( - shell, - "cargo sqlx prepare --database-url {url} -- --tests" - )) - .run()?; - spinner.finish(); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs deleted file mode 100644 index f0262cecb959..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs +++ /dev/null @@ -1,46 +0,0 @@ -use std::path::Path; - -use common::logger; -use config::EcosystemConfig; -use xshell::Shell; - -use super::{args::DatabaseCommonArgs, drop::drop_database, setup::setup_database}; -use crate::{ - dals::{get_dals, Dal}, - messages::{ - msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_RESET_GERUND, - MSG_DATABASE_RESET_PAST, MSG_NO_DATABASES_SELECTED, - }, -}; - -pub async fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { - let args = args.parse(); - if args.selected_dals.none() { - logger::outro(MSG_NO_DATABASES_SELECTED); - return Ok(()); - } - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - logger::info(msg_database_info(MSG_DATABASE_RESET_GERUND)); - - let dals = get_dals(shell, &args.selected_dals, &args.urls)?; - for dal in dals { - logger::info(msg_database_loading(MSG_DATABASE_RESET_GERUND, &dal.path)); - reset_database(shell, ecosystem_config.link_to_code.clone(), dal).await?; - } - - logger::outro(msg_database_success(MSG_DATABASE_RESET_PAST)); - - Ok(()) -} - -pub async fn reset_database( - shell: &Shell, - link_to_code: impl AsRef, - dal: Dal, -) -> anyhow::Result<()> { - drop_database(dal.clone()).await?; - setup_database(shell, link_to_code, dal)?; - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/setup.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/setup.rs deleted file mode 100644 index 15b3ac5c1c72..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/setup.rs +++ /dev/null @@ -1,56 +0,0 @@ -use std::path::Path; - -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::args::DatabaseCommonArgs; -use crate::{ - dals::{get_dals, Dal}, - messages::{ - msg_database_info, msg_database_loading, msg_database_success, MSG_DATABASE_SETUP_GERUND, - MSG_DATABASE_SETUP_PAST, MSG_NO_DATABASES_SELECTED, - }, -}; - -pub fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> { - let args = args.parse(); - if args.selected_dals.none() { - logger::outro(MSG_NO_DATABASES_SELECTED); - return Ok(()); - } - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - logger::info(msg_database_info(MSG_DATABASE_SETUP_GERUND)); - - let dals = get_dals(shell, &args.selected_dals, &args.urls)?; - for dal in dals { - setup_database(shell, &ecosystem_config.link_to_code, dal)?; - } - - logger::outro(msg_database_success(MSG_DATABASE_SETUP_PAST)); - - Ok(()) -} - -pub fn setup_database( - shell: &Shell, - link_to_code: impl AsRef, - dal: Dal, -) -> anyhow::Result<()> { - let dir = link_to_code.as_ref().join(&dal.path); - let _dir_guard = shell.push_dir(dir); - let url = dal.url.as_str(); - - let spinner = Spinner::new(&msg_database_loading(MSG_DATABASE_SETUP_GERUND, &dal.path)); - Cmd::new(cmd!( - shell, - "cargo sqlx database create --database-url {url}" - )) - .run()?; - Cmd::new(cmd!(shell, "cargo sqlx migrate run --database-url {url}")).run()?; - spinner.finish(); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs b/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs deleted file mode 100644 index 3aefc15aba79..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs +++ /dev/null @@ -1,129 +0,0 @@ -use std::path::PathBuf; - -use clap::Parser; -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::sql_fmt::format_sql; -use crate::{ - commands::lint_utils::{get_unignored_files, Target}, - messages::{ - msg_running_fmt_for_extension_spinner, msg_running_fmt_for_extensions_spinner, - msg_running_rustfmt_for_dir_spinner, MSG_RUNNING_CONTRACTS_FMT_SPINNER, - }, -}; - -async fn prettier(shell: Shell, target: Target, check: bool) -> anyhow::Result<()> { - let spinner = Spinner::new(&msg_running_fmt_for_extension_spinner(target)); - let files = get_unignored_files(&shell, &target, None)?; - - if files.is_empty() { - logger::info(format!("No files for {target} found")); - return Ok(()); - } - - spinner.freeze(); - let mode = if check { "--check" } else { "--write" }; - let config = format!("etc/prettier-config/{target}.js"); - Ok( - Cmd::new(cmd!(shell, "yarn --silent prettier {mode} --config {config}").args(files)) - .run()?, - ) -} - -async fn prettier_contracts(shell: Shell, check: bool) -> anyhow::Result<()> { - let spinner = Spinner::new(MSG_RUNNING_CONTRACTS_FMT_SPINNER); - spinner.freeze(); - let prettier_command = cmd!(shell, "yarn --silent --cwd contracts") - .arg(format!("prettier:{}", if check { "check" } else { "fix" })); - - Ok(Cmd::new(prettier_command).run()?) -} - -async fn rustfmt(shell: Shell, check: bool, link_to_code: PathBuf) -> anyhow::Result<()> { - for dir in [".", "prover", "zk_toolbox"] { - let spinner = Spinner::new(&msg_running_rustfmt_for_dir_spinner(dir)); - let _dir = shell.push_dir(link_to_code.join(dir)); - let mut cmd = cmd!(shell, "cargo fmt -- --config imports_granularity=Crate --config group_imports=StdExternalCrate"); - if check { - cmd = cmd.arg("--check"); - } - spinner.freeze(); - Cmd::new(cmd).run()?; - } - Ok(()) -} - -async fn run_all_rust_formatters( - shell: Shell, - check: bool, - link_to_code: PathBuf, -) -> anyhow::Result<()> { - format_sql(shell.clone(), check).await?; - rustfmt(shell.clone(), check, link_to_code).await?; - Ok(()) -} - -#[derive(Debug, Parser)] -pub enum Formatter { - Rustfmt, - Contract, - Prettier { - #[arg(short, long)] - targets: Vec, - }, -} - -#[derive(Debug, Parser)] -pub struct FmtArgs { - #[clap(long, short = 'c')] - pub check: bool, - #[clap(subcommand)] - pub formatter: Option, -} - -pub async fn run(shell: Shell, args: FmtArgs) -> anyhow::Result<()> { - let ecosystem = EcosystemConfig::from_file(&shell)?; - match args.formatter { - None => { - let mut tasks = vec![]; - let extensions: Vec<_> = vec![Target::Js, Target::Ts, Target::Md, Target::Sol]; - let spinner = Spinner::new(&msg_running_fmt_for_extensions_spinner(&extensions)); - spinner.freeze(); - for ext in extensions { - tasks.push(tokio::spawn(prettier(shell.clone(), ext, args.check))); - } - tasks.push(tokio::spawn(run_all_rust_formatters( - shell.clone(), - args.check, - ecosystem.link_to_code, - ))); - tasks.push(tokio::spawn(prettier_contracts(shell.clone(), args.check))); - - futures::future::join_all(tasks) - .await - .iter() - .for_each(|res| { - if let Err(err) = res { - logger::error(err) - } - }); - } - Some(Formatter::Prettier { mut targets }) => { - if targets.is_empty() { - targets = vec![Target::Js, Target::Ts, Target::Md, Target::Sol]; - } - let spinner = Spinner::new(&msg_running_fmt_for_extensions_spinner(&targets)); - for target in targets { - prettier(shell.clone(), target, args.check).await? - } - spinner.finish() - } - Some(Formatter::Rustfmt) => { - run_all_rust_formatters(shell.clone(), args.check, ".".into()).await? - } - Some(Formatter::Contract) => prettier_contracts(shell.clone(), args.check).await?, - } - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs b/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs deleted file mode 100644 index 45a7a46ebbe0..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs +++ /dev/null @@ -1,135 +0,0 @@ -use clap::Parser; -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use crate::{ - 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, - }, -}; - -const CONFIG_PATH: &str = "etc/lint-config"; - -#[derive(Debug, Parser)] -pub struct LintArgs { - #[clap(long, short = 'c')] - pub check: bool, - #[clap(long, short = 't')] - pub targets: Vec, -} - -pub fn run(shell: &Shell, args: LintArgs) -> anyhow::Result<()> { - let targets = if args.targets.is_empty() { - vec![ - Target::Rs, - Target::Md, - Target::Sol, - Target::Js, - Target::Ts, - Target::Contracts, - ] - } else { - args.targets.clone() - }; - - logger::info(msg_running_linters_for_files(&targets)); - - let ecosystem = EcosystemConfig::from_file(shell)?; - - for target in targets { - match target { - Target::Rs => lint_rs(shell, &ecosystem, args.check)?, - Target::Contracts => lint_contracts(shell, &ecosystem, args.check)?, - ext => lint(shell, &ecosystem, &ext, args.check)?, - } - } - - Ok(()) -} - -fn lint_rs(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> anyhow::Result<()> { - let spinner = Spinner::new(&msg_running_linter_for_extension_spinner(&Target::Rs)); - - let link_to_code = &ecosystem.link_to_code; - let lint_to_prover = &ecosystem.link_to_code.join("prover"); - let link_to_toolbox = &ecosystem.link_to_code.join("zk_toolbox"); - let paths = vec![link_to_code, lint_to_prover, link_to_toolbox]; - - spinner.freeze(); - for path in paths { - let _dir_guard = shell.push_dir(path); - let mut cmd = cmd!(shell, "cargo clippy"); - let common_args = &["--locked", "--", "-D", "warnings"]; - if !check { - cmd = cmd.args(&["--fix", "--allow-dirty"]); - } - cmd = cmd.args(common_args); - Cmd::new(cmd).with_force_run().run()?; - } - - Ok(()) -} - -fn get_linter(target: &Target) -> Vec { - match target { - Target::Rs => vec!["cargo".to_string(), "clippy".to_string()], - Target::Md => vec!["markdownlint".to_string()], - Target::Sol => vec!["solhint".to_string()], - Target::Js => vec!["eslint".to_string()], - Target::Ts => vec!["eslint".to_string(), "--ext".to_string(), "ts".to_string()], - Target::Contracts => vec![], - } -} - -fn lint( - shell: &Shell, - ecosystem: &EcosystemConfig, - target: &Target, - check: bool, -) -> anyhow::Result<()> { - let spinner = Spinner::new(&msg_running_linter_for_extension_spinner(target)); - let _dir_guard = shell.push_dir(&ecosystem.link_to_code); - let files = get_unignored_files(shell, target, None)?; - let cmd = cmd!(shell, "yarn"); - let config_path = ecosystem.link_to_code.join(CONFIG_PATH); - let config_path = config_path.join(format!("{}.js", target)); - let config_path = config_path - .to_str() - .expect(MSG_LINT_CONFIG_PATH_ERR) - .to_string(); - - let linter = get_linter(target); - - let fix_option = if check { - vec![] - } else { - vec!["--fix".to_string()] - }; - - let args = [ - linter.as_slice(), - &fix_option, - &["--config".to_string(), config_path], - files.as_slice(), - ] - .concat(); - - Cmd::new(cmd.args(&args)).run()?; - spinner.finish(); - Ok(()) -} - -fn lint_contracts(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> anyhow::Result<()> { - let spinner = Spinner::new(MSG_RUNNING_CONTRACTS_LINTER_SPINNER); - let _dir_guard = shell.push_dir(&ecosystem.link_to_code); - let cmd = cmd!(shell, "yarn"); - let linter = if check { "lint:check" } else { "lint:fix" }; - let args = ["--cwd", "contracts", linter]; - Cmd::new(cmd.args(&args)).run()?; - spinner.finish(); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs b/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs deleted file mode 100644 index 9095e445384b..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs +++ /dev/null @@ -1,55 +0,0 @@ -use clap::ValueEnum; -use serde::{Deserialize, Serialize}; -use strum::EnumIter; -use xshell::{cmd, Shell}; - -const IGNORE_FILE: &str = "etc/lint-config/ignore.yaml"; - -#[derive(Debug, ValueEnum, EnumIter, strum::Display, PartialEq, Eq, Clone, Copy)] -#[strum(serialize_all = "lowercase")] -pub enum Target { - Md, - Sol, - Js, - Ts, - Rs, - Contracts, -} - -#[derive(Deserialize, Serialize, Debug)] -pub struct IgnoredData { - pub files: Vec, - pub dirs: Vec, -} - -impl IgnoredData { - pub fn merge(&mut self, other: &IgnoredData) { - self.files.extend(other.files.clone()); - self.dirs.extend(other.dirs.clone()); - } -} - -pub fn get_unignored_files( - shell: &Shell, - target: &Target, - ignored_data: Option, -) -> anyhow::Result> { - let mut files = Vec::new(); - let mut ignored_files: IgnoredData = serde_yaml::from_str(&shell.read_file(IGNORE_FILE)?)?; - if let Some(ignored_data) = ignored_data { - ignored_files.merge(&ignored_data); - } - let output = cmd!(shell, "git ls-files --recurse-submodules").read()?; - - for line in output.lines() { - let path = line.to_string(); - if !ignored_files.dirs.iter().any(|dir| path.contains(dir)) - && !ignored_files.files.contains(&path) - && path.ends_with(&format!(".{}", target)) - { - files.push(path); - } - } - - Ok(files) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs deleted file mode 100644 index 38ec586e7451..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub mod clean; -pub mod config_writer; -pub mod contracts; -pub mod database; -pub mod fmt; -pub mod lint; -pub(crate) mod lint_utils; -pub mod prover; -pub mod send_transactions; -pub mod snapshot; -pub(crate) mod sql_fmt; -pub mod test; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs deleted file mode 100644 index e837bbe9eb86..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs +++ /dev/null @@ -1,40 +0,0 @@ -use clap::Parser; - -#[derive(Debug, Parser)] -pub struct InsertBatchArgs { - #[clap(long)] - pub number: Option, - #[clap(long, default_value = "false")] - pub default: bool, - #[clap(long)] - pub version: Option, -} - -#[derive(Debug)] -pub struct InsertBatchArgsFinal { - pub number: u32, - pub version: String, -} - -impl InsertBatchArgs { - pub(crate) fn fill_values_with_prompts(self, era_version: String) -> InsertBatchArgsFinal { - let number = self.number.unwrap_or_else(|| { - common::Prompt::new("Enter the number of the batch to insert").ask() - }); - - if self.default { - return InsertBatchArgsFinal { - number, - version: era_version, - }; - } - - let version = self.version.unwrap_or_else(|| { - common::Prompt::new("Enter the version of the batch to insert") - .default(&era_version) - .ask() - }); - - InsertBatchArgsFinal { number, version } - } -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs deleted file mode 100644 index 97e60fb38f8c..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs +++ /dev/null @@ -1,49 +0,0 @@ -use clap::Parser; - -#[derive(Debug, Parser)] -pub struct InsertVersionArgs { - #[clap(long, default_value = "false")] - pub default: bool, - #[clap(long)] - pub version: Option, - #[clap(long)] - pub snark_wrapper: Option, -} - -#[derive(Debug)] -pub struct InsertVersionArgsFinal { - pub snark_wrapper: String, - pub version: String, -} - -impl InsertVersionArgs { - pub(crate) fn fill_values_with_prompts( - self, - era_version: String, - snark_wrapper: String, - ) -> InsertVersionArgsFinal { - if self.default { - return InsertVersionArgsFinal { - snark_wrapper, - version: era_version, - }; - } - - let version = self.version.unwrap_or_else(|| { - common::Prompt::new("Enter the version of the protocol to insert") - .default(&era_version) - .ask() - }); - - let snark_wrapper = self.snark_wrapper.unwrap_or_else(|| { - common::Prompt::new("Enter the snark wrapper of the protocol to insert") - .default(&snark_wrapper) - .ask() - }); - - InsertVersionArgsFinal { - snark_wrapper, - version, - } - } -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs deleted file mode 100644 index 0984546136c9..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod insert_batch; -pub mod insert_version; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs deleted file mode 100644 index 441edb2c4b2d..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs +++ /dev/null @@ -1,95 +0,0 @@ -use std::{ - fs, - path::{Path, PathBuf}, -}; - -use anyhow::Context as _; -use common::logger; -use config::{ChainConfig, EcosystemConfig}; -use xshell::{cmd, Shell}; - -use crate::messages::MSG_CHAIN_NOT_FOUND_ERR; - -pub async fn run(shell: &Shell) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let chain_config = ecosystem_config - .load_current_chain() - .expect(MSG_CHAIN_NOT_FOUND_ERR); - - let link_to_code = ecosystem_config.link_to_code; - let link_to_prover = link_to_code.join("prover"); - - let protocol_version = get_protocol_version(shell, &link_to_prover).await?; - let snark_wrapper = get_snark_wrapper(&link_to_prover).await?; - let prover_url = get_database_url(&chain_config).await?; - - logger::info(format!( - " -=============================== \n -Current prover setup information: \n -Protocol version: {} \n -Snark wrapper: {} \n -Database URL: {}\n -===============================", - protocol_version, snark_wrapper, prover_url - )); - - Ok(()) -} - -pub(crate) async fn get_protocol_version( - shell: &Shell, - link_to_prover: &PathBuf, -) -> anyhow::Result { - shell.change_dir(link_to_prover); - let protocol_version = cmd!(shell, "cargo run --release --bin prover_version").read()?; - - Ok(protocol_version) -} - -pub(crate) async fn get_snark_wrapper(link_to_prover: &Path) -> anyhow::Result { - let path = link_to_prover.join("data/keys/commitments.json"); - let file = fs::File::open(path).expect("Could not find commitments file in zksync-era"); - let json: serde_json::Value = - serde_json::from_reader(file).expect("Could not parse commitments.json"); - - let snark_wrapper = json - .get("snark_wrapper") - .expect("Could not find snark_wrapper in commitments.json"); - - let mut snark_wrapper = snark_wrapper.to_string(); - snark_wrapper.pop(); - snark_wrapper.remove(0); - - Ok(snark_wrapper) -} - -pub(crate) async fn get_database_url(chain: &ChainConfig) -> anyhow::Result { - let prover_url = chain - .get_secrets_config()? - .database - .context("Database secrets not found")? - .prover_url()? - .expose_url() - .to_string(); - Ok(prover_url) -} - -pub fn parse_version(version: &str) -> anyhow::Result<(&str, &str)> { - let splitted: Vec<&str> = version.split(".").collect(); - - assert_eq!(splitted.len(), 3, "Invalid version format"); - assert_eq!(splitted[0], "0", "Invalid major version, expected 0"); - - splitted[1] - .parse::() - .context("Could not parse minor version")?; - splitted[2] - .parse::() - .context("Could not parse patch version")?; - - let minor = splitted[1]; - let patch = splitted[2]; - - Ok((minor, patch)) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs deleted file mode 100644 index 8c2cdd4d88dd..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs +++ /dev/null @@ -1,44 +0,0 @@ -use common::{check_prerequisites, cmd::Cmd, logger, PROVER_CLI_PREREQUISITE}; -use config::{get_link_to_prover, EcosystemConfig}; -use xshell::{cmd, Shell}; - -use crate::{ - commands::prover::{ - args::insert_batch::{InsertBatchArgs, InsertBatchArgsFinal}, - info, - }, - messages::MSG_CHAIN_NOT_FOUND_ERR, -}; - -pub async fn run(shell: &Shell, args: InsertBatchArgs) -> anyhow::Result<()> { - check_prerequisites(shell, &PROVER_CLI_PREREQUISITE, false); - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let chain_config = ecosystem_config - .load_current_chain() - .expect(MSG_CHAIN_NOT_FOUND_ERR); - - let version = info::get_protocol_version(shell, &get_link_to_prover(&ecosystem_config)).await?; - let prover_url = info::get_database_url(&chain_config).await?; - - let InsertBatchArgsFinal { number, version } = args.fill_values_with_prompts(version); - - let (minor, patch) = info::parse_version(&version)?; - - logger::info(format!( - "Inserting protocol version {}, batch number {} into the database", - version, number - )); - - let number = number.to_string(); - - let cmd = Cmd::new(cmd!( - shell, - "prover_cli {prover_url} insert-batch --version={minor} --patch={patch} --number={number}" - )); - cmd.run()?; - - logger::info("Done."); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs deleted file mode 100644 index 3dd9b7e0a1b1..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs +++ /dev/null @@ -1,44 +0,0 @@ -use common::{check_prerequisites, cmd::Cmd, logger, PROVER_CLI_PREREQUISITE}; -use config::{get_link_to_prover, EcosystemConfig}; -use xshell::{cmd, Shell}; - -use crate::{ - commands::prover::{ - args::insert_version::{InsertVersionArgs, InsertVersionArgsFinal}, - info, - }, - messages::MSG_CHAIN_NOT_FOUND_ERR, -}; - -pub async fn run(shell: &Shell, args: InsertVersionArgs) -> anyhow::Result<()> { - check_prerequisites(shell, &PROVER_CLI_PREREQUISITE, false); - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let chain_config = ecosystem_config - .load_current_chain() - .expect(MSG_CHAIN_NOT_FOUND_ERR); - - let version = info::get_protocol_version(shell, &get_link_to_prover(&ecosystem_config)).await?; - let snark_wrapper = info::get_snark_wrapper(&get_link_to_prover(&ecosystem_config)).await?; - - let prover_url = info::get_database_url(&chain_config).await?; - - let InsertVersionArgsFinal { - version, - snark_wrapper, - } = args.fill_values_with_prompts(version, snark_wrapper); - - let (minor, patch) = info::parse_version(&version)?; - - logger::info(format!( - "Inserting protocol version {}, snark wrapper {} into the database", - version, snark_wrapper - )); - - let cmd = Cmd::new(cmd!(shell, "prover_cli {prover_url} insert-version --version={minor} --patch={patch} --snark-wrapper={snark_wrapper}")); - cmd.run()?; - - logger::info("Done."); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs deleted file mode 100644 index 364f8fe93efc..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs +++ /dev/null @@ -1,22 +0,0 @@ -use clap::Subcommand; -use xshell::Shell; - -mod args; -pub mod info; -pub mod insert_batch; -pub mod insert_version; - -#[derive(Subcommand, Debug)] -pub enum ProverCommands { - Info, - InsertBatch(args::insert_batch::InsertBatchArgs), - InsertVersion(args::insert_version::InsertVersionArgs), -} - -pub async fn run(shell: &Shell, args: ProverCommands) -> anyhow::Result<()> { - match args { - ProverCommands::Info => info::run(shell).await, - ProverCommands::InsertBatch(args) => insert_batch::run(shell, args).await, - ProverCommands::InsertVersion(args) => insert_version::run(shell, args).await, - } -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/args/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/args/mod.rs deleted file mode 100644 index e3d4f220ff28..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/args/mod.rs +++ /dev/null @@ -1,69 +0,0 @@ -use std::path::PathBuf; - -use clap::Parser; -use common::Prompt; -use url::Url; - -use crate::{ - defaults::LOCAL_RPC_URL, - messages::{ - MSG_INVALID_L1_RPC_URL_ERR, MSG_PROMPT_L1_RPC_URL, MSG_PROMPT_SECRET_KEY, - MSG_PROMPT_TRANSACTION_FILE, - }, -}; - -const DEFAULT_TRANSACTION_CONFIRMATIONS: usize = 2; - -#[derive(Debug, Parser)] -pub struct SendTransactionsArgs { - #[clap(long)] - pub file: Option, - #[clap(long)] - pub private_key: Option, - #[clap(long)] - pub l1_rpc_url: Option, - #[clap(long)] - pub confirmations: Option, -} - -#[derive(Debug)] -pub struct SendTransactionsArgsFinal { - pub file: PathBuf, - pub private_key: String, - pub l1_rpc_url: String, - pub confirmations: usize, -} - -impl SendTransactionsArgs { - pub fn fill_values_with_prompt(self) -> SendTransactionsArgsFinal { - let file = self - .file - .unwrap_or_else(|| Prompt::new(MSG_PROMPT_TRANSACTION_FILE).ask()); - - let private_key = self - .private_key - .unwrap_or_else(|| Prompt::new(MSG_PROMPT_SECRET_KEY).ask()); - - let l1_rpc_url = self.l1_rpc_url.unwrap_or_else(|| { - Prompt::new(MSG_PROMPT_L1_RPC_URL) - .default(LOCAL_RPC_URL) - .validate_with(|val: &String| -> Result<(), String> { - Url::parse(val) - .map(|_| ()) - .map_err(|_| MSG_INVALID_L1_RPC_URL_ERR.to_string()) - }) - .ask() - }); - - let confirmations = self - .confirmations - .unwrap_or(DEFAULT_TRANSACTION_CONFIRMATIONS); - - SendTransactionsArgsFinal { - file, - private_key, - l1_rpc_url, - confirmations, - } - } -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/mod.rs deleted file mode 100644 index 79d8efc600e8..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/send_transactions/mod.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{ - fs::{File, OpenOptions}, - io::{Read, Write}, - ops::Add, - path::PathBuf, - time::Duration, -}; - -use anyhow::Context; -use args::SendTransactionsArgs; -use chrono::Local; -use common::{ethereum::create_ethers_client, logger}; -use config::EcosystemConfig; -use ethers::{abi::Bytes, providers::Middleware, types::TransactionRequest, utils::hex}; -use serde::Deserialize; -use tokio::time::sleep; -use xshell::Shell; -use zksync_basic_types::{H160, U256}; - -use crate::{ - consts::DEFAULT_UNSIGNED_TRANSACTIONS_DIR, - messages::{ - msg_send_txns_outro, MSG_FAILED_TO_SEND_TXN_ERR, MSG_UNABLE_TO_OPEN_FILE_ERR, - MSG_UNABLE_TO_READ_FILE_ERR, MSG_UNABLE_TO_READ_PARSE_JSON_ERR, - MSG_UNABLE_TO_WRITE_FILE_ERR, - }, -}; - -pub mod args; - -const MAX_ATTEMPTS: u32 = 3; - -#[derive(Deserialize)] -struct Transaction { - from: String, - gas: String, - input: String, -} - -#[derive(Deserialize)] -struct Txn { - #[serde(rename = "contractAddress")] - contract_address: String, - transaction: Transaction, -} - -#[derive(Deserialize)] -struct Txns { - transactions: Vec, -} - -pub async fn run(shell: &Shell, args: SendTransactionsArgs) -> anyhow::Result<()> { - let args = args.fill_values_with_prompt(); - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let chain_id = ecosystem_config.l1_network.chain_id(); - - // Read the JSON file - let mut file = File::open(args.file).context(MSG_UNABLE_TO_OPEN_FILE_ERR)?; - let mut data = String::new(); - file.read_to_string(&mut data) - .context(MSG_UNABLE_TO_READ_FILE_ERR)?; - - // Parse the JSON file - let txns: Txns = serde_json::from_str(&data).context(MSG_UNABLE_TO_READ_PARSE_JSON_ERR)?; - - let timestamp = Local::now().format("%Y%m%d_%H%M%S").to_string(); - let log_file = ecosystem_config - .link_to_code - .join(DEFAULT_UNSIGNED_TRANSACTIONS_DIR) - .join(format!("{}_receipt.log", timestamp)); - - let client = create_ethers_client(args.private_key.parse()?, args.l1_rpc_url, Some(chain_id))?; - let mut nonce = client.get_transaction_count(client.address(), None).await?; - let gas_price = client.get_gas_price().await?; - - for txn in txns.transactions { - let to: H160 = txn.contract_address.parse()?; - let from: H160 = txn.transaction.from.parse()?; - let gas_limit: U256 = txn.transaction.gas.parse()?; - let input_data: Bytes = hex::decode(txn.transaction.input)?; - - let tx = TransactionRequest::new() - .to(to) - .from(from) - .gas(gas_limit) - .gas_price(gas_price) - .nonce(nonce) - .data(input_data) - .chain_id(chain_id); - - nonce = nonce.add(1); - - let mut attempts = 0; - let receipt = loop { - attempts += 1; - match client - .send_transaction(tx.clone(), None) - .await? - .confirmations(args.confirmations) - .interval(Duration::from_millis(30)) - .await - { - Ok(receipt) => break receipt, - Err(e) if attempts < MAX_ATTEMPTS => { - logger::info(format!("Attempt {} failed: {:?}", attempts, e).as_str()); - sleep(Duration::from_secs(1)).await; - continue; - } - Err(e) => return Err(e).context(MSG_FAILED_TO_SEND_TXN_ERR)?, - } - }; - - log_receipt(&log_file, format!("{:?}", receipt).as_str())?; - } - - logger::outro(msg_send_txns_outro(log_file.to_string_lossy().as_ref())); - - Ok(()) -} - -fn log_receipt(path: &PathBuf, receipt: &str) -> anyhow::Result<()> { - let mut file = OpenOptions::new() - .append(true) - .create(true) - .open(path) - .context(MSG_UNABLE_TO_OPEN_FILE_ERR)?; - - writeln!(file, "{}", receipt).context(MSG_UNABLE_TO_WRITE_FILE_ERR)?; - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/snapshot.rs b/zk_toolbox/crates/zk_supervisor/src/commands/snapshot.rs deleted file mode 100644 index 608c56233348..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/snapshot.rs +++ /dev/null @@ -1,40 +0,0 @@ -use anyhow::Context; -use clap::Subcommand; -use common::{cmd::Cmd, logger}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use crate::messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_RUNNING_SNAPSHOT_CREATOR}; - -#[derive(Subcommand, Debug)] -pub enum SnapshotCommands { - Create, -} - -pub(crate) async fn run(shell: &Shell, args: SnapshotCommands) -> anyhow::Result<()> { - match args { - SnapshotCommands::Create => { - create(shell).await?; - } - } - - Ok(()) -} - -async fn create(shell: &Shell) -> anyhow::Result<()> { - let ecosystem = EcosystemConfig::from_file(shell)?; - let chain = ecosystem - .load_current_chain() - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - - let config_path = chain.path_to_general_config(); - let secrets_path = chain.path_to_secrets_config(); - - logger::info(MSG_RUNNING_SNAPSHOT_CREATOR); - - let mut cmd = Cmd::new(cmd!(shell, "cargo run --bin snapshots_creator --release -- --config-path={config_path} --secrets-path={secrets_path}")) - .env("RUST_LOG", "snapshots_creator=debug"); - - cmd = cmd.with_force_run(); - cmd.run().context("Snapshot") -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs b/zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs deleted file mode 100644 index ede2500e6ab6..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs +++ /dev/null @@ -1,149 +0,0 @@ -use std::mem::take; - -use anyhow::{bail, Result}; -use common::spinner::Spinner; -use sqruff_lib::{api::simple::get_simple_config, core::linter::core::Linter}; -use xshell::Shell; - -use super::lint_utils::{get_unignored_files, IgnoredData, Target}; -use crate::messages::{msg_file_is_not_formatted, MSG_RUNNING_SQL_FMT_SPINNER}; - -fn format_query(query: &str) -> anyhow::Result { - let exclude_rules = vec!["LT12".to_string()]; // avoid adding newline before `$` character - let cfg = get_simple_config(Some("postgres".into()), None, Some(exclude_rules), None).unwrap(); - let mut linter = Linter::new(cfg, None, None); - let mut result = linter.lint_string_wrapped(query, None, true); - let formatted_query = take(&mut result.paths[0].files[0]).fix_string(); - // Remove first empty line - let formatted_query = formatted_query - .lines() - .skip(1) - .collect::>() - .join("\n"); - - Ok(formatted_query) -} - -fn extract_query_from_rust_string(query: &str, is_raw: bool) -> String { - let mut query = query.trim().to_string(); - if query.ends_with(',') { - query.pop(); - } - // Removing quotes - if !is_raw { - query = query[1..query.len() - 1].to_string(); - } else { - query = query[3..query.len() - 2].to_string(); - } - - // Remove all escape characters - if !is_raw { - query = query.replace(r#"\""#, "\""); - } - - query -} - -fn embed_text_inside_rust_string(query: &str) -> String { - format!("r#\"\n{}\n\"#", query) -} - -fn add_indent(query: &str, indent: usize) -> String { - query - .lines() - .map(|line| format!("{:indent$}{}", "", line)) - .collect::>() - .join("\n") -} - -fn format_rust_string_query(query: &str, is_raw: bool) -> anyhow::Result { - let base_indent = query.find(|c: char| !c.is_whitespace()).unwrap_or(0); - let raw_query = extract_query_from_rust_string(query, is_raw); - let formatted_query = format_query(&raw_query)?; - let reconstructed_rust_string = embed_text_inside_rust_string(&formatted_query); - Ok(add_indent(&reconstructed_rust_string, base_indent)) -} - -fn fmt_file(shell: &Shell, file_path: &str, check: bool) -> Result<()> { - let content = shell.read_file(file_path)?; - let mut modified_file = String::new(); - - let mut lines_to_query: Option = None; - let mut is_inside_query = false; - let mut is_raw_string = false; - let mut built_query = String::new(); - - for line in content.lines() { - if line.ends_with("sqlx::query!(") { - lines_to_query = Some(1); - is_raw_string = false; - built_query.clear(); - } else if line.ends_with("sqlx::query_as!(") { - lines_to_query = Some(2); - is_raw_string = false; - built_query.clear(); - } - - if let Some(ref mut count) = lines_to_query { - if *count == 0 { - is_inside_query = true; - lines_to_query = None; - if line.contains("r#\"") { - is_raw_string = true; - } - } else { - *count -= 1; - } - } - - if is_inside_query { - let query_not_empty = !built_query.is_empty() || line.trim().len() > 1; - let raw_string_query_ended = line.ends_with("\"#,") || line.ends_with("\"#"); - let regular_string_query_ended = - (line.ends_with("\",") || line.ends_with('"')) && query_not_empty; - built_query.push_str(line); - built_query.push('\n'); - - let line_end_is_not_escape = !line.ends_with("\\\"") && !line.ends_with("\\\","); - if (is_raw_string && raw_string_query_ended) - || (!is_raw_string && regular_string_query_ended && line_end_is_not_escape) - { - is_inside_query = false; - let ended_with_comma = built_query.trim_end().ends_with(','); - modified_file - .push_str(format_rust_string_query(&built_query, is_raw_string)?.trim_end()); - if ended_with_comma { - modified_file.push(','); - } - modified_file.push('\n'); - } - } else { - modified_file.push_str(line); - modified_file.push('\n'); - } - } - - if content != modified_file { - if check { - bail!(msg_file_is_not_formatted(file_path)); - } else { - shell.write_file(file_path, &modified_file)?; - } - } - - Ok(()) -} - -pub async fn format_sql(shell: Shell, check: bool) -> anyhow::Result<()> { - let spinner = Spinner::new(MSG_RUNNING_SQL_FMT_SPINNER); - let ignored_data = Some(IgnoredData { - files: vec![], - dirs: vec!["zk_toolbox".to_string()], - }); - let rust_files = get_unignored_files(&shell, &Target::Rs, ignored_data)?; - for file in rust_files { - fmt_file(&shell, &file, check)?; - } - spinner.finish(); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/fees.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/fees.rs deleted file mode 100644 index 1337566e5369..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/fees.rs +++ /dev/null @@ -1,12 +0,0 @@ -use clap::Parser; -use serde::{Deserialize, Serialize}; - -use crate::messages::{MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP}; - -#[derive(Debug, Serialize, Deserialize, Parser)] -pub struct FeesArgs { - #[clap(short, long, help = MSG_NO_DEPS_HELP)] - pub no_deps: bool, - #[clap(short, long, help = MSG_NO_KILL_HELP)] - pub no_kill: bool, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs deleted file mode 100644 index 435dddfc360c..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs +++ /dev/null @@ -1,14 +0,0 @@ -use clap::Parser; -use serde::{Deserialize, Serialize}; - -use crate::messages::{MSG_NO_DEPS_HELP, MSG_TESTS_EXTERNAL_NODE_HELP, MSG_TEST_PATTERN_HELP}; - -#[derive(Debug, Serialize, Deserialize, Parser)] -pub struct IntegrationArgs { - #[clap(short, long, help = MSG_TESTS_EXTERNAL_NODE_HELP)] - pub external_node: bool, - #[clap(short, long, help = MSG_NO_DEPS_HELP)] - pub no_deps: bool, - #[clap(short, long, help = MSG_TEST_PATTERN_HELP)] - pub test_pattern: Option, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/mod.rs deleted file mode 100644 index b951608e7683..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub mod fees; -pub mod integration; -pub mod recovery; -pub mod revert; -pub mod rust; -pub mod upgrade; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/recovery.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/recovery.rs deleted file mode 100644 index 81cc58fbd9bd..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/recovery.rs +++ /dev/null @@ -1,14 +0,0 @@ -use clap::Parser; -use serde::{Deserialize, Serialize}; - -use crate::messages::{MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_TESTS_RECOVERY_SNAPSHOT_HELP}; - -#[derive(Debug, Serialize, Deserialize, Parser)] -pub struct RecoveryArgs { - #[clap(short, long, help = MSG_TESTS_RECOVERY_SNAPSHOT_HELP)] - pub snapshot: bool, - #[clap(short, long, help = MSG_NO_DEPS_HELP)] - pub no_deps: bool, - #[clap(short, long, help = MSG_NO_KILL_HELP)] - pub no_kill: bool, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/revert.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/revert.rs deleted file mode 100644 index 0154a4c0afd7..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/revert.rs +++ /dev/null @@ -1,18 +0,0 @@ -use clap::Parser; - -use crate::messages::{ - MSG_NO_DEPS_HELP, MSG_NO_KILL_HELP, MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP, - MSG_TESTS_EXTERNAL_NODE_HELP, -}; - -#[derive(Debug, Parser)] -pub struct RevertArgs { - #[clap(long, help = MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP)] - pub enable_consensus: bool, - #[clap(short, long, help = MSG_TESTS_EXTERNAL_NODE_HELP)] - pub external_node: bool, - #[clap(short, long, help = MSG_NO_DEPS_HELP)] - pub no_deps: bool, - #[clap(short, long, help = MSG_NO_KILL_HELP)] - pub no_kill: bool, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/rust.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/rust.rs deleted file mode 100644 index 2d94adc3f6a7..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/rust.rs +++ /dev/null @@ -1,9 +0,0 @@ -use clap::Parser; - -use crate::messages::MSG_TEST_RUST_OPTIONS_HELP; - -#[derive(Debug, Parser)] -pub struct RustArgs { - #[clap(long, help = MSG_TEST_RUST_OPTIONS_HELP)] - pub options: Option, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/upgrade.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/upgrade.rs deleted file mode 100644 index dd96957e9d3b..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/upgrade.rs +++ /dev/null @@ -1,9 +0,0 @@ -use clap::Parser; - -use crate::messages::MSG_NO_DEPS_HELP; - -#[derive(Debug, Parser)] -pub struct UpgradeArgs { - #[clap(short, long, help = MSG_NO_DEPS_HELP)] - pub no_deps: bool, -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/build.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/build.rs deleted file mode 100644 index f48967f59738..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/build.rs +++ /dev/null @@ -1,13 +0,0 @@ -use config::EcosystemConfig; -use xshell::Shell; - -use super::utils::{build_contracts, install_and_build_dependencies}; - -pub fn run(shell: &Shell) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - build_contracts(shell, &ecosystem_config)?; - install_and_build_dependencies(shell, &ecosystem_config)?; - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/db.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/db.rs deleted file mode 100644 index a08b0404605e..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/db.rs +++ /dev/null @@ -1,34 +0,0 @@ -use std::path::Path; - -use common::{cmd::Cmd, db::wait_for_db, logger}; -use xshell::{cmd, Shell}; - -use crate::{commands::database, dals::Dal, messages::MSG_RESETTING_TEST_DATABASES}; - -pub async fn reset_test_databases( - shell: &Shell, - link_to_code: &Path, - dals: Vec, -) -> anyhow::Result<()> { - logger::info(MSG_RESETTING_TEST_DATABASES); - - Cmd::new(cmd!( - shell, - "docker compose -f docker-compose-unit-tests.yml down" - )) - .run()?; - Cmd::new(cmd!( - shell, - "docker compose -f docker-compose-unit-tests.yml up -d" - )) - .run()?; - - for dal in dals { - let mut url = dal.url.clone(); - url.set_path(""); - wait_for_db(&url, 3).await?; - database::reset::reset_database(shell, link_to_code, dal.clone()).await?; - } - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/fees.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/fees.rs deleted file mode 100644 index e0b881a14dbb..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/fees.rs +++ /dev/null @@ -1,65 +0,0 @@ -use std::path::PathBuf; - -use anyhow::Context; -use common::{cmd::Cmd, config::global_config, logger}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::{ - args::fees::FeesArgs, - utils::{build_contracts, install_and_build_dependencies, TS_INTEGRATION_PATH}, -}; -use crate::{ - commands::test::utils::{TestWallets, TEST_WALLETS_PATH}, - messages::{ - MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, - MSG_INTEGRATION_TESTS_RUN_SUCCESS, - }, -}; - -pub async fn run(shell: &Shell, args: FeesArgs) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - shell.change_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); - let chain_config = ecosystem_config - .load_current_chain() - .expect(MSG_CHAIN_NOT_FOUND_ERR); - - if !args.no_deps { - logger::info("Installing dependencies"); - build_contracts(shell, &ecosystem_config)?; - install_and_build_dependencies(shell, &ecosystem_config)?; - } - - logger::info(format!( - "Running fees tests on chain: {}", - ecosystem_config.current_chain() - )); - - let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); - let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) - .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; - - wallets - .init_test_wallet(&ecosystem_config, &chain_config) - .await?; - - let mut command = cmd!(shell, "yarn jest fees.test.ts --testTimeout 240000") - .env("SPAWN_NODE", "1") - .env("RUN_FEE_TEST", "1") - .env("NO_KILL", args.no_kill.to_string()) - .env("CHAIN_NAME", ecosystem_config.current_chain()) - .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); - - if global_config().verbose { - command = command.env( - "ZKSYNC_DEBUG_LOGS", - format!("{:?}", global_config().verbose), - ) - } - - Cmd::new(command).with_force_run().run()?; - - logger::outro(MSG_INTEGRATION_TESTS_RUN_SUCCESS); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs deleted file mode 100644 index 5107abf6a59b..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs +++ /dev/null @@ -1,67 +0,0 @@ -use std::path::PathBuf; - -use anyhow::Context; -use common::{cmd::Cmd, config::global_config, logger}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::{ - args::integration::IntegrationArgs, - utils::{ - build_contracts, install_and_build_dependencies, TestWallets, TEST_WALLETS_PATH, - TS_INTEGRATION_PATH, - }, -}; -use crate::messages::{ - msg_integration_tests_run, MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, - MSG_INTEGRATION_TESTS_RUN_SUCCESS, -}; - -pub async fn run(shell: &Shell, args: IntegrationArgs) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - let chain_config = ecosystem_config - .load_current_chain() - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - shell.change_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); - - logger::info(msg_integration_tests_run(args.external_node)); - - if !args.no_deps { - build_contracts(shell, &ecosystem_config)?; - install_and_build_dependencies(shell, &ecosystem_config)?; - } - - let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); - let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) - .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; - - wallets - .init_test_wallet(&ecosystem_config, &chain_config) - .await?; - - let test_pattern = args.test_pattern; - let mut command = cmd!( - shell, - "yarn jest --forceExit --testTimeout 120000 -t {test_pattern...}" - ) - .env("CHAIN_NAME", ecosystem_config.current_chain()) - .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); - - if args.external_node { - command = command.env("EXTERNAL_NODE", format!("{:?}", args.external_node)) - } - - if global_config().verbose { - command = command.env( - "ZKSYNC_DEBUG_LOGS", - format!("{:?}", global_config().verbose), - ) - } - - Cmd::new(command).with_force_run().run()?; - - logger::outro(MSG_INTEGRATION_TESTS_RUN_SUCCESS); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/l1_contracts.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/l1_contracts.rs deleted file mode 100644 index 0a1e1ec5203f..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/l1_contracts.rs +++ /dev/null @@ -1,18 +0,0 @@ -use common::{cmd::Cmd, logger}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use crate::messages::MSG_L1_CONTRACTS_TEST_SUCCESS; - -pub fn run(shell: &Shell) -> anyhow::Result<()> { - let ecosystem = EcosystemConfig::from_file(shell)?; - let _dir_guard = shell.push_dir(&ecosystem.link_to_code); - - Cmd::new(cmd!(shell, "yarn l1-contracts test")) - .with_force_run() - .run()?; - - logger::outro(MSG_L1_CONTRACTS_TEST_SUCCESS); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs deleted file mode 100644 index ee307438ec97..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs +++ /dev/null @@ -1,52 +0,0 @@ -use anyhow::Context; -use common::{cmd::Cmd, config::global_config, logger}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use crate::messages::MSG_CHAIN_NOT_FOUND_ERR; - -pub fn run(shell: &Shell) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - let chain_config = ecosystem_config - .load_current_chain() - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - - let general_api = chain_config - .get_general_config()? - .api_config - .context("API config is not found")?; - - let mut command = cmd!(shell, "cargo run --release --bin loadnext") - .env( - "L2_CHAIN_ID", - chain_config - .get_genesis_config()? - .l2_chain_id - .as_u64() - .to_string(), - ) - .env( - "MAIN_TOKEN", - format!( - "{:?}", - ecosystem_config - .get_erc20_tokens() - .first() - .context("NO Erc20 tokens were deployed")? - .address - ), - ) - .env("L2_RPC_ADDRESS", general_api.web3_json_rpc.http_url) - .env("L2_WS_RPC_ADDRESS", general_api.web3_json_rpc.ws_url); - - if global_config().verbose { - command = command.env("RUST_LOG", "loadnext=info") - } - - Cmd::new(command).with_force_run().run()?; - - logger::outro("Loadtest success"); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs deleted file mode 100644 index ae6b4518e6db..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs +++ /dev/null @@ -1,69 +0,0 @@ -use args::{ - fees::FeesArgs, integration::IntegrationArgs, recovery::RecoveryArgs, revert::RevertArgs, - rust::RustArgs, upgrade::UpgradeArgs, -}; -use clap::Subcommand; -use xshell::Shell; - -use crate::messages::{ - MSG_BUILD_ABOUT, MSG_INTEGRATION_TESTS_ABOUT, MSG_L1_CONTRACTS_ABOUT, MSG_LOADTEST_ABOUT, - MSG_PROVER_TEST_ABOUT, MSG_RECOVERY_TEST_ABOUT, MSG_REVERT_TEST_ABOUT, MSG_RUST_TEST_ABOUT, - MSG_TEST_WALLETS_INFO, MSG_UPGRADE_TEST_ABOUT, -}; - -mod args; -mod build; -mod db; -mod fees; -mod integration; -mod l1_contracts; -mod loadtest; -mod prover; -mod recovery; -mod revert; -mod rust; -mod upgrade; -mod utils; -mod wallet; - -#[derive(Subcommand, Debug)] -pub enum TestCommands { - #[clap(about = MSG_INTEGRATION_TESTS_ABOUT, alias = "i")] - Integration(IntegrationArgs), - #[clap(about = "Run fees test", alias = "i")] - Fees(FeesArgs), - #[clap(about = MSG_REVERT_TEST_ABOUT, alias = "r")] - Revert(RevertArgs), - #[clap(about = MSG_RECOVERY_TEST_ABOUT, alias = "rec")] - Recovery(RecoveryArgs), - #[clap(about = MSG_UPGRADE_TEST_ABOUT, alias = "u")] - Upgrade(UpgradeArgs), - #[clap(about = MSG_BUILD_ABOUT)] - Build, - #[clap(about = MSG_RUST_TEST_ABOUT, alias = "unit")] - Rust(RustArgs), - #[clap(about = MSG_L1_CONTRACTS_ABOUT, alias = "l1")] - L1Contracts, - #[clap(about = MSG_PROVER_TEST_ABOUT, alias = "p")] - Prover, - #[clap(about = MSG_TEST_WALLETS_INFO)] - Wallet, - #[clap(about = MSG_LOADTEST_ABOUT)] - Loadtest, -} - -pub async fn run(shell: &Shell, args: TestCommands) -> anyhow::Result<()> { - match args { - TestCommands::Integration(args) => integration::run(shell, args).await, - TestCommands::Fees(args) => fees::run(shell, args).await, - TestCommands::Revert(args) => revert::run(shell, args).await, - TestCommands::Recovery(args) => recovery::run(shell, args).await, - TestCommands::Upgrade(args) => upgrade::run(shell, args), - TestCommands::Build => build::run(shell), - TestCommands::Rust(args) => rust::run(shell, args).await, - TestCommands::L1Contracts => l1_contracts::run(shell), - TestCommands::Prover => prover::run(shell).await, - TestCommands::Wallet => wallet::run(shell), - TestCommands::Loadtest => loadtest::run(shell), - } -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/prover.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/prover.rs deleted file mode 100644 index f48b359a9357..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/prover.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::str::FromStr; - -use common::{cmd::Cmd, logger}; -use config::EcosystemConfig; -use url::Url; -use xshell::{cmd, Shell}; - -use crate::{ - commands::test::db::reset_test_databases, - dals::{Dal, PROVER_DAL_PATH}, - defaults::TEST_DATABASE_PROVER_URL, - messages::MSG_PROVER_TEST_SUCCESS, -}; - -pub async fn run(shell: &Shell) -> anyhow::Result<()> { - let ecosystem = EcosystemConfig::from_file(shell)?; - let dals = vec![Dal { - url: Url::from_str(TEST_DATABASE_PROVER_URL)?, - path: PROVER_DAL_PATH.to_string(), - }]; - reset_test_databases(shell, &ecosystem.link_to_code, dals).await?; - - let _dir_guard = shell.push_dir(ecosystem.link_to_code.join("prover")); - Cmd::new(cmd!(shell, "cargo test --release --workspace --locked")) - .with_force_run() - .env("TEST_DATABASE_PROVER_URL", TEST_DATABASE_PROVER_URL) - .run()?; - - logger::outro(MSG_PROVER_TEST_SUCCESS); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs deleted file mode 100644 index 6a3e337d41e9..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs +++ /dev/null @@ -1,68 +0,0 @@ -use std::path::PathBuf; - -use anyhow::Context; -use common::{cmd::Cmd, logger, server::Server, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::{ - args::recovery::RecoveryArgs, - utils::{install_and_build_dependencies, TestWallets, TEST_WALLETS_PATH}, -}; -use crate::messages::{ - MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, MSG_RECOVERY_TEST_RUN_INFO, - MSG_RECOVERY_TEST_RUN_SUCCESS, -}; - -const RECOVERY_TESTS_PATH: &str = "core/tests/recovery-test"; - -pub async fn run(shell: &Shell, args: RecoveryArgs) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - shell.change_dir(ecosystem_config.link_to_code.join(RECOVERY_TESTS_PATH)); - - logger::info(MSG_RECOVERY_TEST_RUN_INFO); - Server::new(None, ecosystem_config.link_to_code.clone(), false).build(shell)?; - - if !args.no_deps { - install_and_build_dependencies(shell, &ecosystem_config)?; - } - - run_test(shell, &args, &ecosystem_config).await?; - logger::outro(MSG_RECOVERY_TEST_RUN_SUCCESS); - - Ok(()) -} - -async fn run_test( - shell: &Shell, - args: &RecoveryArgs, - ecosystem_config: &EcosystemConfig, -) -> anyhow::Result<()> { - Spinner::new("Running test...").freeze(); - let chain_config = ecosystem_config - .load_current_chain() - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - - let cmd = if args.snapshot { - cmd!(shell, "yarn mocha tests/snapshot-recovery.test.ts") - } else { - cmd!(shell, "yarn mocha tests/genesis-recovery.test.ts") - }; - - let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); - let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) - .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; - - wallets - .init_test_wallet(ecosystem_config, &chain_config) - .await?; - - let cmd = Cmd::new(cmd) - .env("CHAIN_NAME", ecosystem_config.current_chain()) - .env("NO_KILL", args.no_kill.to_string()) - .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); - - cmd.with_force_run().run()?; - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/revert.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/revert.rs deleted file mode 100644 index 8b00e9d7f4d1..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/revert.rs +++ /dev/null @@ -1,70 +0,0 @@ -use std::path::PathBuf; - -use anyhow::Context; -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::{ - args::revert::RevertArgs, - utils::{install_and_build_dependencies, TestWallets, TEST_WALLETS_PATH}, -}; -use crate::messages::{ - msg_revert_tests_run, MSG_CHAIN_NOT_FOUND_ERR, MSG_DESERIALIZE_TEST_WALLETS_ERR, - MSG_REVERT_TEST_RUN_INFO, MSG_REVERT_TEST_RUN_SUCCESS, -}; - -const REVERT_TESTS_PATH: &str = "core/tests/revert-test"; - -pub async fn run(shell: &Shell, args: RevertArgs) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - shell.change_dir(ecosystem_config.link_to_code.join(REVERT_TESTS_PATH)); - - logger::info(MSG_REVERT_TEST_RUN_INFO); - - if !args.no_deps { - install_and_build_dependencies(shell, &ecosystem_config)?; - } - - run_test(shell, &args, &ecosystem_config).await?; - logger::outro(MSG_REVERT_TEST_RUN_SUCCESS); - - Ok(()) -} - -async fn run_test( - shell: &Shell, - args: &RevertArgs, - ecosystem_config: &EcosystemConfig, -) -> anyhow::Result<()> { - Spinner::new(&msg_revert_tests_run(args.external_node)).freeze(); - - let chain_config = ecosystem_config - .load_current_chain() - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - - let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); - let wallets: TestWallets = serde_json::from_str(shell.read_file(&wallets_path)?.as_ref()) - .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; - - wallets - .init_test_wallet(ecosystem_config, &chain_config) - .await?; - - let cmd = if args.external_node { - cmd!(shell, "yarn mocha tests/revert-and-restart-en.test.ts") - } else { - cmd!(shell, "yarn mocha tests/revert-and-restart.test.ts") - }; - - let mut cmd = Cmd::new(cmd) - .env("CHAIN_NAME", ecosystem_config.current_chain()) - .env("NO_KILL", args.no_kill.to_string()) - .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); - if args.enable_consensus { - cmd = cmd.env("ENABLE_CONSENSUS", "true"); - } - cmd.with_force_run().run()?; - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs deleted file mode 100644 index 7011e0f0f874..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs +++ /dev/null @@ -1,86 +0,0 @@ -use std::str::FromStr; - -use anyhow::Context; -use common::{cmd::Cmd, logger}; -use config::EcosystemConfig; -use url::Url; -use xshell::{cmd, Shell}; - -use super::args::rust::RustArgs; -use crate::{ - commands::test::db::reset_test_databases, - dals::{Dal, CORE_DAL_PATH, PROVER_DAL_PATH}, - defaults::{TEST_DATABASE_PROVER_URL, TEST_DATABASE_SERVER_URL}, - messages::{ - MSG_CHAIN_NOT_FOUND_ERR, MSG_POSTGRES_CONFIG_NOT_FOUND_ERR, MSG_UNIT_TESTS_RUN_SUCCESS, - MSG_USING_CARGO_NEXTEST, - }, -}; - -pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { - let ecosystem = EcosystemConfig::from_file(shell)?; - let chain = ecosystem - .clone() - .load_chain(Some(ecosystem.default_chain)) - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - let general_config = chain.get_general_config(); - let link_to_code = ecosystem.link_to_code; - - let (test_server_url, test_prover_url) = if let Ok(general_config) = general_config { - let postgres = general_config - .postgres_config - .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?; - - ( - postgres - .test_server_url - .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, - postgres - .test_prover_url - .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, - ) - } else { - ( - TEST_DATABASE_SERVER_URL.to_string(), - TEST_DATABASE_PROVER_URL.to_string(), - ) - }; - - let dals = vec![ - Dal { - url: Url::from_str(&test_server_url.clone())?, - path: CORE_DAL_PATH.to_string(), - }, - Dal { - url: Url::from_str(&test_prover_url.clone())?, - path: PROVER_DAL_PATH.to_string(), - }, - ]; - - reset_test_databases(shell, &link_to_code, dals).await?; - - let _dir_guard = shell.push_dir(&link_to_code); - - logger::info(MSG_USING_CARGO_NEXTEST); - let cmd = cmd!(shell, "cargo nextest run --release"); - - let cmd = if let Some(options) = args.options { - Cmd::new(cmd.args(options.split_whitespace())).with_force_run() - } else { - Cmd::new(cmd).with_force_run() - }; - - let cmd = cmd - .env("TEST_DATABASE_URL", test_server_url) - .env("TEST_PROVER_DATABASE_URL", test_prover_url); - cmd.run()?; - - // Run unit tests for zk_toolbox - let _dir_guard = shell.push_dir(link_to_code.join("zk_toolbox")); - Cmd::new(cmd!(shell, "cargo nextest run --release")) - .with_force_run() - .run()?; - - logger::outro(MSG_UNIT_TESTS_RUN_SUCCESS); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/upgrade.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/upgrade.rs deleted file mode 100644 index 9bd04b81ef34..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/upgrade.rs +++ /dev/null @@ -1,33 +0,0 @@ -use common::{cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::{args::upgrade::UpgradeArgs, utils::install_and_build_dependencies}; -use crate::messages::{MSG_UPGRADE_TEST_RUN_INFO, MSG_UPGRADE_TEST_RUN_SUCCESS}; - -const UPGRADE_TESTS_PATH: &str = "core/tests/upgrade-test"; - -pub fn run(shell: &Shell, args: UpgradeArgs) -> anyhow::Result<()> { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - shell.change_dir(ecosystem_config.link_to_code.join(UPGRADE_TESTS_PATH)); - - logger::info(MSG_UPGRADE_TEST_RUN_INFO); - - if !args.no_deps { - install_and_build_dependencies(shell, &ecosystem_config)?; - } - - run_test(shell, &ecosystem_config)?; - logger::outro(MSG_UPGRADE_TEST_RUN_SUCCESS); - - Ok(()) -} - -fn run_test(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { - Spinner::new(MSG_UPGRADE_TEST_RUN_INFO).freeze(); - let cmd = Cmd::new(cmd!(shell, "yarn mocha tests/upgrade.test.ts")) - .env("CHAIN_NAME", ecosystem_config.current_chain()); - cmd.with_force_run().run()?; - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs deleted file mode 100644 index 8656ff44d319..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs +++ /dev/null @@ -1,111 +0,0 @@ -use std::collections::HashMap; - -use anyhow::Context; -use common::{cmd::Cmd, spinner::Spinner, wallets::Wallet}; -use config::{ChainConfig, EcosystemConfig}; -use ethers::{ - providers::{Http, Middleware, Provider}, - utils::hex::ToHex, -}; -use serde::Deserialize; -use xshell::{cmd, Shell}; - -use crate::messages::{ - MSG_INTEGRATION_TESTS_BUILDING_CONTRACTS, MSG_INTEGRATION_TESTS_BUILDING_DEPENDENCIES, -}; - -pub const TEST_WALLETS_PATH: &str = "etc/test_config/constant/eth.json"; -const AMOUNT_FOR_DISTRIBUTION_TO_WALLETS: u128 = 1000000000000000000000; - -pub const TS_INTEGRATION_PATH: &str = "core/tests/ts-integration"; -const CONTRACTS_TEST_DATA_PATH: &str = "etc/contracts-test-data"; - -#[derive(Deserialize)] -pub struct TestWallets { - base_path: String, - #[serde(flatten)] - wallets: HashMap, -} - -impl TestWallets { - fn get(&self, id: u32) -> anyhow::Result { - let mnemonic = self.wallets.get("test_mnemonic").unwrap().as_str(); - - Wallet::from_mnemonic(mnemonic, &self.base_path, id) - } - - pub fn get_main_wallet(&self) -> anyhow::Result { - self.get(0) - } - - pub fn get_test_wallet(&self, chain_config: &ChainConfig) -> anyhow::Result { - self.get(chain_config.id) - } - - pub fn get_test_pk(&self, chain_config: &ChainConfig) -> anyhow::Result { - self.get_test_wallet(chain_config)? - .private_key - .ok_or(anyhow::Error::msg("Private key not found")) - .map(|pk| pk.encode_hex::()) - } - - pub async fn init_test_wallet( - &self, - ecosystem_config: &EcosystemConfig, - chain_config: &ChainConfig, - ) -> anyhow::Result<()> { - let wallet = self.get_test_wallet(chain_config)?; - - let l1_rpc = chain_config - .get_secrets_config()? - .l1 - .context("No L1 secrets available")? - .l1_rpc_url - .expose_str() - .to_owned(); - - let provider = Provider::::try_from(l1_rpc.clone())?; - let balance = provider.get_balance(wallet.address, None).await?; - - if balance.is_zero() { - common::ethereum::distribute_eth( - self.get_main_wallet()?, - vec![wallet.address], - l1_rpc, - ecosystem_config.l1_network.chain_id(), - AMOUNT_FOR_DISTRIBUTION_TO_WALLETS, - ) - .await? - } - - Ok(()) - } -} - -pub fn build_contracts(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { - shell.change_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); - let spinner = Spinner::new(MSG_INTEGRATION_TESTS_BUILDING_CONTRACTS); - - Cmd::new(cmd!(shell, "yarn build")).run()?; - Cmd::new(cmd!(shell, "yarn build-yul")).run()?; - - let _dir_guard = shell.push_dir(ecosystem_config.link_to_code.join(CONTRACTS_TEST_DATA_PATH)); - Cmd::new(cmd!(shell, "yarn build")).run()?; - - spinner.finish(); - Ok(()) -} - -pub fn install_and_build_dependencies( - shell: &Shell, - ecosystem_config: &EcosystemConfig, -) -> anyhow::Result<()> { - let _dir_guard = shell.push_dir(&ecosystem_config.link_to_code); - let spinner = Spinner::new(MSG_INTEGRATION_TESTS_BUILDING_DEPENDENCIES); - - Cmd::new(cmd!(shell, "yarn install")).run()?; - Cmd::new(cmd!(shell, "yarn utils build")).run()?; - - spinner.finish(); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/wallet.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/wallet.rs deleted file mode 100644 index 62f32b50d559..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/wallet.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::path::PathBuf; - -use anyhow::Context; -use common::logger; -use config::EcosystemConfig; -use xshell::Shell; - -use super::utils::{TestWallets, TEST_WALLETS_PATH}; -use crate::messages::{ - MSG_DESERIALIZE_TEST_WALLETS_ERR, MSG_TEST_WALLETS_INFO, MSG_WALLETS_TEST_SUCCESS, -}; - -pub fn run(shell: &Shell) -> anyhow::Result<()> { - logger::info(MSG_TEST_WALLETS_INFO); - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - - let chain_config = ecosystem_config - .load_current_chain() - .context("Chain not found")?; - - let wallets_path: PathBuf = ecosystem_config.link_to_code.join(TEST_WALLETS_PATH); - let wallets: TestWallets = serde_json::from_str(shell.read_file(wallets_path)?.as_ref()) - .context(MSG_DESERIALIZE_TEST_WALLETS_ERR)?; - - logger::info(format!("Main: {:#?}", wallets.get_main_wallet()?)); - logger::info(format!( - "Chain: {:#?}", - wallets.get_test_wallet(&chain_config)? - )); - - logger::outro(MSG_WALLETS_TEST_SUCCESS); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/consts.rs b/zk_toolbox/crates/zk_supervisor/src/consts.rs deleted file mode 100644 index 66f00c7553b5..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/consts.rs +++ /dev/null @@ -1 +0,0 @@ -pub const DEFAULT_UNSIGNED_TRANSACTIONS_DIR: &str = "transactions"; diff --git a/zk_toolbox/crates/zk_supervisor/src/dals.rs b/zk_toolbox/crates/zk_supervisor/src/dals.rs deleted file mode 100644 index 962a848fe00c..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/dals.rs +++ /dev/null @@ -1,98 +0,0 @@ -use anyhow::{anyhow, Context}; -use config::{EcosystemConfig, SecretsConfig}; -use url::Url; -use xshell::Shell; - -use crate::{ - commands::database::args::DalUrls, - messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_DATABASE_MUST_BE_PRESENTED}, -}; - -pub const CORE_DAL_PATH: &str = "core/lib/dal"; -pub const PROVER_DAL_PATH: &str = "prover/crates/lib/prover_dal"; - -#[derive(Debug, Clone)] -pub struct SelectedDals { - pub prover: bool, - pub core: bool, -} - -impl SelectedDals { - /// Returns true if no databases are selected - pub fn none(&self) -> bool { - !self.prover && !self.core - } -} - -#[derive(Debug, Clone)] -pub struct Dal { - pub path: String, - pub url: Url, -} - -pub fn get_dals( - shell: &Shell, - selected_dals: &SelectedDals, - urls: &DalUrls, -) -> anyhow::Result> { - let mut dals = vec![]; - - if selected_dals.prover { - dals.push(get_prover_dal(shell, urls.prover.clone())?); - } - if selected_dals.core { - dals.push(get_core_dal(shell, urls.core.clone())?); - } - - Ok(dals) -} - -pub fn get_prover_dal(shell: &Shell, url: Option) -> anyhow::Result { - let url = if let Some(url) = url { - Url::parse(&url)? - } else { - let secrets = get_secrets(shell)?; - secrets - .database - .as_ref() - .context(MSG_DATABASE_MUST_BE_PRESENTED)? - .prover_url()? - .expose_url() - .clone() - }; - - Ok(Dal { - path: PROVER_DAL_PATH.to_string(), - url, - }) -} - -pub fn get_core_dal(shell: &Shell, url: Option) -> anyhow::Result { - let url = if let Some(url) = url { - Url::parse(&url)? - } else { - let secrets = get_secrets(shell)?; - secrets - .database - .as_ref() - .context(MSG_DATABASE_MUST_BE_PRESENTED)? - .master_url()? - .expose_url() - .clone() - }; - - Ok(Dal { - path: CORE_DAL_PATH.to_string(), - url, - }) -} - -fn get_secrets(shell: &Shell) -> anyhow::Result { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let chain_config = ecosystem_config - .load_current_chain() - .ok_or(anyhow!(MSG_CHAIN_NOT_FOUND_ERR))?; - let secrets = chain_config.get_secrets_config()?; - - Ok(secrets) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/defaults.rs b/zk_toolbox/crates/zk_supervisor/src/defaults.rs deleted file mode 100644 index d9325402f533..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/defaults.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub const TEST_DATABASE_SERVER_URL: &str = - "postgres://postgres:notsecurepassword@localhost:5433/zksync_local_test"; -pub const TEST_DATABASE_PROVER_URL: &str = - "postgres://postgres:notsecurepassword@localhost:5433/prover_local_test"; -pub const LOCAL_RPC_URL: &str = "http://127.0.0.1:8545"; diff --git a/zk_toolbox/crates/zk_supervisor/src/main.rs b/zk_toolbox/crates/zk_supervisor/src/main.rs deleted file mode 100644 index 242affd8a71b..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/main.rs +++ /dev/null @@ -1,151 +0,0 @@ -use clap::{Parser, Subcommand}; -use commands::{ - config_writer::ConfigWriterArgs, contracts::ContractsArgs, database::DatabaseCommands, - lint::LintArgs, prover::ProverCommands, send_transactions::args::SendTransactionsArgs, - snapshot::SnapshotCommands, test::TestCommands, -}; -use common::{ - check_general_prerequisites, - config::{global_config, init_global_config, GlobalConfig}, - error::log_error, - init_prompt_theme, logger, - version::version_message, -}; -use config::EcosystemConfig; -use messages::{ - msg_global_chain_does_not_exist, MSG_CONFIG_WRITER_ABOUT, MSG_CONTRACTS_ABOUT, - MSG_PROVER_VERSION_ABOUT, MSG_SEND_TXNS_ABOUT, MSG_SUBCOMMAND_CLEAN, - MSG_SUBCOMMAND_DATABASE_ABOUT, MSG_SUBCOMMAND_FMT_ABOUT, MSG_SUBCOMMAND_LINT_ABOUT, - MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT, MSG_SUBCOMMAND_TESTS_ABOUT, -}; -use xshell::Shell; - -use crate::commands::{clean::CleanCommands, fmt::FmtArgs}; - -mod commands; -mod consts; -mod dals; -mod defaults; -mod messages; - -#[derive(Parser, Debug)] -#[command( - version = version_message(env!("CARGO_PKG_VERSION")), - about -)] -struct Supervisor { - #[command(subcommand)] - command: SupervisorSubcommands, - #[clap(flatten)] - global: SupervisorGlobalArgs, -} - -#[derive(Subcommand, Debug)] -enum SupervisorSubcommands { - #[command(subcommand, about = MSG_SUBCOMMAND_DATABASE_ABOUT, alias = "db")] - Database(DatabaseCommands), - #[command(subcommand, about = MSG_SUBCOMMAND_TESTS_ABOUT, alias = "t")] - Test(TestCommands), - #[command(subcommand, about = MSG_SUBCOMMAND_CLEAN)] - Clean(CleanCommands), - #[command(subcommand, about = MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT)] - Snapshot(SnapshotCommands), - #[command(about = MSG_SUBCOMMAND_LINT_ABOUT, alias = "l")] - Lint(LintArgs), - #[command(about = MSG_SUBCOMMAND_FMT_ABOUT)] - Fmt(FmtArgs), - #[command(hide = true)] - Markdown, - #[command(subcommand, about = MSG_PROVER_VERSION_ABOUT)] - Prover(ProverCommands), - #[command(about = MSG_CONTRACTS_ABOUT)] - Contracts(ContractsArgs), - #[command(about = MSG_CONFIG_WRITER_ABOUT, alias = "o")] - ConfigWriter(ConfigWriterArgs), - #[command(about = MSG_SEND_TXNS_ABOUT)] - SendTransactions(SendTransactionsArgs), -} - -#[derive(Parser, Debug)] -#[clap(next_help_heading = "Global options")] -struct SupervisorGlobalArgs { - /// Verbose mode - #[clap(short, long, global = true)] - verbose: bool, - /// Chain to use - #[clap(long, global = true)] - chain: Option, - /// Ignores prerequisites checks - #[clap(long, global = true)] - ignore_prerequisites: bool, -} - -#[tokio::main] -async fn main() -> anyhow::Result<()> { - human_panic::setup_panic!(); - - // We must parse arguments before printing the intro, because some autogenerated - // Clap commands (like `--version` would look odd otherwise). - let args = Supervisor::parse(); - - init_prompt_theme(); - - logger::new_empty_line(); - logger::intro(); - - let shell = Shell::new().unwrap(); - init_global_config_inner(&shell, &args.global)?; - - if !global_config().ignore_prerequisites { - check_general_prerequisites(&shell); - } - - match run_subcommand(args, &shell).await { - Ok(_) => {} - Err(error) => { - log_error(error); - std::process::exit(1); - } - } - - Ok(()) -} - -async fn run_subcommand(args: Supervisor, shell: &Shell) -> anyhow::Result<()> { - match args.command { - SupervisorSubcommands::Database(command) => commands::database::run(shell, command).await?, - SupervisorSubcommands::Test(command) => commands::test::run(shell, command).await?, - SupervisorSubcommands::Clean(command) => commands::clean::run(shell, command)?, - SupervisorSubcommands::Snapshot(command) => commands::snapshot::run(shell, command).await?, - SupervisorSubcommands::Markdown => { - clap_markdown::print_help_markdown::(); - } - SupervisorSubcommands::Lint(args) => commands::lint::run(shell, args)?, - SupervisorSubcommands::Fmt(args) => commands::fmt::run(shell.clone(), args).await?, - SupervisorSubcommands::Prover(command) => commands::prover::run(shell, command).await?, - SupervisorSubcommands::Contracts(args) => commands::contracts::run(shell, args)?, - SupervisorSubcommands::ConfigWriter(args) => commands::config_writer::run(shell, args)?, - SupervisorSubcommands::SendTransactions(args) => { - commands::send_transactions::run(shell, args).await? - } - } - Ok(()) -} - -fn init_global_config_inner(shell: &Shell, args: &SupervisorGlobalArgs) -> anyhow::Result<()> { - if let Some(name) = &args.chain { - if let Ok(config) = EcosystemConfig::from_file(shell) { - let chains = config.list_of_chains(); - if !chains.contains(name) { - anyhow::bail!(msg_global_chain_does_not_exist(name, &chains.join(", "))); - } - } - } - - init_global_config(GlobalConfig { - verbose: args.verbose, - chain_name: args.chain.clone(), - ignore_prerequisites: args.ignore_prerequisites, - }); - Ok(()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/messages.rs b/zk_toolbox/crates/zk_supervisor/src/messages.rs deleted file mode 100644 index 6f6deb22edbf..000000000000 --- a/zk_toolbox/crates/zk_supervisor/src/messages.rs +++ /dev/null @@ -1,236 +0,0 @@ -use crate::commands::lint_utils::Target; - -// Ecosystem related messages -pub(super) const MSG_CHAIN_NOT_FOUND_ERR: &str = "Chain not found"; - -pub(super) fn msg_global_chain_does_not_exist(chain: &str, available_chains: &str) -> String { - format!("Chain with name {chain} doesnt exist, please choose one of: {available_chains}") -} - -// Subcommands help -pub(super) const MSG_PROVER_VERSION_ABOUT: &str = "Protocol version used by provers"; -pub(super) const MSG_SUBCOMMAND_DATABASE_ABOUT: &str = "Database related commands"; -pub(super) const MSG_SUBCOMMAND_TESTS_ABOUT: &str = "Run tests"; -pub(super) const MSG_SUBCOMMAND_CLEAN: &str = "Clean artifacts"; -pub(super) const MSG_SUBCOMMAND_LINT_ABOUT: &str = "Lint code"; -pub(super) const MSG_CONTRACTS_ABOUT: &str = "Build contracts"; -pub(super) const MSG_CONFIG_WRITER_ABOUT: &str = "Overwrite general config"; - -pub(super) const MSG_SUBCOMMAND_FMT_ABOUT: &str = "Format code"; - -pub(super) const MSG_SUBCOMMAND_SNAPSHOTS_CREATOR_ABOUT: &str = "Snapshots creator"; - -// Database related messages -pub(super) const MSG_NO_DATABASES_SELECTED: &str = "No databases selected"; - -pub(super) fn msg_database_info(gerund_verb: &str) -> String { - format!("{gerund_verb} databases") -} - -pub(super) fn msg_database_success(past_verb: &str) -> String { - format!("Databases {past_verb} successfully") -} - -pub(super) fn msg_database_loading(gerund_verb: &str, dal: &str) -> String { - format!("{gerund_verb} database for dal {dal}...") -} - -pub(super) const MSG_DATABASE_CHECK_SQLX_DATA_GERUND: &str = "Checking"; -pub(super) const MSG_DATABASE_CHECK_SQLX_DATA_PAST: &str = "checked"; -pub(super) const MSG_DATABASE_DROP_GERUND: &str = "Dropping"; -pub(super) const MSG_DATABASE_DROP_PAST: &str = "dropped"; -pub(super) const MSG_DATABASE_MIGRATE_GERUND: &str = "Migrating"; -pub(super) const MSG_DATABASE_MIGRATE_PAST: &str = "migrated"; -pub(super) const MSG_DATABASE_PREPARE_GERUND: &str = "Preparing"; -pub(super) const MSG_DATABASE_PREPARE_PAST: &str = "prepared"; -pub(super) const MSG_DATABASE_RESET_GERUND: &str = "Resetting"; -pub(super) const MSG_DATABASE_RESET_PAST: &str = "reset"; -pub(super) const MSG_DATABASE_SETUP_GERUND: &str = "Setting up"; -pub(super) const MSG_DATABASE_SETUP_PAST: &str = "set up"; -pub(super) const MSG_DATABASE_MUST_BE_PRESENTED: &str = "Database config must be presented"; -pub(super) const MSG_DATABASE_COMMON_PROVER_HELP: &str = "Prover database"; -pub(super) const MSG_DATABASE_COMMON_PROVER_URL_HELP: &str = - "URL of the Prover database. If not specified, it is used from the current chain's secrets"; -pub(super) const MSG_DATABASE_COMMON_CORE_URL_HELP: &str = - "URL of the Core database. If not specified, it is used from the current chain's secrets."; -pub(super) const MSG_DATABASE_COMMON_CORE_HELP: &str = "Core database"; -pub(super) const MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP: &str = - "Database to create new migration for"; -pub(super) const MSG_DATABASE_NEW_MIGRATION_NAME_HELP: &str = "Migration name"; - -pub(super) const MSG_DATABASE_CHECK_SQLX_DATA_ABOUT: &str = "Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked."; -pub(super) const MSG_DATABASE_DROP_ABOUT: &str = - "Drop databases. If no databases are selected, all databases will be dropped."; -pub(super) const MSG_DATABASE_MIGRATE_ABOUT: &str = - "Migrate databases. If no databases are selected, all databases will be migrated."; -pub(super) const MSG_DATABASE_NEW_MIGRATION_ABOUT: &str = "Create new migration"; -pub(super) const MSG_DATABASE_PREPARE_ABOUT: &str = - "Prepare sqlx-data.json. If no databases are selected, all databases will be prepared."; -pub(super) const MSG_DATABASE_RESET_ABOUT: &str = - "Reset databases. If no databases are selected, all databases will be reset."; -pub(super) const MSG_DATABASE_SETUP_ABOUT: &str = - "Setup databases. If no databases are selected, all databases will be setup."; - -// Database new_migration messages -pub(super) const MSG_DATABASE_NEW_MIGRATION_DB_PROMPT: &str = - "What database do you want to create a new migration for?"; -pub(super) const MSG_DATABASE_NEW_MIGRATION_NAME_PROMPT: &str = - "How do you want to name the migration?"; - -pub(super) fn msg_database_new_migration_loading(dal: &str) -> String { - format!("Creating new database migration for dal {}...", dal) -} - -pub(super) const MSG_DATABASE_NEW_MIGRATION_SUCCESS: &str = "Migration created successfully"; - -// Tests related messages -pub(super) const MSG_INTEGRATION_TESTS_ABOUT: &str = "Run integration tests"; -pub(super) const MSG_REVERT_TEST_ABOUT: &str = "Run revert tests"; -pub(super) const MSG_RECOVERY_TEST_ABOUT: &str = "Run recovery tests"; -pub(super) const MSG_UPGRADE_TEST_ABOUT: &str = "Run upgrade tests"; -pub(super) const MSG_RUST_TEST_ABOUT: &str = "Run unit-tests, accepts optional cargo test flags"; -pub(super) const MSG_TEST_RUST_OPTIONS_HELP: &str = "Cargo test flags"; -pub(super) const MSG_BUILD_ABOUT: &str = "Build all test dependencies"; -pub(super) const MSG_TESTS_EXTERNAL_NODE_HELP: &str = "Run tests for external node"; -pub(super) const MSG_NO_DEPS_HELP: &str = "Do not install or build dependencies"; -pub(super) const MSG_TEST_PATTERN_HELP: &str = - "Run just the tests matching a pattern. Same as the -t flag on jest."; -pub(super) const MSG_NO_KILL_HELP: &str = "The test will not kill all the nodes during execution"; -pub(super) const MSG_TESTS_RECOVERY_SNAPSHOT_HELP: &str = - "Run recovery from a snapshot instead of genesis"; -pub(super) const MSG_UNIT_TESTS_RUN_SUCCESS: &str = "Unit tests ran successfully"; -pub(super) const MSG_USING_CARGO_NEXTEST: &str = "Using cargo-nextest for running tests"; -pub(super) const MSG_L1_CONTRACTS_ABOUT: &str = "Run L1 contracts tests"; -pub(super) const MSG_L1_CONTRACTS_TEST_SUCCESS: &str = "L1 contracts tests ran successfully"; -pub(super) const MSG_PROVER_TEST_ABOUT: &str = "Run prover tests"; -pub(super) const MSG_PROVER_TEST_SUCCESS: &str = "Prover tests ran successfully"; -pub(super) const MSG_POSTGRES_CONFIG_NOT_FOUND_ERR: &str = "Postgres config not found"; -pub(super) const MSG_RESETTING_TEST_DATABASES: &str = "Resetting test databases"; - -// Contract building related messages -pub(super) const MSG_NOTHING_TO_BUILD_MSG: &str = "Nothing to build!"; -pub(super) const MSG_BUILDING_CONTRACTS: &str = "Building contracts"; -pub(super) const MSG_CONTRACTS_DEPS_SPINNER: &str = "Installing dependencies.."; -pub(super) const MSG_BUILDING_L2_CONTRACTS_SPINNER: &str = "Building L2 contracts.."; -pub(super) const MSG_BUILDING_L1_CONTRACTS_SPINNER: &str = "Building L1 contracts.."; -pub(super) const MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER: &str = "Building system contracts.."; -pub(super) const MSG_BUILDING_TEST_CONTRACTS_SPINNER: &str = "Building test contracts.."; -pub(super) const MSG_BUILDING_CONTRACTS_SUCCESS: &str = "Contracts built successfully"; -pub(super) const MSG_BUILD_L1_CONTRACTS_HELP: &str = "Build L1 contracts"; -pub(super) const MSG_BUILD_L2_CONTRACTS_HELP: &str = "Build L2 contracts"; -pub(super) const MSG_BUILD_SYSTEM_CONTRACTS_HELP: &str = "Build system contracts"; -pub(super) const MSG_BUILD_TEST_CONTRACTS_HELP: &str = "Build test contracts"; - -// Integration tests related messages -pub(super) fn msg_integration_tests_run(external_node: bool) -> String { - let base = "Running integration tests"; - if external_node { - format!("{} for external node", base) - } else { - format!("{} for main server", base) - } -} - -pub(super) const MSG_INTEGRATION_TESTS_RUN_SUCCESS: &str = "Integration tests ran successfully"; -pub(super) const MSG_INTEGRATION_TESTS_BUILDING_DEPENDENCIES: &str = - "Building repository dependencies..."; -pub(super) const MSG_INTEGRATION_TESTS_BUILDING_CONTRACTS: &str = "Building test contracts..."; - -// Revert tests related messages -pub(super) const MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP: &str = "Enable consensus"; -pub(super) const MSG_REVERT_TEST_RUN_INFO: &str = "Running revert and restart test"; - -pub(super) fn msg_revert_tests_run(external_node: bool) -> String { - let base = "Running integration tests"; - if external_node { - format!("{} for external node", base) - } else { - format!("{} for main server", base) - } -} - -pub(super) const MSG_REVERT_TEST_RUN_SUCCESS: &str = "Revert and restart test ran successfully"; - -// Recovery tests related messages -pub(super) const MSG_RECOVERY_TEST_RUN_INFO: &str = "Running recovery test"; -pub(super) const MSG_RECOVERY_TEST_RUN_SUCCESS: &str = "Recovery test ran successfully"; - -// Upgrade tests related messages -pub(super) const MSG_UPGRADE_TEST_RUN_INFO: &str = "Running upgrade test"; -pub(super) const MSG_UPGRADE_TEST_RUN_SUCCESS: &str = "Upgrade test ran successfully"; - -// Cleaning related messages -pub(super) const MSG_DOCKER_COMPOSE_DOWN: &str = "docker compose down"; -pub(super) const MSG_DOCKER_COMPOSE_REMOVE_VOLUMES: &str = "docker compose remove volumes"; -pub(super) const MSG_DOCKER_COMPOSE_CLEANED: &str = "docker compose network cleaned"; -pub(super) const MSG_CONTRACTS_CLEANING: &str = - "Removing contracts building and deployment artifacts"; -pub(super) const MSG_CONTRACTS_CLEANING_FINISHED: &str = - "Contracts building and deployment artifacts are cleaned up"; - -/// Snapshot creator related messages -pub(super) const MSG_RUNNING_SNAPSHOT_CREATOR: &str = "Running snapshot creator"; - -// Lint related messages -pub(super) fn msg_running_linters_for_files(targets: &[Target]) -> String { - let targets: Vec = targets.iter().map(|e| format!(".{}", e)).collect(); - format!("Running linters for targets: {:?}", targets) -} - -pub(super) fn msg_running_linter_for_extension_spinner(target: &Target) -> String { - format!("Running linter for files with extension: .{}", target) -} - -pub(super) fn msg_running_fmt_for_extension_spinner(target: Target) -> String { - format!("Running prettier for: {target:?}") -} - -pub(super) fn msg_running_rustfmt_for_dir_spinner(dir: &str) -> String { - format!("Running rustfmt for: {dir:?}") -} - -pub(super) fn msg_running_fmt_for_extensions_spinner(targets: &[Target]) -> String { - format!("Running prettier for: {targets:?} and rustfmt") -} - -pub(super) const MSG_LINT_CONFIG_PATH_ERR: &str = "Lint config path error"; -pub(super) const MSG_RUNNING_CONTRACTS_LINTER_SPINNER: &str = "Running contracts linter.."; -pub(super) const MSG_RUNNING_CONTRACTS_FMT_SPINNER: &str = "Running prettier for contracts.."; - -pub(super) const MSG_RUNNING_SQL_FMT_SPINNER: &str = "Running SQL formatter.."; - -pub(super) fn msg_file_is_not_formatted(file: &str) -> String { - format!("File {} is not formatted", file) -} - -// Test wallets related messages -pub(super) const MSG_TEST_WALLETS_INFO: &str = "Print test wallets information"; -pub(super) const MSG_DESERIALIZE_TEST_WALLETS_ERR: &str = "Impossible to deserialize test wallets"; -pub(super) const MSG_WALLETS_TEST_SUCCESS: &str = "Wallets test success"; - -pub(super) const MSG_LOADTEST_ABOUT: &str = "Run loadtest"; - -pub(super) const MSG_OVERRIDE_CONFIG_PATH_HELP: &str = "Path to the config file to override"; -pub(super) const MSG_OVERRRIDE_CONFIG_PATH_PROMPT: &str = - "Provide path to the config file to override"; -pub(super) const MSG_OVERRIDE_SUCCESS: &str = "Config was overridden successfully"; - -pub(super) fn msg_overriding_config(chain: String) -> String { - format!("Overriding general config for chain {}", chain) -} - -// Send transactions related messages -pub(super) const MSG_SEND_TXNS_ABOUT: &str = "Send transactions from file"; -pub(super) const MSG_PROMPT_TRANSACTION_FILE: &str = "Path to transactions file"; -pub(super) const MSG_PROMPT_SECRET_KEY: &str = "Secret key of the sender"; -pub(super) const MSG_PROMPT_L1_RPC_URL: &str = "L1 RPC URL"; -pub(super) fn msg_send_txns_outro(log_file: &str) -> String { - format!("Transaction receipts logged to: {}", log_file) -} - -pub(super) const MSG_UNABLE_TO_OPEN_FILE_ERR: &str = "Unable to open file"; -pub(super) const MSG_UNABLE_TO_READ_FILE_ERR: &str = "Unable to read file"; -pub(super) const MSG_UNABLE_TO_WRITE_FILE_ERR: &str = "Unable to write data to file"; -pub(super) const MSG_UNABLE_TO_READ_PARSE_JSON_ERR: &str = "Unable to parse JSON"; -pub(super) const MSG_FAILED_TO_SEND_TXN_ERR: &str = "Failed to send transaction"; -pub(super) const MSG_INVALID_L1_RPC_URL_ERR: &str = "Invalid L1 RPC URL"; From ab7d584452c78bc77bbacd9ff6b097b3b5b907d6 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 18:18:38 +0200 Subject: [PATCH 006/103] fix: remove occurences of zks in dev and installation scripts --- .githooks/pre-push | 6 ++--- bin/zkt | 2 -- .../tests/snapshot-recovery.test.ts | 2 +- docker/Makefile | 2 +- zk_toolbox/zkup/zkup | 27 +++---------------- 5 files changed, 8 insertions(+), 31 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 73168e08ec42..d1222e1ab788 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -7,10 +7,10 @@ RED='\033[0;31m' NC='\033[0m' # No Color # Check that prettier formatting rules are not violated. -if which zk_supervisor >/dev/null; then - if ! zk_supervisor fmt --check; then +if which zk_inception >/dev/null; then + if ! zk_inception dev fmt --check; then echo -e "${RED}Push error!${NC}" - echo "Please format the code via 'zks fmt', cannot push unformatted code" + echo "Please format the code via 'zki dev fmt', cannot push unformatted code" exit 1 fi else diff --git a/bin/zkt b/bin/zkt index f781ca67528b..29e495fd5940 100755 --- a/bin/zkt +++ b/bin/zkt @@ -4,7 +4,6 @@ cd $(dirname $0) if which zkup >/dev/null; then cargo uninstall zk_inception - cargo uninstall zk_supervisor git config --local core.hooksPath || git config --local core.hooksPath ./.githooks zkup -p .. --alias @@ -12,6 +11,5 @@ else echo zkup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup cd ../zk_toolbox cargo install --path ./crates/zk_inception --force - cargo install --path ./crates/zk_supervisor --force fi diff --git a/core/tests/recovery-test/tests/snapshot-recovery.test.ts b/core/tests/recovery-test/tests/snapshot-recovery.test.ts index cadf146c5226..6f3d91a7050d 100644 --- a/core/tests/recovery-test/tests/snapshot-recovery.test.ts +++ b/core/tests/recovery-test/tests/snapshot-recovery.test.ts @@ -461,7 +461,7 @@ async function decompressGzip(filePath: string): Promise { async function createSnapshot(zkSupervisor: boolean) { let command = ''; if (zkSupervisor) { - command = `zk_supervisor snapshot create`; + command = `zk_inception dev snapshot create`; command += ` --chain ${fileConfig.chain}`; } else { command = `zk run snapshots-creator`; diff --git a/docker/Makefile b/docker/Makefile index 72189902aa1a..b309f791528c 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ zkt || true && \ - zk_supervisor contracts + zk_inception dev contracts # Download setup-key prepare-keys: diff --git a/zk_toolbox/zkup/zkup b/zk_toolbox/zkup/zkup index e6ca17487385..3eb8f340ee79 100755 --- a/zk_toolbox/zkup/zkup +++ b/zk_toolbox/zkup/zkup @@ -19,7 +19,7 @@ main() { check_prerequisites mkdir -p "$ZKT_BIN_DIR" - set_bins + BINS+=(zk_inception) if [ -n "$ZKUP_PATH" ]; then install_local @@ -116,9 +116,8 @@ Options: -b, --branch Git branch to use when installing from a repository. Ignored if --commit or --version is provided. -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided. -v, --version Git tag to use when installing from a repository. Ignored if --branch or --commit is provided. - -a, --alias Create aliases zki and zks for zk_inception and zk_supervisor binaries. - --inception Installs the zk_inception binary. Default is to install both zk_inception and zk_supervisor binaries. - --supervisor Installs the zk_supervisor binary. Default is to install both zk_inception and zk_supervisor binaries. + -a, --alias Create aliases zki for zk_inception binaries. + --inception Installs the zk_inception binary. Default is to install both zk_inception binary. -h, --help Show this help message and exit. Examples: @@ -127,21 +126,6 @@ Examples: EOF } -set_bins() { - if [ $ZKUP_INSTALL_INCEPTION -eq 1 ]; then - BINS+=(zk_inception) - fi - - if [ $ZKUP_INSTALL_SUPERVISOR -eq 1 ]; then - BINS+=(zk_supervisor) - fi - - # Installs both binaries if not option is provided - if [ ${#BINS[@]} -eq 0 ]; then - BINS=(zk_inception zk_supervisor) - fi -} - install_local() { if [ ! -d "$ZKUP_PATH/zk_toolbox" ]; then err "Path $ZKUP_PATH does not contain zk_toolbox" @@ -192,11 +176,6 @@ create_alias() { say "Creating alias 'zki' for zk_inception" ensure ln -sf "$ZKT_BIN_DIR/zk_inception" "$ZKT_BIN_DIR/zki" fi - - if [[ "${BINS[@]}" =~ "zk_supervisor" ]]; then - say "Creating alias 'zks' for zk_supervisor" - ensure ln -sf "$ZKT_BIN_DIR/zk_supervisor" "$ZKT_BIN_DIR/zks" - fi } ensure() { From 2d02e41bd1260b566f28ba19447467585ae252bd Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 2 Oct 2024 18:35:20 +0200 Subject: [PATCH 007/103] fix: remove unused flags in zkup --- zk_toolbox/zkup/zkup | 5 ----- 1 file changed, 5 deletions(-) diff --git a/zk_toolbox/zkup/zkup b/zk_toolbox/zkup/zkup index 3eb8f340ee79..a528428fc709 100755 --- a/zk_toolbox/zkup/zkup +++ b/zk_toolbox/zkup/zkup @@ -5,8 +5,6 @@ BASE_DIR=${XDG_CONFIG_HOME:-$HOME} ZKT_DIR=${ZKT_DIR:-"$BASE_DIR/.zkt"} ZKT_BIN_DIR="$ZKT_DIR/bin" -ZKUP_INSTALL_SUPERVISOR=0 -ZKUP_INSTALL_INCEPTION=0 ZKUP_ALIAS=0 BINS=() @@ -87,8 +85,6 @@ parse_args() { shift ZKUP_VERSION=$1 ;; - --inception) ZKUP_INSTALL_INCEPTION=1 ;; - --supervisor) ZKUP_INSTALL_SUPERVISOR=1 ;; -a | --alias) ZKUP_ALIAS=1 ;; -h | --help) usage @@ -117,7 +113,6 @@ Options: -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided. -v, --version Git tag to use when installing from a repository. Ignored if --branch or --commit is provided. -a, --alias Create aliases zki for zk_inception binaries. - --inception Installs the zk_inception binary. Default is to install both zk_inception binary. -h, --help Show this help message and exit. Examples: From a2c36ffe9ea420263255d624a47e07e5e60f8b2b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 15:41:04 +0200 Subject: [PATCH 008/103] fix: allor to run benchmarks on main branch after zks will be removed --- .github/workflows/vm-perf-comparison.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 992483955051..69a8979d5601 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: shell: bash run: | ci_run zkt - ci_run zk_inception dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zk_inception dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes From 5f04a791d340548923250f6d78dc345821c402eb Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 15:47:41 +0200 Subject: [PATCH 009/103] style: format code --- .../zk_inception/src/commands/chain/args/init/configs.rs | 2 +- .../crates/zk_inception/src/commands/chain/init/configs.rs | 6 ++---- .../crates/zk_inception/src/commands/chain/init/mod.rs | 4 ++-- .../crates/zk_inception/src/commands/ecosystem/args/init.rs | 4 ++-- .../crates/zk_inception/src/commands/ecosystem/init.rs | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/init/configs.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/args/init/configs.rs index b4a49f29d219..c26ad6475247 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/args/init/configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/args/init/configs.rs @@ -13,7 +13,7 @@ use crate::{ defaults::LOCAL_RPC_URL, messages::{ 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_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP, }, }; diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init/configs.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/init/configs.rs index e6b9fa7117d4..d0897473b832 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init/configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init/configs.rs @@ -1,10 +1,8 @@ use anyhow::Context; use common::logger; use config::{ - copy_configs, set_l1_rpc_url, update_from_chain_config, - ChainConfig, ContractsConfig, EcosystemConfig, - traits::SaveConfigWithBasePath, - DEFAULT_CONSENSUS_PORT, + copy_configs, set_l1_rpc_url, traits::SaveConfigWithBasePath, update_from_chain_config, + ChainConfig, ContractsConfig, EcosystemConfig, DEFAULT_CONSENSUS_PORT, }; use ethers::types::Address; use xshell::Shell; diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs index 8a36f4e32b2f..ac80a5b98f72 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs @@ -80,7 +80,7 @@ pub async fn init( let init_configs_args = InitConfigsArgsFinal::from_chain_init_args(init_args); let mut contracts_config = init_configs(&init_configs_args, shell, ecosystem_config, chain_config).await?; - + // Fund some wallet addresses with ETH or base token (only for Localhost) distribute_eth(ecosystem_config, chain_config, init_args.l1_rpc_url.clone()).await?; mint_base_token(ecosystem_config, chain_config, init_args.l1_rpc_url.clone()).await?; @@ -178,6 +178,6 @@ pub async fn init( genesis(init_args.genesis_args.clone(), shell, chain_config) .await .context(MSG_GENESIS_DATABASE_ERR)?; - + Ok(()) } diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/init.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/init.rs index 6d6ed2f3fd9e..830b7b25e470 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/init.rs @@ -12,8 +12,8 @@ use crate::{ 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_OBSERVABILITY_HELP, MSG_OBSERVABILITY_PROMPT, - MSG_NO_PORT_REALLOCATION_HELP, + MSG_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP, MSG_OBSERVABILITY_HELP, + MSG_OBSERVABILITY_PROMPT, }, }; diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs index 67ae31628423..6b64b740aedd 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs @@ -366,7 +366,7 @@ async fn init_chains( genesis_args: genesis_args.clone(), deploy_paymaster, l1_rpc_url: Some(final_init_args.ecosystem.l1_rpc_url.clone()), - no_port_reallocation: final_init_args.no_port_reallocation + no_port_reallocation: final_init_args.no_port_reallocation, }; let final_chain_init_args = chain_init_args.fill_values_with_prompt(&chain_config); From c51dd6973e53e0f0d54773110b50a64825ca50a0 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 16:05:16 +0200 Subject: [PATCH 010/103] refactor: rename zk_inception to zkstack --- .githooks/pre-push | 4 +- .github/pull_request_template.md | 2 +- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 +-- .github/workflows/ci-core-reusable.yml | 126 +++++++++--------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- bin/zkt | 5 +- core/tests/recovery-test/src/index.ts | 8 +- core/tests/recovery-test/src/utils.ts | 2 +- .../tests/snapshot-recovery.test.ts | 2 +- core/tests/revert-test/tests/utils.ts | 20 +-- core/tests/ts-integration/src/utils.ts | 6 +- core/tests/upgrade-test/tests/utils.ts | 2 +- docker/Makefile | 2 +- prover/docs/05_proving_batch.md | 22 +-- zk_toolbox/Cargo.lock | 32 ++--- zk_toolbox/Cargo.toml | 2 +- zk_toolbox/crates/common/src/forge.rs | 2 +- .../{zk_inception => zkstack}/Cargo.toml | 2 +- .../{zk_inception => zkstack}/README.md | 0 .../abi/ConsensusRegistry.json | 0 .../crates/{zk_inception => zkstack}/build.rs | 0 .../src/accept_ownership.rs | 0 .../src/commands/args/containers.rs | 0 .../src/commands/args/mod.rs | 0 .../src/commands/args/run_server.rs | 0 .../src/commands/args/update.rs | 0 .../commands/chain/accept_chain_ownership.rs | 0 .../commands/chain/args/build_transactions.rs | 0 .../src/commands/chain/args/create.rs | 0 .../src/commands/chain/args/genesis.rs | 0 .../src/commands/chain/args/init/configs.rs | 0 .../src/commands/chain/args/init/mod.rs | 0 .../src/commands/chain/args/mod.rs | 0 .../src/commands/chain/build_transactions.rs | 0 .../src/commands/chain/common.rs | 0 .../src/commands/chain/create.rs | 0 .../src/commands/chain/deploy_l2_contracts.rs | 0 .../src/commands/chain/deploy_paymaster.rs | 0 .../src/commands/chain/genesis/database.rs | 0 .../src/commands/chain/genesis/mod.rs | 0 .../src/commands/chain/genesis/server.rs | 0 .../src/commands/chain/init/configs.rs | 0 .../src/commands/chain/init/mod.rs | 0 .../src/commands/chain/mod.rs | 0 .../src/commands/chain/register_chain.rs | 0 .../chain/set_token_multiplier_setter.rs | 0 .../src/commands/chain/setup_legacy_bridge.rs | 0 .../src/commands/consensus.rs | 0 .../src/commands/containers.rs | 0 .../commands/contract_verifier/args/init.rs | 0 .../commands/contract_verifier/args/mod.rs | 0 .../contract_verifier/args/releases.rs | 0 .../src/commands/contract_verifier/init.rs | 0 .../src/commands/contract_verifier/mod.rs | 0 .../src/commands/contract_verifier/run.rs | 0 .../src/commands/dev/commands/clean/mod.rs | 0 .../commands/dev/commands/config_writer.rs | 0 .../src/commands/dev/commands/contracts.rs | 0 .../dev/commands/database/args/mod.rs | 0 .../commands/database/args/new_migration.rs | 0 .../dev/commands/database/check_sqlx_data.rs | 0 .../commands/dev/commands/database/drop.rs | 0 .../commands/dev/commands/database/migrate.rs | 0 .../src/commands/dev/commands/database/mod.rs | 0 .../dev/commands/database/new_migration.rs | 0 .../commands/dev/commands/database/prepare.rs | 0 .../commands/dev/commands/database/reset.rs | 0 .../commands/dev/commands/database/setup.rs | 0 .../src/commands/dev/commands/fmt.rs | 0 .../src/commands/dev/commands/lint.rs | 0 .../src/commands/dev/commands/lint_utils.rs | 0 .../src/commands/dev/commands/mod.rs | 0 .../dev/commands/prover/args/insert_batch.rs | 0 .../commands/prover/args/insert_version.rs | 0 .../commands/dev/commands/prover/args/mod.rs | 0 .../src/commands/dev/commands/prover/info.rs | 0 .../dev/commands/prover/insert_batch.rs | 0 .../dev/commands/prover/insert_version.rs | 0 .../src/commands/dev/commands/prover/mod.rs | 0 .../commands/send_transactions/args/mod.rs | 0 .../dev/commands/send_transactions/mod.rs | 0 .../src/commands/dev/commands/snapshot.rs | 0 .../src/commands/dev/commands/sql_fmt.rs | 0 .../commands/dev/commands/test/args/fees.rs | 0 .../dev/commands/test/args/integration.rs | 0 .../commands/dev/commands/test/args/mod.rs | 0 .../dev/commands/test/args/recovery.rs | 0 .../commands/dev/commands/test/args/revert.rs | 0 .../commands/dev/commands/test/args/rust.rs | 0 .../dev/commands/test/args/upgrade.rs | 0 .../src/commands/dev/commands/test/build.rs | 0 .../src/commands/dev/commands/test/db.rs | 0 .../src/commands/dev/commands/test/fees.rs | 0 .../commands/dev/commands/test/integration.rs | 0 .../dev/commands/test/l1_contracts.rs | 0 .../commands/dev/commands/test/loadtest.rs | 0 .../src/commands/dev/commands/test/mod.rs | 0 .../src/commands/dev/commands/test/prover.rs | 0 .../commands/dev/commands/test/recovery.rs | 0 .../src/commands/dev/commands/test/revert.rs | 0 .../src/commands/dev/commands/test/rust.rs | 0 .../src/commands/dev/commands/test/upgrade.rs | 0 .../src/commands/dev/commands/test/utils.rs | 0 .../src/commands/dev/commands/test/wallet.rs | 0 .../src/commands/dev/consts.rs | 0 .../src/commands/dev/dals.rs | 0 .../src/commands/dev/defaults.rs | 0 .../src/commands/dev/messages.rs | 0 .../src/commands/dev/mod.rs | 0 .../ecosystem/args/build_transactions.rs | 0 .../commands/ecosystem/args/change_default.rs | 0 .../src/commands/ecosystem/args/create.rs | 0 .../src/commands/ecosystem/args/init.rs | 0 .../src/commands/ecosystem/args/mod.rs | 0 .../commands/ecosystem/build_transactions.rs | 0 .../src/commands/ecosystem/change_default.rs | 0 .../src/commands/ecosystem/common.rs | 0 .../src/commands/ecosystem/create.rs | 0 .../src/commands/ecosystem/create_configs.rs | 0 .../src/commands/ecosystem/init.rs | 0 .../src/commands/ecosystem/mod.rs | 0 .../commands/ecosystem/setup_observability.rs | 0 .../src/commands/ecosystem/utils.rs | 0 .../src/commands/explorer/backend.rs | 0 .../src/commands/explorer/init.rs | 0 .../src/commands/explorer/mod.rs | 0 .../src/commands/explorer/run.rs | 0 .../src/commands/external_node/args/mod.rs | 0 .../external_node/args/prepare_configs.rs | 0 .../src/commands/external_node/args/run.rs | 0 .../src/commands/external_node/init.rs | 0 .../src/commands/external_node/mod.rs | 0 .../commands/external_node/prepare_configs.rs | 0 .../src/commands/external_node/run.rs | 0 .../src/commands/mod.rs | 0 .../src/commands/portal.rs | 0 .../commands/prover/args/compressor_keys.rs | 0 .../src/commands/prover/args/init.rs | 0 .../commands/prover/args/init_bellman_cuda.rs | 0 .../src/commands/prover/args/mod.rs | 0 .../src/commands/prover/args/run.rs | 0 .../src/commands/prover/args/setup_keys.rs | 0 .../src/commands/prover/compressor_keys.rs | 0 .../src/commands/prover/gcs.rs | 0 .../src/commands/prover/init.rs | 0 .../src/commands/prover/init_bellman_cuda.rs | 0 .../src/commands/prover/mod.rs | 0 .../src/commands/prover/run.rs | 0 .../src/commands/prover/setup_keys.rs | 0 .../src/commands/server.rs | 0 .../src/commands/update.rs | 0 .../{zk_inception => zkstack}/src/consts.rs | 0 .../{zk_inception => zkstack}/src/defaults.rs | 0 .../src/external_node.rs | 0 .../{zk_inception => zkstack}/src/main.rs | 0 .../{zk_inception => zkstack}/src/messages.rs | 4 +- .../src/utils/consensus.rs | 0 .../src/utils/forge.rs | 0 .../src/utils/mod.rs | 0 .../src/utils/ports.rs | 0 .../src/utils/rocks_db.rs | 0 zk_toolbox/zkup/zkup | 18 +-- 171 files changed, 142 insertions(+), 159 deletions(-) rename zk_toolbox/crates/{zk_inception => zkstack}/Cargo.toml (98%) rename zk_toolbox/crates/{zk_inception => zkstack}/README.md (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/abi/ConsensusRegistry.json (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/build.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/accept_ownership.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/args/containers.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/args/run_server.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/args/update.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/accept_chain_ownership.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/args/build_transactions.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/args/create.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/args/genesis.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/args/init/configs.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/args/init/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/build_transactions.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/common.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/create.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/deploy_l2_contracts.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/deploy_paymaster.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/genesis/database.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/genesis/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/genesis/server.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/init/configs.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/init/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/register_chain.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/set_token_multiplier_setter.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/chain/setup_legacy_bridge.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/consensus.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/containers.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/contract_verifier/args/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/contract_verifier/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/contract_verifier/args/releases.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/contract_verifier/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/contract_verifier/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/contract_verifier/run.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/clean/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/config_writer.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/contracts.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/args/new_migration.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/check_sqlx_data.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/drop.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/migrate.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/new_migration.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/prepare.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/reset.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/database/setup.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/fmt.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/lint.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/lint_utils.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/args/insert_batch.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/args/insert_version.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/info.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/insert_batch.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/insert_version.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/prover/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/send_transactions/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/send_transactions/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/snapshot.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/sql_fmt.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/fees.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/integration.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/recovery.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/revert.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/rust.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/args/upgrade.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/build.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/db.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/fees.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/integration.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/l1_contracts.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/loadtest.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/prover.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/recovery.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/revert.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/rust.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/upgrade.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/utils.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/commands/test/wallet.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/consts.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/dals.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/defaults.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/messages.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/dev/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/args/build_transactions.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/args/change_default.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/args/create.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/args/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/build_transactions.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/change_default.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/common.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/create.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/create_configs.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/setup_observability.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/ecosystem/utils.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/explorer/backend.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/explorer/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/explorer/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/explorer/run.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/args/prepare_configs.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/args/run.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/prepare_configs.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/external_node/run.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/portal.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/args/compressor_keys.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/args/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/args/init_bellman_cuda.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/args/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/args/run.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/args/setup_keys.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/compressor_keys.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/gcs.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/init.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/init_bellman_cuda.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/run.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/prover/setup_keys.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/server.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/commands/update.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/consts.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/defaults.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/external_node.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/main.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/messages.rs (99%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/utils/consensus.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/utils/forge.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/utils/mod.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/utils/ports.rs (100%) rename zk_toolbox/crates/{zk_inception => zkstack}/src/utils/rocks_db.rs (100%) diff --git a/.githooks/pre-push b/.githooks/pre-push index d1222e1ab788..4c5ab115c985 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -7,8 +7,8 @@ RED='\033[0;31m' NC='\033[0m' # No Color # Check that prettier formatting rules are not violated. -if which zk_inception >/dev/null; then - if ! zk_inception dev fmt --check; then +if which zkstack >/dev/null; then + if ! zkstack dev fmt --check; then echo -e "${RED}Push error!${NC}" echo "Please format the code via 'zki dev fmt', cannot push unformatted code" exit 1 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index fcfd699f0df7..d68b45e9d435 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,4 +17,4 @@ - [ ] 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 `zk_inception dev fmt` and `zk_inception dev lint`. +- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 1e49627dae5d..3322d6034813 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -121,7 +121,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zk_inception dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index fa9bf0dcc7a8..6cb39957e2c9 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -134,7 +134,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zk_inception dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 37427b8a6afa..c7c7f2c8c18c 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -63,7 +63,7 @@ jobs: ci_run zk ci_run zkt ci_run cp etc/tokens/{test,localhost}.json - ci_run zk_inception dev contracts + ci_run zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index e8f19207b180..36254567302f 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -37,5 +37,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zk_inception dev lint -t rs --check + run: ci_run zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index e7ce12950a5a..8d38fa7e27ce 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -32,18 +32,18 @@ jobs: ci_run ./bin/zkt ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync - ci_run zk_inception dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zk_inception dev fmt --check - ci_run zk_inception dev lint -t md --check - ci_run zk_inception dev lint -t sol --check - ci_run zk_inception dev lint -t js --check - ci_run zk_inception dev lint -t ts --check - ci_run zk_inception dev lint -t rs --check + ci_run zkstack dev fmt --check + ci_run zkstack dev lint -t md --check + ci_run zkstack dev lint -t sol --check + ci_run zkstack dev lint -t js --check + ci_run zkstack dev lint -t ts --check + ci_run zkstack dev lint -t rs --check - name: Check Database run: | - ci_run zk_inception dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 29a30e304853..5a07b25dabf5 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -57,14 +57,14 @@ jobs: run: | ci_run run_retried rustup show ci_run ./bin/zkt - ci_run zk_inception dev contracts + ci_run zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zk_inception dev test rust + ci_run zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -114,7 +114,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zkt - ci_run zk_inception chain create \ + ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -127,18 +127,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run zk_inception ecosystem init --dev --verbose - ci_run zk_inception dev contracts --test-contracts + ci_run zkstack ecosystem init --dev --verbose + ci_run zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zk_inception dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run zk_inception server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zk_inception dev t loadtest -v --chain=legacy + run: ci_run zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -212,7 +212,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zk_inception ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -229,7 +229,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run zk_inception chain create \ + ci_run zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -241,7 +241,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zk_inception chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -252,7 +252,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run zk_inception chain create \ + ci_run zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -264,7 +264,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zk_inception chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -275,7 +275,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run zk_inception chain create \ + ci_run zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -287,11 +287,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zk_inception chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zk_inception dev send-transactions \ + ci_run zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -310,7 +310,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run zk_inception chain create \ + ci_run zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -322,7 +322,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zk_inception chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -333,19 +333,19 @@ jobs: - name: Build test dependencies run: | - ci_run zk_inception dev test build + ci_run zkstack dev test build - name: Initialize Contract verifier run: | - ci_run zk_inception contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run zk_inception contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run zk_inception server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run zk_inception server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run zk_inception server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run zk_inception server --ignore-prerequisites --chain consensus \ + ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -353,21 +353,21 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run zk_inception consensus set-attester-committee --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run zkstack consensus set-attester-committee --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | PASSED_ENV_VARS="RUN_CONTRACT_VERIFICATION_TEST" \ - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -377,35 +377,35 @@ jobs: - name: Init external nodes run: | - ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run zk_inception external-node init --ignore-prerequisites --chain era + ci_run zkstack external-node init --ignore-prerequisites --chain era - ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run zk_inception external-node init --ignore-prerequisites --chain validium + ci_run zkstack external-node init --ignore-prerequisites --chain validium - ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run zk_inception external-node init --ignore-prerequisites --chain custom_token + ci_run zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run zk_inception external-node init --ignore-prerequisites --chain consensus + ci_run zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_inception dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -415,16 +415,16 @@ jobs: - name: Run recovery tests (from genesis) run: | - ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_inception dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -434,23 +434,23 @@ jobs: - name: Run external node server run: | - ci_run zk_inception external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run zk_inception external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run zk_inception external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run zk_inception external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_inception dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -462,16 +462,16 @@ jobs: run: | ci_run killall -INT zksync_server || true - ci_run zk_inception dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & PID1=$! - ci_run zk_inception dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_inception dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_inception dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -484,16 +484,16 @@ jobs: ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & PID2=$! - ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zk_inception dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -507,7 +507,7 @@ jobs: # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zk_inception dev test upgrade --no-deps --chain era + ci_run zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 420b9656ee3c..43c1075368c1 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -35,4 +35,4 @@ jobs: - name: Lints run: | - ci_run zk_inception dev lint -t md --check + ci_run zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 4a90d7f93743..1b637ddce277 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Init run: | ci_run zkt - ci_run zk_inception dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -73,4 +73,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zk_inception dev test prover + ci_run zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index c8710160072d..f4920ae1b916 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -134,7 +134,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zk_inception dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 51486acf43f9..c930df6a9608 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -139,7 +139,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zk_inception dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 69a8979d5601..9fe0aa6d1b6c 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: shell: bash run: | ci_run zkt - ci_run zk_supervisor contracts --system-contracts || ci_run zk_inception dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: shell: bash run: | ci_run zkt - ci_run zk_inception dev contracts --system-contracts + ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 77024ffe83b9..4ee0c90f59bc 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -34,7 +34,7 @@ jobs: run_retried docker compose pull zk docker compose up -d zk ci_run zkt - ci_run zk_inception dev contracts + ci_run zkstack dev contracts - name: run benchmarks run: | diff --git a/bin/zkt b/bin/zkt index 29e495fd5940..cc14c9018dd4 100755 --- a/bin/zkt +++ b/bin/zkt @@ -3,13 +3,12 @@ cd $(dirname $0) if which zkup >/dev/null; then - cargo uninstall zk_inception + cargo uninstall zkstack git config --local core.hooksPath || git config --local core.hooksPath ./.githooks zkup -p .. --alias else echo zkup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup cd ../zk_toolbox - cargo install --path ./crates/zk_inception --force + cargo install --path ./crates/zkstack --force fi - diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index 462404af6065..bac376964bd3 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -78,7 +78,7 @@ export async function getExternalNodeHealth(url: string) { } console.log( `Request to EN health check server failed: ${displayedError}. In CI, you can see more details ` + - 'in "Show * logs" steps' + 'in "Show * logs" steps' ); return null; } @@ -86,7 +86,7 @@ export async function getExternalNodeHealth(url: string) { export async function dropNodeData(env: { [key: string]: string }, useZkSupervisor?: boolean, chain?: string) { if (useZkSupervisor) { - let cmd = 'zk_inception external-node init'; + let cmd = 'zkstack external-node init'; cmd += chain ? ` --chain ${chain}` : ''; await executeNodeCommand(env, cmd); } else { @@ -193,7 +193,7 @@ export class NodeProcess { return new NodeProcess(childProcess, logs); } - private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) {} + private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) { } exitCode() { return this.childProcess.exitCode; @@ -243,7 +243,7 @@ export class FundedWallet { return new FundedWallet(wallet); } - private constructor(private readonly wallet: zksync.Wallet) {} + private constructor(private readonly wallet: zksync.Wallet) { } /** Ensure that this wallet is funded on L2, depositing funds from L1 if necessary. */ async ensureIsFunded() { diff --git a/core/tests/recovery-test/src/utils.ts b/core/tests/recovery-test/src/utils.ts index 98c6b6d4405c..efa5f87dc0c9 100644 --- a/core/tests/recovery-test/src/utils.ts +++ b/core/tests/recovery-test/src/utils.ts @@ -60,7 +60,7 @@ export function runExternalNodeInBackground({ }): ChildProcessWithoutNullStreams { let command = ''; if (useZkInception) { - command = 'zk_inception external-node run'; + command = 'zkstack external-node run'; command += chain ? ` --chain ${chain}` : ''; } else { command = 'zk external-node --'; diff --git a/core/tests/recovery-test/tests/snapshot-recovery.test.ts b/core/tests/recovery-test/tests/snapshot-recovery.test.ts index 6f3d91a7050d..51b129c46de8 100644 --- a/core/tests/recovery-test/tests/snapshot-recovery.test.ts +++ b/core/tests/recovery-test/tests/snapshot-recovery.test.ts @@ -461,7 +461,7 @@ async function decompressGzip(filePath: string): Promise { async function createSnapshot(zkSupervisor: boolean) { let command = ''; if (zkSupervisor) { - command = `zk_inception dev snapshot create`; + command = `zkstack dev snapshot create`; command += ` --chain ${fileConfig.chain}`; } else { command = `zk run snapshots-creator`; diff --git a/core/tests/revert-test/tests/utils.ts b/core/tests/revert-test/tests/utils.ts index ea8a45b97c37..c3b96a3b4fde 100644 --- a/core/tests/revert-test/tests/utils.ts +++ b/core/tests/revert-test/tests/utils.ts @@ -63,7 +63,7 @@ export function runServerInBackground({ }): ChildProcessWithoutNullStreams { let command = ''; if (useZkInception) { - command = 'zk_inception server'; + command = 'zkstack server'; if (chain) { command += ` --chain ${chain}`; } @@ -90,7 +90,7 @@ export function runExternalNodeInBackground({ }): ChildProcessWithoutNullStreams { let command = ''; if (useZkInception) { - command = 'zk_inception external-node run'; + command = 'zkstack external-node run'; command += chain ? ` --chain ${chain}` : ''; } else { command = 'zk external-node'; @@ -153,12 +153,12 @@ async function runBlockReverter( const options = env ? { - cwd: env.ZKSYNC_HOME, - env: { - ...env, - PATH: process.env.PATH - } - } + cwd: env.ZKSYNC_HOME, + env: { + ...env, + PATH: process.env.PATH + } + } : {}; const executedProcess = await exec(cmd, options); return executedProcess.stdout; @@ -229,7 +229,7 @@ export class Node { public readonly tester: Tester, private readonly proc: ChildProcessWithoutNullStreams, private readonly type: TYPE - ) {} + ) { } public async terminate() { try { @@ -308,7 +308,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private readonly env?: ProcessEnvOptions['env'] - ) {} + ) { } public async spawnMainNode(enableExecute: boolean): Promise> { const env = this.env ?? process.env; diff --git a/core/tests/ts-integration/src/utils.ts b/core/tests/ts-integration/src/utils.ts index 128d0be57d00..dedb17f930e3 100644 --- a/core/tests/ts-integration/src/utils.ts +++ b/core/tests/ts-integration/src/utils.ts @@ -34,7 +34,7 @@ export function runServerInBackground({ }): ChildProcessWithoutNullStreams { let command = ''; if (useZkInception) { - command = 'zk_inception server'; + command = 'zkstack server'; if (chain) { command += ` --chain ${chain}`; } @@ -62,7 +62,7 @@ export enum NodeType { } export class Node { - constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) {} + constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) { } public async terminate() { try { @@ -112,7 +112,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private env?: ProcessEnvOptions['env'] - ) {} + ) { } public async spawnMainNode(newL1GasPrice?: string, newPubdataPrice?: string): Promise> { const env = this.env ?? process.env; diff --git a/core/tests/upgrade-test/tests/utils.ts b/core/tests/upgrade-test/tests/utils.ts index 7a7829caf86b..9941acfaec2c 100644 --- a/core/tests/upgrade-test/tests/utils.ts +++ b/core/tests/upgrade-test/tests/utils.ts @@ -19,7 +19,7 @@ export function runServerInBackground({ let command = ''; if (useZkInception) { - command = 'zk_inception server'; + command = 'zkstack server'; command += chain ? ` --chain ${chain}` : ''; } else { command = 'cd $ZKSYNC_HOME && cargo run --bin zksync_server --release --'; diff --git a/docker/Makefile b/docker/Makefile index 0f1378dc79f1..fd590816ee20 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -67,7 +67,7 @@ prepare-contracts: check-tools check-contracts export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ zkt || true && \ - zk_inception dev contracts && \ + zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts # Download setup-key diff --git a/prover/docs/05_proving_batch.md b/prover/docs/05_proving_batch.md index e09a44cb0ff7..73eee42c8e3b 100644 --- a/prover/docs/05_proving_batch.md +++ b/prover/docs/05_proving_batch.md @@ -14,17 +14,17 @@ GPU, which requires an NVIDIA A100 80GB GPU. ### Prerequisites -First of all, you need to install CUDA drivers, all other things will be dealt with by `zk_inception` and `prover_cli` +First of all, you need to install CUDA drivers, all other things will be dealt with by `zkstack` and `prover_cli` tools. For that, check the following [guide](./02_setup.md)(you can skip bellman-cuda step). Install the prerequisites, which you can find [here](https://github.com/matter-labs/zksync-era/blob/main/docs/guides/setup-dev.md). Note, that if you are not using Google VM instance, you also need to install [gcloud](https://cloud.google.com/sdk/docs/install#deb). -Now, you can use `zk_inception` and `prover_cli` tools for setting up the env and running prover subsystem. +Now, you can use `zkstack` and `prover_cli` tools for setting up the env and running prover subsystem. ```shell -cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked zk_inception zk_supervisor prover_cli --force +cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked zkstack zk_supervisor prover_cli --force ``` ## Initializing system @@ -33,14 +33,14 @@ After you have installed the tool, you can create ecosystem(you need to run only running: ```shell -zk_inception ecosystem create --l1-network=localhost --prover-mode=gpu --wallet-creation=localhost --l1-batch-commit-data-generator-mode=rollup --start-containers=true +zkstack ecosystem create --l1-network=localhost --prover-mode=gpu --wallet-creation=localhost --l1-batch-commit-data-generator-mode=rollup --start-containers=true ``` The command will create the ecosystem and all the necessary components for the prover subsystem. You can leave default values for all the prompts you will see Now, you need to initialize the prover subsystem by running: ```shell -zk_inception prover init --shall-save-to-public-bucket=false --setup-database=true --use-default=true --dont-drop=false +zkstack prover init --shall-save-to-public-bucket=false --setup-database=true --use-default=true --dont-drop=false ``` For prompts you can leave default values as well. @@ -118,7 +118,7 @@ prover_cli insert-batch --number= --version=` + /// e.g.: `zkstack init -a --private-key=` #[clap(long, short)] #[arg(trailing_var_arg = true, allow_hyphen_values = true, hide = false)] additional_args: Vec, diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zkstack/Cargo.toml similarity index 98% rename from zk_toolbox/crates/zk_inception/Cargo.toml rename to zk_toolbox/crates/zkstack/Cargo.toml index a81451297f5f..e8bb3911773e 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zkstack/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "zk_inception" +name = "zkstack" version = "0.1.0" edition.workspace = true homepage.workspace = true diff --git a/zk_toolbox/crates/zk_inception/README.md b/zk_toolbox/crates/zkstack/README.md similarity index 100% rename from zk_toolbox/crates/zk_inception/README.md rename to zk_toolbox/crates/zkstack/README.md diff --git a/zk_toolbox/crates/zk_inception/abi/ConsensusRegistry.json b/zk_toolbox/crates/zkstack/abi/ConsensusRegistry.json similarity index 100% rename from zk_toolbox/crates/zk_inception/abi/ConsensusRegistry.json rename to zk_toolbox/crates/zkstack/abi/ConsensusRegistry.json diff --git a/zk_toolbox/crates/zk_inception/build.rs b/zk_toolbox/crates/zkstack/build.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/build.rs rename to zk_toolbox/crates/zkstack/build.rs diff --git a/zk_toolbox/crates/zk_inception/src/accept_ownership.rs b/zk_toolbox/crates/zkstack/src/accept_ownership.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/accept_ownership.rs rename to zk_toolbox/crates/zkstack/src/accept_ownership.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/args/containers.rs b/zk_toolbox/crates/zkstack/src/commands/args/containers.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/args/containers.rs rename to zk_toolbox/crates/zkstack/src/commands/args/containers.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/args/run_server.rs b/zk_toolbox/crates/zkstack/src/commands/args/run_server.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/args/run_server.rs rename to zk_toolbox/crates/zkstack/src/commands/args/run_server.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/args/update.rs b/zk_toolbox/crates/zkstack/src/commands/args/update.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/args/update.rs rename to zk_toolbox/crates/zkstack/src/commands/args/update.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/accept_chain_ownership.rs b/zk_toolbox/crates/zkstack/src/commands/chain/accept_chain_ownership.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/accept_chain_ownership.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/accept_chain_ownership.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/build_transactions.rs b/zk_toolbox/crates/zkstack/src/commands/chain/args/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/args/build_transactions.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/args/build_transactions.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs b/zk_toolbox/crates/zkstack/src/commands/chain/args/create.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/args/create.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/genesis.rs b/zk_toolbox/crates/zkstack/src/commands/chain/args/genesis.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/args/genesis.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/args/genesis.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/init/configs.rs b/zk_toolbox/crates/zkstack/src/commands/chain/args/init/configs.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/args/init/configs.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/args/init/configs.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/init/mod.rs b/zk_toolbox/crates/zkstack/src/commands/chain/args/init/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/args/init/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/args/init/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/chain/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/build_transactions.rs b/zk_toolbox/crates/zkstack/src/commands/chain/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/build_transactions.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/build_transactions.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/common.rs b/zk_toolbox/crates/zkstack/src/commands/chain/common.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/common.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/common.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs b/zk_toolbox/crates/zkstack/src/commands/chain/create.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/create.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/create.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_l2_contracts.rs b/zk_toolbox/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/deploy_l2_contracts.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs b/zk_toolbox/crates/zkstack/src/commands/chain/deploy_paymaster.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/deploy_paymaster.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis/database.rs b/zk_toolbox/crates/zkstack/src/commands/chain/genesis/database.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/genesis/database.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/genesis/database.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis/mod.rs b/zk_toolbox/crates/zkstack/src/commands/chain/genesis/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/genesis/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/genesis/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis/server.rs b/zk_toolbox/crates/zkstack/src/commands/chain/genesis/server.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/genesis/server.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/genesis/server.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init/configs.rs b/zk_toolbox/crates/zkstack/src/commands/chain/init/configs.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/init/configs.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/init/configs.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs b/zk_toolbox/crates/zkstack/src/commands/chain/init/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/init/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs b/zk_toolbox/crates/zkstack/src/commands/chain/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/register_chain.rs b/zk_toolbox/crates/zkstack/src/commands/chain/register_chain.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/register_chain.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/register_chain.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/set_token_multiplier_setter.rs b/zk_toolbox/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/set_token_multiplier_setter.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/setup_legacy_bridge.rs b/zk_toolbox/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/chain/setup_legacy_bridge.rs rename to zk_toolbox/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/consensus.rs b/zk_toolbox/crates/zkstack/src/commands/consensus.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/consensus.rs rename to zk_toolbox/crates/zkstack/src/commands/consensus.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/containers.rs b/zk_toolbox/crates/zkstack/src/commands/containers.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/containers.rs rename to zk_toolbox/crates/zkstack/src/commands/containers.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/contract_verifier/args/init.rs b/zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/contract_verifier/args/init.rs rename to zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/contract_verifier/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/contract_verifier/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/contract_verifier/args/releases.rs b/zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/releases.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/contract_verifier/args/releases.rs rename to zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/releases.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/contract_verifier/init.rs b/zk_toolbox/crates/zkstack/src/commands/contract_verifier/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/contract_verifier/init.rs rename to zk_toolbox/crates/zkstack/src/commands/contract_verifier/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/contract_verifier/mod.rs b/zk_toolbox/crates/zkstack/src/commands/contract_verifier/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/contract_verifier/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/contract_verifier/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/contract_verifier/run.rs b/zk_toolbox/crates/zkstack/src/commands/contract_verifier/run.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/contract_verifier/run.rs rename to zk_toolbox/crates/zkstack/src/commands/contract_verifier/run.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/clean/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/clean/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/clean/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/clean/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/config_writer.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/config_writer.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/config_writer.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/config_writer.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/contracts.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/contracts.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/contracts.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/contracts.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/new_migration.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/args/new_migration.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/check_sqlx_data.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/check_sqlx_data.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/drop.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/drop.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/drop.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/drop.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/migrate.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/migrate.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/migrate.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/migrate.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/new_migration.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/new_migration.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/new_migration.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/new_migration.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/prepare.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/prepare.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/prepare.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/prepare.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/reset.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/reset.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/reset.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/reset.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/setup.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/setup.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/database/setup.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/database/setup.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/fmt.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/fmt.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/fmt.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/fmt.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/lint.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/lint.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint_utils.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/lint_utils.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/lint_utils.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/lint_utils.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_batch.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_batch.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_version.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/insert_version.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/info.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/info.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/info.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/info.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_batch.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_batch.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_version.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/insert_version.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/prover/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/send_transactions/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/snapshot.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/snapshot.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/snapshot.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/snapshot.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/sql_fmt.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/sql_fmt.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/sql_fmt.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/sql_fmt.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/fees.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/fees.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/fees.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/fees.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/integration.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/integration.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/integration.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/integration.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/recovery.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/revert.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/revert.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/revert.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/revert.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/rust.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/rust.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/rust.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/rust.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/upgrade.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/args/upgrade.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/build.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/build.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/build.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/build.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/db.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/db.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/db.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/db.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/fees.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/fees.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/fees.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/fees.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/integration.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/integration.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/integration.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/integration.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/l1_contracts.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/l1_contracts.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/loadtest.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/loadtest.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/loadtest.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/loadtest.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/prover.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/prover.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/prover.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/prover.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/recovery.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/recovery.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/recovery.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/recovery.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/revert.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/revert.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/revert.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/revert.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/rust.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/rust.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/rust.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/rust.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/upgrade.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/upgrade.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/upgrade.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/upgrade.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/utils.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/utils.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/utils.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/utils.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/wallet.rs b/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/wallet.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/commands/test/wallet.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/commands/test/wallet.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/consts.rs b/zk_toolbox/crates/zkstack/src/commands/dev/consts.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/consts.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/consts.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/dals.rs b/zk_toolbox/crates/zkstack/src/commands/dev/dals.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/dals.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/dals.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/defaults.rs b/zk_toolbox/crates/zkstack/src/commands/dev/defaults.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/defaults.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/defaults.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/messages.rs b/zk_toolbox/crates/zkstack/src/commands/dev/messages.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/messages.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/messages.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs b/zk_toolbox/crates/zkstack/src/commands/dev/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/dev/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/dev/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/build_transactions.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/build_transactions.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/change_default.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/change_default.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/change_default.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/args/change_default.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/create.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/args/create.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/init.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/init.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/args/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/build_transactions.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/build_transactions.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/build_transactions.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/change_default.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/change_default.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/change_default.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/change_default.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/common.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/common.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/common.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/common.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/create.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/create.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create_configs.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/create_configs.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/create_configs.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/create_configs.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/mod.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/setup_observability.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/setup_observability.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/setup_observability.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/setup_observability.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/utils.rs b/zk_toolbox/crates/zkstack/src/commands/ecosystem/utils.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/ecosystem/utils.rs rename to zk_toolbox/crates/zkstack/src/commands/ecosystem/utils.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/explorer/backend.rs b/zk_toolbox/crates/zkstack/src/commands/explorer/backend.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/explorer/backend.rs rename to zk_toolbox/crates/zkstack/src/commands/explorer/backend.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/explorer/init.rs b/zk_toolbox/crates/zkstack/src/commands/explorer/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/explorer/init.rs rename to zk_toolbox/crates/zkstack/src/commands/explorer/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/explorer/mod.rs b/zk_toolbox/crates/zkstack/src/commands/explorer/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/explorer/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/explorer/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/explorer/run.rs b/zk_toolbox/crates/zkstack/src/commands/explorer/run.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/explorer/run.rs rename to zk_toolbox/crates/zkstack/src/commands/explorer/run.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/args/prepare_configs.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/args/prepare_configs.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/args/prepare_configs.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/args/prepare_configs.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/args/run.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/args/run.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/args/run.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/args/run.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/mod.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/prepare_configs.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/prepare_configs.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/run.rs b/zk_toolbox/crates/zkstack/src/commands/external_node/run.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/external_node/run.rs rename to zk_toolbox/crates/zkstack/src/commands/external_node/run.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/mod.rs b/zk_toolbox/crates/zkstack/src/commands/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/portal.rs b/zk_toolbox/crates/zkstack/src/commands/portal.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/portal.rs rename to zk_toolbox/crates/zkstack/src/commands/portal.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/compressor_keys.rs b/zk_toolbox/crates/zkstack/src/commands/prover/args/compressor_keys.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/args/compressor_keys.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/args/compressor_keys.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs b/zk_toolbox/crates/zkstack/src/commands/prover/args/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/args/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init_bellman_cuda.rs b/zk_toolbox/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/args/init_bellman_cuda.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/mod.rs b/zk_toolbox/crates/zkstack/src/commands/prover/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/args/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/args/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs b/zk_toolbox/crates/zkstack/src/commands/prover/args/run.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/args/run.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/setup_keys.rs b/zk_toolbox/crates/zkstack/src/commands/prover/args/setup_keys.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/args/setup_keys.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/args/setup_keys.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/compressor_keys.rs b/zk_toolbox/crates/zkstack/src/commands/prover/compressor_keys.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/compressor_keys.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/compressor_keys.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/gcs.rs b/zk_toolbox/crates/zkstack/src/commands/prover/gcs.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/gcs.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/gcs.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs b/zk_toolbox/crates/zkstack/src/commands/prover/init.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/init.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/init.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs b/zk_toolbox/crates/zkstack/src/commands/prover/init_bellman_cuda.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/init_bellman_cuda.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs b/zk_toolbox/crates/zkstack/src/commands/prover/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs b/zk_toolbox/crates/zkstack/src/commands/prover/run.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/run.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/run.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs b/zk_toolbox/crates/zkstack/src/commands/prover/setup_keys.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs rename to zk_toolbox/crates/zkstack/src/commands/prover/setup_keys.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/server.rs b/zk_toolbox/crates/zkstack/src/commands/server.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/server.rs rename to zk_toolbox/crates/zkstack/src/commands/server.rs diff --git a/zk_toolbox/crates/zk_inception/src/commands/update.rs b/zk_toolbox/crates/zkstack/src/commands/update.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/commands/update.rs rename to zk_toolbox/crates/zkstack/src/commands/update.rs diff --git a/zk_toolbox/crates/zk_inception/src/consts.rs b/zk_toolbox/crates/zkstack/src/consts.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/consts.rs rename to zk_toolbox/crates/zkstack/src/consts.rs diff --git a/zk_toolbox/crates/zk_inception/src/defaults.rs b/zk_toolbox/crates/zkstack/src/defaults.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/defaults.rs rename to zk_toolbox/crates/zkstack/src/defaults.rs diff --git a/zk_toolbox/crates/zk_inception/src/external_node.rs b/zk_toolbox/crates/zkstack/src/external_node.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/external_node.rs rename to zk_toolbox/crates/zkstack/src/external_node.rs diff --git a/zk_toolbox/crates/zk_inception/src/main.rs b/zk_toolbox/crates/zkstack/src/main.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/main.rs rename to zk_toolbox/crates/zkstack/src/main.rs diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zkstack/src/messages.rs similarity index 99% rename from zk_toolbox/crates/zk_inception/src/messages.rs rename to zk_toolbox/crates/zkstack/src/messages.rs index ebdcf7378a44..d1d86db83989 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zkstack/src/messages.rs @@ -296,7 +296,7 @@ pub(super) const MSG_EXPLORER_FAILED_TO_RUN_DOCKER_ERR: &str = pub(super) const MSG_EXPLORER_FAILED_TO_CREATE_CONFIG_ERR: &str = "Failed to create explorer config"; pub(super) const MSG_EXPLORER_FAILED_TO_FIND_ANY_CHAIN_ERR: &str = - "Failed to find any valid chain to run explorer for. Did you run `zk_inception explorer init`?"; + "Failed to find any valid chain to run explorer for. Did you run `zkstack explorer init`?"; pub(super) const MSG_EXPLORER_INITIALIZED: &str = "Explorer has been initialized successfully"; pub(super) fn msg_explorer_initializing_database_for(chain: &str) -> String { format!("Initializing explorer database for {chain} chain") @@ -311,7 +311,7 @@ pub(super) fn msg_explorer_starting_on(host: &str, port: u16) -> String { format!("Starting explorer on http://{host}:{port}") } pub(super) fn msg_explorer_chain_not_initialized(chain: &str) -> String { - format!("Chain {chain} is not initialized for explorer: run `zk_inception explorer init --chain {chain}` first") + format!("Chain {chain} is not initialized for explorer: run `zkstack explorer init --chain {chain}` first") } /// Forge utils related messages diff --git a/zk_toolbox/crates/zk_inception/src/utils/consensus.rs b/zk_toolbox/crates/zkstack/src/utils/consensus.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/utils/consensus.rs rename to zk_toolbox/crates/zkstack/src/utils/consensus.rs diff --git a/zk_toolbox/crates/zk_inception/src/utils/forge.rs b/zk_toolbox/crates/zkstack/src/utils/forge.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/utils/forge.rs rename to zk_toolbox/crates/zkstack/src/utils/forge.rs diff --git a/zk_toolbox/crates/zk_inception/src/utils/mod.rs b/zk_toolbox/crates/zkstack/src/utils/mod.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/utils/mod.rs rename to zk_toolbox/crates/zkstack/src/utils/mod.rs diff --git a/zk_toolbox/crates/zk_inception/src/utils/ports.rs b/zk_toolbox/crates/zkstack/src/utils/ports.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/utils/ports.rs rename to zk_toolbox/crates/zkstack/src/utils/ports.rs diff --git a/zk_toolbox/crates/zk_inception/src/utils/rocks_db.rs b/zk_toolbox/crates/zkstack/src/utils/rocks_db.rs similarity index 100% rename from zk_toolbox/crates/zk_inception/src/utils/rocks_db.rs rename to zk_toolbox/crates/zkstack/src/utils/rocks_db.rs diff --git a/zk_toolbox/zkup/zkup b/zk_toolbox/zkup/zkup index a528428fc709..dcff19de5c14 100755 --- a/zk_toolbox/zkup/zkup +++ b/zk_toolbox/zkup/zkup @@ -5,8 +5,6 @@ BASE_DIR=${XDG_CONFIG_HOME:-$HOME} ZKT_DIR=${ZKT_DIR:-"$BASE_DIR/.zkt"} ZKT_BIN_DIR="$ZKT_DIR/bin" -ZKUP_ALIAS=0 - BINS=() main() { @@ -17,7 +15,7 @@ main() { check_prerequisites mkdir -p "$ZKT_BIN_DIR" - BINS+=(zk_inception) + BINS+=(zkstack) if [ -n "$ZKUP_PATH" ]; then install_local @@ -30,10 +28,6 @@ main() { for bin in "${BINS[@]}"; do success "Installed $bin to $ZKT_BIN_DIR/$bin" done - - if [ $ZKUP_ALIAS -eq 1 ]; then - create_alias - fi } PREREQUISITES=(cargo git) @@ -85,7 +79,6 @@ parse_args() { shift ZKUP_VERSION=$1 ;; - -a | --alias) ZKUP_ALIAS=1 ;; -h | --help) usage exit 0 @@ -112,12 +105,10 @@ Options: -b, --branch Git branch to use when installing from a repository. Ignored if --commit or --version is provided. -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided. -v, --version Git tag to use when installing from a repository. Ignored if --branch or --commit is provided. - -a, --alias Create aliases zki for zk_inception binaries. -h, --help Show this help message and exit. Examples: $(basename "$0") --repo matter-labs/zksync-era --version 0.1.1 - $(basename "$0") --path /path/to/local/zk_toolbox --inception EOF } @@ -166,13 +157,6 @@ install_from_repo() { fi } -create_alias() { - if [[ "${BINS[@]}" =~ "zk_inception" ]]; then - say "Creating alias 'zki' for zk_inception" - ensure ln -sf "$ZKT_BIN_DIR/zk_inception" "$ZKT_BIN_DIR/zki" - fi -} - ensure() { if ! "$@"; then err "command failed: $*" From 805515c4677139f104b72116a1df6b3c1a6d1648 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 16:09:57 +0200 Subject: [PATCH 011/103] style: format code --- core/tests/recovery-test/src/index.ts | 6 +++--- core/tests/revert-test/tests/utils.ts | 16 ++++++++-------- core/tests/ts-integration/src/utils.ts | 4 ++-- prover/docs/05_proving_batch.md | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index bac376964bd3..f2bbc8f34e1d 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -78,7 +78,7 @@ export async function getExternalNodeHealth(url: string) { } console.log( `Request to EN health check server failed: ${displayedError}. In CI, you can see more details ` + - 'in "Show * logs" steps' + 'in "Show * logs" steps' ); return null; } @@ -193,7 +193,7 @@ export class NodeProcess { return new NodeProcess(childProcess, logs); } - private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) { } + private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) {} exitCode() { return this.childProcess.exitCode; @@ -243,7 +243,7 @@ export class FundedWallet { return new FundedWallet(wallet); } - private constructor(private readonly wallet: zksync.Wallet) { } + private constructor(private readonly wallet: zksync.Wallet) {} /** Ensure that this wallet is funded on L2, depositing funds from L1 if necessary. */ async ensureIsFunded() { diff --git a/core/tests/revert-test/tests/utils.ts b/core/tests/revert-test/tests/utils.ts index c3b96a3b4fde..59950cdd77fb 100644 --- a/core/tests/revert-test/tests/utils.ts +++ b/core/tests/revert-test/tests/utils.ts @@ -153,12 +153,12 @@ async function runBlockReverter( const options = env ? { - cwd: env.ZKSYNC_HOME, - env: { - ...env, - PATH: process.env.PATH - } - } + cwd: env.ZKSYNC_HOME, + env: { + ...env, + PATH: process.env.PATH + } + } : {}; const executedProcess = await exec(cmd, options); return executedProcess.stdout; @@ -229,7 +229,7 @@ export class Node { public readonly tester: Tester, private readonly proc: ChildProcessWithoutNullStreams, private readonly type: TYPE - ) { } + ) {} public async terminate() { try { @@ -308,7 +308,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private readonly env?: ProcessEnvOptions['env'] - ) { } + ) {} public async spawnMainNode(enableExecute: boolean): Promise> { const env = this.env ?? process.env; diff --git a/core/tests/ts-integration/src/utils.ts b/core/tests/ts-integration/src/utils.ts index dedb17f930e3..3fdbc0ae8bd3 100644 --- a/core/tests/ts-integration/src/utils.ts +++ b/core/tests/ts-integration/src/utils.ts @@ -62,7 +62,7 @@ export enum NodeType { } export class Node { - constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) { } + constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) {} public async terminate() { try { @@ -112,7 +112,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private env?: ProcessEnvOptions['env'] - ) { } + ) {} public async spawnMainNode(newL1GasPrice?: string, newPubdataPrice?: string): Promise> { const env = this.env ?? process.env; diff --git a/prover/docs/05_proving_batch.md b/prover/docs/05_proving_batch.md index 73eee42c8e3b..518401b877ec 100644 --- a/prover/docs/05_proving_batch.md +++ b/prover/docs/05_proving_batch.md @@ -14,8 +14,8 @@ GPU, which requires an NVIDIA A100 80GB GPU. ### Prerequisites -First of all, you need to install CUDA drivers, all other things will be dealt with by `zkstack` and `prover_cli` -tools. For that, check the following [guide](./02_setup.md)(you can skip bellman-cuda step). +First of all, you need to install CUDA drivers, all other things will be dealt with by `zkstack` and `prover_cli` tools. +For that, check the following [guide](./02_setup.md)(you can skip bellman-cuda step). Install the prerequisites, which you can find [here](https://github.com/matter-labs/zksync-era/blob/main/docs/guides/setup-dev.md). Note, that if you are not using From 5e2de693e25775d79b67e80a59474c0508a9d067 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 16:32:47 +0200 Subject: [PATCH 012/103] docs: fix zk_supervisor occurences in docs --- prover/docs/05_proving_batch.md | 14 ++++++++++++-- zk_toolbox/README.md | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/prover/docs/05_proving_batch.md b/prover/docs/05_proving_batch.md index 518401b877ec..3a4077b4de39 100644 --- a/prover/docs/05_proving_batch.md +++ b/prover/docs/05_proving_batch.md @@ -87,13 +87,23 @@ After you have the data, you need to prepare the system to run the batch. So, da the protocol version it should use. You can do that with running ```shell -zk_supervisor prover-version +zkstack dev prover info ``` Example output: ```shell -Current protocol version found in zksync-era: 0.24.2, snark_wrapper: "0x14f97b81e54b35fe673d8708cc1a19e1ea5b5e348e12d31e39824ed4f42bbca2" +=============================== + +Current prover setup information: + +Protocol version: 0.24.2 + +Snark wrapper: 0x14f97b81e54b35fe673d8708cc1a19e1ea5b5e348e12d31e39824ed4f42bbca2 + +Database URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_era + +=============================== ``` This command will provide you with the information about the semantic protocol version(you need to know only minor and diff --git a/zk_toolbox/README.md b/zk_toolbox/README.md index a3b44fa98b32..7b08cfe560d7 100644 --- a/zk_toolbox/README.md +++ b/zk_toolbox/README.md @@ -314,7 +314,7 @@ Tools for developing ZKsync. Commands for database manipulation: ```bash -zk_supervisor db +zkstack dev db ``` Possible commands: @@ -332,7 +332,7 @@ Possible commands: Clean artifacts: ```bash -zk_supervisor clean +zkstack dev clean ``` Possible commands: @@ -346,7 +346,7 @@ Possible commands: Run ZKsync tests: ```bash -zk_supervisor test +zkstack dev test ``` Possible commands: From fa0c34c08a89b8236588b601f78d7dafbfeeff18 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 16:58:20 +0200 Subject: [PATCH 013/103] refactor: remove occurences of zk_toolbox --- .githooks/pre-push | 2 +- .github/release-please/config.json | 6 +++--- .github/release-please/manifest.json | 4 ++-- .github/workflows/ci-core-reusable.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .gitignore | 2 +- bin/zkt | 4 ++-- core/lib/utils/src/env.rs | 4 ++-- flake.nix | 2 +- infrastructure/zk/src/fmt.ts | 2 +- infrastructure/zk/src/lint.ts | 2 +- prover/docs/05_proving_batch.md | 8 ++++---- {zk_toolbox => zkstack_cli}/CHANGELOG.md | 0 {zk_toolbox => zkstack_cli}/Cargo.lock | 0 {zk_toolbox => zkstack_cli}/Cargo.toml | 2 +- {zk_toolbox => zkstack_cli}/README.md | 2 +- .../crates/common/Cargo.toml | 0 .../crates/common/src/cmd.rs | 0 .../crates/common/src/config.rs | 0 .../crates/common/src/db.rs | 0 .../crates/common/src/docker.rs | 0 .../crates/common/src/ethereum.rs | 0 .../crates/common/src/external_node.rs | 0 .../crates/common/src/files.rs | 0 .../crates/common/src/forge.rs | 0 .../crates/common/src/git.rs | 0 .../crates/common/src/lib.rs | 0 .../crates/common/src/prerequisites.rs | 0 .../crates/common/src/prompt/confirm.rs | 0 .../crates/common/src/prompt/input.rs | 0 .../crates/common/src/prompt/mod.rs | 0 .../crates/common/src/prompt/select.rs | 0 .../crates/common/src/server.rs | 0 .../crates/common/src/term/error.rs | 0 .../crates/common/src/term/logger.rs | 0 .../crates/common/src/term/mod.rs | 0 .../crates/common/src/term/spinner.rs | 0 .../crates/common/src/version.rs | 0 .../crates/common/src/wallets.rs | 0 .../crates/common/src/yaml.rs | 0 .../crates/config/Cargo.toml | 0 .../crates/config/src/apps.rs | 0 .../crates/config/src/chain.rs | 0 .../crates/config/src/consensus_config.rs | 0 .../crates/config/src/consensus_secrets.rs | 0 .../crates/config/src/consts.rs | 0 .../crates/config/src/contracts.rs | 0 .../crates/config/src/docker_compose.rs | 0 .../crates/config/src/ecosystem.rs | 0 .../crates/config/src/explorer.rs | 0 .../crates/config/src/explorer_compose.rs | 0 .../crates/config/src/external_node.rs | 0 .../crates/config/src/file_config.rs | 0 .../forge_interface/accept_ownership/mod.rs | 0 .../forge_interface/deploy_ecosystem/input.rs | 0 .../forge_interface/deploy_ecosystem/mod.rs | 0 .../deploy_ecosystem/output.rs | 0 .../deploy_l2_contracts/input.rs | 0 .../deploy_l2_contracts/mod.rs | 0 .../deploy_l2_contracts/output.rs | 0 .../crates/config/src/forge_interface/mod.rs | 0 .../src/forge_interface/paymaster/mod.rs | 0 .../forge_interface/register_chain/input.rs | 0 .../src/forge_interface/register_chain/mod.rs | 0 .../forge_interface/register_chain/output.rs | 0 .../src/forge_interface/script_params.rs | 0 .../setup_legacy_bridge/mod.rs | 0 .../crates/config/src/general.rs | 0 .../crates/config/src/genesis.rs | 0 .../crates/config/src/lib.rs | 0 .../crates/config/src/manipulations.rs | 0 .../crates/config/src/portal.rs | 0 .../crates/config/src/secrets.rs | 0 .../crates/config/src/traits.rs | 0 .../crates/config/src/wallet_creation.rs | 0 .../crates/config/src/wallets.rs | 0 .../crates/git_version_macro/Cargo.toml | 0 .../crates/git_version_macro/src/lib.rs | 0 .../crates/types/Cargo.toml | 0 .../crates/types/src/base_token.rs | 0 .../crates/types/src/l1_network.rs | 0 .../crates/types/src/lib.rs | 0 .../crates/types/src/prover_mode.rs | 0 .../crates/types/src/token_info.rs | 0 .../crates/types/src/wallet_creation.rs | 0 .../crates/zkstack/Cargo.toml | 0 .../crates/zkstack/README.md | 0 .../crates/zkstack/abi/ConsensusRegistry.json | 0 .../crates/zkstack/build.rs | 0 .../crates/zkstack/src/accept_ownership.rs | 0 .../zkstack/src/commands/args/containers.rs | 0 .../crates/zkstack/src/commands/args/mod.rs | 0 .../zkstack/src/commands/args/run_server.rs | 0 .../zkstack/src/commands/args/update.rs | 0 .../commands/chain/accept_chain_ownership.rs | 0 .../commands/chain/args/build_transactions.rs | 0 .../zkstack/src/commands/chain/args/create.rs | 0 .../src/commands/chain/args/genesis.rs | 0 .../src/commands/chain/args/init/configs.rs | 0 .../src/commands/chain/args/init/mod.rs | 0 .../zkstack/src/commands/chain/args/mod.rs | 0 .../src/commands/chain/build_transactions.rs | 0 .../zkstack/src/commands/chain/common.rs | 0 .../zkstack/src/commands/chain/create.rs | 0 .../src/commands/chain/deploy_l2_contracts.rs | 0 .../src/commands/chain/deploy_paymaster.rs | 0 .../src/commands/chain/genesis/database.rs | 0 .../zkstack/src/commands/chain/genesis/mod.rs | 0 .../src/commands/chain/genesis/server.rs | 0 .../src/commands/chain/init/configs.rs | 0 .../zkstack/src/commands/chain/init/mod.rs | 0 .../crates/zkstack/src/commands/chain/mod.rs | 0 .../src/commands/chain/register_chain.rs | 0 .../chain/set_token_multiplier_setter.rs | 0 .../src/commands/chain/setup_legacy_bridge.rs | 0 .../crates/zkstack/src/commands/consensus.rs | 0 .../crates/zkstack/src/commands/containers.rs | 0 .../commands/contract_verifier/args/init.rs | 0 .../commands/contract_verifier/args/mod.rs | 0 .../contract_verifier/args/releases.rs | 0 .../src/commands/contract_verifier/init.rs | 0 .../src/commands/contract_verifier/mod.rs | 0 .../src/commands/contract_verifier/run.rs | 0 .../src/commands/dev/commands/clean/mod.rs | 0 .../commands/dev/commands/config_writer.rs | 0 .../src/commands/dev/commands/contracts.rs | 0 .../dev/commands/database/args/mod.rs | 0 .../commands/database/args/new_migration.rs | 0 .../dev/commands/database/check_sqlx_data.rs | 0 .../commands/dev/commands/database/drop.rs | 0 .../commands/dev/commands/database/migrate.rs | 0 .../src/commands/dev/commands/database/mod.rs | 0 .../dev/commands/database/new_migration.rs | 0 .../commands/dev/commands/database/prepare.rs | 0 .../commands/dev/commands/database/reset.rs | 0 .../commands/dev/commands/database/setup.rs | 0 .../zkstack/src/commands/dev/commands/fmt.rs | 2 +- .../zkstack/src/commands/dev/commands/lint.rs | 2 +- .../src/commands/dev/commands/lint_utils.rs | 0 .../zkstack/src/commands/dev/commands/mod.rs | 0 .../dev/commands/prover/args/insert_batch.rs | 0 .../commands/prover/args/insert_version.rs | 0 .../commands/dev/commands/prover/args/mod.rs | 0 .../src/commands/dev/commands/prover/info.rs | 0 .../dev/commands/prover/insert_batch.rs | 0 .../dev/commands/prover/insert_version.rs | 0 .../src/commands/dev/commands/prover/mod.rs | 0 .../commands/send_transactions/args/mod.rs | 0 .../dev/commands/send_transactions/mod.rs | 0 .../src/commands/dev/commands/snapshot.rs | 0 .../src/commands/dev/commands/sql_fmt.rs | 2 +- .../commands/dev/commands/test/args/fees.rs | 0 .../dev/commands/test/args/integration.rs | 0 .../commands/dev/commands/test/args/mod.rs | 0 .../dev/commands/test/args/recovery.rs | 0 .../commands/dev/commands/test/args/revert.rs | 0 .../commands/dev/commands/test/args/rust.rs | 0 .../dev/commands/test/args/upgrade.rs | 0 .../src/commands/dev/commands/test/build.rs | 0 .../src/commands/dev/commands/test/db.rs | 0 .../src/commands/dev/commands/test/fees.rs | 0 .../commands/dev/commands/test/integration.rs | 0 .../dev/commands/test/l1_contracts.rs | 0 .../commands/dev/commands/test/loadtest.rs | 0 .../src/commands/dev/commands/test/mod.rs | 0 .../src/commands/dev/commands/test/prover.rs | 0 .../commands/dev/commands/test/recovery.rs | 0 .../src/commands/dev/commands/test/revert.rs | 0 .../src/commands/dev/commands/test/rust.rs | 4 ++-- .../src/commands/dev/commands/test/upgrade.rs | 0 .../src/commands/dev/commands/test/utils.rs | 0 .../src/commands/dev/commands/test/wallet.rs | 0 .../crates/zkstack/src/commands/dev/consts.rs | 0 .../crates/zkstack/src/commands/dev/dals.rs | 0 .../zkstack/src/commands/dev/defaults.rs | 0 .../zkstack/src/commands/dev/messages.rs | 0 .../crates/zkstack/src/commands/dev/mod.rs | 0 .../ecosystem/args/build_transactions.rs | 0 .../commands/ecosystem/args/change_default.rs | 0 .../src/commands/ecosystem/args/create.rs | 0 .../src/commands/ecosystem/args/init.rs | 0 .../src/commands/ecosystem/args/mod.rs | 0 .../commands/ecosystem/build_transactions.rs | 0 .../src/commands/ecosystem/change_default.rs | 0 .../zkstack/src/commands/ecosystem/common.rs | 0 .../zkstack/src/commands/ecosystem/create.rs | 0 .../src/commands/ecosystem/create_configs.rs | 0 .../zkstack/src/commands/ecosystem/init.rs | 0 .../zkstack/src/commands/ecosystem/mod.rs | 0 .../commands/ecosystem/setup_observability.rs | 0 .../zkstack/src/commands/ecosystem/utils.rs | 0 .../zkstack/src/commands/explorer/backend.rs | 0 .../zkstack/src/commands/explorer/init.rs | 0 .../zkstack/src/commands/explorer/mod.rs | 0 .../zkstack/src/commands/explorer/run.rs | 0 .../src/commands/external_node/args/mod.rs | 0 .../external_node/args/prepare_configs.rs | 0 .../src/commands/external_node/args/run.rs | 0 .../src/commands/external_node/init.rs | 0 .../zkstack/src/commands/external_node/mod.rs | 0 .../commands/external_node/prepare_configs.rs | 0 .../zkstack/src/commands/external_node/run.rs | 0 .../crates/zkstack/src/commands/mod.rs | 0 .../crates/zkstack/src/commands/portal.rs | 0 .../commands/prover/args/compressor_keys.rs | 0 .../zkstack/src/commands/prover/args/init.rs | 0 .../commands/prover/args/init_bellman_cuda.rs | 0 .../zkstack/src/commands/prover/args/mod.rs | 0 .../zkstack/src/commands/prover/args/run.rs | 0 .../src/commands/prover/args/setup_keys.rs | 0 .../src/commands/prover/compressor_keys.rs | 0 .../crates/zkstack/src/commands/prover/gcs.rs | 0 .../zkstack/src/commands/prover/init.rs | 0 .../src/commands/prover/init_bellman_cuda.rs | 0 .../crates/zkstack/src/commands/prover/mod.rs | 0 .../crates/zkstack/src/commands/prover/run.rs | 0 .../zkstack/src/commands/prover/setup_keys.rs | 0 .../crates/zkstack/src/commands/server.rs | 0 .../crates/zkstack/src/commands/update.rs | 0 .../crates/zkstack/src/consts.rs | 0 .../crates/zkstack/src/defaults.rs | 0 .../crates/zkstack/src/external_node.rs | 0 .../crates/zkstack/src/main.rs | 0 .../crates/zkstack/src/messages.rs | 0 .../crates/zkstack/src/utils/consensus.rs | 0 .../crates/zkstack/src/utils/forge.rs | 0 .../crates/zkstack/src/utils/mod.rs | 0 .../crates/zkstack/src/utils/ports.rs | 0 .../crates/zkstack/src/utils/rocks_db.rs | 0 {zk_toolbox => zkstack_cli}/rust-toolchain | 0 {zk_toolbox => zkstack_cli}/zkup/README.md | 20 +++++++++---------- {zk_toolbox => zkstack_cli}/zkup/install | 2 +- {zk_toolbox => zkstack_cli}/zkup/zkup | 16 +++++++-------- 233 files changed, 47 insertions(+), 47 deletions(-) rename {zk_toolbox => zkstack_cli}/CHANGELOG.md (100%) rename {zk_toolbox => zkstack_cli}/Cargo.lock (100%) rename {zk_toolbox => zkstack_cli}/Cargo.toml (95%) rename {zk_toolbox => zkstack_cli}/README.md (99%) rename {zk_toolbox => zkstack_cli}/crates/common/Cargo.toml (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/cmd.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/config.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/db.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/docker.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/ethereum.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/external_node.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/files.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/forge.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/git.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/lib.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/prerequisites.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/prompt/confirm.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/prompt/input.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/prompt/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/prompt/select.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/server.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/term/error.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/term/logger.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/term/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/term/spinner.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/version.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/wallets.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/common/src/yaml.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/Cargo.toml (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/apps.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/chain.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/consensus_config.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/consensus_secrets.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/consts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/contracts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/docker_compose.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/ecosystem.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/explorer.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/explorer_compose.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/external_node.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/file_config.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/accept_ownership/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/deploy_ecosystem/input.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/deploy_ecosystem/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/deploy_ecosystem/output.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/deploy_l2_contracts/input.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/deploy_l2_contracts/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/deploy_l2_contracts/output.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/paymaster/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/register_chain/input.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/register_chain/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/register_chain/output.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/script_params.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/general.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/genesis.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/lib.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/manipulations.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/portal.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/secrets.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/traits.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/wallet_creation.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/config/src/wallets.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/git_version_macro/Cargo.toml (100%) rename {zk_toolbox => zkstack_cli}/crates/git_version_macro/src/lib.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/types/Cargo.toml (100%) rename {zk_toolbox => zkstack_cli}/crates/types/src/base_token.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/types/src/l1_network.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/types/src/lib.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/types/src/prover_mode.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/types/src/token_info.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/types/src/wallet_creation.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/Cargo.toml (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/README.md (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/abi/ConsensusRegistry.json (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/build.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/accept_ownership.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/args/containers.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/args/run_server.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/args/update.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/accept_chain_ownership.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/args/build_transactions.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/args/create.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/args/genesis.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/args/init/configs.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/args/init/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/build_transactions.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/common.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/create.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/deploy_paymaster.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/genesis/database.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/genesis/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/genesis/server.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/init/configs.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/init/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/register_chain.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/consensus.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/containers.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/contract_verifier/args/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/contract_verifier/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/contract_verifier/args/releases.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/contract_verifier/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/contract_verifier/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/contract_verifier/run.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/clean/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/config_writer.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/contracts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/drop.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/migrate.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/new_migration.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/prepare.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/reset.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/database/setup.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/fmt.rs (98%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/lint.rs (98%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/lint_utils.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/info.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/prover/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/snapshot.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/sql_fmt.rs (99%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/fees.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/integration.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/revert.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/rust.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/build.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/db.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/fees.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/integration.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/loadtest.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/prover.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/recovery.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/revert.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/rust.rs (95%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/upgrade.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/utils.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/commands/test/wallet.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/consts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/dals.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/defaults.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/messages.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/dev/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/args/change_default.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/args/create.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/args/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/build_transactions.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/change_default.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/common.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/create.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/create_configs.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/setup_observability.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/ecosystem/utils.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/explorer/backend.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/explorer/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/explorer/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/explorer/run.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/args/prepare_configs.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/args/run.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/prepare_configs.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/external_node/run.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/portal.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/args/compressor_keys.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/args/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/args/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/args/run.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/args/setup_keys.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/compressor_keys.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/gcs.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/init.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/init_bellman_cuda.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/run.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/prover/setup_keys.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/server.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/commands/update.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/consts.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/defaults.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/external_node.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/main.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/messages.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/utils/consensus.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/utils/forge.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/utils/mod.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/utils/ports.rs (100%) rename {zk_toolbox => zkstack_cli}/crates/zkstack/src/utils/rocks_db.rs (100%) rename {zk_toolbox => zkstack_cli}/rust-toolchain (100%) rename {zk_toolbox => zkstack_cli}/zkup/README.md (73%) rename {zk_toolbox => zkstack_cli}/zkup/install (97%) rename {zk_toolbox => zkstack_cli}/zkup/zkup (92%) diff --git a/.githooks/pre-push b/.githooks/pre-push index 4c5ab115c985..f595c4452dea 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -14,6 +14,6 @@ if which zkstack >/dev/null; then exit 1 fi else - echo "Please install zk_toolbox using zkup from https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup, and then run ./bin/zkt from the zksync-era repository." + echo "Please install ZK Stack CLI using zkup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkup, and then run ./bin/zkt from the zksync-era repository." exit 1 fi diff --git a/.github/release-please/config.json b/.github/release-please/config.json index 86839e804ca4..c6f98692cfdd 100644 --- a/.github/release-please/config.json +++ b/.github/release-please/config.json @@ -20,12 +20,12 @@ "release-type": "simple", "component": "prover" }, - "zk_toolbox": { + "zkstack_cli": { "release-type": "simple", - "component": "zk_toolbox", + "component": "zkstack_cli", "plugins": [ "cargo-workspace" ] } } -} +} \ No newline at end of file diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json index e0e8fbeecf74..1e76757363b5 100644 --- a/.github/release-please/manifest.json +++ b/.github/release-please/manifest.json @@ -1,5 +1,5 @@ { "core": "24.28.0", "prover": "16.5.0", - "zk_toolbox": "0.1.2" -} + "zkstack_cli": "0.1.2" +} \ No newline at end of file diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 5a07b25dabf5..8a28c284dcd4 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -174,7 +174,7 @@ jobs: run: | ci_localnet_up - - name: Build zk_toolbox + - name: Build ZK Stack CLI run: ci_run bash -c "./bin/zkt" - name: Create log directories diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a27a719aeb6..fd9dedf8af4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: outputs: core: ${{ steps.changed-files.outputs.core_any_changed }} prover: ${{ steps.changed-files.outputs.prover_any_changed }} - zk_toolbox: ${{ steps.changed-files.outputs.zk_toolbox_any_changed }} + zkstack_cli: ${{ steps.changed-files.outputs.zkstack_cli_any_changed }} docs: ${{ steps.changed-files.outputs.docs_any_changed }} all: ${{ steps.changed-files.outputs.all_any_changed }} steps: @@ -58,7 +58,7 @@ jobs: - '.github/workflows/ci-core-lint-reusable.yml' - 'Cargo.toml' - 'Cargo.lock' - - 'zk_toolbox/**' + - 'zkstack_cli/**' - '!**/*.md' - '!**/*.MD' - 'docker-compose.yml' diff --git a/.gitignore b/.gitignore index c3de7a2df84d..05a10d8706c3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ Cargo.lock !/Cargo.lock !/infrastructure/zksync-crypto/Cargo.lock !/prover/Cargo.lock -!/zk_toolbox/Cargo.lock +!/zkstack_cli/Cargo.lock /etc/env/target/* /etc/env/.current diff --git a/bin/zkt b/bin/zkt index cc14c9018dd4..63b206ba432a 100755 --- a/bin/zkt +++ b/bin/zkt @@ -8,7 +8,7 @@ if which zkup >/dev/null; then git config --local core.hooksPath ./.githooks zkup -p .. --alias else - echo zkup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup - cd ../zk_toolbox + echo zkup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkup + cd ../zkstack_cli cargo install --path ./crates/zkstack --force fi diff --git a/core/lib/utils/src/env.rs b/core/lib/utils/src/env.rs index 5ae07caf1486..eb361ad16327 100644 --- a/core/lib/utils/src/env.rs +++ b/core/lib/utils/src/env.rs @@ -48,7 +48,7 @@ impl Workspace<'static> { impl<'a> Workspace<'a> { const PROVER_DIRECTORY_NAME: &'static str = "prover"; - const TOOLBOX_DIRECTORY_NAME: &'static str = "zk_toolbox"; + const TOOLBOX_DIRECTORY_NAME: &'static str = "zkstack_cli"; /// Returns the path of the core workspace. /// For `Workspace::None`, considers the current directory to represent core workspace. @@ -68,7 +68,7 @@ impl<'a> Workspace<'a> { } } - /// Returns the path of the `zk_toolbox`` workspace. + /// Returns the path of the ZK Stack CLI workspace. pub fn toolbox(self) -> PathBuf { match self { Self::Toolbox(path) => path.into(), diff --git a/flake.nix b/flake.nix index ef618816f9c9..ef38620037b1 100644 --- a/flake.nix +++ b/flake.nix @@ -91,7 +91,7 @@ ./Cargo.toml ./core ./prover - ./zk_toolbox + ./zkstack_cli ./.github/release-please/manifest.json ]; }; diff --git a/infrastructure/zk/src/fmt.ts b/infrastructure/zk/src/fmt.ts index e58cdbc8e547..b9f7f1b9d60b 100644 --- a/infrastructure/zk/src/fmt.ts +++ b/infrastructure/zk/src/fmt.ts @@ -48,7 +48,7 @@ export async function rustfmt(check: boolean = false) { const dirs = [ process.env.ZKSYNC_HOME as string, `${process.env.ZKSYNC_HOME}/prover`, - `${process.env.ZKSYNC_HOME}/zk_toolbox` + `${process.env.ZKSYNC_HOME}/zkstack_cli` ]; for (const dir of dirs) { diff --git a/infrastructure/zk/src/lint.ts b/infrastructure/zk/src/lint.ts index 7a24881c0f96..f23469df7179 100644 --- a/infrastructure/zk/src/lint.ts +++ b/infrastructure/zk/src/lint.ts @@ -39,7 +39,7 @@ async function proverClippy() { } async function toolboxClippy() { - process.chdir(`${process.env.ZKSYNC_HOME}/zk_toolbox`); + process.chdir(`${process.env.ZKSYNC_HOME}/zkstack_cli`); await utils.spawn('cargo clippy --tests --locked -- -D warnings'); } diff --git a/prover/docs/05_proving_batch.md b/prover/docs/05_proving_batch.md index 3a4077b4de39..cef493a39abc 100644 --- a/prover/docs/05_proving_batch.md +++ b/prover/docs/05_proving_batch.md @@ -93,13 +93,13 @@ zkstack dev prover info Example output: ```shell -=============================== +=============================== -Current prover setup information: +Current prover setup information: -Protocol version: 0.24.2 +Protocol version: 0.24.2 -Snark wrapper: 0x14f97b81e54b35fe673d8708cc1a19e1ea5b5e348e12d31e39824ed4f42bbca2 +Snark wrapper: 0x14f97b81e54b35fe673d8708cc1a19e1ea5b5e348e12d31e39824ed4f42bbca2 Database URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_era diff --git a/zk_toolbox/CHANGELOG.md b/zkstack_cli/CHANGELOG.md similarity index 100% rename from zk_toolbox/CHANGELOG.md rename to zkstack_cli/CHANGELOG.md diff --git a/zk_toolbox/Cargo.lock b/zkstack_cli/Cargo.lock similarity index 100% rename from zk_toolbox/Cargo.lock rename to zkstack_cli/Cargo.lock diff --git a/zk_toolbox/Cargo.toml b/zkstack_cli/Cargo.toml similarity index 95% rename from zk_toolbox/Cargo.toml rename to zkstack_cli/Cargo.toml index f150dc7378ae..85519fa49e5d 100644 --- a/zk_toolbox/Cargo.toml +++ b/zkstack_cli/Cargo.toml @@ -15,7 +15,7 @@ homepage = "https://zksync.io/" license = "MIT OR Apache-2.0" authors = ["The Matter Labs Team "] exclude = ["./github"] -repository = "https://github.com/matter-labs/zk_toolbox/" +repository = "https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/" description = "ZK Toolbox is a set of tools for working with zk stack." keywords = ["zk", "cryptography", "blockchain", "ZKStack", "ZKsync"] diff --git a/zk_toolbox/README.md b/zkstack_cli/README.md similarity index 99% rename from zk_toolbox/README.md rename to zkstack_cli/README.md index 7b08cfe560d7..5a71c48e90bf 100644 --- a/zk_toolbox/README.md +++ b/zkstack_cli/README.md @@ -1,4 +1,4 @@ -# zk_toolbox +# ZK Stack CLI Toolkit for creating and managing ZK Stack chains. diff --git a/zk_toolbox/crates/common/Cargo.toml b/zkstack_cli/crates/common/Cargo.toml similarity index 100% rename from zk_toolbox/crates/common/Cargo.toml rename to zkstack_cli/crates/common/Cargo.toml diff --git a/zk_toolbox/crates/common/src/cmd.rs b/zkstack_cli/crates/common/src/cmd.rs similarity index 100% rename from zk_toolbox/crates/common/src/cmd.rs rename to zkstack_cli/crates/common/src/cmd.rs diff --git a/zk_toolbox/crates/common/src/config.rs b/zkstack_cli/crates/common/src/config.rs similarity index 100% rename from zk_toolbox/crates/common/src/config.rs rename to zkstack_cli/crates/common/src/config.rs diff --git a/zk_toolbox/crates/common/src/db.rs b/zkstack_cli/crates/common/src/db.rs similarity index 100% rename from zk_toolbox/crates/common/src/db.rs rename to zkstack_cli/crates/common/src/db.rs diff --git a/zk_toolbox/crates/common/src/docker.rs b/zkstack_cli/crates/common/src/docker.rs similarity index 100% rename from zk_toolbox/crates/common/src/docker.rs rename to zkstack_cli/crates/common/src/docker.rs diff --git a/zk_toolbox/crates/common/src/ethereum.rs b/zkstack_cli/crates/common/src/ethereum.rs similarity index 100% rename from zk_toolbox/crates/common/src/ethereum.rs rename to zkstack_cli/crates/common/src/ethereum.rs diff --git a/zk_toolbox/crates/common/src/external_node.rs b/zkstack_cli/crates/common/src/external_node.rs similarity index 100% rename from zk_toolbox/crates/common/src/external_node.rs rename to zkstack_cli/crates/common/src/external_node.rs diff --git a/zk_toolbox/crates/common/src/files.rs b/zkstack_cli/crates/common/src/files.rs similarity index 100% rename from zk_toolbox/crates/common/src/files.rs rename to zkstack_cli/crates/common/src/files.rs diff --git a/zk_toolbox/crates/common/src/forge.rs b/zkstack_cli/crates/common/src/forge.rs similarity index 100% rename from zk_toolbox/crates/common/src/forge.rs rename to zkstack_cli/crates/common/src/forge.rs diff --git a/zk_toolbox/crates/common/src/git.rs b/zkstack_cli/crates/common/src/git.rs similarity index 100% rename from zk_toolbox/crates/common/src/git.rs rename to zkstack_cli/crates/common/src/git.rs diff --git a/zk_toolbox/crates/common/src/lib.rs b/zkstack_cli/crates/common/src/lib.rs similarity index 100% rename from zk_toolbox/crates/common/src/lib.rs rename to zkstack_cli/crates/common/src/lib.rs diff --git a/zk_toolbox/crates/common/src/prerequisites.rs b/zkstack_cli/crates/common/src/prerequisites.rs similarity index 100% rename from zk_toolbox/crates/common/src/prerequisites.rs rename to zkstack_cli/crates/common/src/prerequisites.rs diff --git a/zk_toolbox/crates/common/src/prompt/confirm.rs b/zkstack_cli/crates/common/src/prompt/confirm.rs similarity index 100% rename from zk_toolbox/crates/common/src/prompt/confirm.rs rename to zkstack_cli/crates/common/src/prompt/confirm.rs diff --git a/zk_toolbox/crates/common/src/prompt/input.rs b/zkstack_cli/crates/common/src/prompt/input.rs similarity index 100% rename from zk_toolbox/crates/common/src/prompt/input.rs rename to zkstack_cli/crates/common/src/prompt/input.rs diff --git a/zk_toolbox/crates/common/src/prompt/mod.rs b/zkstack_cli/crates/common/src/prompt/mod.rs similarity index 100% rename from zk_toolbox/crates/common/src/prompt/mod.rs rename to zkstack_cli/crates/common/src/prompt/mod.rs diff --git a/zk_toolbox/crates/common/src/prompt/select.rs b/zkstack_cli/crates/common/src/prompt/select.rs similarity index 100% rename from zk_toolbox/crates/common/src/prompt/select.rs rename to zkstack_cli/crates/common/src/prompt/select.rs diff --git a/zk_toolbox/crates/common/src/server.rs b/zkstack_cli/crates/common/src/server.rs similarity index 100% rename from zk_toolbox/crates/common/src/server.rs rename to zkstack_cli/crates/common/src/server.rs diff --git a/zk_toolbox/crates/common/src/term/error.rs b/zkstack_cli/crates/common/src/term/error.rs similarity index 100% rename from zk_toolbox/crates/common/src/term/error.rs rename to zkstack_cli/crates/common/src/term/error.rs diff --git a/zk_toolbox/crates/common/src/term/logger.rs b/zkstack_cli/crates/common/src/term/logger.rs similarity index 100% rename from zk_toolbox/crates/common/src/term/logger.rs rename to zkstack_cli/crates/common/src/term/logger.rs diff --git a/zk_toolbox/crates/common/src/term/mod.rs b/zkstack_cli/crates/common/src/term/mod.rs similarity index 100% rename from zk_toolbox/crates/common/src/term/mod.rs rename to zkstack_cli/crates/common/src/term/mod.rs diff --git a/zk_toolbox/crates/common/src/term/spinner.rs b/zkstack_cli/crates/common/src/term/spinner.rs similarity index 100% rename from zk_toolbox/crates/common/src/term/spinner.rs rename to zkstack_cli/crates/common/src/term/spinner.rs diff --git a/zk_toolbox/crates/common/src/version.rs b/zkstack_cli/crates/common/src/version.rs similarity index 100% rename from zk_toolbox/crates/common/src/version.rs rename to zkstack_cli/crates/common/src/version.rs diff --git a/zk_toolbox/crates/common/src/wallets.rs b/zkstack_cli/crates/common/src/wallets.rs similarity index 100% rename from zk_toolbox/crates/common/src/wallets.rs rename to zkstack_cli/crates/common/src/wallets.rs diff --git a/zk_toolbox/crates/common/src/yaml.rs b/zkstack_cli/crates/common/src/yaml.rs similarity index 100% rename from zk_toolbox/crates/common/src/yaml.rs rename to zkstack_cli/crates/common/src/yaml.rs diff --git a/zk_toolbox/crates/config/Cargo.toml b/zkstack_cli/crates/config/Cargo.toml similarity index 100% rename from zk_toolbox/crates/config/Cargo.toml rename to zkstack_cli/crates/config/Cargo.toml diff --git a/zk_toolbox/crates/config/src/apps.rs b/zkstack_cli/crates/config/src/apps.rs similarity index 100% rename from zk_toolbox/crates/config/src/apps.rs rename to zkstack_cli/crates/config/src/apps.rs diff --git a/zk_toolbox/crates/config/src/chain.rs b/zkstack_cli/crates/config/src/chain.rs similarity index 100% rename from zk_toolbox/crates/config/src/chain.rs rename to zkstack_cli/crates/config/src/chain.rs diff --git a/zk_toolbox/crates/config/src/consensus_config.rs b/zkstack_cli/crates/config/src/consensus_config.rs similarity index 100% rename from zk_toolbox/crates/config/src/consensus_config.rs rename to zkstack_cli/crates/config/src/consensus_config.rs diff --git a/zk_toolbox/crates/config/src/consensus_secrets.rs b/zkstack_cli/crates/config/src/consensus_secrets.rs similarity index 100% rename from zk_toolbox/crates/config/src/consensus_secrets.rs rename to zkstack_cli/crates/config/src/consensus_secrets.rs diff --git a/zk_toolbox/crates/config/src/consts.rs b/zkstack_cli/crates/config/src/consts.rs similarity index 100% rename from zk_toolbox/crates/config/src/consts.rs rename to zkstack_cli/crates/config/src/consts.rs diff --git a/zk_toolbox/crates/config/src/contracts.rs b/zkstack_cli/crates/config/src/contracts.rs similarity index 100% rename from zk_toolbox/crates/config/src/contracts.rs rename to zkstack_cli/crates/config/src/contracts.rs diff --git a/zk_toolbox/crates/config/src/docker_compose.rs b/zkstack_cli/crates/config/src/docker_compose.rs similarity index 100% rename from zk_toolbox/crates/config/src/docker_compose.rs rename to zkstack_cli/crates/config/src/docker_compose.rs diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zkstack_cli/crates/config/src/ecosystem.rs similarity index 100% rename from zk_toolbox/crates/config/src/ecosystem.rs rename to zkstack_cli/crates/config/src/ecosystem.rs diff --git a/zk_toolbox/crates/config/src/explorer.rs b/zkstack_cli/crates/config/src/explorer.rs similarity index 100% rename from zk_toolbox/crates/config/src/explorer.rs rename to zkstack_cli/crates/config/src/explorer.rs diff --git a/zk_toolbox/crates/config/src/explorer_compose.rs b/zkstack_cli/crates/config/src/explorer_compose.rs similarity index 100% rename from zk_toolbox/crates/config/src/explorer_compose.rs rename to zkstack_cli/crates/config/src/explorer_compose.rs diff --git a/zk_toolbox/crates/config/src/external_node.rs b/zkstack_cli/crates/config/src/external_node.rs similarity index 100% rename from zk_toolbox/crates/config/src/external_node.rs rename to zkstack_cli/crates/config/src/external_node.rs diff --git a/zk_toolbox/crates/config/src/file_config.rs b/zkstack_cli/crates/config/src/file_config.rs similarity index 100% rename from zk_toolbox/crates/config/src/file_config.rs rename to zkstack_cli/crates/config/src/file_config.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/accept_ownership/mod.rs b/zkstack_cli/crates/config/src/forge_interface/accept_ownership/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/accept_ownership/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/accept_ownership/mod.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs rename to zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/mod.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/mod.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/output.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs rename to zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/output.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/input.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/input.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/input.rs rename to zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/input.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/mod.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/mod.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/output.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/output.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/output.rs rename to zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/output.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/mod.rs b/zkstack_cli/crates/config/src/forge_interface/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/mod.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs b/zkstack_cli/crates/config/src/forge_interface/paymaster/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/paymaster/mod.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs b/zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs rename to zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/mod.rs b/zkstack_cli/crates/config/src/forge_interface/register_chain/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/register_chain/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/register_chain/mod.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/output.rs b/zkstack_cli/crates/config/src/forge_interface/register_chain/output.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/register_chain/output.rs rename to zkstack_cli/crates/config/src/forge_interface/register_chain/output.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/script_params.rs b/zkstack_cli/crates/config/src/forge_interface/script_params.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/script_params.rs rename to zkstack_cli/crates/config/src/forge_interface/script_params.rs diff --git a/zk_toolbox/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs b/zkstack_cli/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs similarity index 100% rename from zk_toolbox/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs rename to zkstack_cli/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs diff --git a/zk_toolbox/crates/config/src/general.rs b/zkstack_cli/crates/config/src/general.rs similarity index 100% rename from zk_toolbox/crates/config/src/general.rs rename to zkstack_cli/crates/config/src/general.rs diff --git a/zk_toolbox/crates/config/src/genesis.rs b/zkstack_cli/crates/config/src/genesis.rs similarity index 100% rename from zk_toolbox/crates/config/src/genesis.rs rename to zkstack_cli/crates/config/src/genesis.rs diff --git a/zk_toolbox/crates/config/src/lib.rs b/zkstack_cli/crates/config/src/lib.rs similarity index 100% rename from zk_toolbox/crates/config/src/lib.rs rename to zkstack_cli/crates/config/src/lib.rs diff --git a/zk_toolbox/crates/config/src/manipulations.rs b/zkstack_cli/crates/config/src/manipulations.rs similarity index 100% rename from zk_toolbox/crates/config/src/manipulations.rs rename to zkstack_cli/crates/config/src/manipulations.rs diff --git a/zk_toolbox/crates/config/src/portal.rs b/zkstack_cli/crates/config/src/portal.rs similarity index 100% rename from zk_toolbox/crates/config/src/portal.rs rename to zkstack_cli/crates/config/src/portal.rs diff --git a/zk_toolbox/crates/config/src/secrets.rs b/zkstack_cli/crates/config/src/secrets.rs similarity index 100% rename from zk_toolbox/crates/config/src/secrets.rs rename to zkstack_cli/crates/config/src/secrets.rs diff --git a/zk_toolbox/crates/config/src/traits.rs b/zkstack_cli/crates/config/src/traits.rs similarity index 100% rename from zk_toolbox/crates/config/src/traits.rs rename to zkstack_cli/crates/config/src/traits.rs diff --git a/zk_toolbox/crates/config/src/wallet_creation.rs b/zkstack_cli/crates/config/src/wallet_creation.rs similarity index 100% rename from zk_toolbox/crates/config/src/wallet_creation.rs rename to zkstack_cli/crates/config/src/wallet_creation.rs diff --git a/zk_toolbox/crates/config/src/wallets.rs b/zkstack_cli/crates/config/src/wallets.rs similarity index 100% rename from zk_toolbox/crates/config/src/wallets.rs rename to zkstack_cli/crates/config/src/wallets.rs diff --git a/zk_toolbox/crates/git_version_macro/Cargo.toml b/zkstack_cli/crates/git_version_macro/Cargo.toml similarity index 100% rename from zk_toolbox/crates/git_version_macro/Cargo.toml rename to zkstack_cli/crates/git_version_macro/Cargo.toml diff --git a/zk_toolbox/crates/git_version_macro/src/lib.rs b/zkstack_cli/crates/git_version_macro/src/lib.rs similarity index 100% rename from zk_toolbox/crates/git_version_macro/src/lib.rs rename to zkstack_cli/crates/git_version_macro/src/lib.rs diff --git a/zk_toolbox/crates/types/Cargo.toml b/zkstack_cli/crates/types/Cargo.toml similarity index 100% rename from zk_toolbox/crates/types/Cargo.toml rename to zkstack_cli/crates/types/Cargo.toml diff --git a/zk_toolbox/crates/types/src/base_token.rs b/zkstack_cli/crates/types/src/base_token.rs similarity index 100% rename from zk_toolbox/crates/types/src/base_token.rs rename to zkstack_cli/crates/types/src/base_token.rs diff --git a/zk_toolbox/crates/types/src/l1_network.rs b/zkstack_cli/crates/types/src/l1_network.rs similarity index 100% rename from zk_toolbox/crates/types/src/l1_network.rs rename to zkstack_cli/crates/types/src/l1_network.rs diff --git a/zk_toolbox/crates/types/src/lib.rs b/zkstack_cli/crates/types/src/lib.rs similarity index 100% rename from zk_toolbox/crates/types/src/lib.rs rename to zkstack_cli/crates/types/src/lib.rs diff --git a/zk_toolbox/crates/types/src/prover_mode.rs b/zkstack_cli/crates/types/src/prover_mode.rs similarity index 100% rename from zk_toolbox/crates/types/src/prover_mode.rs rename to zkstack_cli/crates/types/src/prover_mode.rs diff --git a/zk_toolbox/crates/types/src/token_info.rs b/zkstack_cli/crates/types/src/token_info.rs similarity index 100% rename from zk_toolbox/crates/types/src/token_info.rs rename to zkstack_cli/crates/types/src/token_info.rs diff --git a/zk_toolbox/crates/types/src/wallet_creation.rs b/zkstack_cli/crates/types/src/wallet_creation.rs similarity index 100% rename from zk_toolbox/crates/types/src/wallet_creation.rs rename to zkstack_cli/crates/types/src/wallet_creation.rs diff --git a/zk_toolbox/crates/zkstack/Cargo.toml b/zkstack_cli/crates/zkstack/Cargo.toml similarity index 100% rename from zk_toolbox/crates/zkstack/Cargo.toml rename to zkstack_cli/crates/zkstack/Cargo.toml diff --git a/zk_toolbox/crates/zkstack/README.md b/zkstack_cli/crates/zkstack/README.md similarity index 100% rename from zk_toolbox/crates/zkstack/README.md rename to zkstack_cli/crates/zkstack/README.md diff --git a/zk_toolbox/crates/zkstack/abi/ConsensusRegistry.json b/zkstack_cli/crates/zkstack/abi/ConsensusRegistry.json similarity index 100% rename from zk_toolbox/crates/zkstack/abi/ConsensusRegistry.json rename to zkstack_cli/crates/zkstack/abi/ConsensusRegistry.json diff --git a/zk_toolbox/crates/zkstack/build.rs b/zkstack_cli/crates/zkstack/build.rs similarity index 100% rename from zk_toolbox/crates/zkstack/build.rs rename to zkstack_cli/crates/zkstack/build.rs diff --git a/zk_toolbox/crates/zkstack/src/accept_ownership.rs b/zkstack_cli/crates/zkstack/src/accept_ownership.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/accept_ownership.rs rename to zkstack_cli/crates/zkstack/src/accept_ownership.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/args/containers.rs b/zkstack_cli/crates/zkstack/src/commands/args/containers.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/args/containers.rs rename to zkstack_cli/crates/zkstack/src/commands/args/containers.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/args/run_server.rs b/zkstack_cli/crates/zkstack/src/commands/args/run_server.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/args/run_server.rs rename to zkstack_cli/crates/zkstack/src/commands/args/run_server.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/args/update.rs b/zkstack_cli/crates/zkstack/src/commands/args/update.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/args/update.rs rename to zkstack_cli/crates/zkstack/src/commands/args/update.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/accept_chain_ownership.rs b/zkstack_cli/crates/zkstack/src/commands/chain/accept_chain_ownership.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/accept_chain_ownership.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/accept_chain_ownership.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/args/build_transactions.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/args/build_transactions.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/args/build_transactions.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/args/create.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/create.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/args/create.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/args/create.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/args/genesis.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/genesis.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/args/genesis.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/args/genesis.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/args/init/configs.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/configs.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/args/init/configs.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/args/init/configs.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/args/init/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/args/init/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/args/init/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/build_transactions.rs b/zkstack_cli/crates/zkstack/src/commands/chain/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/build_transactions.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/build_transactions.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/common.rs b/zkstack_cli/crates/zkstack/src/commands/chain/common.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/common.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/common.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/create.rs b/zkstack_cli/crates/zkstack/src/commands/chain/create.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/create.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/create.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs b/zkstack_cli/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/deploy_l2_contracts.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/deploy_paymaster.rs b/zkstack_cli/crates/zkstack/src/commands/chain/deploy_paymaster.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/deploy_paymaster.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/deploy_paymaster.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/genesis/database.rs b/zkstack_cli/crates/zkstack/src/commands/chain/genesis/database.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/genesis/database.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/genesis/database.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/genesis/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/genesis/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/genesis/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/genesis/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/genesis/server.rs b/zkstack_cli/crates/zkstack/src/commands/chain/genesis/server.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/genesis/server.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/genesis/server.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/init/configs.rs b/zkstack_cli/crates/zkstack/src/commands/chain/init/configs.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/init/configs.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/init/configs.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/init/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/init/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/init/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/init/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/mod.rs b/zkstack_cli/crates/zkstack/src/commands/chain/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/register_chain.rs b/zkstack_cli/crates/zkstack/src/commands/chain/register_chain.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/register_chain.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/register_chain.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs b/zkstack_cli/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/set_token_multiplier_setter.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs b/zkstack_cli/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs rename to zkstack_cli/crates/zkstack/src/commands/chain/setup_legacy_bridge.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/consensus.rs b/zkstack_cli/crates/zkstack/src/commands/consensus.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/consensus.rs rename to zkstack_cli/crates/zkstack/src/commands/consensus.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/containers.rs b/zkstack_cli/crates/zkstack/src/commands/containers.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/containers.rs rename to zkstack_cli/crates/zkstack/src/commands/containers.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/init.rs b/zkstack_cli/crates/zkstack/src/commands/contract_verifier/args/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/init.rs rename to zkstack_cli/crates/zkstack/src/commands/contract_verifier/args/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/contract_verifier/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/contract_verifier/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/releases.rs b/zkstack_cli/crates/zkstack/src/commands/contract_verifier/args/releases.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/contract_verifier/args/releases.rs rename to zkstack_cli/crates/zkstack/src/commands/contract_verifier/args/releases.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/contract_verifier/init.rs b/zkstack_cli/crates/zkstack/src/commands/contract_verifier/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/contract_verifier/init.rs rename to zkstack_cli/crates/zkstack/src/commands/contract_verifier/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/contract_verifier/mod.rs b/zkstack_cli/crates/zkstack/src/commands/contract_verifier/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/contract_verifier/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/contract_verifier/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/contract_verifier/run.rs b/zkstack_cli/crates/zkstack/src/commands/contract_verifier/run.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/contract_verifier/run.rs rename to zkstack_cli/crates/zkstack/src/commands/contract_verifier/run.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/clean/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/clean/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/clean/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/clean/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/config_writer.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/config_writer.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/config_writer.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/config_writer.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/contracts.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/contracts.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/contracts.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/contracts.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/args/new_migration.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/check_sqlx_data.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/drop.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/drop.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/drop.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/drop.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/migrate.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/migrate.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/migrate.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/migrate.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/new_migration.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/new_migration.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/new_migration.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/new_migration.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/prepare.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/prepare.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/prepare.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/prepare.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/reset.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/reset.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/reset.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/reset.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/database/setup.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/database/setup.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/database/setup.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/database/setup.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/fmt.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/fmt.rs similarity index 98% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/fmt.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/fmt.rs index 1a64327fcda3..0fbcbda737a0 100644 --- a/zk_toolbox/crates/zkstack/src/commands/dev/commands/fmt.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/fmt.rs @@ -42,7 +42,7 @@ async fn prettier_contracts(shell: Shell, check: bool) -> anyhow::Result<()> { } async fn rustfmt(shell: Shell, check: bool, link_to_code: PathBuf) -> anyhow::Result<()> { - for dir in [".", "prover", "zk_toolbox"] { + for dir in [".", "prover", "zkstack_cli"] { let spinner = Spinner::new(&msg_running_rustfmt_for_dir_spinner(dir)); let _dir = shell.push_dir(link_to_code.join(dir)); let mut cmd = cmd!(shell, "cargo fmt -- --config imports_granularity=Crate --config group_imports=StdExternalCrate"); diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/lint.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs similarity index 98% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/lint.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs index f2e97c3ddfab..48b67320c98b 100644 --- a/zk_toolbox/crates/zkstack/src/commands/dev/commands/lint.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs @@ -55,7 +55,7 @@ fn lint_rs(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> anyhow::R let link_to_code = &ecosystem.link_to_code; let lint_to_prover = &ecosystem.link_to_code.join("prover"); - let link_to_toolbox = &ecosystem.link_to_code.join("zk_toolbox"); + let link_to_toolbox = &ecosystem.link_to_code.join("zkstack_cli"); let paths = vec![link_to_code, lint_to_prover, link_to_toolbox]; spinner.freeze(); diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/lint_utils.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint_utils.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/lint_utils.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/lint_utils.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/args/insert_batch.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/args/insert_version.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/info.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/info.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/info.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/info.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/insert_batch.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/insert_version.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/prover/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/prover/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/send_transactions/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/send_transactions/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/snapshot.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/snapshot.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/snapshot.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/snapshot.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/sql_fmt.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/sql_fmt.rs similarity index 99% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/sql_fmt.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/sql_fmt.rs index c5faf70f07c0..0f7ce061ce18 100644 --- a/zk_toolbox/crates/zkstack/src/commands/dev/commands/sql_fmt.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/sql_fmt.rs @@ -138,7 +138,7 @@ pub async fn format_sql(shell: Shell, check: bool) -> anyhow::Result<()> { let spinner = Spinner::new(MSG_RUNNING_SQL_FMT_SPINNER); let ignored_data = Some(IgnoredData { files: vec![], - dirs: vec!["zk_toolbox".to_string()], + dirs: vec!["zkstack_cli".to_string()], }); let rust_files = get_unignored_files(&shell, &Target::Rs, ignored_data)?; for file in rust_files { diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/fees.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/fees.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/fees.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/fees.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/integration.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/integration.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/integration.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/integration.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/recovery.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/revert.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/revert.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/revert.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/revert.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/rust.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/rust.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/rust.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/rust.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/args/upgrade.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/build.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/build.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/build.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/build.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/db.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/db.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/db.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/db.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/fees.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/fees.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/fees.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/fees.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/integration.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/integration.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/integration.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/integration.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/l1_contracts.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/loadtest.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/loadtest.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/loadtest.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/loadtest.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/prover.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/prover.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/prover.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/prover.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/recovery.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/recovery.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/recovery.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/recovery.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/revert.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/revert.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/revert.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/revert.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/rust.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/rust.rs similarity index 95% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/rust.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/rust.rs index 68657061f2d8..8c0c707f6a2e 100644 --- a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/rust.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/rust.rs @@ -75,8 +75,8 @@ pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { .env("TEST_PROVER_DATABASE_URL", test_prover_url); cmd.run()?; - // Run unit tests for zk_toolbox - let _dir_guard = shell.push_dir(link_to_code.join("zk_toolbox")); + // Run unit tests for ZK Stack CLI + let _dir_guard = shell.push_dir(link_to_code.join("zkstack_cli")); Cmd::new(cmd!(shell, "cargo nextest run --release")) .with_force_run() .run()?; diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/upgrade.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/upgrade.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/upgrade.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/upgrade.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/utils.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/utils.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/utils.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/utils.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/commands/test/wallet.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/test/wallet.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/commands/test/wallet.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/commands/test/wallet.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/consts.rs b/zkstack_cli/crates/zkstack/src/commands/dev/consts.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/consts.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/consts.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/dals.rs b/zkstack_cli/crates/zkstack/src/commands/dev/dals.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/dals.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/dals.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/defaults.rs b/zkstack_cli/crates/zkstack/src/commands/dev/defaults.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/defaults.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/defaults.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/messages.rs b/zkstack_cli/crates/zkstack/src/commands/dev/messages.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/messages.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/messages.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/dev/mod.rs b/zkstack_cli/crates/zkstack/src/commands/dev/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/dev/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/dev/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/args/build_transactions.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/change_default.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/change_default.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/args/change_default.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/args/change_default.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/create.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/create.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/args/create.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/args/create.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/init.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/args/init.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/build_transactions.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/build_transactions.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/build_transactions.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/build_transactions.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/change_default.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/change_default.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/change_default.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/change_default.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/common.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/common.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/common.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/common.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/create.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/create.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/create.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/create.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/create_configs.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/create_configs.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/create_configs.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/create_configs.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/init.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/init.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/mod.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/setup_observability.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/setup_observability.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/setup_observability.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/setup_observability.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/ecosystem/utils.rs b/zkstack_cli/crates/zkstack/src/commands/ecosystem/utils.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/ecosystem/utils.rs rename to zkstack_cli/crates/zkstack/src/commands/ecosystem/utils.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/explorer/backend.rs b/zkstack_cli/crates/zkstack/src/commands/explorer/backend.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/explorer/backend.rs rename to zkstack_cli/crates/zkstack/src/commands/explorer/backend.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/explorer/init.rs b/zkstack_cli/crates/zkstack/src/commands/explorer/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/explorer/init.rs rename to zkstack_cli/crates/zkstack/src/commands/explorer/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/explorer/mod.rs b/zkstack_cli/crates/zkstack/src/commands/explorer/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/explorer/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/explorer/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/explorer/run.rs b/zkstack_cli/crates/zkstack/src/commands/explorer/run.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/explorer/run.rs rename to zkstack_cli/crates/zkstack/src/commands/explorer/run.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/args/prepare_configs.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/args/prepare_configs.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/args/prepare_configs.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/args/prepare_configs.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/args/run.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/args/run.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/args/run.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/args/run.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/init.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/init.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/mod.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/prepare_configs.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/prepare_configs.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/prepare_configs.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/prepare_configs.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/external_node/run.rs b/zkstack_cli/crates/zkstack/src/commands/external_node/run.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/external_node/run.rs rename to zkstack_cli/crates/zkstack/src/commands/external_node/run.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/mod.rs b/zkstack_cli/crates/zkstack/src/commands/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/portal.rs b/zkstack_cli/crates/zkstack/src/commands/portal.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/portal.rs rename to zkstack_cli/crates/zkstack/src/commands/portal.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/args/compressor_keys.rs b/zkstack_cli/crates/zkstack/src/commands/prover/args/compressor_keys.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/args/compressor_keys.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/args/compressor_keys.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/args/init.rs b/zkstack_cli/crates/zkstack/src/commands/prover/args/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/args/init.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/args/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs b/zkstack_cli/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/args/init_bellman_cuda.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/args/mod.rs b/zkstack_cli/crates/zkstack/src/commands/prover/args/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/args/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/args/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/args/run.rs b/zkstack_cli/crates/zkstack/src/commands/prover/args/run.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/args/run.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/args/run.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/args/setup_keys.rs b/zkstack_cli/crates/zkstack/src/commands/prover/args/setup_keys.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/args/setup_keys.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/args/setup_keys.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/compressor_keys.rs b/zkstack_cli/crates/zkstack/src/commands/prover/compressor_keys.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/compressor_keys.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/compressor_keys.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/gcs.rs b/zkstack_cli/crates/zkstack/src/commands/prover/gcs.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/gcs.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/gcs.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/init.rs b/zkstack_cli/crates/zkstack/src/commands/prover/init.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/init.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/init.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/init_bellman_cuda.rs b/zkstack_cli/crates/zkstack/src/commands/prover/init_bellman_cuda.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/init_bellman_cuda.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/init_bellman_cuda.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/mod.rs b/zkstack_cli/crates/zkstack/src/commands/prover/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/mod.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/run.rs b/zkstack_cli/crates/zkstack/src/commands/prover/run.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/run.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/run.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/prover/setup_keys.rs b/zkstack_cli/crates/zkstack/src/commands/prover/setup_keys.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/prover/setup_keys.rs rename to zkstack_cli/crates/zkstack/src/commands/prover/setup_keys.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/server.rs b/zkstack_cli/crates/zkstack/src/commands/server.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/server.rs rename to zkstack_cli/crates/zkstack/src/commands/server.rs diff --git a/zk_toolbox/crates/zkstack/src/commands/update.rs b/zkstack_cli/crates/zkstack/src/commands/update.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/commands/update.rs rename to zkstack_cli/crates/zkstack/src/commands/update.rs diff --git a/zk_toolbox/crates/zkstack/src/consts.rs b/zkstack_cli/crates/zkstack/src/consts.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/consts.rs rename to zkstack_cli/crates/zkstack/src/consts.rs diff --git a/zk_toolbox/crates/zkstack/src/defaults.rs b/zkstack_cli/crates/zkstack/src/defaults.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/defaults.rs rename to zkstack_cli/crates/zkstack/src/defaults.rs diff --git a/zk_toolbox/crates/zkstack/src/external_node.rs b/zkstack_cli/crates/zkstack/src/external_node.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/external_node.rs rename to zkstack_cli/crates/zkstack/src/external_node.rs diff --git a/zk_toolbox/crates/zkstack/src/main.rs b/zkstack_cli/crates/zkstack/src/main.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/main.rs rename to zkstack_cli/crates/zkstack/src/main.rs diff --git a/zk_toolbox/crates/zkstack/src/messages.rs b/zkstack_cli/crates/zkstack/src/messages.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/messages.rs rename to zkstack_cli/crates/zkstack/src/messages.rs diff --git a/zk_toolbox/crates/zkstack/src/utils/consensus.rs b/zkstack_cli/crates/zkstack/src/utils/consensus.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/utils/consensus.rs rename to zkstack_cli/crates/zkstack/src/utils/consensus.rs diff --git a/zk_toolbox/crates/zkstack/src/utils/forge.rs b/zkstack_cli/crates/zkstack/src/utils/forge.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/utils/forge.rs rename to zkstack_cli/crates/zkstack/src/utils/forge.rs diff --git a/zk_toolbox/crates/zkstack/src/utils/mod.rs b/zkstack_cli/crates/zkstack/src/utils/mod.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/utils/mod.rs rename to zkstack_cli/crates/zkstack/src/utils/mod.rs diff --git a/zk_toolbox/crates/zkstack/src/utils/ports.rs b/zkstack_cli/crates/zkstack/src/utils/ports.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/utils/ports.rs rename to zkstack_cli/crates/zkstack/src/utils/ports.rs diff --git a/zk_toolbox/crates/zkstack/src/utils/rocks_db.rs b/zkstack_cli/crates/zkstack/src/utils/rocks_db.rs similarity index 100% rename from zk_toolbox/crates/zkstack/src/utils/rocks_db.rs rename to zkstack_cli/crates/zkstack/src/utils/rocks_db.rs diff --git a/zk_toolbox/rust-toolchain b/zkstack_cli/rust-toolchain similarity index 100% rename from zk_toolbox/rust-toolchain rename to zkstack_cli/rust-toolchain diff --git a/zk_toolbox/zkup/README.md b/zkstack_cli/zkup/README.md similarity index 73% rename from zk_toolbox/zkup/README.md rename to zkstack_cli/zkup/README.md index d6e3e634688c..8b0c515230ce 100644 --- a/zk_toolbox/zkup/README.md +++ b/zkstack_cli/zkup/README.md @@ -1,18 +1,18 @@ -# zkup - zk_toolbox Installer +# zkup - ZK Stack CLI Installer `zkup` is a script designed to simplify the installation of -[zk_toolbox](https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox). It allows you to install the tool from a -local directory or directly from a GitHub repository. +[ZK Stack CLI](https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli). It allows you to install the tool from +a local directory or directly from a GitHub repository. ## Getting Started To install `zkup`, run the following command: ```bash -curl -L https://raw.githubusercontent.com/matter-labs/zksync-era/main/zk_toolbox/zkup/install | bash +curl -L https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkup/install | bash ``` -After installing `zkup`, you can use it to install `zk_toolbox` with: +After installing `zkup`, you can use it to install `zkstack_cli` with: ```bash zkup @@ -20,12 +20,12 @@ zkup ## Usage -The `zkup` script provides various options for installing `zk_toolbox`: +The `zkup` script provides various options for installing ZK Stack CLI: ### Options - `-p, --path ` - Specify a local path to install `zk_toolbox` from. This option is ignored if `--repo` is provided. + Specify a local path to install ZK Stack CLI from. This option is ignored if `--repo` is provided. - `-r, --repo ` GitHub repository to install from (e.g., "matter-labs/zksync-era"). Defaults to "matter-labs/zksync-era". @@ -47,13 +47,13 @@ The `zkup` script provides various options for installing `zk_toolbox`: ### Local Installation -If you provide a local path using the `-p` or `--path` option, `zkup` will install `zk_toolbox` from that directory. +If you provide a local path using the `-p` or `--path` option, `zkup` will install ZK Stack CLI from that directory. Note that repository-specific arguments (`--repo`, `--branch`, `--commit`, `--version`) will be ignored in this case to preserve git state. ### Repository Installation -By default, `zkup` installs `zk_toolbox` from the "matter-labs/zksync-era" GitHub repository. You can specify a +By default, `zkup` installs ZK Stack CLI from the "matter-labs/zksync-era" GitHub repository. You can specify a different repository, branch, commit, or version using the respective options. If multiple arguments are provided, `zkup` will prioritize them as follows: @@ -72,5 +72,5 @@ zkup --repo matter-labs/zksync-era --version 0.1.1 **Install from a local path, only installing `zk_inception`:** ```bash -zkup --path /path/to/local/zk_toolbox --inception +zkup --path /path/to/local/zkstack_cli --inception ``` diff --git a/zk_toolbox/zkup/install b/zkstack_cli/zkup/install similarity index 97% rename from zk_toolbox/zkup/install rename to zkstack_cli/zkup/install index 4e24b03dec46..555338748e88 100755 --- a/zk_toolbox/zkup/install +++ b/zkstack_cli/zkup/install @@ -5,7 +5,7 @@ BASE_DIR=${XDG_CONFIG_HOME:-$HOME} ZKT_DIR=${ZKT_DIR:-"$BASE_DIR/.zkt"} ZKT_BIN_DIR="$ZKT_DIR/bin" -BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zk_toolbox/zkup/zkup" +BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkup/zkup" BIN_PATH="$ZKT_BIN_DIR/zkup" mkdir -p "$ZKT_BIN_DIR" diff --git a/zk_toolbox/zkup/zkup b/zkstack_cli/zkup/zkup similarity index 92% rename from zk_toolbox/zkup/zkup rename to zkstack_cli/zkup/zkup index dcff19de5c14..64b0537de29d 100755 --- a/zk_toolbox/zkup/zkup +++ b/zkstack_cli/zkup/zkup @@ -95,12 +95,12 @@ parse_args() { usage() { cat < Specify a local path to install zk_toolbox from. Ignored if --repo is provided. + -p, --path Specify a local path to install ZK Stack CLI from. Ignored if --repo is provided. -r, --repo GitHub repository to install from (e.g., "matter-labs/zksync-era"). Defaults to "matter-labs/zksync-era". -b, --branch Git branch to use when installing from a repository. Ignored if --commit or --version is provided. -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided. @@ -113,8 +113,8 @@ EOF } install_local() { - if [ ! -d "$ZKUP_PATH/zk_toolbox" ]; then - err "Path $ZKUP_PATH does not contain zk_toolbox" + if [ ! -d "$ZKUP_PATH/zkstack_cli" ]; then + err "Path $ZKUP_PATH does not contain zkstack_cli" exit 1 fi @@ -122,8 +122,8 @@ install_local() { warn "Ignoring --repo, --branch, --commit and --version arguments when installing from local path" fi - say "Installing zk_toolbox from $ZKUP_PATH" - ensure cd "$ZKUP_PATH"/zk_toolbox + say "Installing ZK Stack CLI from $ZKUP_PATH" + ensure cd "$ZKUP_PATH"/zkstack_cli for bin in "${BINS[@]}"; do say "Installing $bin" @@ -138,13 +138,13 @@ install_from_repo() { ZKUP_REPO=${ZKUP_REPO:-"matter-labs/zksync-era"} - say "Installing zk_toolbox from $ZKUP_REPO" + say "Installing ZK Stack CLI from $ZKUP_REPO" if [ -n "$ZKUP_VERSION" ]; then if [ -n "$ZKUP_COMMIT" ] || [ -n "$ZKUP_BRANCH" ]; then warn "Ignoring --commit and --branch arguments when installing by version" fi - ensure cargo install --root $ZKT_DIR --git "https://github.com/$ZKUP_REPO" --tag "zk_toolbox-v$ZKUP_VERSION" --locked "${BINS[@]}" --force + ensure cargo install --root $ZKT_DIR --git "https://github.com/$ZKUP_REPO" --tag "zkstack_cli-v$ZKUP_VERSION" --locked "${BINS[@]}" --force elif [ -n "$ZKUP_COMMIT" ]; then if [ -n "$ZKUP_BRANCH" ]; then warn "Ignoring --branch argument when installing by commit" From f41b59cbbe859f39e3a2ab3b943ff792d09ffd37 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 17:04:39 +0200 Subject: [PATCH 014/103] refactor: replace ZkInception with ZkStack --- .gitignore | 2 +- core/lib/utils/src/env.rs | 6 ++-- core/tests/recovery-test/src/index.ts | 10 +++--- core/tests/recovery-test/src/utils.ts | 6 ++-- core/tests/revert-test/tests/utils.ts | 32 +++++++++---------- core/tests/ts-integration/src/utils.ts | 12 +++---- core/tests/upgrade-test/tests/upgrade.test.ts | 8 ++--- core/tests/upgrade-test/tests/utils.ts | 10 +++--- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 05a10d8706c3..587b48217fd5 100644 --- a/.gitignore +++ b/.gitignore @@ -112,7 +112,7 @@ hyperchain-*.yml prover/crates/bin/vk_setup_data_generator_server_fri/data/setup_* prover/data/keys/setup_* -# Zk Toolbox +# ZK Stack CLI chains/era/configs/* configs/* era-observability/ diff --git a/core/lib/utils/src/env.rs b/core/lib/utils/src/env.rs index eb361ad16327..d85d4c6dc3c2 100644 --- a/core/lib/utils/src/env.rs +++ b/core/lib/utils/src/env.rs @@ -19,7 +19,7 @@ pub enum Workspace<'a> { Core(&'a Path), /// `prover` folder. Prover(&'a Path), - /// `toolbox` folder. + /// ZK Stack CLI folder. Toolbox(&'a Path), } @@ -154,7 +154,7 @@ mod tests { let workspace = Workspace::locate(); assert_matches!(workspace, Workspace::Core(_)); let core_path = workspace.core(); - // Check if prover and toolbox directories exist. + // Check if prover and ZK Stack CLI directories exist. assert!(workspace.prover().exists()); assert_matches!( Workspace::from(workspace.prover().as_path()), @@ -187,7 +187,7 @@ mod tests { Workspace::Toolbox(_) ); - // Toolbox. + // ZK Stack CLI std::env::set_current_dir(workspace.toolbox()).unwrap(); let workspace_path = locate_workspace_inner().unwrap(); let workspace = Workspace::from(workspace_path.as_path()); diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index f2bbc8f34e1d..0910b6552aa1 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -78,7 +78,7 @@ export async function getExternalNodeHealth(url: string) { } console.log( `Request to EN health check server failed: ${displayedError}. In CI, you can see more details ` + - 'in "Show * logs" steps' + 'in "Show * logs" steps' ); return null; } @@ -176,7 +176,7 @@ export class NodeProcess { logsFile: FileHandle | string, pathToHome: string, components: NodeComponents = NodeComponents.STANDARD, - useZkInception?: boolean, + useZkStack?: boolean, chain?: string ) { const logs = typeof logsFile === 'string' ? await fs.open(logsFile, 'a') : logsFile; @@ -186,14 +186,14 @@ export class NodeProcess { stdio: ['ignore', logs.fd, logs.fd], cwd: pathToHome, env, - useZkInception, + useZkStack, chain }); return new NodeProcess(childProcess, logs); } - private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) {} + private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) { } exitCode() { return this.childProcess.exitCode; @@ -243,7 +243,7 @@ export class FundedWallet { return new FundedWallet(wallet); } - private constructor(private readonly wallet: zksync.Wallet) {} + private constructor(private readonly wallet: zksync.Wallet) { } /** Ensure that this wallet is funded on L2, depositing funds from L1 if necessary. */ async ensureIsFunded() { diff --git a/core/tests/recovery-test/src/utils.ts b/core/tests/recovery-test/src/utils.ts index efa5f87dc0c9..c60f5603f17d 100644 --- a/core/tests/recovery-test/src/utils.ts +++ b/core/tests/recovery-test/src/utils.ts @@ -48,18 +48,18 @@ export function runExternalNodeInBackground({ stdio, cwd, env, - useZkInception, + useZkStack, chain }: { components?: string[]; stdio: any; cwd?: Parameters[0]['cwd']; env?: Parameters[0]['env']; - useZkInception?: boolean; + useZkStack?: boolean; chain?: string; }): ChildProcessWithoutNullStreams { let command = ''; - if (useZkInception) { + if (useZkStack) { command = 'zkstack external-node run'; command += chain ? ` --chain ${chain}` : ''; } else { diff --git a/core/tests/revert-test/tests/utils.ts b/core/tests/revert-test/tests/utils.ts index 59950cdd77fb..6134c81ee8d9 100644 --- a/core/tests/revert-test/tests/utils.ts +++ b/core/tests/revert-test/tests/utils.ts @@ -51,18 +51,18 @@ export function runServerInBackground({ stdio, cwd, env, - useZkInception, + useZkStack, chain }: { components?: string[]; stdio: any; cwd?: Parameters[0]['cwd']; env?: Parameters[0]['env']; - useZkInception?: boolean; + useZkStack?: boolean; chain?: string; }): ChildProcessWithoutNullStreams { let command = ''; - if (useZkInception) { + if (useZkStack) { command = 'zkstack server'; if (chain) { command += ` --chain ${chain}`; @@ -78,18 +78,18 @@ export function runExternalNodeInBackground({ stdio, cwd, env, - useZkInception, + useZkStack, chain }: { components?: string[]; stdio: any; cwd?: Parameters[0]['cwd']; env?: Parameters[0]['env']; - useZkInception?: boolean; + useZkStack?: boolean; chain?: string; }): ChildProcessWithoutNullStreams { let command = ''; - if (useZkInception) { + if (useZkStack) { command = 'zkstack external-node run'; command += chain ? ` --chain ${chain}` : ''; } else { @@ -153,12 +153,12 @@ async function runBlockReverter( const options = env ? { - cwd: env.ZKSYNC_HOME, - env: { - ...env, - PATH: process.env.PATH - } - } + cwd: env.ZKSYNC_HOME, + env: { + ...env, + PATH: process.env.PATH + } + } : {}; const executedProcess = await exec(cmd, options); return executedProcess.stdout; @@ -229,7 +229,7 @@ export class Node { public readonly tester: Tester, private readonly proc: ChildProcessWithoutNullStreams, private readonly type: TYPE - ) {} + ) { } public async terminate() { try { @@ -308,7 +308,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private readonly env?: ProcessEnvOptions['env'] - ) {} + ) { } public async spawnMainNode(enableExecute: boolean): Promise> { const env = this.env ?? process.env; @@ -334,7 +334,7 @@ export class NodeSpawner { stdio: ['ignore', logs, logs], cwd: pathToHome, env: env, - useZkInception: fileConfig.loadFromFile, + useZkStack: fileConfig.loadFromFile, chain: fileConfig.chain }); @@ -362,7 +362,7 @@ export class NodeSpawner { stdio: ['ignore', logs, logs], cwd: pathToHome, env, - useZkInception: fileConfig.loadFromFile, + useZkStack: fileConfig.loadFromFile, chain: fileConfig.chain }); diff --git a/core/tests/ts-integration/src/utils.ts b/core/tests/ts-integration/src/utils.ts index 3fdbc0ae8bd3..35d3d627965b 100644 --- a/core/tests/ts-integration/src/utils.ts +++ b/core/tests/ts-integration/src/utils.ts @@ -20,20 +20,20 @@ export function runServerInBackground({ stdio, cwd, env, - useZkInception, + useZkStack, chain }: { components?: string[]; stdio: any; cwd?: ProcessEnvOptions['cwd']; env?: ProcessEnvOptions['env']; - useZkInception?: boolean; + useZkStack?: boolean; newL1GasPrice?: string; newPubdataPrice?: string; chain?: string; }): ChildProcessWithoutNullStreams { let command = ''; - if (useZkInception) { + if (useZkStack) { command = 'zkstack server'; if (chain) { command += ` --chain ${chain}`; @@ -62,7 +62,7 @@ export enum NodeType { } export class Node { - constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) {} + constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) { } public async terminate() { try { @@ -112,7 +112,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private env?: ProcessEnvOptions['env'] - ) {} + ) { } public async spawnMainNode(newL1GasPrice?: string, newPubdataPrice?: string): Promise> { const env = this.env ?? process.env; @@ -167,7 +167,7 @@ export class NodeSpawner { stdio: ['ignore', logs, logs], cwd: pathToHome, env: env, - useZkInception: fileConfig.loadFromFile, + useZkStack: fileConfig.loadFromFile, chain: fileConfig.chain }); diff --git a/core/tests/upgrade-test/tests/upgrade.test.ts b/core/tests/upgrade-test/tests/upgrade.test.ts index 2e223b9d7441..20f720b56e06 100644 --- a/core/tests/upgrade-test/tests/upgrade.test.ts +++ b/core/tests/upgrade-test/tests/upgrade.test.ts @@ -123,7 +123,7 @@ describe('Upgrade test', function () { await utils.exec('pkill zksync_server'); // It may take some time for witness generator to stop. await utils.sleep(10); - } catch (_) {} + } catch (_) { } // Set small timeouts. process.env.ETH_SENDER_SENDER_AGGREGATED_BLOCK_COMMIT_DEADLINE = '1'; @@ -144,7 +144,7 @@ describe('Upgrade test', function () { components: serverComponents, stdio: ['ignore', logs, logs], cwd: pathToHome, - useZkInception: fileConfig.loadFromFile, + useZkStack: fileConfig.loadFromFile, chain: fileConfig.chain }); // Server may need some time to recompile if it's a cold run, so wait for it. @@ -354,7 +354,7 @@ describe('Upgrade test', function () { components: serverComponents, stdio: ['ignore', logs, logs], cwd: pathToHome, - useZkInception: fileConfig.loadFromFile, + useZkStack: fileConfig.loadFromFile, chain: fileConfig.chain }); await utils.sleep(10); @@ -373,7 +373,7 @@ describe('Upgrade test', function () { try { await utils.exec('pkill zksync_server'); - } catch (_) {} + } catch (_) { } }); async function sendGovernanceOperation(data: string) { diff --git a/core/tests/upgrade-test/tests/utils.ts b/core/tests/upgrade-test/tests/utils.ts index 9941acfaec2c..9f130c1e5565 100644 --- a/core/tests/upgrade-test/tests/utils.ts +++ b/core/tests/upgrade-test/tests/utils.ts @@ -7,18 +7,18 @@ export function runServerInBackground({ components, stdio, cwd, - useZkInception, + useZkStack, chain }: { components?: string[]; stdio: any; cwd?: Parameters[0]['cwd']; - useZkInception?: boolean; + useZkStack?: boolean; chain?: string; }) { let command = ''; - if (useZkInception) { + if (useZkStack) { command = 'zkstack server'; command += chain ? ` --chain ${chain}` : ''; } else { @@ -71,8 +71,8 @@ export interface Contracts { stateTransitonManager: any; } -export function initContracts(pathToHome: string, zkToolbox: boolean): Contracts { - if (zkToolbox) { +export function initContracts(pathToHome: string, zkStack: boolean): Contracts { + if (zkStack) { const CONTRACTS_FOLDER = `${pathToHome}/contracts`; return { l1DefaultUpgradeAbi: new ethers.Interface( From 07373fa04aa499eef4450b20838507b33ec7a93b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 17:09:28 +0200 Subject: [PATCH 015/103] style: format code --- core/tests/recovery-test/src/index.ts | 6 +++--- core/tests/revert-test/tests/utils.ts | 16 ++++++++-------- core/tests/ts-integration/src/utils.ts | 4 ++-- core/tests/upgrade-test/tests/upgrade.test.ts | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index 0910b6552aa1..d30fe83e98e9 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -78,7 +78,7 @@ export async function getExternalNodeHealth(url: string) { } console.log( `Request to EN health check server failed: ${displayedError}. In CI, you can see more details ` + - 'in "Show * logs" steps' + 'in "Show * logs" steps' ); return null; } @@ -193,7 +193,7 @@ export class NodeProcess { return new NodeProcess(childProcess, logs); } - private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) { } + private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) {} exitCode() { return this.childProcess.exitCode; @@ -243,7 +243,7 @@ export class FundedWallet { return new FundedWallet(wallet); } - private constructor(private readonly wallet: zksync.Wallet) { } + private constructor(private readonly wallet: zksync.Wallet) {} /** Ensure that this wallet is funded on L2, depositing funds from L1 if necessary. */ async ensureIsFunded() { diff --git a/core/tests/revert-test/tests/utils.ts b/core/tests/revert-test/tests/utils.ts index 6134c81ee8d9..fe5cb40799a4 100644 --- a/core/tests/revert-test/tests/utils.ts +++ b/core/tests/revert-test/tests/utils.ts @@ -153,12 +153,12 @@ async function runBlockReverter( const options = env ? { - cwd: env.ZKSYNC_HOME, - env: { - ...env, - PATH: process.env.PATH - } - } + cwd: env.ZKSYNC_HOME, + env: { + ...env, + PATH: process.env.PATH + } + } : {}; const executedProcess = await exec(cmd, options); return executedProcess.stdout; @@ -229,7 +229,7 @@ export class Node { public readonly tester: Tester, private readonly proc: ChildProcessWithoutNullStreams, private readonly type: TYPE - ) { } + ) {} public async terminate() { try { @@ -308,7 +308,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private readonly env?: ProcessEnvOptions['env'] - ) { } + ) {} public async spawnMainNode(enableExecute: boolean): Promise> { const env = this.env ?? process.env; diff --git a/core/tests/ts-integration/src/utils.ts b/core/tests/ts-integration/src/utils.ts index 35d3d627965b..bb6fa93757ee 100644 --- a/core/tests/ts-integration/src/utils.ts +++ b/core/tests/ts-integration/src/utils.ts @@ -62,7 +62,7 @@ export enum NodeType { } export class Node { - constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) { } + constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) {} public async terminate() { try { @@ -112,7 +112,7 @@ export class NodeSpawner { private readonly fileConfig: FileConfig, private readonly options: MainNodeSpawnOptions, private env?: ProcessEnvOptions['env'] - ) { } + ) {} public async spawnMainNode(newL1GasPrice?: string, newPubdataPrice?: string): Promise> { const env = this.env ?? process.env; diff --git a/core/tests/upgrade-test/tests/upgrade.test.ts b/core/tests/upgrade-test/tests/upgrade.test.ts index 20f720b56e06..9f1350643d33 100644 --- a/core/tests/upgrade-test/tests/upgrade.test.ts +++ b/core/tests/upgrade-test/tests/upgrade.test.ts @@ -123,7 +123,7 @@ describe('Upgrade test', function () { await utils.exec('pkill zksync_server'); // It may take some time for witness generator to stop. await utils.sleep(10); - } catch (_) { } + } catch (_) {} // Set small timeouts. process.env.ETH_SENDER_SENDER_AGGREGATED_BLOCK_COMMIT_DEADLINE = '1'; @@ -373,7 +373,7 @@ describe('Upgrade test', function () { try { await utils.exec('pkill zksync_server'); - } catch (_) { } + } catch (_) {} }); async function sendGovernanceOperation(data: string) { From 89d92d910863261c68abb2521a632565c63fe12b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 17:26:21 +0200 Subject: [PATCH 016/103] refactor: remove some more occurences of toolbox wording --- infrastructure/zk/src/lint.ts | 6 +++--- zkstack_cli/Cargo.toml | 2 +- zkstack_cli/crates/common/src/term/logger.rs | 2 +- zkstack_cli/crates/config/src/traits.rs | 2 +- zkstack_cli/crates/zkstack/README.md | 2 +- .../crates/zkstack/src/commands/dev/commands/lint.rs | 4 ++-- zkstack_cli/zkup/install | 2 +- zkstack_cli/zkup/zkup | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/infrastructure/zk/src/lint.ts b/infrastructure/zk/src/lint.ts index f23469df7179..229e841955a5 100644 --- a/infrastructure/zk/src/lint.ts +++ b/infrastructure/zk/src/lint.ts @@ -38,7 +38,7 @@ async function proverClippy() { await utils.spawn('cargo clippy --tests --locked -- -D warnings'); } -async function toolboxClippy() { +async function zkstackClippy() { process.chdir(`${process.env.ZKSYNC_HOME}/zkstack_cli`); await utils.spawn('cargo clippy --tests --locked -- -D warnings'); } @@ -62,7 +62,7 @@ export const command = new Command('lint') await lintContracts(cmd.check); break; case 'toolbox': - await toolboxClippy(); + await zkstackClippy(); break; default: await lint(extension, cmd.check); @@ -72,7 +72,7 @@ export const command = new Command('lint') promises.push(lintContracts(cmd.check)); promises.push(clippy()); promises.push(proverClippy()); - promises.push(toolboxClippy()); + promises.push(zkstackClippy()); await Promise.all(promises); } }); diff --git a/zkstack_cli/Cargo.toml b/zkstack_cli/Cargo.toml index 85519fa49e5d..d4f4a4f473d4 100644 --- a/zkstack_cli/Cargo.toml +++ b/zkstack_cli/Cargo.toml @@ -16,7 +16,7 @@ license = "MIT OR Apache-2.0" authors = ["The Matter Labs Team "] exclude = ["./github"] repository = "https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/" -description = "ZK Toolbox is a set of tools for working with zk stack." +description = "ZK Stack CLI is a set of tools for working with zk stack." keywords = ["zk", "cryptography", "blockchain", "ZKStack", "ZKsync"] diff --git a/zkstack_cli/crates/common/src/term/logger.rs b/zkstack_cli/crates/common/src/term/logger.rs index 17e518d9ad92..035e81dc1355 100644 --- a/zkstack_cli/crates/common/src/term/logger.rs +++ b/zkstack_cli/crates/common/src/term/logger.rs @@ -14,7 +14,7 @@ fn term_write(msg: impl Display) { } pub fn intro() { - cliclak_intro(style(" ZKsync toolbox ").on_cyan().black()).unwrap(); + cliclak_intro(style(" ZK Stack CLI ").on_cyan().black()).unwrap(); } pub fn outro(msg: impl Display) { diff --git a/zkstack_cli/crates/config/src/traits.rs b/zkstack_cli/crates/config/src/traits.rs index bb0722762e31..e2eabe5ae588 100644 --- a/zkstack_cli/crates/config/src/traits.rs +++ b/zkstack_cli/crates/config/src/traits.rs @@ -8,7 +8,7 @@ use serde::{de::DeserializeOwned, Serialize}; use url::Url; use xshell::Shell; -// Configs that we use only inside zk toolbox, we don't have protobuf implementation for them. +// Configs that we use only inside ZK Stack CLI, we don't have protobuf implementation for them. pub trait ZkToolboxConfig {} pub trait FileConfigWithDefaultName { diff --git a/zkstack_cli/crates/zkstack/README.md b/zkstack_cli/crates/zkstack/README.md index 904b1421e3a0..c2ba940c2eae 100644 --- a/zkstack_cli/crates/zkstack/README.md +++ b/zkstack_cli/crates/zkstack/README.md @@ -38,7 +38,7 @@ This document contains the help content for the `zk_inception` command-line prog ## `zk_inception` -ZK Toolbox is a set of tools for working with zk stack. +ZK Stack CLI is a set of tools for working with zk stack. **Usage:** `zk_inception [OPTIONS] ` 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 48b67320c98b..71f21a02e739 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/lint.rs @@ -55,8 +55,8 @@ fn lint_rs(shell: &Shell, ecosystem: &EcosystemConfig, check: bool) -> anyhow::R let link_to_code = &ecosystem.link_to_code; let lint_to_prover = &ecosystem.link_to_code.join("prover"); - let link_to_toolbox = &ecosystem.link_to_code.join("zkstack_cli"); - let paths = vec![link_to_code, lint_to_prover, link_to_toolbox]; + let link_to_zkstack = &ecosystem.link_to_code.join("zkstack_cli"); + let paths = vec![link_to_code, lint_to_prover, link_to_zkstack]; spinner.freeze(); for path in paths { diff --git a/zkstack_cli/zkup/install b/zkstack_cli/zkup/install index 555338748e88..1f876a08c6c1 100755 --- a/zkstack_cli/zkup/install +++ b/zkstack_cli/zkup/install @@ -52,4 +52,4 @@ fi echo echo "Added zkup to PATH." echo "Run 'source $PROFILE' or start a new terminal session to use zkup." -echo "Then run 'zkup' to install ZK Toolbox." +echo "Then run 'zkup' to install ZK Stack CLI." diff --git a/zkstack_cli/zkup/zkup b/zkstack_cli/zkup/zkup index 64b0537de29d..964c801cf0d3 100755 --- a/zkstack_cli/zkup/zkup +++ b/zkstack_cli/zkup/zkup @@ -10,7 +10,7 @@ BINS=() main() { parse_args "$@" - zktoolbox_banner + zkstack_banner check_prerequisites mkdir -p "$ZKT_BIN_DIR" @@ -23,7 +23,7 @@ main() { install_from_repo fi - zktoolbox_banner + zkstack_banner for bin in "${BINS[@]}"; do success "Installed $bin to $ZKT_BIN_DIR/$bin" @@ -183,7 +183,7 @@ err() { echo -e "\033[1;31mERROR: $1\033[0m" >&2 } -zktoolbox_banner() { +zkstack_banner() { printf ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= From 52c1ca7387cb7119f63cdfbf8fee023fb123e853 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 3 Oct 2024 18:10:05 +0200 Subject: [PATCH 017/103] refactor: rename zkup to zkstackup --- .githooks/pre-push | 2 +- bin/zkt | 6 +-- zkstack_cli/{zkup => zkstackup}/README.md | 28 +++++------ zkstack_cli/{zkup => zkstackup}/install | 24 +++++----- .../{zkup/zkup => zkstackup/zkstackup} | 48 +++++++++---------- 5 files changed, 54 insertions(+), 54 deletions(-) rename zkstack_cli/{zkup => zkstackup}/README.md (65%) rename zkstack_cli/{zkup => zkstackup}/install (51%) rename zkstack_cli/{zkup/zkup => zkstackup/zkstackup} (80%) diff --git a/.githooks/pre-push b/.githooks/pre-push index f595c4452dea..619f9e5fa7a7 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -14,6 +14,6 @@ if which zkstack >/dev/null; then exit 1 fi else - echo "Please install ZK Stack CLI using zkup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkup, and then run ./bin/zkt from the zksync-era repository." + echo "Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup, and then run ./bin/zkt from the zksync-era repository." exit 1 fi diff --git a/bin/zkt b/bin/zkt index 63b206ba432a..2dbb97c9365f 100755 --- a/bin/zkt +++ b/bin/zkt @@ -2,13 +2,13 @@ cd $(dirname $0) -if which zkup >/dev/null; then +if which zkstackup >/dev/null; then cargo uninstall zkstack git config --local core.hooksPath || git config --local core.hooksPath ./.githooks - zkup -p .. --alias + zkstackup -p .. --alias else - echo zkup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkup + echo zkstackup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup cd ../zkstack_cli cargo install --path ./crates/zkstack --force fi diff --git a/zkstack_cli/zkup/README.md b/zkstack_cli/zkstackup/README.md similarity index 65% rename from zkstack_cli/zkup/README.md rename to zkstack_cli/zkstackup/README.md index 8b0c515230ce..8a8ba4ae54a6 100644 --- a/zkstack_cli/zkup/README.md +++ b/zkstack_cli/zkstackup/README.md @@ -1,26 +1,26 @@ -# zkup - ZK Stack CLI Installer +# zkstackup - ZK Stack CLI Installer -`zkup` is a script designed to simplify the installation of +`zkstackup` is a script designed to simplify the installation of [ZK Stack CLI](https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli). It allows you to install the tool from a local directory or directly from a GitHub repository. ## Getting Started -To install `zkup`, run the following command: +To install `zkstackup`, run the following command: ```bash -curl -L https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkup/install | bash +curl -L https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/install | bash ``` -After installing `zkup`, you can use it to install `zkstack_cli` with: +After installing `zkstackup`, you can use it to install `zkstack_cli` with: ```bash -zkup +zkstackup ``` ## Usage -The `zkup` script provides various options for installing ZK Stack CLI: +The `zkstackup` script provides various options for installing ZK Stack CLI: ### Options @@ -40,22 +40,22 @@ The `zkup` script provides various options for installing ZK Stack CLI: Git tag to use when installing from a repository. Ignored if `--branch` or `--commit` is provided. - `--inception` - Installs `zk_inception` from the repository. By default, `zkup` installs `zk_inception` and `zk_supervisor`. + Installs `zk_inception` from the repository. By default, `zkstackup` installs `zk_inception` and `zk_supervisor`. - `--supervisor` Installs `zk_supervisor` from the repository. ### Local Installation -If you provide a local path using the `-p` or `--path` option, `zkup` will install ZK Stack CLI from that directory. +If you provide a local path using the `-p` or `--path` option, `zkstackup` will install ZK Stack CLI from that directory. Note that repository-specific arguments (`--repo`, `--branch`, `--commit`, `--version`) will be ignored in this case to preserve git state. ### Repository Installation -By default, `zkup` installs ZK Stack CLI from the "matter-labs/zksync-era" GitHub repository. You can specify a +By default, `zkstackup` installs ZK Stack CLI from the "matter-labs/zksync-era" GitHub repository. You can specify a different repository, branch, commit, or version using the respective options. If multiple arguments are provided, -`zkup` will prioritize them as follows: +`zkstackup` will prioritize them as follows: - `--version` - `--commit` @@ -66,11 +66,11 @@ different repository, branch, commit, or version using the respective options. I **Install from a GitHub repository with a specific version:** ```bash -zkup --repo matter-labs/zksync-era --version 0.1.1 +zkstackup --repo matter-labs/zksync-era --version 0.1.1 ``` -**Install from a local path, only installing `zk_inception`:** +**Install from a local path:** ```bash -zkup --path /path/to/local/zkstack_cli --inception +zkstackup --path /path/to/local/zkstack_cli ``` diff --git a/zkstack_cli/zkup/install b/zkstack_cli/zkstackup/install similarity index 51% rename from zkstack_cli/zkup/install rename to zkstack_cli/zkstackup/install index 1f876a08c6c1..4da35d84f785 100755 --- a/zkstack_cli/zkup/install +++ b/zkstack_cli/zkstackup/install @@ -5,15 +5,15 @@ BASE_DIR=${XDG_CONFIG_HOME:-$HOME} ZKT_DIR=${ZKT_DIR:-"$BASE_DIR/.zkt"} ZKT_BIN_DIR="$ZKT_DIR/bin" -BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkup/zkup" -BIN_PATH="$ZKT_BIN_DIR/zkup" +BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/zkstackup" +BIN_PATH="$ZKT_BIN_DIR/zkstackup" mkdir -p "$ZKT_BIN_DIR" curl -sSfL "$BIN_URL" -o "$BIN_PATH" chmod +x "$BIN_PATH" if [[ ":$PATH:" == *":${ZKT_BIN_DIR}:"* ]]; then - echo "zkup: found ${ZKT_BIN_DIR} in PATH" + echo "zkstackup: found ${ZKT_BIN_DIR} in PATH" exit 0 fi @@ -31,25 +31,25 @@ case $SHELL in PROFILE="$HOME/.profile" ;; *) - echo "zkup: could not detect shell, manually add ${ZKT_BIN_DIR} to your PATH." + echo "zkstackup: could not detect shell, manually add ${ZKT_BIN_DIR} to your PATH." exit 1 ;; esac if [[ ! -f "$PROFILE" ]]; then - echo "zkup: Profile file $PROFILE does not exist, creating it." + echo "zkstackup: Profile file $PROFILE does not exist, creating it." touch "$PROFILE" fi if [[ "$SHELL" == *"/fish"* ]]; then - echo -e "\n# Added by zkup\nfish_add_path -a $ZKT_BIN_DIR" >>"$PROFILE" - echo "zkup: Added $ZKT_BIN_DIR to PATH in $PROFILE using fish_add_path." + echo -e "\n# Added by zkstackup\nfish_add_path -a $ZKT_BIN_DIR" >>"$PROFILE" + echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE using fish_add_path." else - echo -e "\n# Added by zkup\nexport PATH=\"\$PATH:$ZKT_BIN_DIR\"" >>"$PROFILE" - echo "zkup: Added $ZKT_BIN_DIR to PATH in $PROFILE." + echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$ZKT_BIN_DIR\"" >>"$PROFILE" + echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE." fi echo -echo "Added zkup to PATH." -echo "Run 'source $PROFILE' or start a new terminal session to use zkup." -echo "Then run 'zkup' to install ZK Stack CLI." +echo "Added zkstackup to PATH." +echo "Run 'source $PROFILE' or start a new terminal session to use zkstackup." +echo "Then run 'zkstackup' to install ZK Stack CLI." diff --git a/zkstack_cli/zkup/zkup b/zkstack_cli/zkstackup/zkstackup similarity index 80% rename from zkstack_cli/zkup/zkup rename to zkstack_cli/zkstackup/zkstackup index 964c801cf0d3..2d4517629d35 100755 --- a/zkstack_cli/zkup/zkup +++ b/zkstack_cli/zkstackup/zkstackup @@ -17,7 +17,7 @@ main() { BINS+=(zkstack) - if [ -n "$ZKUP_PATH" ]; then + if [ -n "$ZKSTACKUP_PATH" ]; then install_local else install_from_repo @@ -61,23 +61,23 @@ parse_args() { -p | --path) shift - ZKUP_PATH=$1 + ZKSTACKUP_PATH=$1 ;; -r | --repo) shift - ZKUP_REPO=$1 + ZKSTACKUP_REPO=$1 ;; -b | --branch) shift - ZKUP_BRANCH=$1 + ZKSTACKUP_BRANCH=$1 ;; -c | --commit) shift - ZKUP_COMMIT=$1 + ZKSTACKUP_COMMIT=$1 ;; -v | --version) shift - ZKUP_VERSION=$1 + ZKSTACKUP_VERSION=$1 ;; -h | --help) usage @@ -95,7 +95,7 @@ parse_args() { usage() { cat < Date: Fri, 4 Oct 2024 09:56:59 +0200 Subject: [PATCH 018/103] refactor: rename ZkToolboxConfig to ZkStackConfig --- zkstack_cli/crates/config/src/apps.rs | 4 ++-- zkstack_cli/crates/config/src/chain.rs | 4 ++-- zkstack_cli/crates/config/src/contracts.rs | 6 +++--- zkstack_cli/crates/config/src/docker_compose.rs | 4 ++-- zkstack_cli/crates/config/src/ecosystem.rs | 6 +++--- zkstack_cli/crates/config/src/explorer.rs | 4 ++-- zkstack_cli/crates/config/src/explorer_compose.rs | 4 ++-- .../config/src/forge_interface/accept_ownership/mod.rs | 4 ++-- .../src/forge_interface/deploy_ecosystem/input.rs | 10 +++++----- .../src/forge_interface/deploy_ecosystem/output.rs | 6 +++--- .../src/forge_interface/deploy_l2_contracts/input.rs | 4 ++-- .../src/forge_interface/deploy_l2_contracts/output.rs | 10 +++++----- .../crates/config/src/forge_interface/paymaster/mod.rs | 6 +++--- .../config/src/forge_interface/register_chain/input.rs | 4 ++-- .../src/forge_interface/register_chain/output.rs | 4 ++-- .../src/forge_interface/setup_legacy_bridge/mod.rs | 4 ++-- zkstack_cli/crates/config/src/portal.rs | 4 ++-- zkstack_cli/crates/config/src/traits.rs | 6 +++--- zkstack_cli/crates/config/src/wallets.rs | 6 +++--- 19 files changed, 50 insertions(+), 50 deletions(-) diff --git a/zkstack_cli/crates/config/src/apps.rs b/zkstack_cli/crates/config/src/apps.rs index 697b35b0851b..3bd611bdc32a 100644 --- a/zkstack_cli/crates/config/src/apps.rs +++ b/zkstack_cli/crates/config/src/apps.rs @@ -5,7 +5,7 @@ use xshell::Shell; use crate::{ consts::{APPS_CONFIG_FILE, DEFAULT_EXPLORER_PORT, DEFAULT_PORTAL_PORT, LOCAL_CONFIGS_PATH}, - traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, ZkStackConfig}, }; /// Ecosystem level configuration for the apps (portal and explorer). @@ -20,7 +20,7 @@ pub struct AppEcosystemConfig { pub http_port: u16, } -impl ZkToolboxConfig for AppsEcosystemConfig {} +impl ZkStackConfig for AppsEcosystemConfig {} impl FileConfigWithDefaultName for AppsEcosystemConfig { const FILE_NAME: &'static str = APPS_CONFIG_FILE; } diff --git a/zkstack_cli/crates/config/src/chain.rs b/zkstack_cli/crates/config/src/chain.rs index affc8ccc770c..1a395ee937d3 100644 --- a/zkstack_cli/crates/config/src/chain.rs +++ b/zkstack_cli/crates/config/src/chain.rs @@ -16,7 +16,7 @@ use crate::{ create_localhost_wallets, traits::{ FileConfigWithDefaultName, ReadConfig, ReadConfigWithBasePath, SaveConfig, - SaveConfigWithBasePath, ZkToolboxConfig, + SaveConfigWithBasePath, ZkStackConfig, }, ContractsConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, }; @@ -165,4 +165,4 @@ impl FileConfigWithDefaultName for ChainConfigInternal { const FILE_NAME: &'static str = CONFIG_NAME; } -impl ZkToolboxConfig for ChainConfigInternal {} +impl ZkStackConfig for ChainConfigInternal {} diff --git a/zkstack_cli/crates/config/src/contracts.rs b/zkstack_cli/crates/config/src/contracts.rs index 8296aa188527..e6676989e68c 100644 --- a/zkstack_cli/crates/config/src/contracts.rs +++ b/zkstack_cli/crates/config/src/contracts.rs @@ -11,7 +11,7 @@ use crate::{ }, register_chain::output::RegisterChainOutput, }, - traits::{FileConfigWithDefaultName, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ZkStackConfig}, }; #[derive(Debug, Deserialize, Serialize, Clone, Default)] @@ -114,7 +114,7 @@ impl FileConfigWithDefaultName for ContractsConfig { const FILE_NAME: &'static str = CONTRACTS_FILE; } -impl ZkToolboxConfig for ContractsConfig {} +impl ZkStackConfig for ContractsConfig {} #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)] pub struct EcosystemContracts { @@ -125,7 +125,7 @@ pub struct EcosystemContracts { pub diamond_cut_data: String, } -impl ZkToolboxConfig for EcosystemContracts {} +impl ZkStackConfig for EcosystemContracts {} #[derive(Debug, Serialize, Deserialize, Clone, Default)] pub struct BridgesContracts { diff --git a/zkstack_cli/crates/config/src/docker_compose.rs b/zkstack_cli/crates/config/src/docker_compose.rs index 05c6e73eaea5..2208c5a8654e 100644 --- a/zkstack_cli/crates/config/src/docker_compose.rs +++ b/zkstack_cli/crates/config/src/docker_compose.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; -use crate::traits::ZkToolboxConfig; +use crate::traits::ZkStackConfig; #[derive(Debug, Default, Serialize, Deserialize, Clone)] pub struct DockerComposeConfig { @@ -34,7 +34,7 @@ pub struct DockerComposeService { pub other: serde_json::Value, } -impl ZkToolboxConfig for DockerComposeConfig {} +impl ZkStackConfig for DockerComposeConfig {} impl DockerComposeConfig { pub fn add_service(&mut self, name: &str, service: DockerComposeService) { diff --git a/zkstack_cli/crates/config/src/ecosystem.rs b/zkstack_cli/crates/config/src/ecosystem.rs index 7e7c5d4dae52..bed0e1a2da4b 100644 --- a/zkstack_cli/crates/config/src/ecosystem.rs +++ b/zkstack_cli/crates/config/src/ecosystem.rs @@ -21,7 +21,7 @@ use crate::{ input::{Erc20DeploymentConfig, InitialDeploymentConfig}, output::{ERC20Tokens, Erc20Token}, }, - traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, ZkStackConfig}, ChainConfig, ChainConfigInternal, ContractsConfig, WalletsConfig, }; @@ -94,9 +94,9 @@ impl FileConfigWithDefaultName for EcosystemConfig { const FILE_NAME: &'static str = CONFIG_NAME; } -impl ZkToolboxConfig for EcosystemConfigInternal {} +impl ZkStackConfig for EcosystemConfigInternal {} -impl ZkToolboxConfig for EcosystemConfig {} +impl ZkStackConfig for EcosystemConfig {} impl EcosystemConfig { fn get_shell(&self) -> &Shell { diff --git a/zkstack_cli/crates/config/src/explorer.rs b/zkstack_cli/crates/config/src/explorer.rs index ee7a59e5105c..7ce9b986a1eb 100644 --- a/zkstack_cli/crates/config/src/explorer.rs +++ b/zkstack_cli/crates/config/src/explorer.rs @@ -8,7 +8,7 @@ use crate::{ EXPLORER_CONFIG_FILE, EXPLORER_JS_CONFIG_FILE, LOCAL_APPS_PATH, LOCAL_CONFIGS_PATH, LOCAL_GENERATED_PATH, }, - traits::{ReadConfig, SaveConfig, ZkToolboxConfig}, + traits::{ReadConfig, SaveConfig, ZkStackConfig}, }; /// Explorer JSON configuration file. This file contains configuration for the explorer app. @@ -144,4 +144,4 @@ impl Default for ExplorerConfig { } } -impl ZkToolboxConfig for ExplorerConfig {} +impl ZkStackConfig for ExplorerConfig {} diff --git a/zkstack_cli/crates/config/src/explorer_compose.rs b/zkstack_cli/crates/config/src/explorer_compose.rs index ca9abc1e3e23..13dd665d2e3d 100644 --- a/zkstack_cli/crates/config/src/explorer_compose.rs +++ b/zkstack_cli/crates/config/src/explorer_compose.rs @@ -16,7 +16,7 @@ use crate::{ EXPLORER_WORKER_DOCKER_IMAGE, LOCAL_CHAINS_PATH, LOCAL_CONFIGS_PATH, }, docker_compose::{DockerComposeConfig, DockerComposeService}, - traits::ZkToolboxConfig, + traits::ZkStackConfig, EXPLORER_BATCHES_PROCESSING_POLLING_INTERVAL, }; @@ -72,7 +72,7 @@ pub struct ExplorerBackendComposeConfig { pub docker_compose: DockerComposeConfig, } -impl ZkToolboxConfig for ExplorerBackendComposeConfig {} +impl ZkStackConfig for ExplorerBackendComposeConfig {} impl ExplorerBackendComposeConfig { const API_NAME: &'static str = "api"; diff --git a/zkstack_cli/crates/config/src/forge_interface/accept_ownership/mod.rs b/zkstack_cli/crates/config/src/forge_interface/accept_ownership/mod.rs index 636cffc49f89..4f73483b393a 100644 --- a/zkstack_cli/crates/config/src/forge_interface/accept_ownership/mod.rs +++ b/zkstack_cli/crates/config/src/forge_interface/accept_ownership/mod.rs @@ -1,9 +1,9 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use crate::traits::ZkToolboxConfig; +use crate::traits::ZkStackConfig; -impl ZkToolboxConfig for AcceptOwnershipInput {} +impl ZkStackConfig for AcceptOwnershipInput {} #[derive(Debug, Deserialize, Serialize, Clone)] pub struct AcceptOwnershipInput { diff --git a/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs index 30ec0eeb9c48..8c1c5c3e8092 100644 --- a/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -10,7 +10,7 @@ use zksync_basic_types::L2ChainId; use crate::{ consts::INITIAL_DEPLOYMENT_FILE, - traits::{FileConfigWithDefaultName, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ZkStackConfig}, ContractsConfig, GenesisConfig, WalletsConfig, }; @@ -61,7 +61,7 @@ impl FileConfigWithDefaultName for InitialDeploymentConfig { const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; } -impl ZkToolboxConfig for InitialDeploymentConfig {} +impl ZkStackConfig for InitialDeploymentConfig {} #[derive(Debug, Deserialize, Serialize, Clone)] pub struct Erc20DeploymentConfig { @@ -72,7 +72,7 @@ impl FileConfigWithDefaultName for Erc20DeploymentConfig { const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; } -impl ZkToolboxConfig for Erc20DeploymentConfig {} +impl ZkStackConfig for Erc20DeploymentConfig {} impl Default for Erc20DeploymentConfig { fn default() -> Self { @@ -115,7 +115,7 @@ pub struct DeployL1Config { pub tokens: TokensDeployL1Config, } -impl ZkToolboxConfig for DeployL1Config {} +impl ZkStackConfig for DeployL1Config {} impl DeployL1Config { pub fn new( @@ -210,7 +210,7 @@ pub struct DeployErc20Config { pub additional_addresses_for_minting: Vec
, } -impl ZkToolboxConfig for DeployErc20Config {} +impl ZkStackConfig for DeployErc20Config {} impl DeployErc20Config { pub fn new( diff --git a/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/output.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/output.rs index 7f35cf0357c2..7a922cbdf3c0 100644 --- a/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/output.rs +++ b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/output.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use crate::{ consts::ERC20_CONFIGS_FILE, - traits::{FileConfigWithDefaultName, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ZkStackConfig}, }; #[derive(Debug, Deserialize, Serialize, Clone)] @@ -21,7 +21,7 @@ pub struct DeployL1Output { pub deployed_addresses: DeployL1DeployedAddressesOutput, } -impl ZkToolboxConfig for DeployL1Output {} +impl ZkStackConfig for DeployL1Output {} #[derive(Debug, Deserialize, Serialize, Clone)] pub struct DeployL1ContractsConfigOutput { @@ -98,4 +98,4 @@ impl FileConfigWithDefaultName for ERC20Tokens { const FILE_NAME: &'static str = ERC20_CONFIGS_FILE; } -impl ZkToolboxConfig for ERC20Tokens {} +impl ZkStackConfig for ERC20Tokens {} diff --git a/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/input.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/input.rs index b20b58f99c58..3836dca9d24c 100644 --- a/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/input.rs +++ b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/input.rs @@ -2,9 +2,9 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; use zksync_basic_types::L2ChainId; -use crate::{traits::ZkToolboxConfig, ChainConfig}; +use crate::{traits::ZkStackConfig, ChainConfig}; -impl ZkToolboxConfig for DeployL2ContractsInput {} +impl ZkStackConfig for DeployL2ContractsInput {} /// Fields corresponding to `contracts/l1-contracts/deploy-script-config-template/config-deploy-l2-config.toml` /// which are read by `contracts/l1-contracts/deploy-scripts/DeployL2Contracts.sol`. diff --git a/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/output.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/output.rs index ca5cac12c02d..29be89b91016 100644 --- a/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/output.rs +++ b/zkstack_cli/crates/config/src/forge_interface/deploy_l2_contracts/output.rs @@ -1,12 +1,12 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use crate::traits::ZkToolboxConfig; +use crate::traits::ZkStackConfig; -impl ZkToolboxConfig for InitializeBridgeOutput {} -impl ZkToolboxConfig for DefaultL2UpgradeOutput {} -impl ZkToolboxConfig for ConsensusRegistryOutput {} -impl ZkToolboxConfig for Multicall3Output {} +impl ZkStackConfig for InitializeBridgeOutput {} +impl ZkStackConfig for DefaultL2UpgradeOutput {} +impl ZkStackConfig for ConsensusRegistryOutput {} +impl ZkStackConfig for Multicall3Output {} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InitializeBridgeOutput { diff --git a/zkstack_cli/crates/config/src/forge_interface/paymaster/mod.rs b/zkstack_cli/crates/config/src/forge_interface/paymaster/mod.rs index 9631fe743180..2af7502e0b76 100644 --- a/zkstack_cli/crates/config/src/forge_interface/paymaster/mod.rs +++ b/zkstack_cli/crates/config/src/forge_interface/paymaster/mod.rs @@ -2,7 +2,7 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; use zksync_basic_types::L2ChainId; -use crate::{traits::ZkToolboxConfig, ChainConfig}; +use crate::{traits::ZkStackConfig, ChainConfig}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct DeployPaymasterInput { @@ -22,11 +22,11 @@ impl DeployPaymasterInput { } } -impl ZkToolboxConfig for DeployPaymasterInput {} +impl ZkStackConfig for DeployPaymasterInput {} #[derive(Debug, Serialize, Deserialize, Clone)] pub struct DeployPaymasterOutput { pub paymaster: Address, } -impl ZkToolboxConfig for DeployPaymasterOutput {} +impl ZkStackConfig for DeployPaymasterOutput {} diff --git a/zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs b/zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs index e2e60294e867..fb7c606a4569 100644 --- a/zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs +++ b/zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use types::L1BatchCommitmentMode; use zksync_basic_types::L2ChainId; -use crate::{traits::ZkToolboxConfig, ChainConfig, ContractsConfig}; +use crate::{traits::ZkStackConfig, ChainConfig, ContractsConfig}; #[derive(Debug, Deserialize, Serialize, Clone)] struct Bridgehub { @@ -50,7 +50,7 @@ pub struct ChainL1Config { pub governance_min_delay: u64, } -impl ZkToolboxConfig for RegisterChainL1Config {} +impl ZkStackConfig for RegisterChainL1Config {} impl RegisterChainL1Config { pub fn new(chain_config: &ChainConfig, contracts: &ContractsConfig) -> anyhow::Result { diff --git a/zkstack_cli/crates/config/src/forge_interface/register_chain/output.rs b/zkstack_cli/crates/config/src/forge_interface/register_chain/output.rs index f9521b16328f..a3e23f7bae42 100644 --- a/zkstack_cli/crates/config/src/forge_interface/register_chain/output.rs +++ b/zkstack_cli/crates/config/src/forge_interface/register_chain/output.rs @@ -1,7 +1,7 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use crate::traits::ZkToolboxConfig; +use crate::traits::ZkStackConfig; #[derive(Debug, Deserialize, Serialize, Clone)] pub struct RegisterChainOutput { @@ -10,4 +10,4 @@ pub struct RegisterChainOutput { pub chain_admin_addr: Address, } -impl ZkToolboxConfig for RegisterChainOutput {} +impl ZkStackConfig for RegisterChainOutput {} diff --git a/zkstack_cli/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs b/zkstack_cli/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs index e8189c521fb3..201cf86b734b 100644 --- a/zkstack_cli/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs +++ b/zkstack_cli/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use zksync_basic_types::{Address, L2ChainId, H256}; -use crate::traits::ZkToolboxConfig; +use crate::traits::ZkStackConfig; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SetupLegacyBridgeInput { @@ -17,4 +17,4 @@ pub struct SetupLegacyBridgeInput { pub create2factory_addr: Address, } -impl ZkToolboxConfig for SetupLegacyBridgeInput {} +impl ZkStackConfig for SetupLegacyBridgeInput {} diff --git a/zkstack_cli/crates/config/src/portal.rs b/zkstack_cli/crates/config/src/portal.rs index c787c6cc7026..2b6f0ffd5156 100644 --- a/zkstack_cli/crates/config/src/portal.rs +++ b/zkstack_cli/crates/config/src/portal.rs @@ -9,7 +9,7 @@ use crate::{ LOCAL_APPS_PATH, LOCAL_CONFIGS_PATH, LOCAL_GENERATED_PATH, PORTAL_CONFIG_FILE, PORTAL_JS_CONFIG_FILE, }, - traits::{ReadConfig, SaveConfig, ZkToolboxConfig}, + traits::{ReadConfig, SaveConfig, ZkStackConfig}, }; /// Portal JSON configuration file. This file contains configuration for the portal app. @@ -172,4 +172,4 @@ impl Default for PortalConfig { } } -impl ZkToolboxConfig for PortalConfig {} +impl ZkStackConfig for PortalConfig {} diff --git a/zkstack_cli/crates/config/src/traits.rs b/zkstack_cli/crates/config/src/traits.rs index e2eabe5ae588..a4a4ad22c613 100644 --- a/zkstack_cli/crates/config/src/traits.rs +++ b/zkstack_cli/crates/config/src/traits.rs @@ -9,7 +9,7 @@ use url::Url; use xshell::Shell; // Configs that we use only inside ZK Stack CLI, we don't have protobuf implementation for them. -pub trait ZkToolboxConfig {} +pub trait ZkStackConfig {} pub trait FileConfigWithDefaultName { const FILE_NAME: &'static str; @@ -19,7 +19,7 @@ pub trait FileConfigWithDefaultName { } } -impl SaveConfig for T { +impl SaveConfig for T { fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { save_with_comment(shell, path, self, "") } @@ -49,7 +49,7 @@ pub trait ReadConfig: Sized { impl ReadConfig for T where - T: DeserializeOwned + Clone + ZkToolboxConfig, + T: DeserializeOwned + Clone + ZkStackConfig, { fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { let error_context = || format!("Failed to parse config file {:?}.", path.as_ref()); diff --git a/zkstack_cli/crates/config/src/wallets.rs b/zkstack_cli/crates/config/src/wallets.rs index 9c87453954ec..4da1e764e853 100644 --- a/zkstack_cli/crates/config/src/wallets.rs +++ b/zkstack_cli/crates/config/src/wallets.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use crate::{ consts::WALLETS_FILE, - traits::{FileConfigWithDefaultName, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ZkStackConfig}, }; #[derive(Debug, Clone, Serialize, Deserialize)] @@ -63,6 +63,6 @@ pub(crate) struct EthMnemonicConfig { pub(crate) base_path: String, } -impl ZkToolboxConfig for EthMnemonicConfig {} +impl ZkStackConfig for EthMnemonicConfig {} -impl ZkToolboxConfig for WalletsConfig {} +impl ZkStackConfig for WalletsConfig {} From 240636a58ab559ed21f086bafd77bed7a49d5839 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 4 Oct 2024 10:11:52 +0200 Subject: [PATCH 019/103] refactor: remove last occurences of the wording "toolbox" --- core/lib/utils/src/env.rs | 32 ++++++++++++++++---------------- infrastructure/zk/src/lint.ts | 4 ++-- zkstack_cli/zkstackup/README.md | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/core/lib/utils/src/env.rs b/core/lib/utils/src/env.rs index d85d4c6dc3c2..8f4aa1da9400 100644 --- a/core/lib/utils/src/env.rs +++ b/core/lib/utils/src/env.rs @@ -20,7 +20,7 @@ pub enum Workspace<'a> { /// `prover` folder. Prover(&'a Path), /// ZK Stack CLI folder. - Toolbox(&'a Path), + ZkStackCli(&'a Path), } impl Workspace<'static> { @@ -48,7 +48,7 @@ impl Workspace<'static> { impl<'a> Workspace<'a> { const PROVER_DIRECTORY_NAME: &'static str = "prover"; - const TOOLBOX_DIRECTORY_NAME: &'static str = "zkstack_cli"; + const ZKSTACK_CLI_DIRECTORY_NAME: &'static str = "zkstack_cli"; /// Returns the path of the core workspace. /// For `Workspace::None`, considers the current directory to represent core workspace. @@ -56,7 +56,7 @@ impl<'a> Workspace<'a> { match self { Self::None => PathBuf::from("."), Self::Core(path) => path.into(), - Self::Prover(path) | Self::Toolbox(path) => path.parent().unwrap().into(), + Self::Prover(path) | Self::ZkStackCli(path) => path.parent().unwrap().into(), } } @@ -69,10 +69,10 @@ impl<'a> Workspace<'a> { } /// Returns the path of the ZK Stack CLI workspace. - pub fn toolbox(self) -> PathBuf { + pub fn zkstack_cli(self) -> PathBuf { match self { - Self::Toolbox(path) => path.into(), - _ => self.core().join(Self::TOOLBOX_DIRECTORY_NAME), + Self::ZkStackCli(path) => path.into(), + _ => self.core().join(Self::ZKSTACK_CLI_DIRECTORY_NAME), } } } @@ -81,8 +81,8 @@ impl<'a> From<&'a Path> for Workspace<'a> { fn from(path: &'a Path) -> Self { if path.ends_with(Self::PROVER_DIRECTORY_NAME) { Self::Prover(path) - } else if path.ends_with(Self::TOOLBOX_DIRECTORY_NAME) { - Self::Toolbox(path) + } else if path.ends_with(Self::ZKSTACK_CLI_DIRECTORY_NAME) { + Self::ZkStackCli(path) } else { Self::Core(path) } @@ -160,10 +160,10 @@ mod tests { Workspace::from(workspace.prover().as_path()), Workspace::Prover(_) ); - assert!(workspace.toolbox().exists()); + assert!(workspace.zkstack_cli().exists()); assert_matches!( - Workspace::from(workspace.toolbox().as_path()), - Workspace::Toolbox(_) + Workspace::from(workspace.zkstack_cli().as_path()), + Workspace::ZkStackCli(_) ); // Prover. @@ -181,17 +181,17 @@ mod tests { Workspace::from(workspace.core().as_path()), Workspace::Core(_) ); - assert!(workspace.toolbox().exists()); + assert!(workspace.zkstack_cli().exists()); assert_matches!( - Workspace::from(workspace.toolbox().as_path()), - Workspace::Toolbox(_) + Workspace::from(workspace.zkstack_cli().as_path()), + Workspace::ZkStackCli(_) ); // ZK Stack CLI - std::env::set_current_dir(workspace.toolbox()).unwrap(); + std::env::set_current_dir(workspace.zkstack_cli()).unwrap(); let workspace_path = locate_workspace_inner().unwrap(); let workspace = Workspace::from(workspace_path.as_path()); - assert_matches!(workspace, Workspace::Toolbox(_)); + assert_matches!(workspace, Workspace::ZkStackCli(_)); assert_eq!(workspace.core(), core_path); assert_matches!( Workspace::from(workspace.core().as_path()), diff --git a/infrastructure/zk/src/lint.ts b/infrastructure/zk/src/lint.ts index 229e841955a5..49ae4d0753ec 100644 --- a/infrastructure/zk/src/lint.ts +++ b/infrastructure/zk/src/lint.ts @@ -43,7 +43,7 @@ async function zkstackClippy() { await utils.spawn('cargo clippy --tests --locked -- -D warnings'); } -const ARGS = [...EXTENSIONS, 'rust', 'prover', 'contracts', 'toolbox'] as const; +const ARGS = [...EXTENSIONS, 'rust', 'prover', 'contracts', 'zkstack_cli'] as const; export const command = new Command('lint') .description('lint code') @@ -61,7 +61,7 @@ export const command = new Command('lint') case 'contracts': await lintContracts(cmd.check); break; - case 'toolbox': + case 'zkstack_cli': await zkstackClippy(); break; default: diff --git a/zkstack_cli/zkstackup/README.md b/zkstack_cli/zkstackup/README.md index 8a8ba4ae54a6..b753c792c0df 100644 --- a/zkstack_cli/zkstackup/README.md +++ b/zkstack_cli/zkstackup/README.md @@ -47,9 +47,9 @@ The `zkstackup` script provides various options for installing ZK Stack CLI: ### Local Installation -If you provide a local path using the `-p` or `--path` option, `zkstackup` will install ZK Stack CLI from that directory. -Note that repository-specific arguments (`--repo`, `--branch`, `--commit`, `--version`) will be ignored in this case to -preserve git state. +If you provide a local path using the `-p` or `--path` option, `zkstackup` will install ZK Stack CLI from that +directory. Note that repository-specific arguments (`--repo`, `--branch`, `--commit`, `--version`) will be ignored in +this case to preserve git state. ### Repository Installation From b3fd67ae045eed4fd64174a2578f3d8f859472e3 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 4 Oct 2024 11:00:55 +0200 Subject: [PATCH 020/103] refactor: update ascii art banner --- zkstack_cli/zkstackup/zkstackup | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 2d4517629d35..a36462dc8919 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -188,13 +188,13 @@ zkstack_banner() { =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -███████╗██╗ ██╗ ████████╗ ██████╗ ██████╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ -╚══███╔╝██║ ██╔╝ ╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██╔══██╗██╔═══██╗╚██╗██╔╝ - ███╔╝ █████╔╝ ██║ ██║ ██║██║ ██║██║ ██████╔╝██║ ██║ ╚███╔╝ - ███╔╝ ██╔═██╗ ██║ ██║ ██║██║ ██║██║ ██╔══██╗██║ ██║ ██╔██╗ -███████╗██║ ██╗ ██║ ╚██████╔╝╚██████╔╝███████╗██████╔╝╚██████╔╝██╔╝ ██╗ -╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝ - + ███████╗██╗ ██╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗ + ╚══███╔╝██║ ██╔╝ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝ + ███╔╝ █████╔╝ ███████╗ ██║ ███████║██║ █████╔╝ + ███╔╝ ██╔═██╗ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗ + ███████╗██║ ██╗ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗ + ╚══════╝╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ + A Comprehensive Toolkit for Creating and Managing ZK Stack Chains From 07707826e4d8f03c49adb972b93f309674ab4bc4 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 8 Oct 2024 10:38:31 +0200 Subject: [PATCH 021/103] fix: remove unsupported flag --alias --- bin/zkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/zkt b/bin/zkt index 2dbb97c9365f..682c18b7f7b1 100755 --- a/bin/zkt +++ b/bin/zkt @@ -6,7 +6,7 @@ if which zkstackup >/dev/null; then cargo uninstall zkstack git config --local core.hooksPath || git config --local core.hooksPath ./.githooks - zkstackup -p .. --alias + zkstackup -p .. else echo zkstackup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup cd ../zkstack_cli From 1b7d1103e820129f053cdef4d58024df84b8d86d Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 8 Oct 2024 10:47:35 +0200 Subject: [PATCH 022/103] refactor: remove occurences of old ZK supervisor wording --- core/tests/recovery-test/src/index.ts | 4 ++-- core/tests/recovery-test/tests/snapshot-recovery.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index d30fe83e98e9..8567be6d6d30 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -84,8 +84,8 @@ export async function getExternalNodeHealth(url: string) { } } -export async function dropNodeData(env: { [key: string]: string }, useZkSupervisor?: boolean, chain?: string) { - if (useZkSupervisor) { +export async function dropNodeData(env: { [key: string]: string }, useZkStack?: boolean, chain?: string) { + if (useZkStack) { let cmd = 'zkstack external-node init'; cmd += chain ? ` --chain ${chain}` : ''; await executeNodeCommand(env, cmd); diff --git a/core/tests/recovery-test/tests/snapshot-recovery.test.ts b/core/tests/recovery-test/tests/snapshot-recovery.test.ts index 51b129c46de8..eca0da78d782 100644 --- a/core/tests/recovery-test/tests/snapshot-recovery.test.ts +++ b/core/tests/recovery-test/tests/snapshot-recovery.test.ts @@ -458,9 +458,9 @@ async function decompressGzip(filePath: string): Promise { }); } -async function createSnapshot(zkSupervisor: boolean) { +async function createSnapshot(useZkStack: boolean) { let command = ''; - if (zkSupervisor) { + if (useZkStack) { command = `zkstack dev snapshot create`; command += ` --chain ${fileConfig.chain}`; } else { From a0d0eae19537f000a550094dc910fcda41cf5a84 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 8 Oct 2024 10:48:07 +0200 Subject: [PATCH 023/103] docs: use new ZK Stack CLI wording in docs --- prover/docs/05_proving_batch.md | 2 +- zkstack_cli/README.md | 64 ++++++++++++++++----------------- zkstack_cli/zkstackup/README.md | 6 ---- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/prover/docs/05_proving_batch.md b/prover/docs/05_proving_batch.md index cef493a39abc..dd381a4e4f76 100644 --- a/prover/docs/05_proving_batch.md +++ b/prover/docs/05_proving_batch.md @@ -24,7 +24,7 @@ Google VM instance, you also need to install [gcloud](https://cloud.google.com/s Now, you can use `zkstack` and `prover_cli` tools for setting up the env and running prover subsystem. ```shell -cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked zkstack zk_supervisor prover_cli --force +cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked zkstack prover_cli --force ``` ## Initializing system diff --git a/zkstack_cli/README.md b/zkstack_cli/README.md index 7660073c7a0e..b67c0687703e 100644 --- a/zkstack_cli/README.md +++ b/zkstack_cli/README.md @@ -1,11 +1,7 @@ # ZK Stack CLI -Toolkit for creating and managing ZK Stack chains. - -## ZK Inception - -`ZK Inception` facilitates the creation and management of ZK Stacks. Commands are interactive but can also accept -arguments via the command line. +Toolkit for creating and managing ZK Stack chains. `ZK Stack CLI` facilitates the creation and management of ZK Stacks. +Commands are interactive but can also accept arguments via the command line. ### Dependencies @@ -14,10 +10,10 @@ dependencies on your machine. Ignore the Environment section for now. ### Installation -Install `zk_inception` from Git: +Install `zkstack` from Git: ```bash -cargo install --git https://github.com/matter-labs/zksync-era/ --locked zk_inception zk_supervisor --force +cargo install --git https://github.com/matter-labs/zksync-era/ --locked zkstack --force ``` Or manually build from a local copy of the [ZKsync](https://github.com/matter-labs/zksync-era/) repository: @@ -26,7 +22,7 @@ Or manually build from a local copy of the [ZKsync](https://github.com/matter-la ./bin/zkt ``` -This command installs `zk_inception` and `zk_supervisor` from the current repository. +This command installs `zkstack` from the current repository. ### Foundry Integration @@ -51,13 +47,13 @@ BridgeHub, shared bridges, and state transition managers. To create a ZK Stack project, start by creating an ecosystem: ```bash -zk_inception ecosystem create +zkstack ecosystem create ``` If you choose not to start database & L1 containers after creating the ecosystem, you can later run: ```bash -zk_inception containers +zkstack containers ``` Execute subsequent commands from within the created ecosystem folder: @@ -71,14 +67,14 @@ cd path/to/ecosystem/name If the ecosystem has never been deployed before, initialize it: ```bash -zk_inception ecosystem init +zkstack ecosystem init ``` This initializes the first ZK chain, which becomes the default. Override with `--chain ` if needed. For default params, use: ```bash -zk_inception ecosystem init --dev +zkstack ecosystem init --dev ``` If the process gets stuck, resume it with `--resume`. This flag keeps track of already sent transactions and sends new @@ -98,7 +94,7 @@ To verify contracts, use the `--verify` flag. To change the default ZK chain: ```bash -zk_inception ecosystem change-default-chain +zkstack ecosystem change-default-chain ``` IMPORTANT: Currently, you cannot use an existing ecosystem to register a new chain. This feature will be added in the @@ -109,19 +105,19 @@ future. To setup [era-observability](https://github.com/matter-labs/era-observability): ```bash -zk_inception ecosystem setup-observability +zkstack ecosystem setup-observability ``` Or run: ```bash -zk_inception ecosystem init --observability +zkstack ecosystem init --observability ``` To start observability containers: ```bash -zk_inception containers --observability +zkstack containers --observability ``` ### ZK Chain @@ -131,7 +127,7 @@ zk_inception containers --observability The first ZK chain is generated upon ecosystem creation. Create additional chains and switch between them: ```bash -zk_inception chain create +zkstack chain create ``` #### Init @@ -139,7 +135,7 @@ zk_inception chain create Deploy contracts and initialize Zk Chain: ```bash -zk_inception chain init +zkstack chain init ``` This registers the chain in the BridgeHub and deploys all necessary contracts. Manual initialization steps: @@ -154,7 +150,7 @@ by a third party). To run the chain: ```bash -zk_inception server +zkstack server ``` You can specify the component you want to run using `--components` flag @@ -180,13 +176,13 @@ information. Initialize the prover: ```bash -zk_inception prover init +zkstack prover init ``` Run the prover: ```bash -zk_inception prover run +zkstack prover run ``` Specify the prover component with `--component `. Components: @@ -202,13 +198,13 @@ For `witness-generator`, specify the round with `--round `. Rounds: Download required binaries (`solc`, `zksolc`, `vyper`, `zkvyper`): ```bash -zk_inception contract-verifier init +zkstack contract-verifier init ``` Run the contract verifier: ```bash -zk_inception contract-verifier run +zkstack contract-verifier run ``` ### External Node @@ -220,7 +216,7 @@ Commands for running an external node: Prepare configs: ```bash -zk_inception en configs +zkstack en configs ``` This ensures no port conflicts with the main node. @@ -230,7 +226,7 @@ This ensures no port conflicts with the main node. Prepare the databases: ```bash -zk_inception en init +zkstack en init ``` #### Run @@ -238,7 +234,7 @@ zk_inception en init Run the external node: ```bash -zk_inception en run +zkstack en run ``` ### Portal @@ -247,7 +243,7 @@ Once you have at least one chain initialized, you can run the [portal](https://g web-app to bridge tokens between L1 and L2 and more: ```bash -zk_inception portal +zkstack portal ``` This command will start the dockerized portal app using configuration from `apps/portal.config.json` file inside your @@ -263,7 +259,7 @@ contracts and more. First, each chain should be initialized: ```bash -zk_inception explorer init +zkstack explorer init ``` This command creates a database to store explorer data and generatesdocker compose file with explorer services @@ -272,7 +268,7 @@ This command creates a database to store explorer data and generatesdocker compo Next, for each chain you want to have an explorer, you need to start its backend services: ```bash -zk_inception explorer backend --chain +zkstack explorer backend --chain ``` This command uses previously created docker compose file to start the services (api, data fetcher, worker) required for @@ -281,7 +277,7 @@ the explorer. Finally, you can run the explorer app: ```bash -zk_inception explorer run +zkstack explorer run ``` This command will start the dockerized explorer app using configuration from `apps/explorer.config.json` file inside @@ -293,15 +289,15 @@ your ecosystem directory. You can edit this file to configure the app if needed. To update your node: ```bash -zk_inception update +zkstack update ``` This command pulls the latest changes, syncs the general config for all chains, and raises a warning if L1 upgrades are needed. -## ZK Supervisor +## Dev -Tools for developing ZKsync. +The subcommand `zkstack dev` offers tools for developing ZKsync. ### Database diff --git a/zkstack_cli/zkstackup/README.md b/zkstack_cli/zkstackup/README.md index b753c792c0df..4977c4641e09 100644 --- a/zkstack_cli/zkstackup/README.md +++ b/zkstack_cli/zkstackup/README.md @@ -39,12 +39,6 @@ The `zkstackup` script provides various options for installing ZK Stack CLI: - `-v, --version ` Git tag to use when installing from a repository. Ignored if `--branch` or `--commit` is provided. -- `--inception` - Installs `zk_inception` from the repository. By default, `zkstackup` installs `zk_inception` and `zk_supervisor`. - -- `--supervisor` - Installs `zk_supervisor` from the repository. - ### Local Installation If you provide a local path using the `-p` or `--path` option, `zkstackup` will install ZK Stack CLI from that From 15aecf700ea8d69991b5a868caba4c68b2b16268 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 8 Oct 2024 11:09:35 +0200 Subject: [PATCH 024/103] docs: remove occurences of zks alias from docs --- zkstack_cli/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zkstack_cli/README.md b/zkstack_cli/README.md index b67c0687703e..63304bdee9f3 100644 --- a/zkstack_cli/README.md +++ b/zkstack_cli/README.md @@ -354,7 +354,7 @@ Possible commands: Create a snapshot of the current chain: ```bash -zks snapshot create +zkstack dev snapshot create ``` ### Contracts @@ -362,7 +362,7 @@ zks snapshot create Build contracts: ```bash -zks contracts +zkstack dev contracts ``` ### Format @@ -370,7 +370,7 @@ zks contracts Format code: ```bash -zks fmt +zkstack dev fmt ``` By default, this command runs all formatters. To run a specific fomatter use the following subcommands: @@ -384,7 +384,7 @@ By default, this command runs all formatters. To run a specific fomatter use the Lint code: ```bash -zks lint +zkstack dev lint ``` By default, this command runs the linter on all files. To target specific file types, use the `--target` option. From d84ad52e610aadbd0a393581d12b2785d37c5fd7 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 8 Oct 2024 11:22:16 +0200 Subject: [PATCH 025/103] feat: fallback to zk_supervisor in case zkstack is not installed --- .githooks/pre-push | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 619f9e5fa7a7..31a92de6a456 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -6,14 +6,28 @@ RED='\033[0;31m' NC='\033[0m' # No Color +# Prompt to install zkstack +INSTALL_PROPT="Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup, and then run ./bin/zkt from the zksync-era repository." + # Check that prettier formatting rules are not violated. if which zkstack >/dev/null; then if ! zkstack dev fmt --check; then echo -e "${RED}Push error!${NC}" - echo "Please format the code via 'zki dev fmt', cannot push unformatted code" + echo "Please format the code via 'zkstack dev fmt', cannot push unformatted code" exit 1 fi else - echo "Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup, and then run ./bin/zkt from the zksync-era repository." - exit 1 + if which zk_supervisor >/dev/null; then + echo -e "${RED}WARNING: zk_inception, zk_supervisor, and their aliases zki and zks are DEPRECATED.${NC}" + echo -e "${RED}${INSTALL_PROPT}${NC}" + + if ! zk_supervisor fmt --check; then + echo -e "${RED}Push error!${NC}" + echo "Please format the code via 'zkstack dev fmt', cannot push unformatted code" + exit 1 + fi + else + echo -e "${INSTALL_PROPT}" + exit 1 + fi fi From 2f733306dfd055b6b0761e8ca6fe212651e7e6af Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Tue, 8 Oct 2024 11:27:48 +0200 Subject: [PATCH 026/103] docs: change deprecation message to include zkup --- .githooks/pre-push | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 31a92de6a456..13b70c9cb234 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -18,7 +18,7 @@ if which zkstack >/dev/null; then fi else if which zk_supervisor >/dev/null; then - echo -e "${RED}WARNING: zk_inception, zk_supervisor, and their aliases zki and zks are DEPRECATED.${NC}" + echo -e "${RED}WARNING: zkup, zk_inception/zki, and zk_supervisor/zks are DEPRECATED.${NC}" echo -e "${RED}${INSTALL_PROPT}${NC}" if ! zk_supervisor fmt --check; then From a86cf29747830db89bd531bd481b2acfec74d78b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 12:26:50 +0200 Subject: [PATCH 027/103] feat: remove zkt --- .githooks/pre-push | 2 +- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 6 +- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- bin/zkt | 14 -- docker/Makefile | 2 +- zkstack_cli/README.md | 12 +- zkstack_cli/zkstackup/install | 145 ++++++++++++------ zkstack_cli/zkstackup/zkstackup | 17 +- 16 files changed, 140 insertions(+), 80 deletions(-) delete mode 100755 bin/zkt diff --git a/.githooks/pre-push b/.githooks/pre-push index 13b70c9cb234..7e6f9f2dd9b5 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -7,7 +7,7 @@ RED='\033[0;31m' NC='\033[0m' # No Color # Prompt to install zkstack -INSTALL_PROPT="Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup, and then run ./bin/zkt from the zksync-era repository." +INSTALL_PROPT="Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup" # Check that prettier formatting rules are not violated. if which zkstack >/dev/null; then diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 3322d6034813..c2874ef4f3d4 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -113,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./bin/zkt || true + ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 6cb39957e2c9..51650ea09842 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,7 +127,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./bin/zkt || true + ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index c7c7f2c8c18c..fbb78a000150 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -61,7 +61,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run zkt + ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 36254567302f..cce5c1c78496 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run zkt + ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 8d38fa7e27ce..fbfbd94e91ab 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run ./bin/zkt + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 447a167e5752..27d39fe88d4d 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -56,7 +56,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./bin/zkt + ci_run zkstackup --local ci_run zkstack dev contracts - name: Contracts unit tests @@ -113,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./bin/zkt + ci_run zkstackup --local ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ @@ -175,7 +175,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "./bin/zkt" + run: ci_run bash -c "zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 43c1075368c1..05f65e03b0f5 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run ./bin/zkt + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 1b637ddce277..30513344e1b6 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run zkt + ci_run zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting @@ -67,7 +67,7 @@ jobs: - name: Init run: | - ci_run zkt + ci_run zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 9fe0aa6d1b6c..31420b686542 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -48,7 +48,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt + ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -60,7 +60,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run zkt + ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 4ee0c90f59bc..59f600d729c3 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -33,7 +33,7 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - ci_run zkt + ci_run zkstackup --local ci_run zkstack dev contracts - name: run benchmarks diff --git a/bin/zkt b/bin/zkt deleted file mode 100755 index 682c18b7f7b1..000000000000 --- a/bin/zkt +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -cd $(dirname $0) - -if which zkstackup >/dev/null; then - cargo uninstall zkstack - git config --local core.hooksPath || - git config --local core.hooksPath ./.githooks - zkstackup -p .. -else - echo zkstackup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup - cd ../zkstack_cli - cargo install --path ./crates/zkstack --force -fi diff --git a/docker/Makefile b/docker/Makefile index fd590816ee20..30a90a357015 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ - zkt || true && \ + zkstackup --local || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts diff --git a/zkstack_cli/README.md b/zkstack_cli/README.md index 63304bdee9f3..f1c92cc3d2e3 100644 --- a/zkstack_cli/README.md +++ b/zkstack_cli/README.md @@ -10,16 +10,22 @@ dependencies on your machine. Ignore the Environment section for now. ### Installation -Install `zkstack` from Git: +You can use `zkstackup` to install and manage `zkstack`: ```bash -cargo install --git https://github.com/matter-labs/zksync-era/ --locked zkstack --force +curl -L https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/install | bash +``` + +Then install the most recent version with: + +```bash +zkstackup ``` Or manually build from a local copy of the [ZKsync](https://github.com/matter-labs/zksync-era/) repository: ```bash -./bin/zkt +zkstackup --local ``` This command installs `zkstack` from the current repository. diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index 4da35d84f785..be5d24b3397b 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -8,48 +8,103 @@ ZKT_BIN_DIR="$ZKT_DIR/bin" BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/zkstackup" BIN_PATH="$ZKT_BIN_DIR/zkstackup" -mkdir -p "$ZKT_BIN_DIR" -curl -sSfL "$BIN_URL" -o "$BIN_PATH" -chmod +x "$BIN_PATH" - -if [[ ":$PATH:" == *":${ZKT_BIN_DIR}:"* ]]; then - echo "zkstackup: found ${ZKT_BIN_DIR} in PATH" - exit 0 -fi - -case $SHELL in -*/zsh) - PROFILE="${ZDOTDIR-"$HOME"}/.zshenv" - ;; -*/bash) - PROFILE="$HOME/.bashrc" - ;; -*/fish) - PROFILE="$HOME/.config/fish/config.fish" - ;; -*/ash) - PROFILE="$HOME/.profile" - ;; -*) - echo "zkstackup: could not detect shell, manually add ${ZKT_BIN_DIR} to your PATH." - exit 1 - ;; -esac - -if [[ ! -f "$PROFILE" ]]; then - echo "zkstackup: Profile file $PROFILE does not exist, creating it." - touch "$PROFILE" -fi - -if [[ "$SHELL" == *"/fish"* ]]; then - echo -e "\n# Added by zkstackup\nfish_add_path -a $ZKT_BIN_DIR" >>"$PROFILE" - echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE using fish_add_path." -else - echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$ZKT_BIN_DIR\"" >>"$PROFILE" - echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE." -fi - -echo -echo "Added zkstackup to PATH." -echo "Run 'source $PROFILE' or start a new terminal session to use zkstackup." -echo "Then run 'zkstackup' to install ZK Stack CLI." +main() { + parse_args "$@" + + mkdir -p "$ZKT_BIN_DIR" + + if [ -n "$ZKSTACKUP_PATH" ]; then + cp -r "$ZKSTACKUP_PATH" "$ZKT_BIN_DIR" + else + curl -sSfL "$BIN_URL" -o "$BIN_PATH" + fi + + chmod +x "$BIN_PATH" + echo "zkstackup: successfully installed in ${ZKT_BIN_DIR}." + + if [[ ":$PATH:" == *":${ZKT_BIN_DIR}:"* ]]; then + echo "zkstackup: found ${ZKT_BIN_DIR} in PATH" + exit 0 + fi + + case $SHELL in + */zsh) + PROFILE="${ZDOTDIR-"$HOME"}/.zshenv" + ;; + */bash) + PROFILE="$HOME/.bashrc" + ;; + */fish) + PROFILE="$HOME/.config/fish/config.fish" + ;; + */ash) + PROFILE="$HOME/.profile" + ;; + *) + echo "zkstackup: could not detect shell, manually add ${ZKT_BIN_DIR} to your PATH." + exit 1 + ;; + esac + + if [[ ! -f "$PROFILE" ]]; then + echo "zkstackup: Profile file $PROFILE does not exist, creating it." + touch "$PROFILE" + fi + + if [[ "$SHELL" == *"/fish"* ]]; then + echo -e "\n# Added by zkstackup\nfish_add_path -a $ZKT_BIN_DIR" >>"$PROFILE" + echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE using fish_add_path." + else + echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$ZKT_BIN_DIR\"" >>"$PROFILE" + echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE." + fi + + echo + echo "Added zkstackup to PATH." + echo "Run 'source $PROFILE' or start a new terminal session to use zkstackup." + echo "Then run 'zkstackup' to install ZK Stack CLI." +} + + +parse_args() { + while [[ $# -gt 0 ]]; do + case $1 in + --) + shift + break + ;; + -p | --path) + shift + ZKSTACKUP_PATH=$1 + ;; + -h | --help) + usage + exit 0 + ;; + *) + err "Unknown argument: $1" + usage + exit 1 + ;; + esac + shift + done +} + + +usage() { + cat < Specify a local path to install zkstackup from. + -h, --help Show this help message and exit. + +Examples: + $(basename "$0") --path /path/to/zkstackup +EOF +} + +main "$@" diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index a36462dc8919..91e329101c13 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -20,7 +20,12 @@ main() { if [ -n "$ZKSTACKUP_PATH" ]; then install_local else - install_from_repo + if [ -n "$ZKSTACKUP_LOCAL" ]; then + ZKSTACKUP_PATH="./" + install_local + else + install_from_repo + fi fi zkstack_banner @@ -63,6 +68,9 @@ parse_args() { shift ZKSTACKUP_PATH=$1 ;; + -l | --local) + ZKSTACKUP_LOCAL=true + ;; -r | --repo) shift ZKSTACKUP_REPO=$1 @@ -101,6 +109,7 @@ Usage: $(basename "$0") [OPTIONS] Options: -p, --path Specify a local path to install ZK Stack CLI from. Ignored if --repo is provided. + -l, --local Install ZK Stack CLI from the current directory. -r, --repo GitHub repository to install from (e.g., "matter-labs/zksync-era"). Defaults to "matter-labs/zksync-era". -b, --branch Git branch to use when installing from a repository. Ignored if --commit or --version is provided. -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided. @@ -114,7 +123,11 @@ EOF install_local() { if [ ! -d "$ZKSTACKUP_PATH/zkstack_cli" ]; then - err "Path $ZKSTACKUP_PATH does not contain zkstack_cli" + if [ -n "$ZKSTACKUP_LOCAL" ]; then + err "Current folder does not contain zkstack_cli" + else + err "Path $ZKSTACKUP_PATH does not contain zkstack_cli" + fi exit 1 fi From f15d3a993b4c4593ae8f8ce4bae89d29856d6b55 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 13:25:10 +0200 Subject: [PATCH 028/103] fix: invoke zkstackup using its relative path --- .github/workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 6 +++--- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index c2874ef4f3d4..c68ef9868ba0 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -113,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 51650ea09842..c18cb6825cc3 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,7 +127,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index fbb78a000150..e169b459125d 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -61,7 +61,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index cce5c1c78496..510a14ff4343 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index fbfbd94e91ab..5bc7474d87e9 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index c30da667458a..fc82a6617ea5 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -56,7 +56,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts - name: Contracts unit tests @@ -113,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ @@ -176,7 +176,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "zkstackup --local" + run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 05f65e03b0f5..d33e4bd17cc2 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 30513344e1b6..52c10ed6ed4b 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting @@ -67,7 +67,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 31420b686542..868293551a79 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -48,7 +48,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -60,7 +60,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 59f600d729c3..161ce1901c37 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -33,7 +33,7 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts - name: run benchmarks From 45e639f7312024ec726dd416eb0518f27ef919a8 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 13:53:15 +0200 Subject: [PATCH 029/103] fix: install zkstackup in CI before invoking zkstack --- .github/workflows/build-contract-verifier-template.yml | 3 ++- .github/workflows/build-core-template.yml | 3 ++- .github/workflows/build-local-node-docker.yml | 3 ++- .github/workflows/ci-common-reusable.yml | 3 ++- .github/workflows/ci-core-lint-reusable.yml | 3 ++- .github/workflows/ci-core-reusable.yml | 7 ++++--- .github/workflows/ci-docs-reusable.yml | 3 ++- .github/workflows/ci-prover-reusable.yml | 6 ++++-- .github/workflows/vm-perf-comparison.yml | 6 ++++-- .github/workflows/vm-perf-to-prometheus.yml | 3 ++- 10 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index c68ef9868ba0..f2d7f0836c78 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -113,7 +113,8 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index c18cb6825cc3..0202f5bfc4c6 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,7 +127,8 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index e169b459125d..75ea5089bb48 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -61,7 +61,8 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 510a14ff4343..4e77b2219065 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -32,7 +32,8 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 5bc7474d87e9..b254cbf5b55d 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,7 +29,8 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index fc82a6617ea5..98576aedbf45 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -56,7 +56,8 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run zkstack dev contracts - name: Contracts unit tests @@ -113,7 +114,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ @@ -176,7 +177,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" + run: ci_run bash -c "zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index d33e4bd17cc2..7de3468de6ad 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,7 +29,8 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 52c10ed6ed4b..2da7a2e2b0ae 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,7 +32,8 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting @@ -67,7 +68,8 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 868293551a79..8be142bcb737 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -48,7 +48,8 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -60,7 +61,8 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 161ce1901c37..baa45b542114 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -33,7 +33,8 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run zkstackup --local ci_run zkstack dev contracts - name: run benchmarks From 4f3cde5be48e7093661268c3b00537a71955600b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 14:10:31 +0200 Subject: [PATCH 030/103] fix: typo in zkstackup installation command --- .github/workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 2 +- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index f2d7f0836c78..fa661c44c229 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -113,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 0202f5bfc4c6..f60f9ad706fa 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,7 +127,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 75ea5089bb48..82c7c4d33705 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -61,7 +61,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 4e77b2219065..8ecf6412ea1c 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index b254cbf5b55d..784e373a4bc0 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 98576aedbf45..b4f8d1571bd0 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -56,7 +56,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run zkstack dev contracts diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 7de3468de6ad..95771bdfaa87 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 2da7a2e2b0ae..56597c3ac321 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} @@ -68,7 +68,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run run_retried rustup show diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 8be142bcb737..8fd5853de095 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -48,7 +48,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai @@ -61,7 +61,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index baa45b542114..0531d08680bb 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -33,7 +33,7 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/install || true + ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true ci_run zkstackup --local ci_run zkstack dev contracts From ae868d1ce780c800ed1f1efd0ca831e6fd84c363 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 14:18:50 +0200 Subject: [PATCH 031/103] fix: fix more typos --- .github/workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 2 +- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index fa661c44c229..df321ed015df 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -113,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index f60f9ad706fa..5eb5fcdb68bb 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,7 +127,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 82c7c4d33705..50bdc721eb77 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -61,7 +61,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 8ecf6412ea1c..d0a497e4a30f 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 784e373a4bc0..d6f9e1bab69d 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index b4f8d1571bd0..48eb25a5564c 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -56,7 +56,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run zkstack dev contracts diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 95771bdfaa87..085e67343ef4 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 56597c3ac321..4c5d5e83a045 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} @@ -68,7 +68,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run run_retried rustup show diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 8fd5853de095..467b5517abca 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -48,7 +48,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai @@ -61,7 +61,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 0531d08680bb..aee957698230 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -33,7 +33,7 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - ci_run ./zkstack_cli/zkstack/install --path ./zkstack_cli/zkstack/zkstackup || true + ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup --local ci_run zkstack dev contracts From c556a3f78aa268ee91e89cc4b61e2604a487bfe8 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 14:29:53 +0200 Subject: [PATCH 032/103] fix: source /root/.bashrc before invoking zkstackup --- .github/workflows/build-contract-verifier-template.yml | 1 + .github/workflows/build-core-template.yml | 1 + .github/workflows/build-local-node-docker.yml | 1 + .github/workflows/ci-common-reusable.yml | 1 + .github/workflows/ci-core-lint-reusable.yml | 1 + .github/workflows/ci-core-reusable.yml | 1 + .github/workflows/ci-docs-reusable.yml | 1 + .github/workflows/ci-prover-reusable.yml | 2 ++ .github/workflows/vm-perf-comparison.yml | 2 ++ .github/workflows/vm-perf-to-prometheus.yml | 1 + 10 files changed, 12 insertions(+) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index df321ed015df..d2d946185285 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -114,6 +114,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 5eb5fcdb68bb..f6a43728d362 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -128,6 +128,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 50bdc721eb77..a1aa32f1aa4b 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -62,6 +62,7 @@ jobs: ci_run zk ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index d0a497e4a30f..6ad78a9a2609 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -33,6 +33,7 @@ jobs: - name: Init run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index d6f9e1bab69d..729f651104fc 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -30,6 +30,7 @@ jobs: - name: Build run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 48eb25a5564c..6f62e842dc87 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -57,6 +57,7 @@ jobs: run: | ci_run run_retried rustup show ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run zkstack dev contracts diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 085e67343ef4..e0eb0fc2573e 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -30,6 +30,7 @@ jobs: - name: Build run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 4c5d5e83a045..eb5c10401f77 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,6 +33,7 @@ jobs: - name: Init run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} @@ -69,6 +70,7 @@ jobs: - name: Init run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run run_retried rustup show diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 467b5517abca..d6353038b475 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,6 +49,7 @@ jobs: shell: bash run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai @@ -62,6 +63,7 @@ jobs: shell: bash run: | ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index aee957698230..ac58b7627413 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -34,6 +34,7 @@ jobs: run_retried docker compose pull zk docker compose up -d zk ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true + source /root/.bashrc ci_run zkstackup --local ci_run zkstack dev contracts From 04d6bbe6ae8db7f7ac1c45fe1f6e61f180d0858c Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 14:47:32 +0200 Subject: [PATCH 033/103] fix: invoke zkstackup using its relative path --- .github/workflows/build-contract-verifier-template.yml | 4 +--- .github/workflows/build-core-template.yml | 4 +--- .github/workflows/build-local-node-docker.yml | 4 +--- .github/workflows/ci-common-reusable.yml | 4 +--- .github/workflows/ci-core-lint-reusable.yml | 4 +--- .github/workflows/ci-core-reusable.yml | 8 +++----- .github/workflows/ci-docs-reusable.yml | 4 +--- .github/workflows/ci-prover-reusable.yml | 10 +++------- .github/workflows/vm-perf-comparison.yml | 8 ++------ .github/workflows/vm-perf-to-prometheus.yml | 5 ++--- 10 files changed, 16 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index d2d946185285..c68ef9868ba0 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -113,9 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index f6a43728d362..c18cb6825cc3 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,9 +127,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index a1aa32f1aa4b..e169b459125d 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -61,9 +61,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run cp etc/tokens/{test,localhost}.json ci_run zkstack dev contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 6ad78a9a2609..510a14ff4343 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -32,9 +32,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 729f651104fc..5bc7474d87e9 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,9 +29,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 6f62e842dc87..fc82a6617ea5 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -56,9 +56,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts - name: Contracts unit tests @@ -115,7 +113,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ @@ -178,7 +176,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "zkstackup --local" + run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index e0eb0fc2573e..d33e4bd17cc2 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,9 +29,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index eb5c10401f77..752b952ea1cf 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -31,10 +31,8 @@ jobs: docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres - name: Init - run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + run: | + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting @@ -69,9 +67,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index d6353038b475..868293551a79 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -48,9 +48,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -62,9 +60,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index ac58b7627413..28a2ff0d8291 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -33,9 +33,8 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - ci_run ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup || true - source /root/.bashrc - ci_run zkstackup --local + + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts - name: run benchmarks From 341e2a9aef18d63fa9cfc0d5c48c3a351435e9c6 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 14:58:17 +0200 Subject: [PATCH 034/103] fix: invoke zkstack with its relative path --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 +-- .github/workflows/ci-core-reusable.yml | 126 +++++++++--------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 10 files changed, 81 insertions(+), 81 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index c68ef9868ba0..72e395045b7c 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -121,7 +121,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.zkt/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index c18cb6825cc3..024144b9b764 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -134,7 +134,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.zkt/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index e169b459125d..ef1283f66685 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -63,7 +63,7 @@ jobs: ci_run zk ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.zkt/bin/zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 510a14ff4343..4cdc972051f4 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -37,5 +37,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zkstack dev lint -t rs --check + run: ci_run /root/.zkt/bin/zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 5bc7474d87e9..ed90b306f515 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -32,18 +32,18 @@ jobs: ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.zkt/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zkstack dev fmt --check - ci_run zkstack dev lint -t md --check - ci_run zkstack dev lint -t sol --check - 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 /root/.zkt/bin/zkstack dev fmt --check + ci_run /root/.zkt/bin/zkstack dev lint -t md --check + ci_run /root/.zkt/bin/zkstack dev lint -t sol --check + ci_run /root/.zkt/bin/zkstack dev lint -t js --check + ci_run /root/.zkt/bin/zkstack dev lint -t ts --check + ci_run /root/.zkt/bin/zkstack dev lint -t rs --check - name: Check Database run: | - ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.zkt/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index fc82a6617ea5..eebaf4b90e65 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -57,14 +57,14 @@ jobs: run: | ci_run run_retried rustup show ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zkstack dev contracts + ci_run /root/.zkt/bin//root/.zkt/bin/zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zkstack dev test rust + ci_run /root/.zkt/bin/zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -114,7 +114,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zkstack chain create \ + ci_run /root/.zkt/bin/zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -127,18 +127,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run zkstack ecosystem init --dev --verbose - ci_run zkstack dev contracts --test-contracts + ci_run /root/.zkt/bin/zkstack ecosystem init --dev --verbose + ci_run /root/.zkt/bin/zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run /root/.zkt/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run /root/.zkt/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zkstack dev t loadtest -v --chain=legacy + run: ci_run /root/.zkt/bin/zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -213,7 +213,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run /root/.zkt/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -228,7 +228,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run zkstack chain create \ + ci_run /root/.zkt/bin/zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -240,7 +240,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.zkt/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -249,7 +249,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run zkstack chain create \ + ci_run /root/.zkt/bin/zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -261,7 +261,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.zkt/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -270,7 +270,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run zkstack chain create \ + ci_run /root/.zkt/bin/zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -282,11 +282,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run /root/.zkt/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zkstack dev send-transactions \ + ci_run /root/.zkt/bin/zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -305,7 +305,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run zkstack chain create \ + ci_run /root/.zkt/bin/zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -317,7 +317,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.zkt/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -326,19 +326,19 @@ jobs: - name: Build test dependencies run: | - ci_run zkstack dev test build + ci_run /root/.zkt/bin/zkstack dev test build - name: Initialize Contract verifier run: | - ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run /root/.zkt/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run /root/.zkt/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run zkstack server --ignore-prerequisites --chain consensus \ + ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -346,21 +346,21 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run zkstack consensus set-attester-committee --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run /root/.zkt/bin/zkstack consensus set-attester-committee --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | PASSED_ENV_VARS="RUN_CONTRACT_VERIFICATION_TEST" \ - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & PID2=$! - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -370,35 +370,35 @@ jobs: - name: Init external nodes run: | - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run zkstack external-node init --ignore-prerequisites --chain era + ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain era - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run zkstack external-node init --ignore-prerequisites --chain validium + ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain validium - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run zkstack external-node init --ignore-prerequisites --chain consensus + ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -408,16 +408,16 @@ jobs: - name: Run recovery tests (from genesis) run: | - ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -427,23 +427,23 @@ jobs: - name: Run external node server run: | - ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & PID2=$! - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -455,16 +455,16 @@ jobs: run: | ci_run killall -INT zksync_server || true - ci_run zkstack dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & + ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & PID1=$! - ci_run zkstack dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & PID2=$! - ci_run zkstack dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zkstack dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -477,16 +477,16 @@ jobs: ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & + ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & PID1=$! - ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & + ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & PID2=$! - ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & + ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & + ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -500,7 +500,7 @@ jobs: # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zkstack dev test upgrade --no-deps --chain era + ci_run /root/.zkt/bin/zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index d33e4bd17cc2..9af31891650e 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -35,4 +35,4 @@ jobs: - name: Lints run: | - ci_run zkstack dev lint -t md --check + ci_run /root/.zkt/bin/zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 752b952ea1cf..f9bc22df4546 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Init run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.zkt/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -73,4 +73,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zkstack dev test prover + ci_run /root/.zkt/bin/zkstack dev test prover diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 868293551a79..d6b7cbe27d37 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: shell: bash run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run /root/.zkt/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: shell: bash run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zkstack dev contracts --system-contracts + ci_run /root/.zkt/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 28a2ff0d8291..86ab2e3a653b 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -35,7 +35,7 @@ jobs: docker compose up -d zk ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zkstack dev contracts + ci_run /root/.zkt/bin/zkstack dev contracts - name: run benchmarks run: | From 704e854e4ccfee393fc63eb0077f66c21e6bd8d3 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 15:22:36 +0200 Subject: [PATCH 035/103] feat: install zkstack in $HOME/.local/bin --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 +-- .github/workflows/ci-core-reusable.yml | 126 +++++++++--------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- zkstack_cli/zkstackup/install | 27 ++-- 11 files changed, 94 insertions(+), 95 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 72e395045b7c..c68ef9868ba0 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -121,7 +121,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.zkt/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 024144b9b764..c18cb6825cc3 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -134,7 +134,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.zkt/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index ef1283f66685..e169b459125d 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -63,7 +63,7 @@ jobs: ci_run zk ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.zkt/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 4cdc972051f4..510a14ff4343 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -37,5 +37,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run /root/.zkt/bin/zkstack dev lint -t rs --check + run: ci_run zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index ed90b306f515..5bc7474d87e9 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -32,18 +32,18 @@ jobs: ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync - ci_run /root/.zkt/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run /root/.zkt/bin/zkstack dev fmt --check - ci_run /root/.zkt/bin/zkstack dev lint -t md --check - ci_run /root/.zkt/bin/zkstack dev lint -t sol --check - ci_run /root/.zkt/bin/zkstack dev lint -t js --check - ci_run /root/.zkt/bin/zkstack dev lint -t ts --check - ci_run /root/.zkt/bin/zkstack dev lint -t rs --check + ci_run zkstack dev fmt --check + ci_run zkstack dev lint -t md --check + ci_run zkstack dev lint -t sol --check + ci_run zkstack dev lint -t js --check + ci_run zkstack dev lint -t ts --check + ci_run zkstack dev lint -t rs --check - name: Check Database run: | - ci_run /root/.zkt/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index eebaf4b90e65..1333570e17b2 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -57,14 +57,14 @@ jobs: run: | ci_run run_retried rustup show ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run /root/.zkt/bin//root/.zkt/bin/zkstack dev contracts + ci_run /root/.zkt/bin/zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run /root/.zkt/bin/zkstack dev test rust + ci_run zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -114,7 +114,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run /root/.zkt/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -127,18 +127,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run /root/.zkt/bin/zkstack ecosystem init --dev --verbose - ci_run /root/.zkt/bin/zkstack dev contracts --test-contracts + ci_run zkstack ecosystem init --dev --verbose + ci_run zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run /root/.zkt/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run /root/.zkt/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run /root/.zkt/bin/zkstack dev t loadtest -v --chain=legacy + run: ci_run zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -213,7 +213,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run /root/.zkt/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -228,7 +228,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run /root/.zkt/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -240,7 +240,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.zkt/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -249,7 +249,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run /root/.zkt/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -261,7 +261,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.zkt/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -270,7 +270,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run /root/.zkt/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -282,11 +282,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.zkt/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run /root/.zkt/bin/zkstack dev send-transactions \ + ci_run zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -305,7 +305,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run /root/.zkt/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -317,7 +317,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.zkt/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -326,19 +326,19 @@ jobs: - name: Build test dependencies run: | - ci_run /root/.zkt/bin/zkstack dev test build + ci_run zkstack dev test build - name: Initialize Contract verifier run: | - ci_run /root/.zkt/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run /root/.zkt/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run /root/.zkt/bin/zkstack server --ignore-prerequisites --chain consensus \ + ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -346,21 +346,21 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run /root/.zkt/bin/zkstack consensus set-attester-committee --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run zkstack consensus set-attester-committee --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | PASSED_ENV_VARS="RUN_CONTRACT_VERIFICATION_TEST" \ - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain era &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/rollup.log & PID1=$! - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain validium &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/validium.log & PID2=$! - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -370,35 +370,35 @@ jobs: - name: Init external nodes run: | - ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain era + ci_run zkstack external-node init --ignore-prerequisites --chain era - ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain validium + ci_run zkstack external-node init --ignore-prerequisites --chain validium - ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run /root/.zkt/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run /root/.zkt/bin/zkstack external-node init --ignore-prerequisites --chain consensus + ci_run zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain validium &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run /root/.zkt/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -408,16 +408,16 @@ jobs: - name: Run recovery tests (from genesis) run: | - ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain era &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/rollup.log & PID1=$! - ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain validium &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/validium.log & PID2=$! - ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run /root/.zkt/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -427,23 +427,23 @@ jobs: - name: Run external node server run: | - ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run /root/.zkt/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain era &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/rollup.log & PID1=$! - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain validium &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/validium.log & PID2=$! - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run /root/.zkt/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -455,16 +455,16 @@ jobs: run: | ci_run killall -INT zksync_server || true - ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain era &> ${{ env.FEES_LOGS_DIR }}/era.log & PID1=$! - ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain validium &> ${{ env.FEES_LOGS_DIR }}/validium.log & PID2=$! - ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain custom_token &> ${{ env.FEES_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run /root/.zkt/bin/zkstack dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test fees --no-deps --no-kill --chain consensus &> ${{ env.FEES_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -477,16 +477,16 @@ jobs: ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain era &> ${{ env.REVERT_LOGS_DIR }}/rollup.log & PID1=$! - ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain validium &> ${{ env.REVERT_LOGS_DIR }}/validium.log & PID2=$! - ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & PID3=$! - ci_run /root/.zkt/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & + ci_run zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & PID4=$! wait $PID1 @@ -500,7 +500,7 @@ jobs: # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run /root/.zkt/bin/zkstack dev test upgrade --no-deps --chain era + ci_run zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 9af31891650e..d33e4bd17cc2 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -35,4 +35,4 @@ jobs: - name: Lints run: | - ci_run /root/.zkt/bin/zkstack dev lint -t md --check + ci_run zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index f9bc22df4546..752b952ea1cf 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Init run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run /root/.zkt/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -73,4 +73,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run /root/.zkt/bin/zkstack dev test prover + ci_run zkstack dev test prover diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index d6b7cbe27d37..868293551a79 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: shell: bash run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run /root/.zkt/bin/zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: shell: bash run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run /root/.zkt/bin/zkstack dev contracts --system-contracts + ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 86ab2e3a653b..28a2ff0d8291 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -35,7 +35,7 @@ jobs: docker compose up -d zk ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run /root/.zkt/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: run benchmarks run: | diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index be5d24b3397b..6004c8777726 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -1,29 +1,28 @@ #!/usr/bin/env bash set -eo pipefail -BASE_DIR=${XDG_CONFIG_HOME:-$HOME} -ZKT_DIR=${ZKT_DIR:-"$BASE_DIR/.zkt"} -ZKT_BIN_DIR="$ZKT_DIR/bin" +HOME_DIR=${XDG_CONFIG_HOME:-$HOME} +BIN_DIR="$HOME_DIR/.local/bin" BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/zkstackup" -BIN_PATH="$ZKT_BIN_DIR/zkstackup" +BIN_PATH="$BIN_DIR/zkstackup" main() { parse_args "$@" - mkdir -p "$ZKT_BIN_DIR" + mkdir -p "$BIN_DIR" if [ -n "$ZKSTACKUP_PATH" ]; then - cp -r "$ZKSTACKUP_PATH" "$ZKT_BIN_DIR" + cp -r "$ZKSTACKUP_PATH" "$BIN_DIR" else curl -sSfL "$BIN_URL" -o "$BIN_PATH" fi chmod +x "$BIN_PATH" - echo "zkstackup: successfully installed in ${ZKT_BIN_DIR}." + echo "zkstackup: successfully installed in ${BIN_DIR}." - if [[ ":$PATH:" == *":${ZKT_BIN_DIR}:"* ]]; then - echo "zkstackup: found ${ZKT_BIN_DIR} in PATH" + if [[ ":$PATH:" == *":${BIN_DIR}:"* ]]; then + echo "zkstackup: found ${BIN_DIR} in PATH" exit 0 fi @@ -41,7 +40,7 @@ main() { PROFILE="$HOME/.profile" ;; *) - echo "zkstackup: could not detect shell, manually add ${ZKT_BIN_DIR} to your PATH." + echo "zkstackup: could not detect shell, manually add ${BIN_DIR} to your PATH." exit 1 ;; esac @@ -52,11 +51,11 @@ main() { fi if [[ "$SHELL" == *"/fish"* ]]; then - echo -e "\n# Added by zkstackup\nfish_add_path -a $ZKT_BIN_DIR" >>"$PROFILE" - echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE using fish_add_path." + echo -e "\n# Added by zkstackup\nfish_add_path -a $BIN_DIR" >>"$PROFILE" + echo "zkstackup: Added $BIN_DIR to PATH in $PROFILE using fish_add_path." else - echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$ZKT_BIN_DIR\"" >>"$PROFILE" - echo "zkstackup: Added $ZKT_BIN_DIR to PATH in $PROFILE." + echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$BIN_DIR\"" >>"$PROFILE" + echo "zkstackup: Added $BIN_DIR to PATH in $PROFILE." fi echo From 442342823906bd5b7fdfcb05762fbdd3bf34a719 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 15:39:31 +0200 Subject: [PATCH 036/103] feat: use $HOME/.local in zkstackup --- zkstack_cli/zkstackup/zkstackup | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 91e329101c13..8ded3a75f9ab 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -1,9 +1,9 @@ #!/usr/bin/env bash set -eo pipefail -BASE_DIR=${XDG_CONFIG_HOME:-$HOME} -ZKT_DIR=${ZKT_DIR:-"$BASE_DIR/.zkt"} -ZKT_BIN_DIR="$ZKT_DIR/bin" +HOME_DIR=${XDG_CONFIG_HOME:-$HOME} +LOCAL_DIR=${LOCAL_DIR:-"$HOME_DIR/.local"} +BIN_DIR="$LOCAL_DIR/bin" BINS=() @@ -13,7 +13,7 @@ main() { zkstack_banner check_prerequisites - mkdir -p "$ZKT_BIN_DIR" + mkdir -p "$BIN_DIR" BINS+=(zkstack) @@ -31,7 +31,7 @@ main() { zkstack_banner for bin in "${BINS[@]}"; do - success "Installed $bin to $ZKT_BIN_DIR/$bin" + success "Installed $bin to $BIN_DIR/$bin" done } @@ -140,7 +140,7 @@ install_local() { for bin in "${BINS[@]}"; do say "Installing $bin" - ensure cargo install --root $ZKT_DIR --path ./crates/$bin --force + ensure cargo install --root $LOCAL_DIR --path ./crates/$bin --force done } @@ -157,16 +157,16 @@ install_from_repo() { if [ -n "$ZKSTACKUP_COMMIT" ] || [ -n "$ZKSTACKUP_BRANCH" ]; then warn "Ignoring --commit and --branch arguments when installing by version" fi - ensure cargo install --root $ZKT_DIR --git "https://github.com/$ZKSTACKUP_REPO" --tag "zkstack_cli-v$ZKSTACKUP_VERSION" --locked "${BINS[@]}" --force + ensure cargo install --root $LOCAL_DIR --git "https://github.com/$ZKSTACKUP_REPO" --tag "zkstack_cli-v$ZKSTACKUP_VERSION" --locked "${BINS[@]}" --force elif [ -n "$ZKSTACKUP_COMMIT" ]; then if [ -n "$ZKSTACKUP_BRANCH" ]; then warn "Ignoring --branch argument when installing by commit" fi - ensure cargo install --root $ZKT_DIR --git "https://github.com/$ZKSTACKUP_REPO" --rev "$ZKSTACKUP_COMMIT" --locked "${BINS[@]}" --force + ensure cargo install --root $LOCAL_DIR --git "https://github.com/$ZKSTACKUP_REPO" --rev "$ZKSTACKUP_COMMIT" --locked "${BINS[@]}" --force elif [ -n "$ZKSTACKUP_BRANCH" ]; then - ensure cargo install --root $ZKT_DIR --git "https://github.com/$ZKSTACKUP_REPO" --branch "$ZKSTACKUP_BRANCH" --locked "${BINS[@]}" --force + ensure cargo install --root $LOCAL_DIR --git "https://github.com/$ZKSTACKUP_REPO" --branch "$ZKSTACKUP_BRANCH" --locked "${BINS[@]}" --force else - ensure cargo install --root $ZKT_DIR --git "https://github.com/$ZKSTACKUP_REPO" --locked "${BINS[@]}" --force + ensure cargo install --root $LOCAL_DIR --git "https://github.com/$ZKSTACKUP_REPO" --locked "${BINS[@]}" --force fi } From 5286e90a2104eeb01e69b1e0ae29ec8cd759a7bb Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 16:08:30 +0200 Subject: [PATCH 037/103] refactor: improve CI steps subdivision --- .github/workflows/build-local-node-docker.yml | 3 +++ .github/workflows/ci-core-lint-reusable.yml | 4 +++- .github/workflows/ci-core-reusable.yml | 8 +++++++- .github/workflows/ci-prover-reusable.yml | 3 +++ .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 3 +++ 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index e169b459125d..dbf531c0688c 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -63,6 +63,9 @@ jobs: ci_run zk ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run cp etc/tokens/{test,localhost}.json + + - name: build contracts + run: | ci_run zkstack dev contracts - name: update-image diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 5bc7474d87e9..4409db700f0f 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -32,8 +32,10 @@ jobs: ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + - name: Database setup + run: | + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 1333570e17b2..6aa8a92854e0 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -57,7 +57,10 @@ jobs: run: | ci_run run_retried rustup show ci_run ./zkstack_cli/zkstackup/zkstackup --local - ci_run /root/.zkt/bin/zkstack dev contracts + + - name: Build contracts + run: | + ci_run zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test @@ -114,6 +117,9 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./zkstack_cli/zkstackup/zkstackup --local + + - name: Create and initialize legacy chain + run: | ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 752b952ea1cf..19804bf293e1 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,6 +33,9 @@ jobs: - name: Init run: | ci_run ./zkstack_cli/zkstackup/zkstackup --local + + - name: Database setup + run: | ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 868293551a79..e8bfc4349042 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -44,11 +44,11 @@ jobs: run: | run_retried docker compose pull zk docker compose up -d zk - + - name: run benchmarks on base branch shell: bash run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkt || ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 28a2ff0d8291..d917694b10d9 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -35,6 +35,9 @@ jobs: docker compose up -d zk ci_run ./zkstack_cli/zkstackup/zkstackup --local + + - name: build contracts + run: | ci_run zkstack dev contracts - name: run benchmarks From 605fdd899091daf438b9bd721d753940c875909f Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 16:21:56 +0200 Subject: [PATCH 038/103] feat: add bin folder to path in zkstackup --- zkstack_cli/zkstackup/install | 5 +++- zkstack_cli/zkstackup/zkstackup | 46 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index 6004c8777726..3b4a70198bdb 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -21,6 +21,10 @@ main() { chmod +x "$BIN_PATH" echo "zkstackup: successfully installed in ${BIN_DIR}." + add_bin_folder_to_path +} + +add_bin_folder_to_path() { if [[ ":$PATH:" == *":${BIN_DIR}:"* ]]; then echo "zkstackup: found ${BIN_DIR} in PATH" exit 0 @@ -64,7 +68,6 @@ main() { echo "Then run 'zkstackup' to install ZK Stack CLI." } - parse_args() { while [[ $# -gt 0 ]]; do case $1 in diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 8ded3a75f9ab..d91816beaab0 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -30,6 +30,8 @@ main() { zkstack_banner + add_bin_folder_to_path + for bin in "${BINS[@]}"; do success "Installed $bin to $BIN_DIR/$bin" done @@ -170,6 +172,50 @@ install_from_repo() { fi } +add_bin_folder_to_path() { + if [[ ":$PATH:" == *":${BIN_DIR}:"* ]]; then + echo "zkstackup: found ${BIN_DIR} in PATH" + exit 0 + fi + + case $SHELL in + */zsh) + PROFILE="${ZDOTDIR-"$HOME"}/.zshenv" + ;; + */bash) + PROFILE="$HOME/.bashrc" + ;; + */fish) + PROFILE="$HOME/.config/fish/config.fish" + ;; + */ash) + PROFILE="$HOME/.profile" + ;; + *) + echo "zkstackup: could not detect shell, manually add ${BIN_DIR} to your PATH." + exit 1 + ;; + esac + + if [[ ! -f "$PROFILE" ]]; then + echo "zkstackup: Profile file $PROFILE does not exist, creating it." + touch "$PROFILE" + fi + + if [[ "$SHELL" == *"/fish"* ]]; then + echo -e "\n# Added by zkstackup\nfish_add_path -a $BIN_DIR" >>"$PROFILE" + echo "zkstackup: Added $BIN_DIR to PATH in $PROFILE using fish_add_path." + else + echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$BIN_DIR\"" >>"$PROFILE" + echo "zkstackup: Added $BIN_DIR to PATH in $PROFILE." + fi + + echo + echo "Added zkstackup to PATH." + echo "Run 'source $PROFILE' or start a new terminal session to use zkstackup." + echo "Then run 'zkstackup' to install ZK Stack CLI." +} + ensure() { if ! "$@"; then err "command failed: $*" From 3ac3a05f624fc70c75cec0e623165fa1ff962b84 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 16:34:51 +0200 Subject: [PATCH 039/103] docs: improve zkstack installation messages --- zkstack_cli/zkstackup/zkstackup | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index d91816beaab0..6a6403750f05 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -174,7 +174,7 @@ install_from_repo() { add_bin_folder_to_path() { if [[ ":$PATH:" == *":${BIN_DIR}:"* ]]; then - echo "zkstackup: found ${BIN_DIR} in PATH" + echo "found ${BIN_DIR} in PATH" exit 0 fi @@ -192,28 +192,27 @@ add_bin_folder_to_path() { PROFILE="$HOME/.profile" ;; *) - echo "zkstackup: could not detect shell, manually add ${BIN_DIR} to your PATH." + echo "could not detect shell, manually add ${BIN_DIR} to your PATH." exit 1 ;; esac if [[ ! -f "$PROFILE" ]]; then - echo "zkstackup: Profile file $PROFILE does not exist, creating it." + echo "Profile file $PROFILE does not exist, creating it." touch "$PROFILE" fi if [[ "$SHELL" == *"/fish"* ]]; then echo -e "\n# Added by zkstackup\nfish_add_path -a $BIN_DIR" >>"$PROFILE" - echo "zkstackup: Added $BIN_DIR to PATH in $PROFILE using fish_add_path." + echo "Added $BIN_DIR to PATH in $PROFILE using fish_add_path." else echo -e "\n# Added by zkstackup\nexport PATH=\"\$PATH:$BIN_DIR\"" >>"$PROFILE" - echo "zkstackup: Added $BIN_DIR to PATH in $PROFILE." + echo "Added $BIN_DIR to PATH in $PROFILE." fi echo - echo "Added zkstackup to PATH." - echo "Run 'source $PROFILE' or start a new terminal session to use zkstackup." - echo "Then run 'zkstackup' to install ZK Stack CLI." + echo "Added zkstack to PATH." + echo "Run 'source $PROFILE' or start a new terminal session to use zkstack." } ensure() { From 783cffa1b0f48a1e5be78eebf997c1bba572d230 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 16:47:55 +0200 Subject: [PATCH 040/103] fix: add more folders to GITHUB_PATH --- .../workflows/build-contract-verifier-template.yml | 4 +++- .github/workflows/build-core-template.yml | 4 +++- .github/workflows/build-local-node-docker.yml | 4 +++- .../workflows/build-witness-generator-template.yml | 2 ++ .github/workflows/ci-common-reusable.yml | 4 +++- .github/workflows/ci-core-lint-reusable.yml | 4 +++- .github/workflows/ci-core-reusable.yml | 12 +++++++++--- .github/workflows/ci-docs-reusable.yml | 4 +++- .github/workflows/ci-prover-reusable.yml | 6 ++++-- .../new-build-contract-verifier-template.yml | 2 ++ .github/workflows/new-build-core-template.yml | 4 ++++ .github/workflows/new-build-prover-template.yml | 4 ++++ .../new-build-witness-generator-template.yml | 4 ++++ .github/workflows/vm-perf-comparison.yml | 6 ++++-- .github/workflows/vm-perf-to-prometheus.yml | 4 +++- 15 files changed, 54 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index c68ef9868ba0..33719bfe8b30 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -47,6 +47,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -113,7 +115,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index c18cb6825cc3..983256070f34 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -56,6 +56,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -127,7 +129,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index dbf531c0688c..adfa3afec8fa 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -27,6 +27,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -61,7 +63,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json - name: build contracts diff --git a/.github/workflows/build-witness-generator-template.yml b/.github/workflows/build-witness-generator-template.yml index 33d78b3cf2fc..db7e7f7f25c3 100644 --- a/.github/workflows/build-witness-generator-template.yml +++ b/.github/workflows/build-witness-generator-template.yml @@ -69,6 +69,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 510a14ff4343..e90a06abe849 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -17,6 +17,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -32,7 +34,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 4409db700f0f..eaa94d410cf7 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -14,6 +14,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -29,7 +31,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 6aa8a92854e0..d7a8ab816549 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -25,6 +25,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -56,7 +58,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: Build contracts run: | @@ -89,6 +91,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -116,7 +120,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: Create and initialize legacy chain run: | @@ -169,6 +173,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -182,7 +188,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" + run: ci_run bash -c "zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index d33e4bd17cc2..403332f735dd 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -16,6 +16,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -29,7 +31,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 19804bf293e1..7760d8082fca 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -16,6 +16,8 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -32,7 +34,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: Database setup run: | @@ -70,7 +72,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index f4920ae1b916..e72729eeba14 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -38,6 +38,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index c930df6a9608..68804318d8b0 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -43,6 +43,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -180,6 +182,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-prover-template.yml b/.github/workflows/new-build-prover-template.yml index 60c152213e60..cd63140c99d3 100644 --- a/.github/workflows/new-build-prover-template.yml +++ b/.github/workflows/new-build-prover-template.yml @@ -53,6 +53,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -109,6 +111,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-witness-generator-template.yml b/.github/workflows/new-build-witness-generator-template.yml index 2f1fc0b2dd86..b9c1265dd1bd 100644 --- a/.github/workflows/new-build-witness-generator-template.yml +++ b/.github/workflows/new-build-witness-generator-template.yml @@ -48,6 +48,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -96,6 +98,8 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index e8bfc4349042..cd0bfd11d0fb 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -35,6 +35,8 @@ jobs: touch .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env @@ -48,7 +50,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkt || ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -60,7 +62,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index d917694b10d9..08865571e2ea 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -28,13 +28,15 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH - name: init run: | run_retried docker compose pull zk docker compose up -d zk - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: build contracts run: | From 89f16387f3c70cbe8b2028845f92bab0d6ec7099 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 17:38:18 +0200 Subject: [PATCH 041/103] fix: invoke zkstackup using its relative path --- .../workflows/build-contract-verifier-template.yml | 4 ++-- .github/workflows/build-core-template.yml | 4 ++-- .github/workflows/build-local-node-docker.yml | 4 ++-- .../workflows/build-witness-generator-template.yml | 2 +- .github/workflows/ci-common-reusable.yml | 4 ++-- .github/workflows/ci-core-lint-reusable.yml | 4 ++-- .github/workflows/ci-core-reusable.yml | 12 ++++++------ .github/workflows/ci-docs-reusable.yml | 4 ++-- .github/workflows/ci-prover-reusable.yml | 6 +++--- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 4 ++-- .github/workflows/new-build-prover-template.yml | 4 ++-- .../new-build-witness-generator-template.yml | 4 ++-- .github/workflows/vm-perf-comparison.yml | 6 +++--- .github/workflows/vm-perf-to-prometheus.yml | 4 ++-- 15 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 33719bfe8b30..dd31b22e66f5 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -48,7 +48,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -115,7 +115,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 983256070f34..6d21433d6208 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -57,7 +57,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -129,7 +129,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index adfa3afec8fa..21c005e1507d 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -28,7 +28,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -63,7 +63,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run cp etc/tokens/{test,localhost}.json - name: build contracts diff --git a/.github/workflows/build-witness-generator-template.yml b/.github/workflows/build-witness-generator-template.yml index db7e7f7f25c3..bd0d503d7ee2 100644 --- a/.github/workflows/build-witness-generator-template.yml +++ b/.github/workflows/build-witness-generator-template.yml @@ -70,7 +70,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index e90a06abe849..2090363502bb 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -18,7 +18,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index eaa94d410cf7..9442bbfefe61 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -15,7 +15,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index d7a8ab816549..17189a677967 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -26,7 +26,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -58,7 +58,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: Build contracts run: | @@ -92,7 +92,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -120,7 +120,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: Create and initialize legacy chain run: | @@ -174,7 +174,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -188,7 +188,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "zkstackup --local" + run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 403332f735dd..437705b3caf0 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -17,7 +17,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 7760d8082fca..a57df4506e3c 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -17,7 +17,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: Database setup run: | @@ -72,7 +72,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index e72729eeba14..869ff88f5309 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -39,7 +39,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 68804318d8b0..9b9f63842430 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -44,7 +44,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -183,7 +183,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-prover-template.yml b/.github/workflows/new-build-prover-template.yml index cd63140c99d3..8272a343a641 100644 --- a/.github/workflows/new-build-prover-template.yml +++ b/.github/workflows/new-build-prover-template.yml @@ -54,7 +54,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -112,7 +112,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-witness-generator-template.yml b/.github/workflows/new-build-witness-generator-template.yml index b9c1265dd1bd..24906bb83d24 100644 --- a/.github/workflows/new-build-witness-generator-template.yml +++ b/.github/workflows/new-build-witness-generator-template.yml @@ -49,7 +49,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -99,7 +99,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index cd0bfd11d0fb..25c46b86b14a 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -36,7 +36,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env @@ -50,7 +50,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run zkstackup --local + ci_run zkt || ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -62,7 +62,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 08865571e2ea..632ff0039b84 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -29,14 +29,14 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + - name: init run: | run_retried docker compose pull zk docker compose up -d zk - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: build contracts run: | From 94235c4e535547e0cd33398063eb9d047c636ae5 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 17:53:39 +0200 Subject: [PATCH 042/103] Revert "fix: invoke zkstackup using its relative path" This reverts commit 89f16387f3c70cbe8b2028845f92bab0d6ec7099. --- .../workflows/build-contract-verifier-template.yml | 4 ++-- .github/workflows/build-core-template.yml | 4 ++-- .github/workflows/build-local-node-docker.yml | 4 ++-- .../workflows/build-witness-generator-template.yml | 2 +- .github/workflows/ci-common-reusable.yml | 4 ++-- .github/workflows/ci-core-lint-reusable.yml | 4 ++-- .github/workflows/ci-core-reusable.yml | 12 ++++++------ .github/workflows/ci-docs-reusable.yml | 4 ++-- .github/workflows/ci-prover-reusable.yml | 6 +++--- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 4 ++-- .github/workflows/new-build-prover-template.yml | 4 ++-- .../new-build-witness-generator-template.yml | 4 ++-- .github/workflows/vm-perf-comparison.yml | 6 +++--- .github/workflows/vm-perf-to-prometheus.yml | 4 ++-- 15 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index dd31b22e66f5..33719bfe8b30 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -48,7 +48,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -115,7 +115,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 6d21433d6208..983256070f34 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -57,7 +57,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -129,7 +129,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 21c005e1507d..adfa3afec8fa 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -28,7 +28,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -63,7 +63,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run cp etc/tokens/{test,localhost}.json - name: build contracts diff --git a/.github/workflows/build-witness-generator-template.yml b/.github/workflows/build-witness-generator-template.yml index bd0d503d7ee2..db7e7f7f25c3 100644 --- a/.github/workflows/build-witness-generator-template.yml +++ b/.github/workflows/build-witness-generator-template.yml @@ -70,7 +70,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 2090363502bb..e90a06abe849 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -18,7 +18,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 9442bbfefe61..eaa94d410cf7 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -15,7 +15,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index ccc7e376940e..649424fb35e1 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -26,7 +26,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -58,7 +58,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: Build contracts run: | @@ -92,7 +92,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -120,7 +120,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: Create and initialize legacy chain run: | @@ -174,7 +174,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -188,7 +188,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" + run: ci_run bash -c "zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 437705b3caf0..403332f735dd 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -17,7 +17,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index a57df4506e3c..7760d8082fca 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -17,7 +17,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: Database setup run: | @@ -72,7 +72,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run run_retried rustup show - name: Prover unit tests diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 869ff88f5309..e72729eeba14 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -39,7 +39,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 9b9f63842430..68804318d8b0 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -44,7 +44,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -183,7 +183,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-prover-template.yml b/.github/workflows/new-build-prover-template.yml index 8272a343a641..cd63140c99d3 100644 --- a/.github/workflows/new-build-prover-template.yml +++ b/.github/workflows/new-build-prover-template.yml @@ -54,7 +54,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -112,7 +112,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-witness-generator-template.yml b/.github/workflows/new-build-witness-generator-template.yml index 24906bb83d24..b9c1265dd1bd 100644 --- a/.github/workflows/new-build-witness-generator-template.yml +++ b/.github/workflows/new-build-witness-generator-template.yml @@ -49,7 +49,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -99,7 +99,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 25c46b86b14a..cd0bfd11d0fb 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -36,7 +36,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env @@ -50,7 +50,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkt || ci_run zkstackup --local ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -62,7 +62,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 632ff0039b84..08865571e2ea 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -29,14 +29,14 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH - name: init run: | run_retried docker compose pull zk docker compose up -d zk - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run zkstackup --local - name: build contracts run: | From 9d982ab280aed5236a4baa1dea656b46316c18e1 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 18:03:56 +0200 Subject: [PATCH 043/103] fix: add zkstack and zkstackup to PATH in containers --- docker/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Makefile b/docker/Makefile index 30a90a357015..11fe5f3ef918 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,6 +66,8 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ + export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ + export PATH=$$PATH:$${HOME}/.local/bin && \ zkstackup --local || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts From 8c3b92e7da228b54fe20db742f51a8b1f200b74c Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 18:05:19 +0200 Subject: [PATCH 044/103] fix: fix typo in PATH export --- docker/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Makefile b/docker/Makefile index 11fe5f3ef918..4f69da68cfeb 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ - export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ + export PATH=$$PATH:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ export PATH=$$PATH:$${HOME}/.local/bin && \ zkstackup --local || true && \ zkstack dev contracts && \ From 9408ea8133aff255d34d6a194e1313114fed5ede Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 18:23:53 +0200 Subject: [PATCH 045/103] fix: use relative path for zkstackup in Makefile --- docker/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 4f69da68cfeb..7e1217cb30e5 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,9 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ - export PATH=$$PATH:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ - export PATH=$$PATH:$${HOME}/.local/bin && \ - zkstackup --local || true && \ + ./zkstack_cli/zkstackup/zkstackup --local || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts From 6f6f328186b3332ffcf008e923c4adc768b9fee4 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 18:26:30 +0200 Subject: [PATCH 046/103] fix: add zkstackup to containers PATH --- docker/Makefile | 2 +- docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile | 2 +- docker/zk-environment/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 7e1217cb30e5..cbbd8444ccc2 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ - ./zkstack_cli/zkstackup/zkstackup --local || true && \ + zkstackup --local || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts diff --git a/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile b/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile index 0c0fd7a9bb3d..39364713a2de 100644 --- a/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile +++ b/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile @@ -104,7 +104,7 @@ RUN wget -c https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 && \ # Setup the environment ENV ZKSYNC_HOME=/usr/src/zksync -ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" +ENV PATH="${ZKSYNC_HOME}/zkstack_cli/zkstackup:${ZKSYNC_HOME}/bin:${PATH}" ENV CI=1 RUN cargo install sccache ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache diff --git a/docker/zk-environment/Dockerfile b/docker/zk-environment/Dockerfile index 53e532653111..da7d612435b2 100644 --- a/docker/zk-environment/Dockerfile +++ b/docker/zk-environment/Dockerfile @@ -164,7 +164,7 @@ RUN wget -c https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 && \ # Setup the environment ENV ZKSYNC_HOME=/usr/src/zksync -ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" +ENV PATH="${ZKSYNC_HOME}/zkstack_cli/zkstackup:${ZKSYNC_HOME}/bin:${PATH}" ENV CI=1 ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache From 77b4603d8d4633d37f0300bbda11e508ad4ff56d Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 18:49:40 +0200 Subject: [PATCH 047/103] fix: add zkstackup to PATH in makefile --- docker/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Makefile b/docker/Makefile index cbbd8444ccc2..e426d44ec88b 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,6 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ + export PATH=$$PATH:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ zkstackup --local || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts From e5149d3296409d79f2d23da282297267931ae279 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Wed, 9 Oct 2024 19:00:17 +0200 Subject: [PATCH 048/103] fix: use relative paths to zkstackup in workflow templates --- .github/workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 33719bfe8b30..ab54b897bd6a 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -115,7 +115,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 983256070f34..856784373440 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -57,7 +57,6 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -129,7 +128,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup --local || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts From 20bbc0bb9a3d41ede5f6ab593238d527cc14b5ba Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 10:44:46 +0200 Subject: [PATCH 049/103] fix: fix relative invoations of zkstackup in CI --- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 6 +++--- .github/workflows/ci-docs-reusable.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index eaa94d410cf7..ef377f5bc21b 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index b2db7cebf271..5cf0ee31ad7c 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -58,7 +58,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: Build contracts run: | @@ -120,7 +120,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: Create and initialize legacy chain run: | @@ -188,7 +188,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "zkstackup --local" + run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 403332f735dd..faeec179f453 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync From c33cdcf33d3bb10ce081eec839df28f6dc8fae9b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 11:32:54 +0200 Subject: [PATCH 050/103] chore: update sqruff-lib to 0.19.0 --- zkstack_cli/crates/zkstack/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zkstack_cli/crates/zkstack/Cargo.toml b/zkstack_cli/crates/zkstack/Cargo.toml index aec2edee3d8f..de51897a6429 100644 --- a/zkstack_cli/crates/zkstack/Cargo.toml +++ b/zkstack_cli/crates/zkstack/Cargo.toml @@ -28,7 +28,7 @@ serde_json.workspace = true serde_yaml.workspace = true slugify-rs.workspace = true strum.workspace = true -sqruff-lib = { git = "https://github.com/quarylabs/sqruff", version = "0.18.2" } +sqruff-lib = { git = "https://github.com/quarylabs/sqruff", version = "0.19.0" } thiserror.workspace = true tokio.workspace = true toml.workspace = true From 7427509c712693f5cada3100829ea8bd1ad28c40 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 11:38:21 +0200 Subject: [PATCH 051/103] chore: use published version for sqruff-lib --- zkstack_cli/crates/zkstack/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zkstack_cli/crates/zkstack/Cargo.toml b/zkstack_cli/crates/zkstack/Cargo.toml index de51897a6429..8215538f024e 100644 --- a/zkstack_cli/crates/zkstack/Cargo.toml +++ b/zkstack_cli/crates/zkstack/Cargo.toml @@ -28,7 +28,7 @@ serde_json.workspace = true serde_yaml.workspace = true slugify-rs.workspace = true strum.workspace = true -sqruff-lib = { git = "https://github.com/quarylabs/sqruff", version = "0.19.0" } +sqruff-lib = "0.19.0" thiserror.workspace = true tokio.workspace = true toml.workspace = true From 884c2fd2b5fd0ebc47e9471149fa7046180c71cb Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 11:49:57 +0200 Subject: [PATCH 052/103] ci: use relative invocations of zkstackup in all CI jobs --- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index e90a06abe849..827a54290722 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 7760d8082fca..292ba84b8b92 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local - name: Database setup run: | @@ -72,7 +72,7 @@ jobs: - name: Init run: | - ci_run zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run run_retried rustup show - name: Prover unit tests From 3afee03837f1983d9733e1be25d445d13199e44a Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:04:44 +0200 Subject: [PATCH 053/103] fix: temporarily invoke zkstack using its absolute path --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index ab54b897bd6a..ad89709d1e72 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 856784373440..8e8ee6c61d09 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index adfa3afec8fa..d94a776273e7 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 827a54290722..c3f2c85f8c04 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zkstack dev lint -t rs --check + run: ci_run /root/.local/bin/zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index ef377f5bc21b..b8a21f5b39ca 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zkstack dev fmt --check - ci_run zkstack dev lint -t md --check - ci_run zkstack dev lint -t sol --check - 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 /root/.local/bin/zkstack dev fmt --check + ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t sol --check + ci_run /root/.local/bin/zkstack dev lint -t js --check + ci_run /root/.local/bin/zkstack dev lint -t ts --check + ci_run /root/.local/bin/zkstack dev lint -t rs --check - name: Check Database run: | - ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 5cf0ee31ad7c..7e3d684d0d9d 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zkstack dev test rust + ci_run /root/.local/bin/zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run zkstack ecosystem init --dev --verbose - ci_run zkstack dev contracts --test-contracts + ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose + ci_run /root/.local/bin/zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zkstack dev t loadtest -v --chain=legacy + run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zkstack dev send-transactions \ + ci_run /root/.local/bin/zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run zkstack dev test build + ci_run /root/.local/bin/zkstack dev test build - name: Initialize Contract verifier run: | - ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run zkstack server --ignore-prerequisites --chain consensus \ + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run zkstack external-node init --ignore-prerequisites --chain era + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run zkstack external-node init --ignore-prerequisites --chain validium + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run zkstack external-node init --ignore-prerequisites --chain consensus + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zkstack dev test upgrade --no-deps --chain era + ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index faeec179f453..d4f216bac639 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 292ba84b8b92..bf7e4d64cccc 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zkstack dev test prover + ci_run /root/.local/bin/zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index e72729eeba14..1c37ef5beda5 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 68804318d8b0..eb8b1ba97579 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index cd0bfd11d0fb..7beb52b996af 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run zkstack dev contracts --system-contracts + ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 08865571e2ea..fef5af8fad01 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: run benchmarks run: | From 0ad41b8ec9a8e04e26b493caa2b36f1ac63df521 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:19:27 +0200 Subject: [PATCH 054/103] chore: update Cargo.lock --- zkstack_cli/Cargo.lock | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zkstack_cli/Cargo.lock b/zkstack_cli/Cargo.lock index 2c3aaf8553ac..988d60f197a5 100644 --- a/zkstack_cli/Cargo.lock +++ b/zkstack_cli/Cargo.lock @@ -5169,7 +5169,8 @@ dependencies = [ [[package]] name = "sqruff-lib" version = "0.19.0" -source = "git+https://github.com/quarylabs/sqruff#67249fab8dc675218fc4e0c36032a274f3bb04f8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676775189e83a98fc603d59fc6d760a66895d511502a538081dac993fde1a09a" dependencies = [ "ahash", "anstyle", @@ -5203,7 +5204,8 @@ dependencies = [ [[package]] name = "sqruff-lib-core" version = "0.19.0" -source = "git+https://github.com/quarylabs/sqruff#67249fab8dc675218fc4e0c36032a274f3bb04f8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48ec5ba65376ae9ba3e3dda153668dcb6452a7212ee7b4c9d48e053eb4f0f3fa" dependencies = [ "ahash", "enum_dispatch", @@ -5223,7 +5225,8 @@ dependencies = [ [[package]] name = "sqruff-lib-dialects" version = "0.19.0" -source = "git+https://github.com/quarylabs/sqruff#67249fab8dc675218fc4e0c36032a274f3bb04f8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00fa1cd168dad593f8f6996d805acc1fd52c6d0ad0f6f5847a9cc22a6198cfc2" dependencies = [ "ahash", "itertools 0.13.0", From 67ee796580d3c40b99c9a66990876f3ff1c24e2c Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:19:49 +0200 Subject: [PATCH 055/103] fix: add executable permissions to zkstack bin --- zkstack_cli/zkstackup/zkstackup | 1 + 1 file changed, 1 insertion(+) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 6a6403750f05..186191ed8108 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -143,6 +143,7 @@ install_local() { for bin in "${BINS[@]}"; do say "Installing $bin" ensure cargo install --root $LOCAL_DIR --path ./crates/$bin --force + chmod +x "$BIN_DIR/$bin" done } From 975b1892472dd043efba29b762b9982d271ff5be Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:31:21 +0200 Subject: [PATCH 056/103] refactor: rely on PATH for zkstack invocation --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index ad89709d1e72..ab54b897bd6a 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 8e8ee6c61d09..856784373440 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index d94a776273e7..adfa3afec8fa 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index c3f2c85f8c04..827a54290722 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run /root/.local/bin/zkstack dev lint -t rs --check + run: ci_run zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index b8a21f5b39ca..ef377f5bc21b 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run /root/.local/bin/zkstack dev fmt --check - ci_run /root/.local/bin/zkstack dev lint -t md --check - ci_run /root/.local/bin/zkstack dev lint -t sol --check - ci_run /root/.local/bin/zkstack dev lint -t js --check - ci_run /root/.local/bin/zkstack dev lint -t ts --check - ci_run /root/.local/bin/zkstack dev lint -t rs --check + ci_run zkstack dev fmt --check + ci_run zkstack dev lint -t md --check + ci_run zkstack dev lint -t sol --check + ci_run zkstack dev lint -t js --check + ci_run zkstack dev lint -t ts --check + ci_run zkstack dev lint -t rs --check - name: Check Database run: | - ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 7e3d684d0d9d..5cf0ee31ad7c 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run /root/.local/bin/zkstack dev test rust + ci_run zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose - ci_run /root/.local/bin/zkstack dev contracts --test-contracts + ci_run zkstack ecosystem init --dev --verbose + ci_run zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy + run: ci_run zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run /root/.local/bin/zkstack dev send-transactions \ + ci_run zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run /root/.local/bin/zkstack dev test build + ci_run zkstack dev test build - name: Initialize Contract verifier run: | - ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ + ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era + ci_run zkstack external-node init --ignore-prerequisites --chain era - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium + ci_run zkstack external-node init --ignore-prerequisites --chain validium - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus + ci_run zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era + ci_run zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index d4f216bac639..faeec179f453 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index bf7e4d64cccc..292ba84b8b92 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run /root/.local/bin/zkstack dev test prover + ci_run zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 1c37ef5beda5..e72729eeba14 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index eb8b1ba97579..68804318d8b0 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 7beb52b996af..cd0bfd11d0fb 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index fef5af8fad01..08865571e2ea 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: run benchmarks run: | From 801775c31e17e88a1b6c219ebf42c332a340d9a3 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:38:17 +0200 Subject: [PATCH 057/103] refactor: use zkstackup instead of zkt --- .github/workflows/new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index e72729eeba14..916dd60401c9 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -130,7 +130,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkt || true + zkstackup || true - name: build contracts shell: bash diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 68804318d8b0..41a34e954be2 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -135,7 +135,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkt || true + zkstackup || true - name: build contracts shell: bash From 92f807985b502f3502f10713716dd82d3d2f9cc5 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:42:45 +0200 Subject: [PATCH 058/103] style: add EOF newline --- .github/release-please/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json index 1e76757363b5..ca19e91219d9 100644 --- a/.github/release-please/manifest.json +++ b/.github/release-please/manifest.json @@ -2,4 +2,4 @@ "core": "24.28.0", "prover": "16.5.0", "zkstack_cli": "0.1.2" -} \ No newline at end of file +} From 87a19b428b64f18f23ccd1b0b7e145235786c5fd Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 12:45:15 +0200 Subject: [PATCH 059/103] Revert "refactor: rely on PATH for zkstack invocation" This reverts commit 975b1892472dd043efba29b762b9982d271ff5be. --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index ab54b897bd6a..ad89709d1e72 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 856784373440..8e8ee6c61d09 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index adfa3afec8fa..d94a776273e7 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 827a54290722..c3f2c85f8c04 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zkstack dev lint -t rs --check + run: ci_run /root/.local/bin/zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index ef377f5bc21b..b8a21f5b39ca 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zkstack dev fmt --check - ci_run zkstack dev lint -t md --check - ci_run zkstack dev lint -t sol --check - 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 /root/.local/bin/zkstack dev fmt --check + ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t sol --check + ci_run /root/.local/bin/zkstack dev lint -t js --check + ci_run /root/.local/bin/zkstack dev lint -t ts --check + ci_run /root/.local/bin/zkstack dev lint -t rs --check - name: Check Database run: | - ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 5cf0ee31ad7c..7e3d684d0d9d 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zkstack dev test rust + ci_run /root/.local/bin/zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run zkstack ecosystem init --dev --verbose - ci_run zkstack dev contracts --test-contracts + ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose + ci_run /root/.local/bin/zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zkstack dev t loadtest -v --chain=legacy + run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zkstack dev send-transactions \ + ci_run /root/.local/bin/zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run zkstack dev test build + ci_run /root/.local/bin/zkstack dev test build - name: Initialize Contract verifier run: | - ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run zkstack server --ignore-prerequisites --chain consensus \ + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run zkstack external-node init --ignore-prerequisites --chain era + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run zkstack external-node init --ignore-prerequisites --chain validium + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run zkstack external-node init --ignore-prerequisites --chain consensus + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zkstack dev test upgrade --no-deps --chain era + ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index faeec179f453..d4f216bac639 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 292ba84b8b92..bf7e4d64cccc 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zkstack dev test prover + ci_run /root/.local/bin/zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 916dd60401c9..65a499037bef 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 41a34e954be2..74f38892ea14 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index cd0bfd11d0fb..7beb52b996af 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run zkstack dev contracts --system-contracts + ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 08865571e2ea..fef5af8fad01 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: run benchmarks run: | From 7516cd128801daaf8d3ac822f0e9e6997a4d2490 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 13:45:07 +0200 Subject: [PATCH 060/103] style: add EOF newline --- .github/release-please/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/release-please/config.json b/.github/release-please/config.json index c6f98692cfdd..358e249a18bd 100644 --- a/.github/release-please/config.json +++ b/.github/release-please/config.json @@ -28,4 +28,4 @@ ] } } -} \ No newline at end of file +} From 1ac7c63227bd6068fb301c00afab734a5a47c3c5 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 13:48:31 +0200 Subject: [PATCH 061/103] refactor: deduplicate format prompts in pre-push --- .githooks/pre-push | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 7e6f9f2dd9b5..ef5e77cbc796 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -6,14 +6,15 @@ RED='\033[0;31m' NC='\033[0m' # No Color -# Prompt to install zkstack +# Common prompts INSTALL_PROPT="Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup" +FORMAT_PROMPT="Please format the code via 'zkstack dev fmt', cannot push unformatted code" # Check that prettier formatting rules are not violated. if which zkstack >/dev/null; then if ! zkstack dev fmt --check; then echo -e "${RED}Push error!${NC}" - echo "Please format the code via 'zkstack dev fmt', cannot push unformatted code" + echo -e "${FORMAT_PROMPT}" exit 1 fi else @@ -23,7 +24,7 @@ else if ! zk_supervisor fmt --check; then echo -e "${RED}Push error!${NC}" - echo "Please format the code via 'zkstack dev fmt', cannot push unformatted code" + echo -e "${FORMAT_PROMPT}" exit 1 fi else From 27f7de242a3cf2e61aa29cdc1ccd55fb25a8af3c Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 13:57:47 +0200 Subject: [PATCH 062/103] fix: add back deleted command --- .github/workflows/ci-core-lint-reusable.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index b8a21f5b39ca..916f5b9275f3 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -34,6 +34,7 @@ jobs: ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Database setup run: | From d11e4c4492b438af5de10b92f8d3c8b64521906b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 13:59:02 +0200 Subject: [PATCH 063/103] Revert "fix: add back deleted command" This reverts commit 27f7de242a3cf2e61aa29cdc1ccd55fb25a8af3c. --- .github/workflows/ci-core-lint-reusable.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 916f5b9275f3..b8a21f5b39ca 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -34,7 +34,6 @@ jobs: ci_run ./zkstack_cli/zkstackup/zkstackup --local ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Database setup run: | From 603e9ff9bda6de8c426f2940f2b496e6ebce4c19 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 15:19:57 +0200 Subject: [PATCH 064/103] refactor: rely on PATH for zkstack invocation in CI --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index ad89709d1e72..ab54b897bd6a 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 8e8ee6c61d09..856784373440 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index d94a776273e7..adfa3afec8fa 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index c3f2c85f8c04..827a54290722 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run /root/.local/bin/zkstack dev lint -t rs --check + run: ci_run zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index b8a21f5b39ca..ef377f5bc21b 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run /root/.local/bin/zkstack dev fmt --check - ci_run /root/.local/bin/zkstack dev lint -t md --check - ci_run /root/.local/bin/zkstack dev lint -t sol --check - ci_run /root/.local/bin/zkstack dev lint -t js --check - ci_run /root/.local/bin/zkstack dev lint -t ts --check - ci_run /root/.local/bin/zkstack dev lint -t rs --check + ci_run zkstack dev fmt --check + ci_run zkstack dev lint -t md --check + ci_run zkstack dev lint -t sol --check + ci_run zkstack dev lint -t js --check + ci_run zkstack dev lint -t ts --check + ci_run zkstack dev lint -t rs --check - name: Check Database run: | - ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 7e3d684d0d9d..5cf0ee31ad7c 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run /root/.local/bin/zkstack dev test rust + ci_run zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose - ci_run /root/.local/bin/zkstack dev contracts --test-contracts + ci_run zkstack ecosystem init --dev --verbose + ci_run zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy + run: ci_run zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run /root/.local/bin/zkstack dev send-transactions \ + ci_run zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run /root/.local/bin/zkstack dev test build + ci_run zkstack dev test build - name: Initialize Contract verifier run: | - ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ + ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era + ci_run zkstack external-node init --ignore-prerequisites --chain era - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium + ci_run zkstack external-node init --ignore-prerequisites --chain validium - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus + ci_run zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era + ci_run zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index d4f216bac639..faeec179f453 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index bf7e4d64cccc..292ba84b8b92 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run /root/.local/bin/zkstack dev test prover + ci_run zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 65a499037bef..916dd60401c9 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 74f38892ea14..41a34e954be2 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 7beb52b996af..cd0bfd11d0fb 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index fef5af8fad01..08865571e2ea 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: run benchmarks run: | From 15f5f42e85913e6f07d5ad098bddfffef312bb26 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 16:17:48 +0200 Subject: [PATCH 065/103] test: print PATH --- .github/workflows/ci-core-reusable.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 5cf0ee31ad7c..636c2097d5ca 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,6 +62,7 @@ jobs: - name: Build contracts run: | + ci_run echo $PATH ci_run zkstack dev contracts - name: Contracts unit tests From b517a460af599f48b259c919ae64b1c2fc5f4e2d Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 16:31:50 +0200 Subject: [PATCH 066/103] Revert "refactor: rely on PATH for zkstack invocation in CI" This reverts commit 603e9ff9bda6de8c426f2940f2b496e6ebce4c19. --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 91 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 66 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index ab54b897bd6a..ad89709d1e72 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 856784373440..8e8ee6c61d09 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index adfa3afec8fa..d94a776273e7 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 827a54290722..c3f2c85f8c04 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zkstack dev lint -t rs --check + run: ci_run /root/.local/bin/zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index ef377f5bc21b..b8a21f5b39ca 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zkstack dev fmt --check - ci_run zkstack dev lint -t md --check - ci_run zkstack dev lint -t sol --check - 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 /root/.local/bin/zkstack dev fmt --check + ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t sol --check + ci_run /root/.local/bin/zkstack dev lint -t js --check + ci_run /root/.local/bin/zkstack dev lint -t ts --check + ci_run /root/.local/bin/zkstack dev lint -t rs --check - name: Check Database run: | - ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 636c2097d5ca..7e3d684d0d9d 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,15 +62,14 @@ jobs: - name: Build contracts run: | - ci_run echo $PATH - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zkstack dev test rust + ci_run /root/.local/bin/zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -125,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -138,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run zkstack ecosystem init --dev --verbose - ci_run zkstack dev contracts --test-contracts + ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose + ci_run /root/.local/bin/zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zkstack dev t loadtest -v --chain=legacy + run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -226,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -241,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -253,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -262,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -274,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -283,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -295,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zkstack dev send-transactions \ + ci_run /root/.local/bin/zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -318,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -330,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -344,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run zkstack dev test build + ci_run /root/.local/bin/zkstack dev test build - name: Initialize Contract verifier run: | - ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run zkstack server --ignore-prerequisites --chain consensus \ + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -364,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run zkstack external-node init --ignore-prerequisites --chain era + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run zkstack external-node init --ignore-prerequisites --chain validium + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run zkstack external-node init --ignore-prerequisites --chain consensus + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zkstack dev test upgrade --no-deps --chain era + ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index faeec179f453..d4f216bac639 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 292ba84b8b92..bf7e4d64cccc 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zkstack dev test prover + ci_run /root/.local/bin/zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 916dd60401c9..65a499037bef 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 41a34e954be2..74f38892ea14 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index cd0bfd11d0fb..7beb52b996af 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run zkstack dev contracts --system-contracts + ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 08865571e2ea..fef5af8fad01 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: run benchmarks run: | From fde4703e2eab609795482e96f2facd06377080ee Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 16:49:40 +0200 Subject: [PATCH 067/103] test: print PATH in CI --- .github/workflows/ci-core-reusable.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 7e3d684d0d9d..c73daf5e2a5a 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -21,6 +21,11 @@ jobs: submodules: "recursive" fetch-depth: 0 + - name: Print PATH env + run: | + echo $PATH + ci_run echo $PATH + - name: Setup environment run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV From 56731902b80014926bd56ec79fe5fcc5ac1b6e70 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 17:22:39 +0200 Subject: [PATCH 068/103] test: print PATH again --- .github/workflows/ci-core-reusable.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index c73daf5e2a5a..923a89073e4b 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -21,11 +21,6 @@ jobs: submodules: "recursive" fetch-depth: 0 - - name: Print PATH env - run: | - echo $PATH - ci_run echo $PATH - - name: Setup environment run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV @@ -60,6 +55,11 @@ jobs: run: | ci_localnet_up + - name: Print PATH env + run: | + echo $PATH + ci_run echo $PATH + - name: Init run: | ci_run run_retried rustup show From 00279d25beffb631da16dbbfc03e7cfd7a3800be Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 17:38:10 +0200 Subject: [PATCH 069/103] fix: add /root/.local/bin to GITHUB_ENV --- .../workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .../workflows/build-witness-generator-template.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 11 +++-------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 2 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 4 ++-- .github/workflows/new-build-prover-template.yml | 4 ++-- .../new-build-witness-generator-template.yml | 4 ++-- .github/workflows/vm-perf-comparison.yml | 2 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 15 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index ad89709d1e72..4247fe4eb2af 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -47,7 +47,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 8e8ee6c61d09..1f0b844159d2 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -56,7 +56,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index d94a776273e7..f7f2fcd7ade2 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -27,7 +27,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-witness-generator-template.yml b/.github/workflows/build-witness-generator-template.yml index db7e7f7f25c3..b5a58e20d4b5 100644 --- a/.github/workflows/build-witness-generator-template.yml +++ b/.github/workflows/build-witness-generator-template.yml @@ -69,7 +69,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index c3f2c85f8c04..3878e1eab8ec 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -17,7 +17,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index b8a21f5b39ca..84b80b96b922 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -14,7 +14,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 923a89073e4b..9c7bbd2d139c 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -25,7 +25,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env @@ -55,11 +55,6 @@ jobs: run: | ci_localnet_up - - name: Print PATH env - run: | - echo $PATH - ci_run echo $PATH - - name: Init run: | ci_run run_retried rustup show @@ -96,7 +91,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env @@ -178,7 +173,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index d4f216bac639..9fac3a21e407 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -16,7 +16,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index bf7e4d64cccc..031866e80a4b 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -16,7 +16,7 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 65a499037bef..e4706bd12a8b 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -38,7 +38,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 74f38892ea14..b4b4f6457cdd 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -43,7 +43,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -182,7 +182,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-prover-template.yml b/.github/workflows/new-build-prover-template.yml index cd63140c99d3..e0a5181eae08 100644 --- a/.github/workflows/new-build-prover-template.yml +++ b/.github/workflows/new-build-prover-template.yml @@ -53,7 +53,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -111,7 +111,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-witness-generator-template.yml b/.github/workflows/new-build-witness-generator-template.yml index b9c1265dd1bd..4495d8766f56 100644 --- a/.github/workflows/new-build-witness-generator-template.yml +++ b/.github/workflows/new-build-witness-generator-template.yml @@ -48,7 +48,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -98,7 +98,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 7beb52b996af..b587e8c361db 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -35,7 +35,7 @@ jobs: touch .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index fef5af8fad01..f568d09f1fd1 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -28,7 +28,7 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $HOME/.local/bin >> $GITHUB_PATH + echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH - name: init From fb07e3627d841e2454142ccc5404521a89593e89 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 17:39:11 +0200 Subject: [PATCH 070/103] refactor: rely on PATH for zkstack invocation --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 4247fe4eb2af..9fdda920eaa0 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 1f0b844159d2..45d03fa2ed21 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index f7f2fcd7ade2..cddb73f9bc8a 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 3878e1eab8ec..9c029725a917 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run /root/.local/bin/zkstack dev lint -t rs --check + run: ci_run zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 84b80b96b922..e83900ac86b1 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run /root/.local/bin/zkstack dev fmt --check - ci_run /root/.local/bin/zkstack dev lint -t md --check - ci_run /root/.local/bin/zkstack dev lint -t sol --check - ci_run /root/.local/bin/zkstack dev lint -t js --check - ci_run /root/.local/bin/zkstack dev lint -t ts --check - ci_run /root/.local/bin/zkstack dev lint -t rs --check + ci_run zkstack dev fmt --check + ci_run zkstack dev lint -t md --check + ci_run zkstack dev lint -t sol --check + ci_run zkstack dev lint -t js --check + ci_run zkstack dev lint -t ts --check + ci_run zkstack dev lint -t rs --check - name: Check Database run: | - ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 9c7bbd2d139c..38ed0a63cea2 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run /root/.local/bin/zkstack dev test rust + ci_run zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose - ci_run /root/.local/bin/zkstack dev contracts --test-contracts + ci_run zkstack ecosystem init --dev --verbose + ci_run zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy + run: ci_run zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run /root/.local/bin/zkstack dev send-transactions \ + ci_run zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run /root/.local/bin/zkstack dev test build + ci_run zkstack dev test build - name: Initialize Contract verifier run: | - ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ + ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era + ci_run zkstack external-node init --ignore-prerequisites --chain era - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium + ci_run zkstack external-node init --ignore-prerequisites --chain validium - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus + ci_run zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era + ci_run zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 9fac3a21e407..10d18d512428 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 031866e80a4b..00176fc21c9c 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run /root/.local/bin/zkstack dev test prover + ci_run zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index e4706bd12a8b..15b394395ac1 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index b4b4f6457cdd..27bf7def311c 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index b587e8c361db..b6475eac8710 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index f568d09f1fd1..451ca41b777d 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: run benchmarks run: | From 7adf3b987472d5508cfd1ed16ea591b09d83287f Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 17:48:08 +0200 Subject: [PATCH 071/103] Revert "refactor: rely on PATH for zkstack invocation" This reverts commit fb07e3627d841e2454142ccc5404521a89593e89. --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 9fdda920eaa0..4247fe4eb2af 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 45d03fa2ed21..1f0b844159d2 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index cddb73f9bc8a..f7f2fcd7ade2 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 9c029725a917..3878e1eab8ec 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run zkstack dev lint -t rs --check + run: ci_run /root/.local/bin/zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index e83900ac86b1..84b80b96b922 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run zkstack dev fmt --check - ci_run zkstack dev lint -t md --check - ci_run zkstack dev lint -t sol --check - 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 /root/.local/bin/zkstack dev fmt --check + ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t sol --check + ci_run /root/.local/bin/zkstack dev lint -t js --check + ci_run /root/.local/bin/zkstack dev lint -t ts --check + ci_run /root/.local/bin/zkstack dev lint -t rs --check - name: Check Database run: | - ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 38ed0a63cea2..9c7bbd2d139c 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zkstack dev test rust + ci_run /root/.local/bin/zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run zkstack ecosystem init --dev --verbose - ci_run zkstack dev contracts --test-contracts + ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose + ci_run /root/.local/bin/zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run zkstack dev t loadtest -v --chain=legacy + run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run zkstack dev send-transactions \ + ci_run /root/.local/bin/zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run zkstack chain create \ + ci_run /root/.local/bin/zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run zkstack chain init \ + ci_run /root/.local/bin/zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run zkstack dev test build + ci_run /root/.local/bin/zkstack dev test build - name: Initialize Contract verifier run: | - ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run zkstack server --ignore-prerequisites --chain consensus \ + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run zkstack external-node init --ignore-prerequisites --chain era + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run zkstack external-node init --ignore-prerequisites --chain validium + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run zkstack external-node init --ignore-prerequisites --chain consensus + ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run zkstack dev test upgrade --no-deps --chain era + ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 10d18d512428..9fac3a21e407 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run zkstack dev lint -t md --check + ci_run /root/.local/bin/zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 00176fc21c9c..031866e80a4b 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run zkstack dev test prover + ci_run /root/.local/bin/zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 15b394395ac1..e4706bd12a8b 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 27bf7def311c..b4b4f6457cdd 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - zkstack dev contracts + /root/.local/bin/zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index b6475eac8710..b587e8c361db 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run zkstack dev contracts --system-contracts + ci_run /root/.local/bin/zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 451ca41b777d..f568d09f1fd1 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run zkstack dev contracts + ci_run /root/.local/bin/zkstack dev contracts - name: run benchmarks run: | From 65e2f882ecf9f581ff50ebb52692c40705f00fff Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 18:12:54 +0200 Subject: [PATCH 072/103] Revert "Revert "refactor: rely on PATH for zkstack invocation"" This reverts commit 7adf3b987472d5508cfd1ed16ea591b09d83287f. --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 16 ++-- .github/workflows/ci-core-reusable.yml | 90 +++++++++---------- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 +- .../new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 +- .github/workflows/vm-perf-to-prometheus.yml | 2 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 4247fe4eb2af..9fdda920eaa0 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -123,7 +123,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 1f0b844159d2..45d03fa2ed21 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -135,7 +135,7 @@ jobs: if: env.BUILD_CONTRACTS == 'true' run: | ci_run cp etc/tokens/{test,localhost}.json - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Login to Docker registries if: ${{ inputs.action == 'push' }} diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index f7f2fcd7ade2..cddb73f9bc8a 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -68,7 +68,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: update-image run: | diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 3878e1eab8ec..9c029725a917 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -39,5 +39,5 @@ jobs: # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build - name: Lints - run: ci_run /root/.local/bin/zkstack dev lint -t rs --check + run: ci_run zkstack dev lint -t rs --check diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 84b80b96b922..e83900ac86b1 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -37,17 +37,17 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Lints run: | - ci_run /root/.local/bin/zkstack dev fmt --check - ci_run /root/.local/bin/zkstack dev lint -t md --check - ci_run /root/.local/bin/zkstack dev lint -t sol --check - ci_run /root/.local/bin/zkstack dev lint -t js --check - ci_run /root/.local/bin/zkstack dev lint -t ts --check - ci_run /root/.local/bin/zkstack dev lint -t rs --check + ci_run zkstack dev fmt --check + ci_run zkstack dev lint -t md --check + ci_run zkstack dev lint -t sol --check + ci_run zkstack dev lint -t js --check + ci_run zkstack dev lint -t ts --check + ci_run zkstack dev lint -t rs --check - name: Check Database run: | - ci_run /root/.local/bin/zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 9c7bbd2d139c..38ed0a63cea2 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -62,14 +62,14 @@ jobs: - name: Build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run /root/.local/bin/zkstack dev test rust + ci_run zkstack dev test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch @@ -124,7 +124,7 @@ jobs: - name: Create and initialize legacy chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name legacy \ --chain-id sequential \ --prover-mode no-proofs \ @@ -137,18 +137,18 @@ jobs: --ignore-prerequisites \ --legacy-bridge - ci_run /root/.local/bin/zkstack ecosystem init --dev --verbose - ci_run /root/.local/bin/zkstack dev contracts --test-contracts + ci_run zkstack ecosystem init --dev --verbose + ci_run zkstack dev contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - ci_run /root/.local/bin/zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy - ci_run /root/.local/bin/zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & + ci_run zkstack dev config-writer --path ${{ matrix.vm_mode == 'NEW' && 'etc/env/file_based/overrides/tests/loadtest-new.yaml' || 'etc/env/file_based/overrides/tests/loadtest-old.yaml' }} --chain legacy + ci_run zkstack server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - name: Perform loadtest - run: ci_run /root/.local/bin/zkstack dev t loadtest -v --chain=legacy + run: ci_run zkstack dev t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -225,7 +225,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run /root/.local/bin/zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ + ci_run zkstack ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --server-db-name=zksync_server_localhost_era \ @@ -240,7 +240,7 @@ jobs: - name: Create and initialize Validium chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name validium \ --chain-id sequential \ --prover-mode no-proofs \ @@ -252,7 +252,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -261,7 +261,7 @@ jobs: - name: Create and initialize chain with Custom Token run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name custom_token \ --chain-id sequential \ --prover-mode no-proofs \ @@ -273,7 +273,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -282,7 +282,7 @@ jobs: - name: Create and register chain with transactions signed "offline" run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name offline_chain \ --chain-id sequential \ --prover-mode no-proofs \ @@ -294,11 +294,11 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 + ci_run zkstack chain build-transactions --chain offline_chain --l1-rpc-url http://127.0.0.1:8545 governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml) - ci_run /root/.local/bin/zkstack dev send-transactions \ + ci_run zkstack dev send-transactions \ --file ./transactions/chain/offline_chain/register-hyperchain-txns.json \ --l1-rpc-url http://127.0.0.1:8545 \ --private-key $governor_pk @@ -317,7 +317,7 @@ jobs: - name: Create and initialize Consensus chain run: | - ci_run /root/.local/bin/zkstack chain create \ + ci_run zkstack chain create \ --chain-name consensus \ --chain-id sequential \ --prover-mode no-proofs \ @@ -329,7 +329,7 @@ jobs: --set-as-default false \ --ignore-prerequisites - ci_run /root/.local/bin/zkstack chain init \ + ci_run zkstack chain init \ --deploy-paymaster \ --l1-rpc-url=http://localhost:8545 \ --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ @@ -343,19 +343,19 @@ jobs: - name: Build test dependencies run: | - ci_run /root/.local/bin/zkstack dev test build + ci_run zkstack dev test build - name: Initialize Contract verifier run: | - ci_run /root/.local/bin/zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era - ci_run /root/.local/bin/zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & + ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era + ci_run zkstack contract-verifier run --chain era &> ${{ env.SERVER_LOGS_DIR }}/contract-verifier-rollup.log & - name: Run servers run: | - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack server --ignore-prerequisites --chain consensus \ + ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & + ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & + ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zkstack server --ignore-prerequisites --chain consensus \ --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & @@ -363,67 +363,67 @@ jobs: - name: Setup attester committee for the consensus chain run: | - ci_run /root/.local/bin/zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log + ci_run zkstack consensus set-attester-committee --chain consensus --from-genesis &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log - name: Run integration tests run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Init external nodes run: | - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain era + ci_run zkstack external-node init --ignore-prerequisites --chain era - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain validium + ci_run zkstack external-node init --ignore-prerequisites --chain validium - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain custom_token + ci_run zkstack external-node init --ignore-prerequisites --chain custom_token - ci_run /root/.local/bin/zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus - ci_run /root/.local/bin/zkstack external-node init --ignore-prerequisites --chain consensus + ci_run zkstack external-node init --ignore-prerequisites --chain consensus - name: Run recovery tests (from snapshot) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --snapshot --no-deps --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run recovery tests (from genesis) run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test recovery --no-deps --no-kill --ignore-prerequisites --verbose" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run external node server run: | - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & - ci_run /root/.local/bin/zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & + ci_run zkstack external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & + ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & + ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & - name: Run integration tests en run: | - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test integration --no-deps --ignore-prerequisites --external-node" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Fee projection tests run: | ci_run killall -INT zksync_server || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} - name: Run revert tests run: | ci_run killall -INT zksync_server || true ci_run killall -INT zksync_external_node || true - ci_run ./bin/run_on_all_chains.sh "/root/.local/bin/zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} + ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }} # Upgrade tests should run last, because as soon as they # finish the bootloader will be different # TODO make upgrade tests safe to run multiple times - name: Run upgrade test run: | - ci_run /root/.local/bin/zkstack dev test upgrade --no-deps --chain era + ci_run zkstack dev test upgrade --no-deps --chain era - name: Upload logs diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 9fac3a21e407..10d18d512428 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -37,4 +37,4 @@ jobs: - name: Lints run: | - ci_run /root/.local/bin/zkstack dev lint -t md --check + ci_run zkstack dev lint -t md --check diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 031866e80a4b..00176fc21c9c 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -38,7 +38,7 @@ jobs: - name: Database setup run: | - ci_run /root/.local/bin/zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} + ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }} - name: Formatting run: ci_run bash -c "cd prover && cargo fmt --check" @@ -78,4 +78,4 @@ jobs: - name: Prover unit tests run: | # Not all tests are enabled, since prover and setup_key_generator_and_server requires bellman-cuda to be present - ci_run /root/.local/bin/zkstack dev test prover + ci_run zkstack dev test prover diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index e4706bd12a8b..15b394395ac1 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -136,7 +136,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index b4b4f6457cdd..27bf7def311c 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | cp etc/tokens/{test,localhost}.json - /root/.local/bin/zkstack dev contracts + zkstack dev contracts - name: Upload contracts uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index b587e8c361db..b6475eac8710 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -51,7 +51,7 @@ jobs: shell: bash run: | ci_run zkt || ci_run zkstackup --local - ci_run zk_supervisor contracts --system-contracts || ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -63,7 +63,7 @@ jobs: shell: bash run: | ci_run zkstackup --local - ci_run /root/.local/bin/zkstack dev contracts --system-contracts + ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index f568d09f1fd1..451ca41b777d 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -40,7 +40,7 @@ jobs: - name: build contracts run: | - ci_run /root/.local/bin/zkstack dev contracts + ci_run zkstack dev contracts - name: run benchmarks run: | From 2696f904881a6f1f06e0987e418aeaacab252fee Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 18:22:16 +0200 Subject: [PATCH 073/103] refactor: try installing zkstack in /usr/local --- zkstack_cli/zkstackup/zkstackup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 186191ed8108..4cd84fb7a454 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -2,7 +2,7 @@ set -eo pipefail HOME_DIR=${XDG_CONFIG_HOME:-$HOME} -LOCAL_DIR=${LOCAL_DIR:-"$HOME_DIR/.local"} +LOCAL_DIR=${LOCAL_DIR:-"$/usr/local"} BIN_DIR="$LOCAL_DIR/bin" BINS=() From ed4be01624f7211a5a191b3a867d085f53b508da Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 18:25:37 +0200 Subject: [PATCH 074/103] fix: typo in LOCAL_DIR --- zkstack_cli/zkstackup/zkstackup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 4cd84fb7a454..905acbcc7d1b 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -2,7 +2,7 @@ set -eo pipefail HOME_DIR=${XDG_CONFIG_HOME:-$HOME} -LOCAL_DIR=${LOCAL_DIR:-"$/usr/local"} +LOCAL_DIR=${LOCAL_DIR:-"/usr/local"} BIN_DIR="$LOCAL_DIR/bin" BINS=() From 008a7d951a970e9c1c5276b238e5d20a2441aba3 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 18:47:49 +0200 Subject: [PATCH 075/103] feat: add global installation option for zkstackup and zkstack --- .../build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 4 ++-- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- zkstack_cli/zkstackup/install | 2 ++ zkstack_cli/zkstackup/zkstackup | 21 ++++++------------- 9 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 9fdda920eaa0..e361d477ac1c 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -115,7 +115,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 45d03fa2ed21..793b5bdc37f9 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -128,7 +128,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/zkstackup --local || true + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 9c029725a917..b24005ac6945 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index e83900ac86b1..54754247b792 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 38ed0a63cea2..8d084d2a7d8b 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -58,7 +58,7 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ - name: Build contracts run: | @@ -120,7 +120,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ - name: Create and initialize legacy chain run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 10d18d512428..dd6af0e4dcf4 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 00176fc21c9c..f3d882233d7c 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -34,7 +34,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ - name: Database setup run: | @@ -72,7 +72,7 @@ jobs: - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup --local + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ ci_run run_retried rustup show - name: Prover unit tests diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index 3b4a70198bdb..fc6018a818d7 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -79,6 +79,8 @@ parse_args() { shift ZKSTACKUP_PATH=$1 ;; + -g | --global) + BIN_DIR="/usr/local" -h | --help) usage exit 0 diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 905acbcc7d1b..2863c6c121cb 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -2,7 +2,7 @@ set -eo pipefail HOME_DIR=${XDG_CONFIG_HOME:-$HOME} -LOCAL_DIR=${LOCAL_DIR:-"/usr/local"} +LOCAL_DIR=${LOCAL_DIR:-"$HOME_DIR/.local"} BIN_DIR="$LOCAL_DIR/bin" BINS=() @@ -20,12 +20,7 @@ main() { if [ -n "$ZKSTACKUP_PATH" ]; then install_local else - if [ -n "$ZKSTACKUP_LOCAL" ]; then - ZKSTACKUP_PATH="./" - install_local - else - install_from_repo - fi + install_from_repo fi zkstack_banner @@ -70,8 +65,8 @@ parse_args() { shift ZKSTACKUP_PATH=$1 ;; - -l | --local) - ZKSTACKUP_LOCAL=true + -g | --global) + LOCAL_DIR="/usr/local" ;; -r | --repo) shift @@ -111,7 +106,7 @@ Usage: $(basename "$0") [OPTIONS] Options: -p, --path Specify a local path to install ZK Stack CLI from. Ignored if --repo is provided. - -l, --local Install ZK Stack CLI from the current directory. + -g, --global Install ZK Stack CLI from the current directory. -r, --repo GitHub repository to install from (e.g., "matter-labs/zksync-era"). Defaults to "matter-labs/zksync-era". -b, --branch Git branch to use when installing from a repository. Ignored if --commit or --version is provided. -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided. @@ -125,11 +120,7 @@ EOF install_local() { if [ ! -d "$ZKSTACKUP_PATH/zkstack_cli" ]; then - if [ -n "$ZKSTACKUP_LOCAL" ]; then - err "Current folder does not contain zkstack_cli" - else - err "Path $ZKSTACKUP_PATH does not contain zkstack_cli" - fi + err "Path $ZKSTACKUP_PATH does not contain zkstack_cli" exit 1 fi From 3fadff41b234bd45533de1080a5f4d477547aa6a Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 18:49:55 +0200 Subject: [PATCH 076/103] refactor: remove /root/.local/bin from GITHUB_PATH --- .github/workflows/build-contract-verifier-template.yml | 1 - .github/workflows/build-core-template.yml | 1 - .github/workflows/build-local-node-docker.yml | 1 - .github/workflows/build-witness-generator-template.yml | 1 - .github/workflows/ci-common-reusable.yml | 1 - .github/workflows/ci-core-lint-reusable.yml | 1 - .github/workflows/ci-core-reusable.yml | 3 --- .github/workflows/ci-docs-reusable.yml | 1 - .github/workflows/ci-prover-reusable.yml | 1 - .github/workflows/new-build-contract-verifier-template.yml | 1 - .github/workflows/new-build-core-template.yml | 2 -- .github/workflows/new-build-prover-template.yml | 2 -- .github/workflows/new-build-witness-generator-template.yml | 2 -- .github/workflows/vm-perf-comparison.yml | 1 - .github/workflows/vm-perf-to-prometheus.yml | 1 - 15 files changed, 20 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index e361d477ac1c..8d8be083223d 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -47,7 +47,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 793b5bdc37f9..24e6ac68baca 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -56,7 +56,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index cddb73f9bc8a..c9dafd48c6e4 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -27,7 +27,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-witness-generator-template.yml b/.github/workflows/build-witness-generator-template.yml index b5a58e20d4b5..89874fbf5f59 100644 --- a/.github/workflows/build-witness-generator-template.yml +++ b/.github/workflows/build-witness-generator-template.yml @@ -69,7 +69,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index b24005ac6945..23e9c0bc0693 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -17,7 +17,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 54754247b792..a37d1fb235f4 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -14,7 +14,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 8d084d2a7d8b..1a64d6089c73 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -25,7 +25,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env @@ -91,7 +90,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env @@ -173,7 +171,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index dd6af0e4dcf4..3bcea001f6a6 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -16,7 +16,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index f3d882233d7c..83df44729de2 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -16,7 +16,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 15b394395ac1..35165c489364 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -38,7 +38,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 27bf7def311c..679769b8cae8 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -43,7 +43,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -182,7 +181,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-prover-template.yml b/.github/workflows/new-build-prover-template.yml index e0a5181eae08..7f8595db6e3f 100644 --- a/.github/workflows/new-build-prover-template.yml +++ b/.github/workflows/new-build-prover-template.yml @@ -53,7 +53,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -111,7 +110,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-witness-generator-template.yml b/.github/workflows/new-build-witness-generator-template.yml index 4495d8766f56..779aa7c7ee0a 100644 --- a/.github/workflows/new-build-witness-generator-template.yml +++ b/.github/workflows/new-build-witness-generator-template.yml @@ -48,7 +48,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -98,7 +97,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index b6475eac8710..9f006a25f552 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -35,7 +35,6 @@ jobs: touch .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 451ca41b777d..26bc66977ac0 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -28,7 +28,6 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo /root/.local/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH - name: init From c47e520dbbc1cef86f6a31b55c9c2595773455ca Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 18:53:58 +0200 Subject: [PATCH 077/103] fix: update BIN_DIR on -g flag --- zkstack_cli/zkstackup/zkstackup | 1 + 1 file changed, 1 insertion(+) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 2863c6c121cb..62ddf84e6ad2 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -67,6 +67,7 @@ parse_args() { ;; -g | --global) LOCAL_DIR="/usr/local" + BIN_DIR="$LOCAL_DIR/bin" ;; -r | --repo) shift From 4436a8c9e2af203453df460040844e7a3bda8052 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 19:01:35 +0200 Subject: [PATCH 078/103] fix: removed --local flag from zkstackup invocations --- .github/workflows/build-local-node-docker.yml | 2 +- .github/workflows/ci-core-reusable.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 2 +- docker/Makefile | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index c9dafd48c6e4..025cd73f3031 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -62,7 +62,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run zkstackup --local + ci_run zkstackup -g ci_run cp etc/tokens/{test,localhost}.json - name: build contracts diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 1a64d6089c73..a556816d732d 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -185,7 +185,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup --local" + run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup -g" - name: Create log directories run: | diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 9f006a25f552..0b1ff9601306 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run zkstackup --local + ci_run zkt || ci_run zkstackup -g ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run zkstackup --local + ci_run zkstackup -g ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 26bc66977ac0..b4c551827511 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -35,7 +35,7 @@ jobs: run_retried docker compose pull zk docker compose up -d zk - ci_run zkstackup --local + ci_run zkstackup -g - name: build contracts run: | diff --git a/docker/Makefile b/docker/Makefile index c37064090d02..4b956b5a5b8c 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ - zkstackup --local || true && \ + zkstackup -g || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts From 28dfeb21177b06a93519ecb7c3c14f1f7aa218e8 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 19:29:59 +0200 Subject: [PATCH 079/103] fix: add missing --path options to zkstackup invocations --- .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 2 +- docker/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 0b1ff9601306..db90c34618b3 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run zkstackup -g + ci_run zkt || ci_run zkstackup -g --path ./ ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run zkstackup -g + ci_run zkstackup -g --path ./ ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index b4c551827511..7707fa638092 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -35,7 +35,7 @@ jobs: run_retried docker compose pull zk docker compose up -d zk - ci_run zkstackup -g + ci_run zkstackup -g --path ./ - name: build contracts run: | diff --git a/docker/Makefile b/docker/Makefile index 4b956b5a5b8c..817c4ac3ecbc 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ - zkstackup -g || true && \ + zkstackup -g --path ./ || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts From 699f476eedf8b4c4de7a16453cbf7caf6a111ccc Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 19:47:55 +0200 Subject: [PATCH 080/103] fix: one more missing --path option --- .github/workflows/ci-core-reusable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index a556816d732d..927352f0e3bd 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -185,7 +185,7 @@ jobs: ci_localnet_up - name: Build ZK Stack CLI - run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup -g" + run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup -g --path ./" - name: Create log directories run: | From f6e703731d7539a446cce05f8a372cc6471aa607 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 19:57:51 +0200 Subject: [PATCH 081/103] fix: missing ;; in --global option parsing --- zkstack_cli/zkstackup/install | 1 + 1 file changed, 1 insertion(+) diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index fc6018a818d7..7ecffaf10f35 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -81,6 +81,7 @@ parse_args() { ;; -g | --global) BIN_DIR="/usr/local" + ;; -h | --help) usage exit 0 From 08b123205949a389099131d3c515dd958933b568 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 10 Oct 2024 20:06:33 +0200 Subject: [PATCH 082/103] refactor: lint code --- core/node/consensus/src/registry/tests.rs | 2 +- core/node/consensus/src/tests/attestation.rs | 4 ++-- docs/guides/external-node/00_quick_start.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/node/consensus/src/registry/tests.rs b/core/node/consensus/src/registry/tests.rs index 33392a7f206d..89afc20e1d57 100644 --- a/core/node/consensus/src/registry/tests.rs +++ b/core/node/consensus/src/registry/tests.rs @@ -80,7 +80,7 @@ async fn test_attester_committee() { .wrap("wait_for_batch_info()")?; // Read the attester committee using the vm. - let batch = attester::BatchNumber(node.last_batch().0.into()); + let batch = attester::BatchNumber(node.last_batch().0); assert_eq!( Some(committee), registry diff --git a/core/node/consensus/src/tests/attestation.rs b/core/node/consensus/src/tests/attestation.rs index bd3886bd4c89..2701a986e9e9 100644 --- a/core/node/consensus/src/tests/attestation.rs +++ b/core/node/consensus/src/tests/attestation.rs @@ -79,7 +79,7 @@ async fn test_attestation_status_api(version: ProtocolVersionId) { let status = fetch_status().await?; assert_eq!( status.next_batch_to_attest, - attester::BatchNumber(first_batch.0.into()) + attester::BatchNumber(first_batch.0) ); tracing::info!("Insert a cert"); @@ -237,7 +237,7 @@ async fn test_multiple_attesters(version: ProtocolVersionId, pregenesis: bool) { } tracing::info!("Wait for the batches to be attested"); - let want_last = attester::BatchNumber(validator.last_sealed_batch().0.into()); + let want_last = attester::BatchNumber(validator.last_sealed_batch().0); validator_pool .wait_for_batch_certificates_and_verify(ctx, want_last, Some(registry_addr)) .await?; diff --git a/docs/guides/external-node/00_quick_start.md b/docs/guides/external-node/00_quick_start.md index b24571d342fc..07e52085cf4f 100644 --- a/docs/guides/external-node/00_quick_start.md +++ b/docs/guides/external-node/00_quick_start.md @@ -38,8 +38,8 @@ sudo docker compose --file testnet-external-node-docker-compose.yml down --volum ### Observability -You can see the status of the node (after recovery) in [local grafana dashboard](http://localhost:3000/dashboards). -You can also access a debug page with more information about the node [here](http://localhost:5000). +You can see the status of the node (after recovery) in [local grafana dashboard](http://localhost:3000/dashboards). You +can also access a debug page with more information about the node [here](http://localhost:5000). The HTTP JSON-RPC API can be accessed on port `3060` and WebSocket API can be accessed on port `3061`. From edf1e0736c4a5026e8ebeb259f82b37b9d941a2e Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 11:04:33 +0200 Subject: [PATCH 083/103] fix: correctly invoke zkstackup in CI --- .github/workflows/new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 35165c489364..71ad80c1f901 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -129,7 +129,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup || true + zkstackup -g --path ./ || true - name: build contracts shell: bash diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 679769b8cae8..e12f962bc3a2 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -134,7 +134,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup || true + zkstackup -g --path ./ || true - name: build contracts shell: bash From 9622e34e9486831cabc07f912710eefbc1195682 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 11:22:08 +0200 Subject: [PATCH 084/103] fix: use ZKSYNC_HOME instead of relative path --- .github/workflows/build-core-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 24e6ac68baca..a7332070b8d0 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,7 +127,7 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ || true + ci_run ./zkstack_cli/zkstackup/zkstackup -g --path $ZKSYNC_HOME || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key - name: build contracts diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index e12f962bc3a2..0ecba10c0000 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -134,7 +134,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup -g --path ./ || true + zkstackup -g --path $ZKSYNC_HOME || true - name: build contracts shell: bash From a283d8b08ad956143d8efa303d7118d1aecc2519 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 11:37:18 +0200 Subject: [PATCH 085/103] fix: use sudo for global installation --- .github/workflows/new-build-core-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 0ecba10c0000..7f90032a6f17 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -134,7 +134,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup -g --path $ZKSYNC_HOME || true + sudo zkstackup -g --path $ZKSYNC_HOME || true - name: build contracts shell: bash From 0c94073ddfd0ce8a78b3c276251c15f807067d23 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 11:43:32 +0200 Subject: [PATCH 086/103] Revert "fix: use sudo for global installation" This reverts commit a283d8b08ad956143d8efa303d7118d1aecc2519. --- .github/workflows/new-build-core-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 7f90032a6f17..0ecba10c0000 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -134,7 +134,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - sudo zkstackup -g --path $ZKSYNC_HOME || true + zkstackup -g --path $ZKSYNC_HOME || true - name: build contracts shell: bash From 5a65009ced778ac5379bcb01f68e59a5933da2c7 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 11:53:58 +0200 Subject: [PATCH 087/103] fix: install zkstack locally --- .github/workflows/new-build-core-template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 0ecba10c0000..19a68d4048a4 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -44,6 +44,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -134,7 +135,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup -g --path $ZKSYNC_HOME || true + zkstackup --path $ZKSYNC_HOME || true - name: build contracts shell: bash From 3eb7a0a772bc84c548708331c7070ae1d2963c54 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 12:07:33 +0200 Subject: [PATCH 088/103] fix: use local installation of zkstack --- .github/workflows/new-build-contract-verifier-template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 71ad80c1f901..d590cecb8f57 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -39,6 +39,7 @@ jobs: echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + echo $HOME/.local/bin >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -129,7 +130,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup -g --path ./ || true + zkstackup --path ./ || true - name: build contracts shell: bash From e04d7ee92a0a026649d0626b4128ed905ad17ae3 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 13:17:35 +0200 Subject: [PATCH 089/103] test: test zkstackup install script in CI --- .../build-contract-verifier-template.yml | 7 +++++-- .github/workflows/build-core-template.yml | 6 +++++- .github/workflows/ci-common-reusable.yml | 7 ++++--- .github/workflows/ci-core-lint-reusable.yml | 7 +++++-- .github/workflows/ci-core-reusable.yml | 21 +++++++++++++------ .github/workflows/ci-docs-reusable.yml | 7 +++++-- .github/workflows/ci-prover-reusable.yml | 14 ++++++++----- 7 files changed, 48 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 8d8be083223d..8d7a984586d6 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -47,7 +47,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -114,10 +113,14 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ || true ci_run ./bin/zk || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key + - name: install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true + ci_run zkstackup -g --path $ZKSYNC_HOME + - name: build contracts if: env.BUILD_CONTRACTS == 'true' run: | diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index a7332070b8d0..98dbd381d8cb 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -127,8 +127,12 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run ./bin/zk || true - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path $ZKSYNC_HOME || true ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key + + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true + ci_run zkstackup -g --path $ZKSYNC_HOME - name: build contracts if: env.BUILD_CONTRACTS == 'true' diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 23e9c0bc0693..08610da813c1 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -30,10 +30,11 @@ jobs: run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull mkdir -p ./volumes/postgres docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres - - - name: Init + + - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME + ci_run zkstackup -g --path $ZKSYNC_HOME # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index a37d1fb235f4..4bd95c6bda0c 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -14,7 +14,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -27,10 +26,14 @@ jobs: - name: Start services run: | ci_localnet_up + + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME + ci_run zkstackup -g --path $ZKSYNC_HOME - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 927352f0e3bd..b8de681a5899 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -25,7 +25,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -57,7 +56,11 @@ jobs: - name: Init run: | ci_run run_retried rustup show - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ + + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME + ci_run zkstackup -g --path $ZKSYNC_HOME - name: Build contracts run: | @@ -118,7 +121,11 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true + ci_run zkstackup -g --path $ZKSYNC_HOME + - name: Create and initialize legacy chain run: | @@ -184,9 +191,11 @@ jobs: run: | ci_localnet_up - - name: Build ZK Stack CLI - run: ci_run bash -c "./zkstack_cli/zkstackup/zkstackup -g --path ./" - + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true + ci_run zkstackup -g --path $ZKSYNC_HOME + - name: Create log directories run: | SERVER_LOGS_DIR=logs/server diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 8a189e7af1e8..195c0d25f729 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -16,7 +16,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -28,9 +27,13 @@ jobs: run_retried docker compose pull zk docker compose up -d zk + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME + ci_run zkstackup -g --path $ZKSYNC_HOME + - name: Build run: | - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ ci_run yarn install ci_run git config --global --add safe.directory /usr/src/zksync diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 83df44729de2..952c4bd80197 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -16,7 +16,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -31,9 +30,10 @@ jobs: mkdir -p ./volumes/postgres docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres - - name: Init - run: | - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME + ci_run zkstackup -g --path $ZKSYNC_HOME - name: Database setup run: | @@ -69,9 +69,13 @@ jobs: mkdir -p ./volumes/postgres docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true + ci_run zkstackup -g --path $ZKSYNC_HOME + - name: Init run: | - ci_run ./zkstack_cli/zkstackup/zkstackup -g --path ./ ci_run run_retried rustup show - name: Prover unit tests From 2dafd48d94c87073aa1d47c43afa97b775f59b48 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 13:26:05 +0200 Subject: [PATCH 090/103] fix: use relative path instead of ZKSYNC_HOME --- .../workflows/build-contract-verifier-template.yml | 4 ++-- .github/workflows/build-core-template.yml | 4 ++-- .github/workflows/ci-common-reusable.yml | 4 ++-- .github/workflows/ci-core-lint-reusable.yml | 4 ++-- .github/workflows/ci-core-reusable.yml | 12 ++++++------ .github/workflows/ci-docs-reusable.yml | 4 ++-- .github/workflows/ci-prover-reusable.yml | 8 ++++---- .github/workflows/new-build-core-template.yml | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 8d7a984586d6..d1d1e1deb0f9 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -118,8 +118,8 @@ jobs: - name: install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run zkstackup -g --path ./ - name: build contracts if: env.BUILD_CONTRACTS == 'true' diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index 98dbd381d8cb..cc78489f5b4c 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -131,8 +131,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run zkstackup -g --path ./ - name: build contracts if: env.BUILD_CONTRACTS == 'true' diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 08610da813c1..5fd2d3081926 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -33,8 +33,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run zkstackup -g --path ./ # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 4bd95c6bda0c..1d8e75ef5b3a 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,8 +29,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run zkstackup -g --path ./ - name: Build run: | diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index b8de681a5899..a3611711e273 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -59,8 +59,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run zkstackup -g --path ./ - name: Build contracts run: | @@ -123,8 +123,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run zkstackup -g --path ./ - name: Create and initialize legacy chain @@ -193,8 +193,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run zkstackup -g --path ./ - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 195c0d25f729..9a98f33d2149 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,8 +29,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run zkstackup -g --path ./ - name: Build run: | diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 952c4bd80197..f37764941655 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,8 +32,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run zkstackup -g --path ./ - name: Database setup run: | @@ -71,8 +71,8 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path $ZKSYNC_HOME || true - ci_run zkstackup -g --path $ZKSYNC_HOME + ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run zkstackup -g --path ./ - name: Init run: | diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 19a68d4048a4..846dea6de887 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -135,7 +135,7 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup --path $ZKSYNC_HOME || true + zkstackup --path ./ || true - name: build contracts shell: bash From 7b37fcb33f65980e3b92b81c0e322bc7e3afe241 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 14:08:37 +0200 Subject: [PATCH 091/103] fix: update BIN_PATH variable when --global option is submitted --- zkstack_cli/zkstackup/install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index 7ecffaf10f35..c736cc9b9853 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -1,10 +1,10 @@ #!/usr/bin/env bash set -eo pipefail +BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/zkstackup" + HOME_DIR=${XDG_CONFIG_HOME:-$HOME} BIN_DIR="$HOME_DIR/.local/bin" - -BIN_URL="https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/zkstackup" BIN_PATH="$BIN_DIR/zkstackup" main() { @@ -81,6 +81,7 @@ parse_args() { ;; -g | --global) BIN_DIR="/usr/local" + BIN_PATH="$BIN_DIR/zkstackup" ;; -h | --help) usage From f13106fc29ed7494c3b97249c8ef0356f00b6067 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 14:41:25 +0200 Subject: [PATCH 092/103] fix: fix global installation for zkstackup --- zkstack_cli/zkstackup/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index c736cc9b9853..ef23c8711b74 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -13,7 +13,7 @@ main() { mkdir -p "$BIN_DIR" if [ -n "$ZKSTACKUP_PATH" ]; then - cp -r "$ZKSTACKUP_PATH" "$BIN_DIR" + cp -r "$ZKSTACKUP_PATH/zkstackup" "$BIN_DIR" else curl -sSfL "$BIN_URL" -o "$BIN_PATH" fi @@ -80,7 +80,7 @@ parse_args() { ZKSTACKUP_PATH=$1 ;; -g | --global) - BIN_DIR="/usr/local" + BIN_DIR="/usr/local/bin" BIN_PATH="$BIN_DIR/zkstackup" ;; -h | --help) From a3a0d4ca85f8410272a48b4d9db8e4e41d8b3e74 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 14:54:32 +0200 Subject: [PATCH 093/103] fix: fix relative path invocation of install script --- .github/workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 6 +++--- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- zkstack_cli/zkstackup/install | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index d1d1e1deb0f9..28e8f90dee90 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -118,7 +118,7 @@ jobs: - name: install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup -g --path ./ - name: build contracts diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index cc78489f5b4c..e88e5a4459bd 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -131,7 +131,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup -g --path ./ - name: build contracts diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index 5fd2d3081926..af86d1baefa1 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup ci_run zkstackup -g --path ./ # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index 1d8e75ef5b3a..f11f421b6a52 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup ci_run zkstackup -g --path ./ - name: Build diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index fcbd950d8c8c..ed7116a53df8 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -59,7 +59,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup ci_run zkstackup -g --path ./ - name: Build contracts @@ -123,7 +123,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup -g --path ./ @@ -193,7 +193,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup -g --path ./ - name: Create log directories diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index 9a98f33d2149..eb485e4b2362 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -29,7 +29,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup ci_run zkstackup -g --path ./ - name: Build diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index f37764941655..993211565593 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -32,7 +32,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup ci_run zkstackup -g --path ./ - name: Database setup @@ -71,7 +71,7 @@ jobs: - name: Install zkstack run: | - ci_run ./zkstack_cli/zkstackup/install -g --path ./ || true + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true ci_run zkstackup -g --path ./ - name: Init diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index ef23c8711b74..f1969694b0f5 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -13,7 +13,7 @@ main() { mkdir -p "$BIN_DIR" if [ -n "$ZKSTACKUP_PATH" ]; then - cp -r "$ZKSTACKUP_PATH/zkstackup" "$BIN_DIR" + cp -r "$ZKSTACKUP_PATH" "$BIN_DIR" else curl -sSfL "$BIN_URL" -o "$BIN_PATH" fi From 14c4c1a3c769959a0188f0a725bb0e6bfa7287ca Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 15:07:37 +0200 Subject: [PATCH 094/103] refactor: remove zkstackup folder from GITHUB_PATH --- .github/workflows/build-local-node-docker.yml | 1 - .github/workflows/build-witness-generator-template.yml | 1 - .github/workflows/ci-common-reusable.yml | 1 - .github/workflows/ci-core-reusable.yml | 2 -- .github/workflows/new-build-contract-verifier-template.yml | 1 - .github/workflows/new-build-core-template.yml | 2 -- .github/workflows/new-build-prover-template.yml | 2 -- .github/workflows/new-build-witness-generator-template.yml | 2 -- .github/workflows/vm-perf-comparison.yml | 1 - .github/workflows/vm-perf-to-prometheus.yml | 1 - 10 files changed, 14 deletions(-) diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 025cd73f3031..250f7b9808a8 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -27,7 +27,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/build-witness-generator-template.yml b/.github/workflows/build-witness-generator-template.yml index 89874fbf5f59..33d78b3cf2fc 100644 --- a/.github/workflows/build-witness-generator-template.yml +++ b/.github/workflows/build-witness-generator-template.yml @@ -69,7 +69,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index af86d1baefa1..e2c39b848455 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -17,7 +17,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index ed7116a53df8..a836d4f19b6f 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -93,7 +93,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env @@ -178,7 +177,6 @@ jobs: run: | echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo IN_DOCKER=1 >> .env echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index d590cecb8f57..43b16a2b3355 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -38,7 +38,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 846dea6de887..dce7bd10e163 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -43,7 +43,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo $HOME/.local/bin >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -182,7 +181,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-prover-template.yml b/.github/workflows/new-build-prover-template.yml index 03cac37837ba..944551c98717 100644 --- a/.github/workflows/new-build-prover-template.yml +++ b/.github/workflows/new-build-prover-template.yml @@ -53,7 +53,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -111,7 +110,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-witness-generator-template.yml b/.github/workflows/new-build-witness-generator-template.yml index 779aa7c7ee0a..2f1fc0b2dd86 100644 --- a/.github/workflows/new-build-witness-generator-template.yml +++ b/.github/workflows/new-build-witness-generator-template.yml @@ -48,7 +48,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -97,7 +96,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index db90c34618b3..d7b61c611eba 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -35,7 +35,6 @@ jobs: touch .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 7707fa638092..5db9fb8a846d 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -28,7 +28,6 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH - name: init run: | From cd2ebe46341a76842e79f229dd115e0f8d95b4d1 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 15:23:16 +0200 Subject: [PATCH 095/103] fix: keep a bunch of zkstackup in GITHUB_PATH --- .github/workflows/build-local-node-docker.yml | 1 + .github/workflows/new-build-contract-verifier-template.yml | 4 ++++ .github/workflows/new-build-core-template.yml | 6 +++++- .github/workflows/vm-perf-comparison.yml | 1 + .github/workflows/vm-perf-to-prometheus.yml | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 250f7b9808a8..025cd73f3031 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -27,6 +27,7 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 43b16a2b3355..9a8d983cc1e8 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -129,6 +129,10 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres + + - name: Install zkstack + run: | + ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup zkstackup --path ./ || true - name: build contracts diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index dce7bd10e163..4aa7e98e6b5e 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -134,8 +134,12 @@ jobs: run: | mkdir -p ./volumes/postgres docker compose up -d postgres - zkstackup --path ./ || true + - name: Install zkstack + run: | + ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup + zkstackup --path ./ || true + - name: build contracts shell: bash run: | diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index d7b61c611eba..db90c34618b3 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -35,6 +35,7 @@ jobs: touch .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo "SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage" >> .env echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 5db9fb8a846d..e094feb1b83e 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -28,12 +28,12 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH + echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH - name: init run: | run_retried docker compose pull zk docker compose up -d zk - ci_run zkstackup -g --path ./ - name: build contracts From 28f13140093420db814adb1e09f1caf9d8099294 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 15:29:11 +0200 Subject: [PATCH 096/103] feat: configure githooks in zk --- bin/zk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/zk b/bin/zk index 868c4e338cdf..99c95c04461b 100755 --- a/bin/zk +++ b/bin/zk @@ -39,6 +39,12 @@ check_yarn_version() { # and it will be hard for them to see what went wrong. check_subdirectory check_yarn_version + +if which zkstackup >/dev/null; then + git config --local core.hooksPath || + git config --local core.hooksPath ./.githooks +fi + if [ -z "$1" ]; then cd $ZKSYNC_HOME run_retried yarn install --frozen-lockfile && yarn utils build && yarn zk build From 989a0ad27b5cbbd9a8e075802d56cf5b5d85c1b7 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 15:51:39 +0200 Subject: [PATCH 097/103] refactor: minimize use of zkstackup in GITHUB_PATH --- .github/workflows/build-local-node-docker.yml | 7 +++++-- .github/workflows/vm-perf-to-prometheus.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-local-node-docker.yml b/.github/workflows/build-local-node-docker.yml index 025cd73f3031..80142cb6005c 100644 --- a/.github/workflows/build-local-node-docker.yml +++ b/.github/workflows/build-local-node-docker.yml @@ -27,7 +27,6 @@ jobs: echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo CI=1 >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH echo CI=1 >> .env echo IN_DOCKER=1 >> .env @@ -54,6 +53,11 @@ jobs: mkdir -p ./volumes/postgres run_retried docker compose pull zk postgres docker compose up -d zk postgres + + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true + ci_run zkstackup -g - name: init run: | @@ -62,7 +66,6 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts ci_run zk - ci_run zkstackup -g ci_run cp etc/tokens/{test,localhost}.json - name: build contracts diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index e094feb1b83e..204b7b0711ef 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -28,13 +28,16 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> .env echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV echo $(pwd)/bin >> $GITHUB_PATH - echo $(pwd)/zkstack_cli/zkstackup >> $GITHUB_PATH + + - name: Install zkstack + run: | + ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true + ci_run zkstackup -g --path ./ - name: init run: | run_retried docker compose pull zk docker compose up -d zk - ci_run zkstackup -g --path ./ - name: build contracts run: | From 51a85adc68002264356cf47020ea01422b3e548c Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 16:03:50 +0200 Subject: [PATCH 098/103] refactor: configure git hooks in zkstackup --- bin/zk | 5 ----- zkstack_cli/zkstackup/zkstackup | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/zk b/bin/zk index 99c95c04461b..f3b927de8f8e 100755 --- a/bin/zk +++ b/bin/zk @@ -40,11 +40,6 @@ check_yarn_version() { check_subdirectory check_yarn_version -if which zkstackup >/dev/null; then - git config --local core.hooksPath || - git config --local core.hooksPath ./.githooks -fi - if [ -z "$1" ]; then cd $ZKSYNC_HOME run_retried yarn install --frozen-lockfile && yarn utils build && yarn zk build diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 62ddf84e6ad2..3c0d5e9f4dfc 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -125,6 +125,11 @@ install_local() { exit 1 fi + if [ "$ZKSTACKUP_PATH" = "./" ]; then + git config --local core.hooksPath || + git config --local core.hooksPath ./.githooks + fi + if [ -n "$ZKSTACKUP_BRANCH" ] || [ -n "$ZKSTACKUP_COMMIT" ] || [ -n "$ZKSTACKUP_VERSION" ] || [ -n "$ZKSTACKUP_REPO" ]; then warn "Ignoring --repo, --branch, --commit and --version arguments when installing from local path" fi From 5dbb2d2a791a383568fca99b0679cf1104990a1b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 11 Oct 2024 16:16:10 +0200 Subject: [PATCH 099/103] fix: setup hooks only if inside a git repo --- zkstack_cli/zkstackup/zkstackup | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index 3c0d5e9f4dfc..ec8a676fcf90 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -126,8 +126,10 @@ install_local() { fi if [ "$ZKSTACKUP_PATH" = "./" ]; then - git config --local core.hooksPath || - git config --local core.hooksPath ./.githooks + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git config --local core.hooksPath || + git config --local core.hooksPath ./.githooks + fi fi if [ -n "$ZKSTACKUP_BRANCH" ] || [ -n "$ZKSTACKUP_COMMIT" ] || [ -n "$ZKSTACKUP_VERSION" ] || [ -n "$ZKSTACKUP_REPO" ]; then From 211c048e4141a1cd9bc2c44fa64c930d3c930139 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Mon, 14 Oct 2024 10:09:15 +0200 Subject: [PATCH 100/103] docs: add TODO for code that must be removed in a future PR --- .github/workflows/vm-perf-comparison.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index db90c34618b3..083031d66fea 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,8 +49,8 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run zkstackup -g --path ./ - ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts + ci_run zkt || ci_run zkstackup -g --path ./ # TODO remove zkt in an upcoming PR + ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts # TODO remove zk_supervisor in an upcoming PR ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes From 3548fd31719dace466ae4f834145a0abc465088f Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Mon, 14 Oct 2024 10:11:23 +0200 Subject: [PATCH 101/103] fix: restore contracts submodule --- contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts b/contracts index bce4b2d0f34b..aafee035db89 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit bce4b2d0f34bd87f1aaadd291772935afb1c3bd6 +Subproject commit aafee035db892689df3f7afe4b89fd6467a39313 From dfc9349da433f41102f9ef9935f70c55f8e3584d Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Mon, 14 Oct 2024 10:34:18 +0200 Subject: [PATCH 102/103] docs: suggest the use of zkstackup for zkstack installation --- prover/docs/05_proving_batch.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/prover/docs/05_proving_batch.md b/prover/docs/05_proving_batch.md index dd381a4e4f76..c35de975bf71 100644 --- a/prover/docs/05_proving_batch.md +++ b/prover/docs/05_proving_batch.md @@ -23,8 +23,16 @@ Google VM instance, you also need to install [gcloud](https://cloud.google.com/s Now, you can use `zkstack` and `prover_cli` tools for setting up the env and running prover subsystem. -```shell -cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked zkstack prover_cli --force +First, install `zkstackup` with: + +```bash +curl -L https://raw.githubusercontent.com/matter-labs/zksync-era/main/zkstack_cli/zkstackup/install | bash +``` + +Then install the most recent version of `zkstack` with: + +```bash +zkstackup ``` ## Initializing system From c7cbfa5c87ac3ee696ee821ad56da6c7a9f8411b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Mon, 14 Oct 2024 10:53:13 +0200 Subject: [PATCH 103/103] feat: add --local alias for --path ./ --- .github/workflows/build-contract-verifier-template.yml | 2 +- .github/workflows/build-core-template.yml | 2 +- .github/workflows/ci-common-reusable.yml | 2 +- .github/workflows/ci-core-lint-reusable.yml | 2 +- .github/workflows/ci-core-reusable.yml | 6 +++--- .github/workflows/ci-docs-reusable.yml | 2 +- .github/workflows/ci-prover-reusable.yml | 4 ++-- .github/workflows/new-build-contract-verifier-template.yml | 2 +- .github/workflows/new-build-core-template.yml | 2 +- .github/workflows/vm-perf-comparison.yml | 4 ++-- .github/workflows/vm-perf-to-prometheus.yml | 2 +- docker/Makefile | 2 +- zkstack_cli/zkstackup/install | 5 +++++ zkstack_cli/zkstackup/zkstackup | 7 +++++-- 14 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-contract-verifier-template.yml b/.github/workflows/build-contract-verifier-template.yml index 28e8f90dee90..e4d04b90410e 100644 --- a/.github/workflows/build-contract-verifier-template.yml +++ b/.github/workflows/build-contract-verifier-template.yml @@ -119,7 +119,7 @@ jobs: - name: install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: build contracts if: env.BUILD_CONTRACTS == 'true' diff --git a/.github/workflows/build-core-template.yml b/.github/workflows/build-core-template.yml index e88e5a4459bd..33053b6a4000 100644 --- a/.github/workflows/build-core-template.yml +++ b/.github/workflows/build-core-template.yml @@ -132,7 +132,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: build contracts if: env.BUILD_CONTRACTS == 'true' diff --git a/.github/workflows/ci-common-reusable.yml b/.github/workflows/ci-common-reusable.yml index e2c39b848455..7d75fb224d6e 100644 --- a/.github/workflows/ci-common-reusable.yml +++ b/.github/workflows/ci-common-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local # This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo # `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build diff --git a/.github/workflows/ci-core-lint-reusable.yml b/.github/workflows/ci-core-lint-reusable.yml index f11f421b6a52..53b25835ff57 100644 --- a/.github/workflows/ci-core-lint-reusable.yml +++ b/.github/workflows/ci-core-lint-reusable.yml @@ -30,7 +30,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Build run: | diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index a836d4f19b6f..9aaa476d740d 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -60,7 +60,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Build contracts run: | @@ -123,7 +123,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Create and initialize legacy chain @@ -192,7 +192,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Create log directories run: | diff --git a/.github/workflows/ci-docs-reusable.yml b/.github/workflows/ci-docs-reusable.yml index eb485e4b2362..e1a9cf78df7d 100644 --- a/.github/workflows/ci-docs-reusable.yml +++ b/.github/workflows/ci-docs-reusable.yml @@ -30,7 +30,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Build run: | diff --git a/.github/workflows/ci-prover-reusable.yml b/.github/workflows/ci-prover-reusable.yml index 993211565593..6cb9c26d21e7 100644 --- a/.github/workflows/ci-prover-reusable.yml +++ b/.github/workflows/ci-prover-reusable.yml @@ -33,7 +33,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Database setup run: | @@ -72,7 +72,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: Init run: | diff --git a/.github/workflows/new-build-contract-verifier-template.yml b/.github/workflows/new-build-contract-verifier-template.yml index 9a8d983cc1e8..3fc83cc62eb7 100644 --- a/.github/workflows/new-build-contract-verifier-template.yml +++ b/.github/workflows/new-build-contract-verifier-template.yml @@ -133,7 +133,7 @@ jobs: - name: Install zkstack run: | ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup - zkstackup --path ./ || true + zkstackup --local || true - name: build contracts shell: bash diff --git a/.github/workflows/new-build-core-template.yml b/.github/workflows/new-build-core-template.yml index 4aa7e98e6b5e..392acbc9f8f1 100644 --- a/.github/workflows/new-build-core-template.yml +++ b/.github/workflows/new-build-core-template.yml @@ -138,7 +138,7 @@ jobs: - name: Install zkstack run: | ./zkstack_cli/zkstackup/install --path ./zkstack_cli/zkstackup/zkstackup - zkstackup --path ./ || true + zkstackup --local || true - name: build contracts shell: bash diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index 083031d66fea..ccf8f370267d 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -49,7 +49,7 @@ jobs: - name: run benchmarks on base branch shell: bash run: | - ci_run zkt || ci_run zkstackup -g --path ./ # TODO remove zkt in an upcoming PR + ci_run zkt || ci_run zkstackup -g --local # TODO remove zkt in an upcoming PR ci_run zk_supervisor contracts --system-contracts || ci_run zkstack dev contracts --system-contracts # TODO remove zk_supervisor in an upcoming PR ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes @@ -61,7 +61,7 @@ jobs: - name: run benchmarks on PR shell: bash run: | - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local ci_run zkstack dev contracts --system-contracts ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes diff --git a/.github/workflows/vm-perf-to-prometheus.yml b/.github/workflows/vm-perf-to-prometheus.yml index 204b7b0711ef..3a2008e1f8e2 100644 --- a/.github/workflows/vm-perf-to-prometheus.yml +++ b/.github/workflows/vm-perf-to-prometheus.yml @@ -32,7 +32,7 @@ jobs: - name: Install zkstack run: | ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true - ci_run zkstackup -g --path ./ + ci_run zkstackup -g --local - name: init run: | diff --git a/docker/Makefile b/docker/Makefile index 52ac3054c4a7..4e0ca51f904e 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -66,7 +66,7 @@ prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ export PATH=$$PATH:$${ZKSYNC_HOME}/bin:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ - zkstackup -g --path ./ || true && \ + zkstackup -g --local || true && \ zkstack dev contracts && \ mkdir -p contracts/l1-contracts/artifacts diff --git a/zkstack_cli/zkstackup/install b/zkstack_cli/zkstackup/install index f1969694b0f5..f20ba4dd545a 100755 --- a/zkstack_cli/zkstackup/install +++ b/zkstack_cli/zkstackup/install @@ -79,6 +79,9 @@ parse_args() { shift ZKSTACKUP_PATH=$1 ;; + -l | --local) + ZKSTACKUP_PATH="./" + ;; -g | --global) BIN_DIR="/usr/local/bin" BIN_PATH="$BIN_DIR/zkstackup" @@ -106,6 +109,8 @@ Usage: $(basename "$0") [OPTIONS] Options: -p, --path Specify a local path to install zkstackup from. + -l, --local Install zkstackup from the current directory. + -g, --global Install zkstackup for all users. -h, --help Show this help message and exit. Examples: diff --git a/zkstack_cli/zkstackup/zkstackup b/zkstack_cli/zkstackup/zkstackup index ec8a676fcf90..20a061620f9a 100755 --- a/zkstack_cli/zkstackup/zkstackup +++ b/zkstack_cli/zkstackup/zkstackup @@ -60,11 +60,13 @@ parse_args() { shift break ;; - -p | --path) shift ZKSTACKUP_PATH=$1 ;; + -l | --local) + ZKSTACKUP_PATH="./" + ;; -g | --global) LOCAL_DIR="/usr/local" BIN_DIR="$LOCAL_DIR/bin" @@ -107,7 +109,8 @@ Usage: $(basename "$0") [OPTIONS] Options: -p, --path Specify a local path to install ZK Stack CLI from. Ignored if --repo is provided. - -g, --global Install ZK Stack CLI from the current directory. + -l, --local Install ZK Stack CLI from the current directory. Ignored if --repo is provided. + -g, --global Install ZK Stack CLI for all users. -r, --repo GitHub repository to install from (e.g., "matter-labs/zksync-era"). Defaults to "matter-labs/zksync-era". -b, --branch Git branch to use when installing from a repository. Ignored if --commit or --version is provided. -c, --commit Git commit hash to use when installing from a repository. Ignored if --branch or --version is provided.