From 1e2303fee8307277a64d381ada7361e0d7f46d39 Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Mon, 15 Dec 2025 20:37:06 +0100 Subject: [PATCH] EVM Node: Add support for `--network` to `download kernel` * What The `download kernel` command has been updated to accept the `--network` argument. This enhancement enables the command to utilize the default, per-network preimages endpoint configuration when the user does not explicitly supply the `--preimages-endpoint` flag. * Why This change improves the user experience by removing the need to manually look up and specify preimage endpoint URLs for standard networks. By simply specifying the network (e.g., mainnet, testnet), the tool can automatically fall back to the correct infrastructure settings, reducing the likelihood of configuration errors. * How The argument parsing logic in `etherlink/bin_node/main.ml` is updated to include `supported_network_arg` within the `preemptive_kernel_download_command`. The retrieved network parameter is then propagated to the configuration setup. Additionally, the changelog is updated to document this new CLI feature, and the regression test expectations for the command's manual page are adjusted to reflect the presence of the new flag. --- etherlink/CHANGES_NODE.md | 10 ++++++---- etherlink/bin_node/main.ml | 9 ++++++--- .../tests/expected/evm_sequencer.ml/EVM Node- man.out | 4 ++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/etherlink/CHANGES_NODE.md b/etherlink/CHANGES_NODE.md index 9e044249d61b..c1222c412c29 100644 --- a/etherlink/CHANGES_NODE.md +++ b/etherlink/CHANGES_NODE.md @@ -15,10 +15,12 @@ - Add a collection of command to inspect the contents of an Etherlink instance durable storage: `shell cat PATH` to print the contents stored under the given `PATH`, `shell ls PATH` to list the subdirectories living under `PATH`, - and `shell` to start a REPL allowing users to use `ls` and `cat` - interactively. See `man shell` for more information. (!20183) -- Add the `tree` command to the REPL to inspect Etherlink instance - durable storage. (!20221) + `shell tree` to list contents stored living under `PATH` directories in a + tree-like format, and `shell` to start a REPL allowing users to use `ls` and + `cat` interactively. See `man shell` for more information. (!20183 !20221) +- Adds support for `--network` to `download kernel` to fallback to default + per-network preimages endpoint when `--preimages-endpoint` is omitted. + (!20241) ### Execution changes diff --git a/etherlink/bin_node/main.ml b/etherlink/bin_node/main.ml index 02b33c4ddb27..d1c370350352 100644 --- a/etherlink/bin_node/main.ml +++ b/etherlink/bin_node/main.ml @@ -3600,12 +3600,13 @@ let preemptive_kernel_download_command = command ~group:Groups.kernel ~desc:"Preemptively download a kernel before running the EVM node." - (args5 + (args6 data_dir_arg config_path_arg preimages_arg preimages_endpoint_arg - num_download_retries) + num_download_retries + (supported_network_arg ())) (prefixes ["download"; "kernel"] @@ param ~name:"kernel-id" @@ -3631,7 +3632,8 @@ let preemptive_kernel_download_command = config_file, preimages, preimages_endpoint, - num_download_retries ) + num_download_retries, + network ) root_hash () -> @@ -3644,6 +3646,7 @@ let preemptive_kernel_download_command = ~data_dir ?preimages ?preimages_endpoint + ?network config_file in let*! () = init_logs ~daily_logs:false configuration in diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out index 72d5b832081a..2f3f52dff8c6 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out @@ -943,6 +943,7 @@ Kernel commands: download kernel [--data-dir ] [--config-file ] [--preimages-dir <_evm_installer_preimages>] [--preimages-endpoint ] [--retry <1>] + [--network ] Preemptively download a kernel before running the EVM node. : Either a root hash of the kernel to download, or the name of a supported kernel ("bifrost", "calypso", "calypso2", "dionysus", "dionysus-r1", "ebisu" or @@ -960,6 +961,9 @@ Kernel commands: --retry <1>: Number of times a revealed preimage can be redownloaded in case the it doesn't pass the sanity check. It can be useful if the download is corrupted for some reason. + --network : The network the EVM node will be connecting to. Can be `mainnet`, + `testnet` or `shadownet`. + If set, defaults to the value of the environment variable `$EVM_NODE_NETWORK`. Debug commands: -- GitLab