fix(zkstack_cli): Prevent duplicate repo clones in ecosystem create #4058 #4442
+1
−8
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-era
repository from being cloned multiple times during thezkstack ecosystem create
command.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_inner
function. It callsresolve_link_to_code
to find the genesis config but passesbase_path
set to the new chains directory. Iflink-to-code
is not set, it would clonezksync-era
into 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_code
and use&ecosystem_config.link_to_code
becauseresolve_link_to_code
is redundant: An ecosystem and specificallylink_to_code
always 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_code
is used.Is this a breaking change?
Operational changes
Checklist
zkstack dev fmt
andzkstack dev lint
.