matter-labs / zksync-era

zkSync era
Apache License 2.0
3.07k stars 2.06k forks source link

Allow to run zk_inception chain create non-interactively to select l1 network #2585

Closed fyInALT closed 2 days ago

fyInALT commented 1 month ago

🌟 Feature Request

📝 Description

Note in https://github.com/matter-labs/zksync-era/pull/2579, it allow to run zk_inception chain create non-interactively, but we notice when run:

$ZKSYNC_HOME/zk_toolbox/target/release/zk_inception ecosystem create \
    -v --ecosystem-name testsepolia2 \
    --chain-id 71271 \
    --l1-batch-commit-data-generator-mode rollup \
    --start-containers false \
    --link-to-code $ZKSYNC_HOME \
    --chain-name testchain3 \
    --wallet-creation random \
    --prover-mode no-proofs \
    --l1-network sepolia \
    --base-token-address 0x0000000000000000000000000000000000000001 \
    --base-token-price-nominator 1 \
    --base-token-price-denominator 1

We had use --l1-network sepolia, but it will show:

...
Docker Compose version v2.29.1
⚙  Command completed: docker compose version
│  
◇  Select the L1 network
│  Sepolia 
│
◇  Selected config ────────────────────────────────────────────────╮
...

In https://github.com/matter-labs/zksync-era/blob/main/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs#L68 :

        let link_to_code = self.link_to_code.unwrap_or_else(|| {
            // ...
        });

        let l1_network = PromptSelect::new(MSG_L1_NETWORK_PROMPT, L1Network::iter()).ask();

The code not check if l1_network is have values, so the cmd is not non-interactively.

🤔 Rationale

It can allow to run zk_inception chain create non-interactively and create custom chains within CI integration tests.

📋 Additional Context

EmilLuta commented 1 month ago

cc: @Deniallugo, @zk-Lumi

sanekmelnikov commented 2 days ago

Thank you! This one was fixed: https://github.com/matter-labs/zksync-era/blob/main/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs#L68-L70