Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zk_toolbox): Add update command #2440

Merged
merged 40 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e5011d1
Add update command
matias-gonz Jul 16, 2024
da3be62
Add merge_yaml
matias-gonz Jul 18, 2024
6e729e9
Add save_updated_config
matias-gonz Jul 18, 2024
53fe0d5
Fix diff
matias-gonz Jul 18, 2024
ee9c4eb
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 19, 2024
bd18341
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 23, 2024
29213c2
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 24, 2024
67a86f6
Update all chains
matias-gonz Jul 24, 2024
eb7da9f
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 24, 2024
e13a204
Update name
matias-gonz Jul 24, 2024
fe4564b
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 24, 2024
dbf7528
Merge branch 'matias-zk-toolbox-update' of github.com:matter-labs/zks…
matias-gonz Jul 24, 2024
0573e91
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 25, 2024
263d17b
Merge branch 'matias-zk-toolbox-update' of github.com:matter-labs/zks…
matias-gonz Jul 25, 2024
6d3ca5e
Use shell instead of std
matias-gonz Jul 25, 2024
5178d9c
Make constants public
matias-gonz Jul 25, 2024
bf47f8b
Add check_diff for genesis config
matias-gonz Jul 25, 2024
33795be
Add Diff.print()
matias-gonz Jul 25, 2024
0ac6ff3
Add warnings for contracts and secrets
matias-gonz Jul 25, 2024
a18b204
Add update external node config
matias-gonz Jul 25, 2024
1f87c95
Add update_config
matias-gonz Jul 26, 2024
e6ab62c
Add merge_yaml tests
matias-gonz Jul 26, 2024
3e98763
Add test
matias-gonz Jul 26, 2024
4223adc
Add parent keys to diff
matias-gonz Jul 26, 2024
923de1a
Merge branch 'main' of github.com:matter-labs/zksync-era into matias-…
matias-gonz Jul 26, 2024
f7f55b0
Update ConfigDiff
matias-gonz Jul 26, 2024
4b3330c
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 26, 2024
507d22d
Refactor merge_yaml
matias-gonz Jul 26, 2024
7ef4d35
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 26, 2024
48186f5
Update path_to_external_node_config
matias-gonz Jul 26, 2024
255bf65
Merge branch 'matias-zk-toolbox-update' of github.com:matter-labs/zks…
matias-gonz Jul 26, 2024
55e3c95
Update GeneralConfig.print
matias-gonz Jul 26, 2024
74b6fad
add general
Deniallugo Jul 26, 2024
9b87baf
Update
Deniallugo Jul 26, 2024
c01e4df
Use git pull from origin branch
Deniallugo Jul 26, 2024
7207656
Add only-config argument
matias-gonz Jul 26, 2024
5fd4e6e
Add support for EN general config
matias-gonz Jul 26, 2024
f822a94
Merge branch 'main' into matias-zk-toolbox-update
matias-gonz Jul 26, 2024
73a2ce4
Merge pull request #2514 from matter-labs/deniallugo-tests
matias-gonz Jul 26, 2024
cf633e7
Lint
matias-gonz Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions zk_toolbox/crates/common/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ pub fn submodule_update(shell: &Shell, link_to_code: PathBuf) -> anyhow::Result<
.run()?;
Ok(())
}

pub fn pull(shell: &Shell, link_to_code: PathBuf) -> anyhow::Result<()> {
let _dir_guard = shell.push_dir(link_to_code);
Cmd::new(cmd!(shell, "git pull")).run()?;
Ok(())
}
16 changes: 15 additions & 1 deletion zk_toolbox/crates/config/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
},
create_localhost_wallets,
traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, SaveConfigWithBasePath},
ContractsConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig,
ContractsConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, EN_CONFIG_FILE,
};

/// Chain configuration file. This file is created in the chain
Expand Down Expand Up @@ -104,6 +104,20 @@ impl ChainConfig {
self.configs.join(GENERAL_FILE)
}

pub fn path_to_external_node_config(&self) -> PathBuf {
self.external_node_config_path
.clone()
.unwrap_or_else(|| self.configs.join(EN_CONFIG_FILE))
}

pub fn path_to_genesis_config(&self) -> PathBuf {
self.configs.join(GENESIS_FILE)
}

pub fn path_to_contracts_config(&self) -> PathBuf {
self.configs.join(CONTRACTS_FILE)
}

pub fn path_to_secrets_config(&self) -> PathBuf {
self.configs.join(SECRETS_FILE)
}
Expand Down
12 changes: 6 additions & 6 deletions zk_toolbox/crates/config/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ use types::ChainId;
/// Name of the main configuration file
pub(crate) const CONFIG_NAME: &str = "ZkStack.yaml";
/// Name of the wallets file
pub(crate) const WALLETS_FILE: &str = "wallets.yaml";
pub const WALLETS_FILE: &str = "wallets.yaml";
/// Name of the secrets config file
pub(crate) const SECRETS_FILE: &str = "secrets.yaml";
pub const SECRETS_FILE: &str = "secrets.yaml";
/// Name of the general config file
pub(crate) const GENERAL_FILE: &str = "general.yaml";
pub const GENERAL_FILE: &str = "general.yaml";
/// Name of the genesis config file
pub(crate) const GENESIS_FILE: &str = "genesis.yaml";
pub const GENESIS_FILE: &str = "genesis.yaml";

// Name of external node specific config
pub(crate) const EN_CONFIG_FILE: &str = "external_node.yaml";
pub const EN_CONFIG_FILE: &str = "external_node.yaml";
pub(crate) const ERC20_CONFIGS_FILE: &str = "erc20.yaml";
/// Name of the initial deployments config file
pub(crate) const INITIAL_DEPLOYMENT_FILE: &str = "initial_deployments.yaml";
/// Name of the erc20 deployments config file
pub(crate) const ERC20_DEPLOYMENT_FILE: &str = "erc20_deployments.yaml";
/// Name of the contracts file
pub(crate) const CONTRACTS_FILE: &str = "contracts.yaml";
pub const CONTRACTS_FILE: &str = "contracts.yaml";
/// Main repository for the ZKsync project
pub const ZKSYNC_ERA_GIT_REPO: &str = "https://github.com/matter-labs/zksync-era";
/// Name of the docker-compose file inside zksync repository
Expand Down
2 changes: 1 addition & 1 deletion zk_toolbox/crates/config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub use chain::*;
pub use consts::{DOCKER_COMPOSE_FILE, ZKSYNC_ERA_GIT_REPO};
pub use consts::*;
pub use contracts::*;
pub use ecosystem::*;
pub use file_config::*;
Expand Down
1 change: 1 addition & 0 deletions zk_toolbox/crates/zk_inception/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ pub mod ecosystem;
pub mod external_node;
pub mod prover;
pub mod server;
pub mod update;
Loading
Loading