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): Make chain init independent from ecosystem #3231

Merged
merged 71 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
027bd85
Update CreateChainArgs
matias-gonz Oct 21, 2024
38084c4
lint autocomplete
matias-gonz Oct 31, 2024
cc3082b
generate autocomplete
matias-gonz Oct 31, 2024
86b9a18
lint
matias-gonz Oct 31, 2024
7426f9d
Merge branch 'main' into matias/separate-chain-create
matias-gonz Oct 31, 2024
48c3765
Lint autocomplete
matias-gonz Oct 31, 2024
070e6a8
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Oct 31, 2024
38c02dd
Add link_to_code
matias-gonz Oct 31, 2024
5283211
Add chain path and era_chain_id to CreateChainArgs
matias-gonz Oct 21, 2024
0a890a4
Fix resolve_link_to_code
matias-gonz Oct 23, 2024
9e1d0b9
Add number_of_chains to ChainCreateArgsFinal
matias-gonz Oct 21, 2024
a15b7f2
Fix set_as_default
matias-gonz Oct 23, 2024
9d25c9b
Add l1_network to ChainCreateArgsFinal
matias-gonz Oct 21, 2024
a8d4496
Add evm-emulator arg to ci
matias-gonz Oct 31, 2024
bcd91de
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Oct 31, 2024
b429086
Fix internal_id
matias-gonz Oct 31, 2024
c962182
Merge branch 'main' into matias/separate-chain-create
matias-gonz Nov 5, 2024
01e18f5
lint
matias-gonz Nov 5, 2024
860e6f6
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Nov 5, 2024
d305c83
Update link to code in init_configs
matias-gonz Oct 29, 2024
b4bf47a
Update l1_network in distribute_eth
matias-gonz Oct 29, 2024
89e7eaa
Update l1_network in mint_base_token
matias-gonz Oct 29, 2024
93970f3
Update link_to_code in register_chain
matias-gonz Oct 29, 2024
97a9e19
Update path_to_foundry in register_chain
matias-gonz Oct 29, 2024
3f35ab9
Update path_to_foundry in accept_admin
matias-gonz Oct 29, 2024
187603e
Update path_to_foundry in set_token_multiplier_setter
matias-gonz Oct 29, 2024
4521114
Update link_to_code in deploy_l2_contracts
matias-gonz Oct 29, 2024
b5f4e8d
lint
matias-gonz Nov 5, 2024
e21ec41
Add contracts path placeholder
matias-gonz Nov 6, 2024
0a1a027
Add prompt_ecosystem_contracts_path
matias-gonz Oct 30, 2024
dcb3836
Add ecosystem_contracts_path arg
matias-gonz Nov 6, 2024
b58b8d1
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Nov 7, 2024
26a8bf8
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 7, 2024
72fd941
Reorder functions
matias-gonz Nov 7, 2024
c1793f9
Fix CI
matias-gonz Nov 8, 2024
d3b8eef
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Nov 11, 2024
099c351
Fix internal_id
matias-gonz Nov 11, 2024
3243f96
Make link_to_code accessible from crate only
matias-gonz Nov 11, 2024
2b10f23
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 11, 2024
b55dd6f
fmt
matias-gonz Nov 11, 2024
73711ef
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Nov 13, 2024
3c2d4a0
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 13, 2024
3a65f21
Fix ecosystem_contracts_path
matias-gonz Nov 15, 2024
464bdfa
Remove ecosystem contracts path from ci
matias-gonz Nov 15, 2024
34409c5
Fix prompt when ecosystem exists
matias-gonz Nov 15, 2024
3cea484
lint
matias-gonz Nov 15, 2024
48490c1
Refactor distribute_eth and mint_base_token
matias-gonz Nov 15, 2024
4b83c2a
Add wallets_path to InitArgs
matias-gonz Nov 15, 2024
a42517c
lint
matias-gonz Nov 15, 2024
a43532f
Make wallets_path non optional
matias-gonz Nov 15, 2024
542df91
Add wallets to register_chain
matias-gonz Nov 15, 2024
8fba235
Fix get wallets in register chain
matias-gonz Nov 19, 2024
6a85354
Add era chain id fallback
matias-gonz Nov 19, 2024
f362ccb
Use wallets in deploy_l2_contracts
matias-gonz Nov 19, 2024
e648b68
Add wallets to setup_legacy_bridge
matias-gonz Nov 19, 2024
0b052fd
Remove unwrap
matias-gonz Nov 19, 2024
8daf32d
Fix conflicts
matias-gonz Nov 19, 2024
b7f4cee
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 20, 2024
b2029ba
Re-add creating chain config spinner
matias-gonz Nov 20, 2024
e56f3e8
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 20, 2024
bfbf83d
Fix ecosystem port scanner
matias-gonz Nov 20, 2024
7cd0e82
Fix EcosystemConfig:from_file
matias-gonz Nov 20, 2024
da08ba0
Fix ecosystem_ports
matias-gonz Nov 20, 2024
89e114c
Fix EcosystemConfig:from_file
matias-gonz Nov 20, 2024
f194e18
Update MSG_WALLETS_PATH_PROMPT
matias-gonz Nov 22, 2024
537a33b
Update ecosystem_preexisting_contracts_path
matias-gonz Nov 22, 2024
04f8388
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Nov 25, 2024
8344568
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 25, 2024
8e2f29f
Merge branch 'matias/refactor-chain-commands' of github.com:matter-la…
matias-gonz Nov 26, 2024
f4d9886
Merge branch 'matias/separate-chain-create' of github.com:matter-labs…
matias-gonz Nov 26, 2024
e1069be
refactor(zkstack): Preload chain and ecosystem config before each cha…
matias-gonz Nov 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: 5 additions & 1 deletion zkstack_cli/crates/config/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
FileConfigWithDefaultName, ReadConfig, ReadConfigWithBasePath, SaveConfig,
SaveConfigWithBasePath, ZkStackConfig,
},
utils::find_file,
utils::{find_file, get_preexisting_ecosystem_contracts_path},
ContractsConfig, EcosystemConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig,
};

Expand Down Expand Up @@ -151,6 +151,10 @@ impl ChainConfig {
config.save_with_base_path(shell, path)
}

pub fn get_preexisting_ecosystem_contracts_path(&self) -> PathBuf {
get_preexisting_ecosystem_contracts_path(&self.link_to_code, self.l1_network)
}

fn get_internal(&self) -> ChainConfigInternal {
ChainConfigInternal {
id: self.id,
Expand Down
4 changes: 2 additions & 2 deletions zkstack_cli/crates/config/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub(crate) const LOCAL_APPS_PATH: &str = "apps/";
pub(crate) const LOCAL_CHAINS_PATH: &str = "chains/";
pub(crate) const LOCAL_CONFIGS_PATH: &str = "configs/";
pub(crate) const LOCAL_GENERATED_PATH: &str = ".generated/";
pub(crate) const LOCAL_DB_PATH: &str = "db/";
pub(crate) const LOCAL_ARTIFACTS_PATH: &str = "artifacts/";
pub const LOCAL_DB_PATH: &str = "db/";
pub const LOCAL_ARTIFACTS_PATH: &str = "artifacts/";

/// Name of apps config file
pub const APPS_CONFIG_FILE: &str = "apps.yaml";
Expand Down
34 changes: 24 additions & 10 deletions zkstack_cli/crates/config/src/ecosystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ use zksync_basic_types::L2ChainId;

use crate::{
consts::{
CONFIGS_PATH, CONFIG_NAME, CONTRACTS_FILE, ECOSYSTEM_PATH, ERA_CHAIN_ID,
ERC20_CONFIGS_FILE, ERC20_DEPLOYMENT_FILE, INITIAL_DEPLOYMENT_FILE, L1_CONTRACTS_FOUNDRY,
LOCAL_ARTIFACTS_PATH, LOCAL_DB_PATH, WALLETS_FILE,
CONFIGS_PATH, CONFIG_NAME, CONTRACTS_FILE, ERA_CHAIN_ID, ERC20_CONFIGS_FILE,
ERC20_DEPLOYMENT_FILE, INITIAL_DEPLOYMENT_FILE, L1_CONTRACTS_FOUNDRY, LOCAL_ARTIFACTS_PATH,
LOCAL_DB_PATH, WALLETS_FILE,
},
create_localhost_wallets,
forge_interface::deploy_ecosystem::{
input::{Erc20DeploymentConfig, InitialDeploymentConfig},
output::{ERC20Tokens, Erc20Token},
},
traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, ZkStackConfig},
utils::find_file,
utils::{find_file, get_preexisting_ecosystem_contracts_path},
ChainConfig, ChainConfigInternal, ContractsConfig, WalletsConfig,
};

Expand Down Expand Up @@ -123,16 +123,22 @@ impl EcosystemConfig {
// with chain and we will find the ecosystem config somewhere in parent directories
let chain_config = ChainConfigInternal::read(shell, CONFIG_NAME)
.map_err(|err| EcosystemConfigFromFileError::InvalidConfig { source: err })?;
logger::info(format!("You are in a directory with chain config, default chain for execution has changed to {}", &chain_config.name));

let current_dir = shell.current_dir();
let Some(parent) = current_dir.parent() else {
return Err(EcosystemConfigFromFileError::NotExists { path });
};
// Try to find ecosystem somewhere in parent directories
shell.change_dir(parent);
let mut ecosystem_config = EcosystemConfig::from_file(shell)?;
let mut ecosystem_config = match EcosystemConfig::from_file(shell) {
Ok(ecosystem) => ecosystem,
Err(err) => {
shell.change_dir(&current_dir);
return Err(err);
}
};
// change the default chain for using it in later executions
logger::info(format!("You are in a directory with chain config, default chain for execution has changed to {}", &chain_config.name));
ecosystem_config.default_chain = chain_config.name;
ecosystem_config
}
Expand Down Expand Up @@ -197,7 +203,7 @@ impl EcosystemConfig {
}

pub fn get_wallets(&self) -> anyhow::Result<WalletsConfig> {
let path = self.config.join(WALLETS_FILE);
let path = self.get_wallets_path();
if self.get_shell().path_exists(&path) {
return WalletsConfig::read(self.get_shell(), &path);
}
Expand All @@ -211,7 +217,7 @@ impl EcosystemConfig {
}

pub fn get_contracts_config(&self) -> anyhow::Result<ContractsConfig> {
ContractsConfig::read(self.get_shell(), self.config.join(CONTRACTS_FILE))
ContractsConfig::read(self.get_shell(), self.get_contracts_path())
}

pub fn path_to_foundry(&self) -> PathBuf {
Expand Down Expand Up @@ -242,8 +248,8 @@ impl EcosystemConfig {
}

/// Path to the predefined ecosystem configs
pub fn get_preexisting_configs_path(&self) -> PathBuf {
self.link_to_code.join(ECOSYSTEM_PATH)
pub fn get_preexisting_ecosystem_contracts_path(&self) -> PathBuf {
get_preexisting_ecosystem_contracts_path(&self.link_to_code, self.l1_network)
}

pub fn get_chain_rocks_db_path(&self, chain_name: &str) -> PathBuf {
Expand Down Expand Up @@ -272,6 +278,14 @@ impl EcosystemConfig {
wallet_creation: self.wallet_creation,
}
}

pub fn get_contracts_path(&self) -> PathBuf {
self.config.join(CONTRACTS_FILE)
}

pub fn get_wallets_path(&self) -> PathBuf {
self.config.join(WALLETS_FILE)
}
}

/// Result of checking if the ecosystem exists.
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub use zksync_protobuf_config::{encode_yaml_repr, read_yaml_repr};

mod apps;
mod chain;
mod consts;
mod contracts;
mod ecosystem;
mod file_config;
Expand All @@ -28,6 +27,7 @@ mod wallets;

pub mod consensus_config;
pub mod consensus_secrets;
pub mod consts;
pub mod docker_compose;
pub mod explorer;
pub mod explorer_compose;
Expand Down
14 changes: 13 additions & 1 deletion zkstack_cli/crates/config/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use std::path::PathBuf;
use std::path::{Path, PathBuf};

use types::L1Network;
use xshell::Shell;

use crate::ECOSYSTEM_PATH;

// Find file in all parents repository and return necessary path or an empty error if nothing has been found
pub fn find_file(shell: &Shell, path_buf: PathBuf, file_name: &str) -> Result<PathBuf, ()> {
let _dir = shell.push_dir(path_buf);
Expand All @@ -15,3 +18,12 @@ pub fn find_file(shell: &Shell, path_buf: PathBuf, file_name: &str) -> Result<Pa
find_file(shell, path.to_path_buf(), file_name)
}
}

pub fn get_preexisting_ecosystem_contracts_path(
link_to_code: &Path,
l1_network: L1Network,
) -> PathBuf {
link_to_code
.join(ECOSYSTEM_PATH)
.join(format!("{}.yaml", l1_network.to_string().to_lowercase()))
}
5 changes: 5 additions & 0 deletions zkstack_cli/crates/zkstack/completion/_zkstack.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ in-file\:"Specify file with wallets"))' \
'--base-token-price-denominator=[Base token denominator]:BASE_TOKEN_PRICE_DENOMINATOR:_default' \
'--set-as-default=[Set as default chain]' \
'--evm-emulator=[Enable EVM emulator]' \
'--l1-network=[L1 Network]:L1_NETWORK:(localhost sepolia holesky mainnet)' \
'--start-containers=[Start reth and postgres containers after creation]' \
'--chain=[Chain to use]:CHAIN:_default' \
'--legacy-bridge[]' \
Expand Down Expand Up @@ -243,6 +244,7 @@ in-file\:"Specify file with wallets"))' \
'--base-token-price-denominator=[Base token denominator]:BASE_TOKEN_PRICE_DENOMINATOR:_default' \
'--set-as-default=[Set as default chain]' \
'--evm-emulator=[Enable EVM emulator]' \
'--l1-network=[L1 Network]:L1_NETWORK:(localhost sepolia holesky mainnet)' \
'--chain=[Chain to use]:CHAIN:_default' \
'--legacy-bridge[]' \
'-v[Verbose mode]' \
Expand Down Expand Up @@ -284,6 +286,8 @@ _arguments "${_arguments_options[@]}" : \
'--server-db-name=[Server database name]:SERVER_DB_NAME:_default' \
'--deploy-paymaster=[]' \
'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL:_default' \
'--ecosystem-contracts-path=[Ecosystem contracts path]:ECOSYSTEM_CONTRACTS_PATH:_default' \
'--wallets-path=[Wallets path]:WALLETS_PATH:_default' \
'--chain=[Chain to use]:CHAIN:_default' \
'--resume[]' \
'-d[]' \
Expand All @@ -310,6 +314,7 @@ _arguments "${_arguments_options[@]}" : \
'--server-db-url=[Server database url without database name]:SERVER_DB_URL:_default' \
'--server-db-name=[Server database name]:SERVER_DB_NAME:_default' \
'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL:_default' \
'--ecosystem-contracts-path=[Ecosystem contracts path]:ECOSYSTEM_CONTRACTS_PATH:_default' \
'--chain=[Chain to use]:CHAIN:_default' \
'-d[Use default database urls and names]' \
'--dev[Use default database urls and names]' \
Expand Down
4 changes: 4 additions & 0 deletions zkstack_cli/crates/zkstack/completion/zkstack.fish
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_se
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l base-token-price-denominator -d 'Base token denominator' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l set-as-default -d 'Set as default chain' -r -f -a "{true\t'',false\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l evm-emulator -d 'Enable EVM emulator' -r -f -a "{true\t'',false\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l l1-network -d 'L1 Network' -r -f -a "{localhost\t'',sepolia\t'',holesky\t'',mainnet\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l start-containers -d 'Start reth and postgres containers after creation' -r -f -a "{true\t'',false\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l chain -d 'Chain to use' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from create" -l legacy-bridge
Expand Down Expand Up @@ -159,6 +160,7 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_s
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l base-token-price-denominator -d 'Base token denominator' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l set-as-default -d 'Set as default chain' -r -f -a "{true\t'',false\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l evm-emulator -d 'Enable EVM emulator' -r -f -a "{true\t'',false\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l l1-network -d 'L1 Network' -r -f -a "{localhost\t'',sepolia\t'',holesky\t'',mainnet\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l chain -d 'Chain to use' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -l legacy-bridge
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from create" -s v -l verbose -d 'Verbose mode'
Expand All @@ -185,6 +187,8 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_s
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l server-db-name -d 'Server database name' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l deploy-paymaster -r -f -a "{true\t'',false\t''}"
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l l1-rpc-url -d 'L1 RPC URL' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l ecosystem-contracts-path -d 'Ecosystem contracts path' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l wallets-path -d 'Wallets path' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l resume
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -s d -l dont-drop
Expand Down
28 changes: 24 additions & 4 deletions zkstack_cli/crates/zkstack/completion/zkstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ _zkstack() {
return 0
;;
zkstack__chain__create)
opts="-v -h --chain-name --chain-id --prover-mode --wallet-creation --wallet-path --l1-batch-commit-data-generator-mode --base-token-address --base-token-price-nominator --base-token-price-denominator --set-as-default --legacy-bridge --evm-emulator --verbose --chain --ignore-prerequisites --help"
opts="-v -h --chain-name --chain-id --prover-mode --wallet-creation --wallet-path --l1-batch-commit-data-generator-mode --base-token-address --base-token-price-nominator --base-token-price-denominator --set-as-default --legacy-bridge --evm-emulator --l1-network --verbose --chain --ignore-prerequisites --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down Expand Up @@ -1713,6 +1713,10 @@ _zkstack() {
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
return 0
;;
--l1-network)
COMPREPLY=($(compgen -W "localhost sepolia holesky mainnet" -- "${cur}"))
return 0
;;
--chain)
COMPREPLY=($(compgen -f "${cur}"))
return 0
Expand Down Expand Up @@ -2551,7 +2555,7 @@ _zkstack() {
return 0
;;
zkstack__chain__init)
opts="-a -d -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --server-db-url --server-db-name --dont-drop --deploy-paymaster --l1-rpc-url --no-port-reallocation --dev --verbose --chain --ignore-prerequisites --help configs help"
opts="-a -d -v -h --verify --verifier --verifier-url --verifier-api-key --resume --additional-args --server-db-url --server-db-name --dont-drop --deploy-paymaster --l1-rpc-url --no-port-reallocation --ecosystem-contracts-path --wallets-path --dev --verbose --chain --ignore-prerequisites --help configs help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down Expand Up @@ -2597,6 +2601,14 @@ _zkstack() {
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--ecosystem-contracts-path)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--wallets-path)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--chain)
COMPREPLY=($(compgen -f "${cur}"))
return 0
Expand All @@ -2609,7 +2621,7 @@ _zkstack() {
return 0
;;
zkstack__chain__init__configs)
opts="-d -d -v -h --server-db-url --server-db-name --dev --dont-drop --l1-rpc-url --no-port-reallocation --verbose --chain --ignore-prerequisites --help"
opts="-d -d -v -h --server-db-url --server-db-name --dev --dont-drop --l1-rpc-url --no-port-reallocation --ecosystem-contracts-path --verbose --chain --ignore-prerequisites --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand All @@ -2627,6 +2639,10 @@ _zkstack() {
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--ecosystem-contracts-path)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--chain)
COMPREPLY=($(compgen -f "${cur}"))
return 0
Expand Down Expand Up @@ -5305,7 +5321,7 @@ _zkstack() {
return 0
;;
zkstack__ecosystem__create)
opts="-v -h --ecosystem-name --l1-network --link-to-code --chain-name --chain-id --prover-mode --wallet-creation --wallet-path --l1-batch-commit-data-generator-mode --base-token-address --base-token-price-nominator --base-token-price-denominator --set-as-default --legacy-bridge --evm-emulator --start-containers --verbose --chain --ignore-prerequisites --help"
opts="-v -h --ecosystem-name --l1-network --link-to-code --chain-name --chain-id --prover-mode --wallet-creation --wallet-path --l1-batch-commit-data-generator-mode --base-token-address --base-token-price-nominator --base-token-price-denominator --set-as-default --legacy-bridge --evm-emulator --l1-network --start-containers --verbose --chain --ignore-prerequisites --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down Expand Up @@ -5381,6 +5397,10 @@ _zkstack() {
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
return 0
;;
--l1-network)
COMPREPLY=($(compgen -W "localhost sepolia holesky mainnet" -- "${cur}"))
return 0
;;
--start-containers)
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
return 0
Expand Down
7 changes: 4 additions & 3 deletions zkstack_cli/crates/zkstack/src/accept_ownership.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::Path;

use common::{
forge::{Forge, ForgeScript, ForgeScriptArgs},
spinner::Spinner,
Expand Down Expand Up @@ -26,7 +28,7 @@ lazy_static! {

pub async fn accept_admin(
shell: &Shell,
ecosystem_config: &EcosystemConfig,
foundry_contracts_path: &Path,
admin: Address,
governor: &Wallet,
target_address: Address,
Expand All @@ -42,8 +44,7 @@ pub async fn accept_admin(
let calldata = ACCEPT_ADMIN
.encode("chainAdminAcceptAdmin", (admin, target_address))
.unwrap();
let foundry_contracts_path = ecosystem_config.path_to_foundry();
let forge = Forge::new(&foundry_contracts_path)
let forge = Forge::new(foundry_contracts_path)
.script(
&ACCEPT_GOVERNANCE_SCRIPT_PARAMS.script(),
forge_args.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> {
let spinner = Spinner::new(MSG_ACCEPTING_ADMIN_SPINNER);
accept_admin(
shell,
&ecosystem_config,
&chain_config.path_to_foundry(),
contracts.l1.chain_admin_addr,
&chain_config.get_wallets_config()?.governor,
contracts.l1.diamond_proxy_addr,
Expand Down
Loading
Loading