From 4ff893f61b295e88a94fc169a7342123370e6b55 Mon Sep 17 00:00:00 2001 From: matias-gonz Date: Thu, 18 Jul 2024 17:43:09 +0200 Subject: [PATCH 1/6] Add check_link_to_code --- .../src/commands/ecosystem/create.rs | 31 ++++++++++++++++--- .../crates/zk_inception/src/messages.rs | 8 +++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs index b7fdfee855f6..5da9d2bdf84a 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs @@ -1,4 +1,7 @@ -use std::{path::PathBuf, str::FromStr}; +use std::{ + path::{Path, PathBuf}, + str::FromStr, +}; use anyhow::bail; use common::{git, logger, spinner::Spinner}; @@ -19,10 +22,11 @@ use crate::{ }, }, messages::{ - msg_created_ecosystem, MSG_CLONING_ERA_REPO_SPINNER, MSG_CREATING_DEFAULT_CHAIN_SPINNER, - MSG_CREATING_ECOSYSTEM, MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER, - MSG_ECOSYSTEM_ALREADY_EXISTS_ERR, MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_SELECTED_CONFIG, - MSG_STARTING_CONTAINERS_SPINNER, + msg_created_ecosystem, msg_directory_does_not_contain_cargo_toml_err, + msg_path_to_zksync_does_not_exist_err, MSG_CLONING_ERA_REPO_SPINNER, + MSG_CREATING_DEFAULT_CHAIN_SPINNER, MSG_CREATING_ECOSYSTEM, + MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER, MSG_ECOSYSTEM_ALREADY_EXISTS_ERR, + MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_SELECTED_CONFIG, MSG_STARTING_CONTAINERS_SPINNER, }, }; @@ -62,6 +66,7 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { link_to_code } else { let path = PathBuf::from_str(&args.link_to_code)?; + check_link_to_code(&path)?; git::submodule_update(shell, path.clone())?; path }; @@ -114,3 +119,19 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { logger::outro(msg_created_ecosystem(ecosystem_name)); Ok(()) } + +fn check_link_to_code(path: &Path) -> anyhow::Result<()> { + if !path.exists() { + bail!(msg_path_to_zksync_does_not_exist_err( + path.to_str().unwrap() + )); + } + + if !path.join("Cargo.toml").exists() { + bail!(msg_directory_does_not_contain_cargo_toml_err( + path.to_str().unwrap() + )); + } + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index af40b48e5795..ad67910a56f3 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -37,6 +37,14 @@ pub(super) const MSG_ECOSYSTEM_CONFIG_INVALID_ERR: &str = "Invalid ecosystem con pub(super) const MSG_LINK_TO_CODE_SELECTION_CLONE: &str = "Clone for me (recommended)"; pub(super) const MSG_LINK_TO_CODE_SELECTION_PATH: &str = "I have the code already"; +pub(super) fn msg_path_to_zksync_does_not_exist_err(path: &str) -> String { + format!("Path to ZkSync-era repo does not exist: {path:?}") +} + +pub(super) fn msg_directory_does_not_contain_cargo_toml_err(path: &str) -> String { + format!("Directory does not contain Cargo.toml: {path:?}") +} + /// Ecosystem and chain init related messages pub(super) const MSG_L1_RPC_URL_HELP: &str = "L1 RPC URL"; pub(super) const MSG_GENESIS_ARGS_HELP: &str = "Genesis options"; From e6e5f9e07666882ac2be149460aaf34839f6a3da Mon Sep 17 00:00:00 2001 From: matias-gonz Date: Tue, 23 Jul 2024 13:42:28 +0200 Subject: [PATCH 2/6] Add pick_new_link_to_code --- .../src/commands/ecosystem/create.rs | 48 ++++++++++++++++--- .../crates/zk_inception/src/messages.rs | 3 ++ 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs index 5da9d2bdf84a..24f249ae6a58 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs @@ -4,13 +4,13 @@ use std::{ }; use anyhow::bail; -use common::{git, logger, spinner::Spinner}; +use common::{cmd::Cmd, git, logger, spinner::Spinner, Prompt, PromptConfirm}; use config::{ create_local_configs_dir, create_wallets, get_default_era_chain_id, traits::SaveConfigWithBasePath, EcosystemConfig, EcosystemConfigFromFileError, ZKSYNC_ERA_GIT_REPO, }; -use xshell::Shell; +use xshell::{cmd, Shell}; use crate::{ commands::{ @@ -24,9 +24,10 @@ use crate::{ messages::{ msg_created_ecosystem, msg_directory_does_not_contain_cargo_toml_err, msg_path_to_zksync_does_not_exist_err, MSG_CLONING_ERA_REPO_SPINNER, - MSG_CREATING_DEFAULT_CHAIN_SPINNER, MSG_CREATING_ECOSYSTEM, + MSG_CONFIRM_STILL_USE_FOLDER, MSG_CREATING_DEFAULT_CHAIN_SPINNER, MSG_CREATING_ECOSYSTEM, MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER, MSG_ECOSYSTEM_ALREADY_EXISTS_ERR, - MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_SELECTED_CONFIG, MSG_STARTING_CONTAINERS_SPINNER, + MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_LINK_TO_CODE_PROMPT, MSG_NOT_MAIN_REPO_OR_FORK_ERR, + MSG_SELECTED_CONFIG, MSG_STARTING_CONTAINERS_SPINNER, }, }; @@ -65,8 +66,14 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { spinner.finish(); link_to_code } else { - let path = PathBuf::from_str(&args.link_to_code)?; - check_link_to_code(&path)?; + let mut path = PathBuf::from_str(&args.link_to_code)?; + if let Err(err) = check_link_to_code(shell, &path) { + logger::warn(err); + if !PromptConfirm::new(MSG_CONFIRM_STILL_USE_FOLDER).ask() { + path = pick_new_link_to_code(shell)?; + } + } + git::submodule_update(shell, path.clone())?; path }; @@ -120,7 +127,7 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { Ok(()) } -fn check_link_to_code(path: &Path) -> anyhow::Result<()> { +fn check_link_to_code(shell: &Shell, path: &Path) -> anyhow::Result<()> { if !path.exists() { bail!(msg_path_to_zksync_does_not_exist_err( path.to_str().unwrap() @@ -133,5 +140,32 @@ fn check_link_to_code(path: &Path) -> anyhow::Result<()> { )); } + let _guard = shell.push_dir(path); + let out = String::from_utf8( + Cmd::new(cmd!(shell, "git remote -v")) + .run_with_output()? + .stdout, + )?; + + if !out.contains("matter-labs/zksync-era") { + bail!(MSG_NOT_MAIN_REPO_OR_FORK_ERR); + } + Ok(()) } + +fn pick_new_link_to_code(shell: &Shell) -> anyhow::Result { + let link_to_code: String = Prompt::new(MSG_LINK_TO_CODE_PROMPT).ask(); + let path = PathBuf::from_str(&link_to_code)?; + match check_link_to_code(shell, &path) { + Ok(_) => Ok(path.to_path_buf()), + Err(err) => { + logger::warn(err); + if !PromptConfirm::new(MSG_CONFIRM_STILL_USE_FOLDER).ask() { + pick_new_link_to_code(shell) + } else { + Ok(path.to_path_buf()) + } + } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index ad67910a56f3..5fd0ff632922 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -36,6 +36,9 @@ pub(super) const MSG_ECOSYSTEM_ALREADY_EXISTS_ERR: &str = "Ecosystem already exi pub(super) const MSG_ECOSYSTEM_CONFIG_INVALID_ERR: &str = "Invalid ecosystem configuration"; pub(super) const MSG_LINK_TO_CODE_SELECTION_CLONE: &str = "Clone for me (recommended)"; pub(super) const MSG_LINK_TO_CODE_SELECTION_PATH: &str = "I have the code already"; +pub(super) const MSG_NOT_MAIN_REPO_OR_FORK_ERR: &str = + "Oh no, seems it's not a main repo or a fork"; +pub(super) const MSG_CONFIRM_STILL_USE_FOLDER: &str = "Do you still want to use this folder?"; pub(super) fn msg_path_to_zksync_does_not_exist_err(path: &str) -> String { format!("Path to ZkSync-era repo does not exist: {path:?}") From ac72ac230c781f753c8bf1a7a567c34f0b271679 Mon Sep 17 00:00:00 2001 From: matias-gonz Date: Wed, 24 Jul 2024 13:54:39 +0200 Subject: [PATCH 3/6] Move check_link_to_code --- .../src/commands/ecosystem/args/create.rs | 70 ++++++++++++++++-- .../src/commands/ecosystem/create.rs | 73 +++---------------- 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs index f005a98f6b64..2d491b09af06 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs @@ -1,19 +1,23 @@ -use std::path::PathBuf; +use std::path::{Path, PathBuf}; +use anyhow::bail; use clap::Parser; -use common::{Prompt, PromptConfirm, PromptSelect}; +use common::{cmd::Cmd, logger, Prompt, PromptConfirm, PromptSelect}; use serde::{Deserialize, Serialize}; use slugify_rs::slugify; use strum::IntoEnumIterator; use strum_macros::EnumIter; use types::{L1Network, WalletCreation}; +use xshell::{cmd, Shell}; use crate::{ commands::chain::{args::create::ChainCreateArgs, ChainCreateArgsFinal}, messages::{ - MSG_ECOSYSTEM_NAME_PROMPT, MSG_L1_NETWORK_HELP, MSG_L1_NETWORK_PROMPT, - MSG_LINK_TO_CODE_HELP, MSG_LINK_TO_CODE_PROMPT, MSG_LINK_TO_CODE_SELECTION_CLONE, - MSG_LINK_TO_CODE_SELECTION_PATH, MSG_REPOSITORY_ORIGIN_PROMPT, MSG_START_CONTAINERS_HELP, + msg_directory_does_not_contain_cargo_toml_err, msg_path_to_zksync_does_not_exist_err, + MSG_CONFIRM_STILL_USE_FOLDER, MSG_ECOSYSTEM_NAME_PROMPT, MSG_L1_NETWORK_HELP, + MSG_L1_NETWORK_PROMPT, MSG_LINK_TO_CODE_HELP, MSG_LINK_TO_CODE_PROMPT, + MSG_LINK_TO_CODE_SELECTION_CLONE, MSG_LINK_TO_CODE_SELECTION_PATH, + MSG_NOT_MAIN_REPO_OR_FORK_ERR, MSG_REPOSITORY_ORIGIN_PROMPT, MSG_START_CONTAINERS_HELP, MSG_START_CONTAINERS_PROMPT, }, }; @@ -34,7 +38,7 @@ pub struct EcosystemCreateArgs { } impl EcosystemCreateArgs { - pub fn fill_values_with_prompt(mut self) -> EcosystemCreateArgsFinal { + pub fn fill_values_with_prompt(mut self, shell: &Shell) -> EcosystemCreateArgsFinal { let mut ecosystem_name = self .ecosystem_name .unwrap_or_else(|| Prompt::new(MSG_ECOSYSTEM_NAME_PROMPT).ask()); @@ -45,7 +49,16 @@ impl EcosystemCreateArgs { PromptSelect::new(MSG_REPOSITORY_ORIGIN_PROMPT, LinkToCodeSelection::iter()).ask(); match link_to_code_selection { LinkToCodeSelection::Clone => "".to_string(), - LinkToCodeSelection::Path => Prompt::new(MSG_LINK_TO_CODE_PROMPT).ask(), + LinkToCodeSelection::Path => { + let mut path: String = Prompt::new(MSG_LINK_TO_CODE_PROMPT).ask(); + if let Err(err) = check_link_to_code(shell, &path) { + logger::warn(err); + if !PromptConfirm::new(MSG_CONFIRM_STILL_USE_FOLDER).ask() { + path = pick_new_link_to_code(shell); + } + } + path + } } }); @@ -105,3 +118,46 @@ impl std::fmt::Display for LinkToCodeSelection { } } } + +fn check_link_to_code(shell: &Shell, path: &str) -> anyhow::Result<()> { + let path = Path::new(path); + if !path.exists() { + bail!(msg_path_to_zksync_does_not_exist_err( + path.to_str().unwrap() + )); + } + + if !path.join("Cargo.toml").exists() { + bail!(msg_directory_does_not_contain_cargo_toml_err( + path.to_str().unwrap() + )); + } + + let _guard = shell.push_dir(path); + let out = String::from_utf8( + Cmd::new(cmd!(shell, "git remote -v")) + .run_with_output()? + .stdout, + )?; + + if !out.contains("matter-labs/zksync-era") { + bail!(MSG_NOT_MAIN_REPO_OR_FORK_ERR); + } + + Ok(()) +} + +fn pick_new_link_to_code(shell: &Shell) -> String { + let link_to_code: String = Prompt::new(MSG_LINK_TO_CODE_PROMPT).ask(); + match check_link_to_code(shell, &link_to_code) { + Ok(_) => link_to_code, + Err(err) => { + logger::warn(err); + if !PromptConfirm::new(MSG_CONFIRM_STILL_USE_FOLDER).ask() { + pick_new_link_to_code(shell) + } else { + link_to_code + } + } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs index 24f249ae6a58..30dffad035ab 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs @@ -1,16 +1,13 @@ -use std::{ - path::{Path, PathBuf}, - str::FromStr, -}; +use std::{path::PathBuf, str::FromStr}; use anyhow::bail; -use common::{cmd::Cmd, git, logger, spinner::Spinner, Prompt, PromptConfirm}; +use common::{git, logger, spinner::Spinner}; use config::{ create_local_configs_dir, create_wallets, get_default_era_chain_id, traits::SaveConfigWithBasePath, EcosystemConfig, EcosystemConfigFromFileError, ZKSYNC_ERA_GIT_REPO, }; -use xshell::{cmd, Shell}; +use xshell::Shell; use crate::{ commands::{ @@ -22,12 +19,10 @@ use crate::{ }, }, messages::{ - msg_created_ecosystem, msg_directory_does_not_contain_cargo_toml_err, - msg_path_to_zksync_does_not_exist_err, MSG_CLONING_ERA_REPO_SPINNER, - MSG_CONFIRM_STILL_USE_FOLDER, MSG_CREATING_DEFAULT_CHAIN_SPINNER, MSG_CREATING_ECOSYSTEM, - MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER, MSG_ECOSYSTEM_ALREADY_EXISTS_ERR, - MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_LINK_TO_CODE_PROMPT, MSG_NOT_MAIN_REPO_OR_FORK_ERR, - MSG_SELECTED_CONFIG, MSG_STARTING_CONTAINERS_SPINNER, + msg_created_ecosystem, MSG_CLONING_ERA_REPO_SPINNER, MSG_CREATING_DEFAULT_CHAIN_SPINNER, + MSG_CREATING_ECOSYSTEM, MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER, + MSG_ECOSYSTEM_ALREADY_EXISTS_ERR, MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_SELECTED_CONFIG, + MSG_STARTING_CONTAINERS_SPINNER, }, }; @@ -44,7 +39,7 @@ pub fn run(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { } fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { - let args = args.fill_values_with_prompt(); + let args = args.fill_values_with_prompt(shell); logger::note(MSG_SELECTED_CONFIG, logger::object_to_string(&args)); logger::info(MSG_CREATING_ECOSYSTEM); @@ -66,14 +61,7 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { spinner.finish(); link_to_code } else { - let mut path = PathBuf::from_str(&args.link_to_code)?; - if let Err(err) = check_link_to_code(shell, &path) { - logger::warn(err); - if !PromptConfirm::new(MSG_CONFIRM_STILL_USE_FOLDER).ask() { - path = pick_new_link_to_code(shell)?; - } - } - + let path = PathBuf::from_str(&args.link_to_code)?; git::submodule_update(shell, path.clone())?; path }; @@ -126,46 +114,3 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { logger::outro(msg_created_ecosystem(ecosystem_name)); Ok(()) } - -fn check_link_to_code(shell: &Shell, path: &Path) -> anyhow::Result<()> { - if !path.exists() { - bail!(msg_path_to_zksync_does_not_exist_err( - path.to_str().unwrap() - )); - } - - if !path.join("Cargo.toml").exists() { - bail!(msg_directory_does_not_contain_cargo_toml_err( - path.to_str().unwrap() - )); - } - - let _guard = shell.push_dir(path); - let out = String::from_utf8( - Cmd::new(cmd!(shell, "git remote -v")) - .run_with_output()? - .stdout, - )?; - - if !out.contains("matter-labs/zksync-era") { - bail!(MSG_NOT_MAIN_REPO_OR_FORK_ERR); - } - - Ok(()) -} - -fn pick_new_link_to_code(shell: &Shell) -> anyhow::Result { - let link_to_code: String = Prompt::new(MSG_LINK_TO_CODE_PROMPT).ask(); - let path = PathBuf::from_str(&link_to_code)?; - match check_link_to_code(shell, &path) { - Ok(_) => Ok(path.to_path_buf()), - Err(err) => { - logger::warn(err); - if !PromptConfirm::new(MSG_CONFIRM_STILL_USE_FOLDER).ask() { - pick_new_link_to_code(shell) - } else { - Ok(path.to_path_buf()) - } - } - } -} From aea1316c81b2841e06b4a0c19387b9740488304e Mon Sep 17 00:00:00 2001 From: matias-gonz Date: Wed, 24 Jul 2024 16:11:18 +0200 Subject: [PATCH 4/6] Update messages --- .../src/commands/ecosystem/args/create.rs | 17 +++++------------ zk_toolbox/crates/zk_inception/src/messages.rs | 8 ++------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs index 2d491b09af06..16c5769a663d 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs @@ -13,12 +13,11 @@ use xshell::{cmd, Shell}; use crate::{ commands::chain::{args::create::ChainCreateArgs, ChainCreateArgsFinal}, messages::{ - msg_directory_does_not_contain_cargo_toml_err, msg_path_to_zksync_does_not_exist_err, - MSG_CONFIRM_STILL_USE_FOLDER, MSG_ECOSYSTEM_NAME_PROMPT, MSG_L1_NETWORK_HELP, - MSG_L1_NETWORK_PROMPT, MSG_LINK_TO_CODE_HELP, MSG_LINK_TO_CODE_PROMPT, - MSG_LINK_TO_CODE_SELECTION_CLONE, MSG_LINK_TO_CODE_SELECTION_PATH, - MSG_NOT_MAIN_REPO_OR_FORK_ERR, MSG_REPOSITORY_ORIGIN_PROMPT, MSG_START_CONTAINERS_HELP, - MSG_START_CONTAINERS_PROMPT, + msg_path_to_zksync_does_not_exist_err, MSG_CONFIRM_STILL_USE_FOLDER, + MSG_ECOSYSTEM_NAME_PROMPT, MSG_L1_NETWORK_HELP, MSG_L1_NETWORK_PROMPT, + MSG_LINK_TO_CODE_HELP, MSG_LINK_TO_CODE_PROMPT, MSG_LINK_TO_CODE_SELECTION_CLONE, + MSG_LINK_TO_CODE_SELECTION_PATH, MSG_NOT_MAIN_REPO_OR_FORK_ERR, + MSG_REPOSITORY_ORIGIN_PROMPT, MSG_START_CONTAINERS_HELP, MSG_START_CONTAINERS_PROMPT, }, }; @@ -127,12 +126,6 @@ fn check_link_to_code(shell: &Shell, path: &str) -> anyhow::Result<()> { )); } - if !path.join("Cargo.toml").exists() { - bail!(msg_directory_does_not_contain_cargo_toml_err( - path.to_str().unwrap() - )); - } - let _guard = shell.push_dir(path); let out = String::from_utf8( Cmd::new(cmd!(shell, "git remote -v")) diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index 5fd0ff632922..a33143b4bd66 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -37,15 +37,11 @@ pub(super) const MSG_ECOSYSTEM_CONFIG_INVALID_ERR: &str = "Invalid ecosystem con pub(super) const MSG_LINK_TO_CODE_SELECTION_CLONE: &str = "Clone for me (recommended)"; pub(super) const MSG_LINK_TO_CODE_SELECTION_PATH: &str = "I have the code already"; pub(super) const MSG_NOT_MAIN_REPO_OR_FORK_ERR: &str = - "Oh no, seems it's not a main repo or a fork"; + "It's not a zkSync Era main repository or fork"; pub(super) const MSG_CONFIRM_STILL_USE_FOLDER: &str = "Do you still want to use this folder?"; pub(super) fn msg_path_to_zksync_does_not_exist_err(path: &str) -> String { - format!("Path to ZkSync-era repo does not exist: {path:?}") -} - -pub(super) fn msg_directory_does_not_contain_cargo_toml_err(path: &str) -> String { - format!("Directory does not contain Cargo.toml: {path:?}") + format!("Path to zkSync Era repo does not exist: {path:?}") } /// Ecosystem and chain init related messages From fa2cfaf21d3ae611dbf45bfa531851db6d28e66f Mon Sep 17 00:00:00 2001 From: matias-gonz Date: Wed, 24 Jul 2024 16:45:55 +0200 Subject: [PATCH 5/6] use shell for checking path --- .../crates/zk_inception/src/commands/ecosystem/args/create.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs index 16c5769a663d..d3d5fe129678 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs @@ -120,7 +120,7 @@ impl std::fmt::Display for LinkToCodeSelection { fn check_link_to_code(shell: &Shell, path: &str) -> anyhow::Result<()> { let path = Path::new(path); - if !path.exists() { + if !shell.path_exists(path) { bail!(msg_path_to_zksync_does_not_exist_err( path.to_str().unwrap() )); From b45dd3a68fd667c7a1d69e5d164d562a0494e813 Mon Sep 17 00:00:00 2001 From: matias-gonz Date: Wed, 24 Jul 2024 16:46:19 +0200 Subject: [PATCH 6/6] fmt --- docs/guides/external-node/09_decentralization.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/guides/external-node/09_decentralization.md b/docs/guides/external-node/09_decentralization.md index aa9598a825ca..fa780ba9ff55 100644 --- a/docs/guides/external-node/09_decentralization.md +++ b/docs/guides/external-node/09_decentralization.md @@ -17,11 +17,10 @@ On the gossipnet, the data integrity will be protected by the BFT (byzantine fau > current implementation it may take a couple of hours and gets faster the more nodes you add to the > `gossip_static_outbound` list (see below). We are working to remove this inconvenience. - > [!NOTE] > -> The minimal supported server version for this is [24.11.0](https://github.com/matter-labs/zksync-era/releases/tag/core-v24.11.0) - +> The minimal supported server version for this is +> [24.11.0](https://github.com/matter-labs/zksync-era/releases/tag/core-v24.11.0) ### Generating secrets