Skip to content

Commit 80f5f21

Browse files
conacheMegaRedHand
andauthored
feat!: align flag names with lean-quickstart spec (lambdaclass#321)
## Summary Closes lambdaclass#287. Aligns CLI flags with the [lean-quickstart spec](https://github.com/blockblaz/lean-quickstart/blob/main/docs/adding-a-new-client.md#required-cli-flags-your-client-must-support). **Removed:** - `--custom-network-config-dir` **Added:** | Flag | Maps to | |---|---| | `--genesis` | `config.yaml` | | `--validators` | `annotated_validators.yaml` | | `--bootnodes` | `nodes.yaml` | | `--validator-config` | `validator-config.yaml` | | `--hash-sig-keys-dir` | `hash-sig-keys/` | `--genesis`, `--validators`, and `--bootnodes` are mandated by the spec. `--validator-config` and `--hash-sig-keys-dir` cover ethlambda-internal paths that the spec doesn't standardize. ## Coordination Coordinated lean-quickstart PR: lambdaclass#321. ## Testing To verify the new flags locally: 1. Build the binary from this branch: ```bash cargo build --release ``` 2. Inspect --help and confirm the new flags appear: ```bash ./target/release/ethlambda --help ``` - Flags that should be listed as part of the change: `--genesis`, `--validators`, `--bootnodes`, `--validator-config`, and `--hash-sig-keys-dir` - `--custom-network-config-dir` should no longer be present --- To boot the binary from the `lean-quickstart` repository: 1. Checkout the [ethlambda-update-cmd-flags](https://github.com/conache/lean-quickstart/tree/ethlambda-update-cmd-flags) branch associated with [the lean-quickstart PR](lambdaclass#321). 2. Run `NETWORK_DIR=local-devnet ./spin-node.sh --node ethlambda_0 --generateGenesis` The binary parses succesfully parses all five flags. #### Important note: > Unrelated to this PR; worth flagging as a separate issue if not already tracked. Local-devnet boot panics after parsing the CLI flags with the following error (confirmed it reproduces identically on `main`): ```bash thread 'main' (13480983) panicked at bin/ethlambda/src/main.rs:136:47: Failed to parse config.yaml: Error("GENESIS_VALIDATORS[0]: invalid type: string \"...", expected struct GenesisValidatorEntry", line: 12, column: 7) ``` --------- Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
1 parent 97e4c1b commit 80f5f21

5 files changed

Lines changed: 60 additions & 19 deletions

File tree

.claude/skills/devnet-runner/references/long-lived-devnet.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,47 @@ done
5353
docker run -d --restart unless-stopped --name ethlambda_0 --network host \
5454
-v $GENESIS:/config -v $DATA/ethlambda_0:/data \
5555
$IMAGE \
56-
--custom-network-config-dir /config \
56+
--genesis /config/config.yaml \
57+
--validators /config/annotated_validators.yaml \
58+
--bootnodes /config/nodes.yaml \
59+
--validator-config /config/validator-config.yaml \
60+
--hash-sig-keys-dir /config/hash-sig-keys \
5761
--gossipsub-port 9001 --node-id ethlambda_0 \
5862
--node-key /config/ethlambda_0.key \
5963
--http-address 0.0.0.0 --api-port 5052 --metrics-port 8081
6064

6165
docker run -d --restart unless-stopped --name ethlambda_1 --network host \
6266
-v $GENESIS:/config -v $DATA/ethlambda_1:/data \
6367
$IMAGE \
64-
--custom-network-config-dir /config \
68+
--genesis /config/config.yaml \
69+
--validators /config/annotated_validators.yaml \
70+
--bootnodes /config/nodes.yaml \
71+
--validator-config /config/validator-config.yaml \
72+
--hash-sig-keys-dir /config/hash-sig-keys \
6573
--gossipsub-port 9002 --node-id ethlambda_1 \
6674
--node-key /config/ethlambda_1.key \
6775
--http-address 0.0.0.0 --api-port 5053 --metrics-port 8082
6876

6977
docker run -d --restart unless-stopped --name ethlambda_2 --network host \
7078
-v $GENESIS:/config -v $DATA/ethlambda_2:/data \
7179
$IMAGE \
72-
--custom-network-config-dir /config \
80+
--genesis /config/config.yaml \
81+
--validators /config/annotated_validators.yaml \
82+
--bootnodes /config/nodes.yaml \
83+
--validator-config /config/validator-config.yaml \
84+
--hash-sig-keys-dir /config/hash-sig-keys \
7385
--gossipsub-port 9003 --node-id ethlambda_2 \
7486
--node-key /config/ethlambda_2.key \
7587
--http-address 0.0.0.0 --api-port 5054 --metrics-port 8083
7688

7789
docker run -d --restart unless-stopped --name ethlambda_3 --network host \
7890
-v $GENESIS:/config -v $DATA/ethlambda_3:/data \
7991
$IMAGE \
80-
--custom-network-config-dir /config \
92+
--genesis /config/config.yaml \
93+
--validators /config/annotated_validators.yaml \
94+
--bootnodes /config/nodes.yaml \
95+
--validator-config /config/validator-config.yaml \
96+
--hash-sig-keys-dir /config/hash-sig-keys \
8197
--gossipsub-port 9004 --node-id ethlambda_3 \
8298
--node-key /config/ethlambda_3.key \
8399
--is-aggregator \
@@ -141,7 +157,11 @@ sleep 60
141157
docker run -d --restart unless-stopped --name ethlambda_0 --network host \
142158
-v $GENESIS:/config -v $DATA/ethlambda_0:/data \
143159
$NEW_IMAGE \
144-
--custom-network-config-dir /config \
160+
--genesis /config/config.yaml \
161+
--validators /config/annotated_validators.yaml \
162+
--bootnodes /config/nodes.yaml \
163+
--validator-config /config/validator-config.yaml \
164+
--hash-sig-keys-dir /config/hash-sig-keys \
145165
--gossipsub-port 9001 --node-id ethlambda_0 \
146166
--node-key /config/ethlambda_0.key \
147167
--http-address 0.0.0.0 --api-port 5052 --metrics-port 8081 \

bin/ethlambda/src/main.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,21 @@ const ASCII_ART: &str = r#"
4848
#[derive(Debug, clap::Parser)]
4949
#[command(name = "ethlambda", author = "LambdaClass", version = version::CLIENT_VERSION, about = "ethlambda consensus client")]
5050
struct CliOptions {
51+
/// Path to the chain genesis config (e.g., config.yaml).
5152
#[arg(long)]
52-
custom_network_config_dir: PathBuf,
53+
genesis: PathBuf,
54+
/// Path to the validator registry (e.g., annotated_validators.yaml).
55+
#[arg(long)]
56+
validators: PathBuf,
57+
/// Path to the bootnode list (e.g., nodes.yaml).
58+
#[arg(long)]
59+
bootnodes: PathBuf,
60+
/// Path to validator-config.yaml (validator name registry for metrics labels).
61+
#[arg(long)]
62+
validator_config: PathBuf,
63+
/// Directory containing per-validator XMSS keys (e.g., hash-sig-keys/).
64+
#[arg(long)]
65+
hash_sig_keys_dir: PathBuf,
5366
#[arg(long, default_value = "9000")]
5467
gossipsub_port: u16,
5568
#[arg(long, default_value = "127.0.0.1")]
@@ -141,15 +154,11 @@ async fn main() -> eyre::Result<()> {
141154

142155
info!(node_key=?options.node_key, "got node key");
143156

144-
let config_path = options.custom_network_config_dir.join("config.yaml");
145-
let bootnodes_path = options.custom_network_config_dir.join("nodes.yaml");
146-
let validators_path = options
147-
.custom_network_config_dir
148-
.join("annotated_validators.yaml");
149-
let validator_config = options
150-
.custom_network_config_dir
151-
.join("validator-config.yaml");
152-
let validator_keys_dir = options.custom_network_config_dir.join("hash-sig-keys");
157+
let config_path = options.genesis;
158+
let bootnodes_path = options.bootnodes;
159+
let validators_path = options.validators;
160+
let validator_config = options.validator_config;
161+
let validator_keys_dir = options.hash_sig_keys_dir;
153162

154163
let config_yaml = std::fs::read_to_string(&config_path).expect("Failed to read config.yaml");
155164
let genesis_config: GenesisConfig =

docs/checkpoint_sync.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ Checkpoint sync allows a new consensus node to skip replaying the entire chain f
66

77
## Usage
88

9-
Checkpoint sync still requires a full network config directory (`--custom-network-config-dir`). The genesis config is needed to verify the downloaded state: checkpoint sync only replaces the starting state, not node configuration.
9+
Checkpoint sync still requires the network config files (genesis, validators, bootnodes, etc.). The genesis config is needed to verify the downloaded state: checkpoint sync only replaces the starting state, not node configuration.
1010

1111
Pass the `--checkpoint-sync-url` flag when starting ethlambda:
1212

1313
```bash
1414
ethlambda \
1515
--checkpoint-sync-url <URL> \
16-
--custom-network-config-dir ./network-config \
16+
--genesis ./network-config/config.yaml \
17+
--validators ./network-config/annotated_validators.yaml \
18+
--bootnodes ./network-config/nodes.yaml \
19+
--validator-config ./network-config/validator-config.yaml \
20+
--hash-sig-keys-dir ./network-config/hash-sig-keys \
1721
--node-key ./node.key \
1822
--node-id ethlambda_0
1923
```

docs/fork_choice_visualization.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ The local devnet runs 3 ethlambda nodes with metrics ports 8085, 8086, and 8087.
2929

3030
```bash
3131
cargo run --release -- \
32-
--custom-network-config-dir ./config \
32+
--genesis ./config/config.yaml \
33+
--validators ./config/annotated_validators.yaml \
34+
--bootnodes ./config/nodes.yaml \
35+
--validator-config ./config/validator-config.yaml \
36+
--hash-sig-keys-dir ./config/hash-sig-keys \
3337
--node-key ./keys/node.key \
3438
--node-id 0 \
3539
--api-port 5052

preview-config.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ let
9090
WorkingDirectory = "${dataDir}/${name}";
9191
ExecStart = builtins.concatStringsSep " " ([
9292
binaryPath
93-
"--custom-network-config-dir" genesisDir
93+
"--genesis" "${genesisDir}/config.yaml"
94+
"--validators" "${genesisDir}/annotated_validators.yaml"
95+
"--bootnodes" "${genesisDir}/nodes.yaml"
96+
"--validator-config" "${genesisDir}/validator-config.yaml"
97+
"--hash-sig-keys-dir" "${genesisDir}/hash-sig-keys"
9498
"--gossipsub-port" (toString gossipPort)
9599
"--node-id" name
96100
"--node-key" "${genesisDir}/${name}.key"

0 commit comments

Comments
 (0)