Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions .claude/skills/devnet-runner/references/long-lived-devnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,47 @@ done
docker run -d --restart unless-stopped --name ethlambda_0 --network host \
-v $GENESIS:/config -v $DATA/ethlambda_0:/data \
$IMAGE \
--custom-network-config-dir /config \
--genesis /config/config.yaml \
--validators /config/annotated_validators.yaml \
--bootnodes /config/nodes.yaml \
--validator-config /config/validator-config.yaml \
--hash-sig-keys-dir /config/hash-sig-keys \
--gossipsub-port 9001 --node-id ethlambda_0 \
--node-key /config/ethlambda_0.key \
--http-address 0.0.0.0 --api-port 5052 --metrics-port 8081

docker run -d --restart unless-stopped --name ethlambda_1 --network host \
-v $GENESIS:/config -v $DATA/ethlambda_1:/data \
$IMAGE \
--custom-network-config-dir /config \
--genesis /config/config.yaml \
--validators /config/annotated_validators.yaml \
--bootnodes /config/nodes.yaml \
--validator-config /config/validator-config.yaml \
--hash-sig-keys-dir /config/hash-sig-keys \
--gossipsub-port 9002 --node-id ethlambda_1 \
--node-key /config/ethlambda_1.key \
--http-address 0.0.0.0 --api-port 5053 --metrics-port 8082

docker run -d --restart unless-stopped --name ethlambda_2 --network host \
-v $GENESIS:/config -v $DATA/ethlambda_2:/data \
$IMAGE \
--custom-network-config-dir /config \
--genesis /config/config.yaml \
--validators /config/annotated_validators.yaml \
--bootnodes /config/nodes.yaml \
--validator-config /config/validator-config.yaml \
--hash-sig-keys-dir /config/hash-sig-keys \
--gossipsub-port 9003 --node-id ethlambda_2 \
--node-key /config/ethlambda_2.key \
--http-address 0.0.0.0 --api-port 5054 --metrics-port 8083

docker run -d --restart unless-stopped --name ethlambda_3 --network host \
-v $GENESIS:/config -v $DATA/ethlambda_3:/data \
$IMAGE \
--custom-network-config-dir /config \
--genesis /config/config.yaml \
--validators /config/annotated_validators.yaml \
--bootnodes /config/nodes.yaml \
--validator-config /config/validator-config.yaml \
--hash-sig-keys-dir /config/hash-sig-keys \
--gossipsub-port 9004 --node-id ethlambda_3 \
--node-key /config/ethlambda_3.key \
--is-aggregator \
Expand Down Expand Up @@ -141,7 +157,11 @@ sleep 60
docker run -d --restart unless-stopped --name ethlambda_0 --network host \
-v $GENESIS:/config -v $DATA/ethlambda_0:/data \
$NEW_IMAGE \
--custom-network-config-dir /config \
--genesis /config/config.yaml \
--validators /config/annotated_validators.yaml \
--bootnodes /config/nodes.yaml \
--validator-config /config/validator-config.yaml \
--hash-sig-keys-dir /config/hash-sig-keys \
--gossipsub-port 9001 --node-id ethlambda_0 \
--node-key /config/ethlambda_0.key \
--http-address 0.0.0.0 --api-port 5052 --metrics-port 8081 \
Expand Down
29 changes: 19 additions & 10 deletions bin/ethlambda/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,21 @@ const ASCII_ART: &str = r#"
#[derive(Debug, clap::Parser)]
#[command(name = "ethlambda", author = "LambdaClass", version = version::CLIENT_VERSION, about = "ethlambda consensus client")]
struct CliOptions {
/// Path to the chain genesis config (e.g., config.yaml).
#[arg(long)]
custom_network_config_dir: PathBuf,
genesis: PathBuf,
/// Path to the validator registry (e.g., annotated_validators.yaml).
#[arg(long)]
validators: PathBuf,
/// Path to the bootnode list (e.g., nodes.yaml).
#[arg(long)]
bootnodes: PathBuf,
/// Path to validator-config.yaml (validator name registry for metrics labels).
#[arg(long)]
validator_config: PathBuf,
/// Directory containing per-validator XMSS keys (e.g., hash-sig-keys/).
#[arg(long)]
hash_sig_keys_dir: PathBuf,
#[arg(long, default_value = "9000")]
gossipsub_port: u16,
#[arg(long, default_value = "127.0.0.1")]
Expand Down Expand Up @@ -121,15 +134,11 @@ async fn main() -> eyre::Result<()> {

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

let config_path = options.custom_network_config_dir.join("config.yaml");
let bootnodes_path = options.custom_network_config_dir.join("nodes.yaml");
let validators_path = options
.custom_network_config_dir
.join("annotated_validators.yaml");
let validator_config = options
.custom_network_config_dir
.join("validator-config.yaml");
let validator_keys_dir = options.custom_network_config_dir.join("hash-sig-keys");
let config_path = options.genesis;
let bootnodes_path = options.bootnodes;
let validators_path = options.validators;
let validator_config = options.validator_config;
let validator_keys_dir = options.hash_sig_keys_dir;

let config_yaml = std::fs::read_to_string(&config_path).expect("Failed to read config.yaml");
let genesis_config: GenesisConfig =
Expand Down
8 changes: 6 additions & 2 deletions docs/checkpoint_sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ Checkpoint sync allows a new consensus node to skip replaying the entire chain f

## Usage

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.
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.

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

```bash
ethlambda \
--checkpoint-sync-url <URL> \
--custom-network-config-dir ./network-config \
--genesis ./network-config/config.yaml \
--validators ./network-config/annotated_validators.yaml \
--bootnodes ./network-config/nodes.yaml \
--validator-config ./network-config/validator-config.yaml \
--hash-sig-keys-dir ./network-config/hash-sig-keys \
--node-key ./node.key \
--node-id ethlambda_0
```
Expand Down
6 changes: 5 additions & 1 deletion docs/fork_choice_visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ The local devnet runs 3 ethlambda nodes with metrics ports 8085, 8086, and 8087.

```bash
cargo run --release -- \
--custom-network-config-dir ./config \
--genesis ./config/config.yaml \
--validators ./config/annotated_validators.yaml \
--bootnodes ./config/nodes.yaml \
--validator-config ./config/validator-config.yaml \
--hash-sig-keys-dir ./config/hash-sig-keys \
--node-key ./keys/node.key \
--node-id 0 \
--api-port 5052
Expand Down
6 changes: 5 additions & 1 deletion preview-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ let
WorkingDirectory = "${dataDir}/${name}";
ExecStart = builtins.concatStringsSep " " ([
binaryPath
"--custom-network-config-dir" genesisDir
"--genesis" "${genesisDir}/config.yaml"
"--validators" "${genesisDir}/annotated_validators.yaml"
"--bootnodes" "${genesisDir}/nodes.yaml"
"--validator-config" "${genesisDir}/validator-config.yaml"
"--hash-sig-keys-dir" "${genesisDir}/hash-sig-keys"
"--gossipsub-port" (toString gossipPort)
"--node-id" name
"--node-key" "${genesisDir}/${name}.key"
Expand Down