fix(zkstack_cli): Prevent duplicate repo clones in ecosystem create #4058 #4442
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What ❔
This PR prevents the
zksync-erarepository from being cloned multiple times during thezkstack ecosystem createcommand.Why ❔
When running zkstack ecosystem create with default options, the command would download two copies of the zksync-era repository instead of one. This is a bug.
The root cause is in the
create_chain_innerfunction. It callsresolve_link_to_codeto find the genesis config but passesbase_pathset to the new chains directory. Iflink-to-codeis not set, it would clonezksync-erainto the chains path since the path of the newly cloned zksync-era in the root folder of the ecosystem is not passed down.I propose to remove
resolve_link_to_codeand use&ecosystem_config.link_to_codebecauseresolve_link_to_codeis redundant: An ecosystem and specificallylink_to_codealways needs to be set before a chain can be created. ItsThis approach is consistent with other parts of the function that already useecosystem_config(1, 2).This fix should also fix genesis config related issues as the config from the correct zksync-era version at
link_to_codeis used.Is this a breaking change?
Operational changes
Checklist
zkstack dev fmtandzkstack dev lint.