Skip to content
Closed
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
4 changes: 3 additions & 1 deletion bin/ethlambda/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct CliOptions {
#[arg(long, default_value = "5054")]
metrics_port: u16,
#[arg(long)]
data_dir: PathBuf,
Comment on lines 57 to +58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 No default value for --data-dir is a breaking change

The previous behaviour hardcoded "./data" as the RocksDB path, so existing start scripts and deployments will now fail at startup with a missing-required-argument error from clap because --data-dir is required but has no default.

If backward compatibility is desired, a default of "./data" can be added; alternatively, a more conventional XDG-style default (e.g., ~/.ethlambda/data) could be documented or provided:

Suggested change
#[arg(long)]
data_dir: PathBuf,
#[arg(long, default_value = "./data")]
data_dir: PathBuf,

If the intent is to force explicit configuration (which is also reasonable), consider documenting this as a breaking change in the PR / release notes.

Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/ethlambda/src/main.rs
Line: 57-58

Comment:
**No default value for `--data-dir` is a breaking change**

The previous behaviour hardcoded `"./data"` as the RocksDB path, so existing start scripts and deployments will now fail at startup with a missing-required-argument error from clap because `--data-dir` is required but has no default.

If backward compatibility is desired, a default of `"./data"` can be added; alternatively, a more conventional XDG-style default (e.g., `~/.ethlambda/data`) could be documented or provided:

```suggestion
    #[arg(long, default_value = "./data")]
    data_dir: PathBuf,
```

If the intent is to _force_ explicit configuration (which is also reasonable), consider documenting this as a breaking change in the PR / release notes.

How can I resolve this? If you propose a fix, please make it concise.

#[arg(long)]
node_key: PathBuf,
/// The node ID to look up in annotated_validators.yaml (e.g., "ethlambda_0")
#[arg(long)]
Expand Down Expand Up @@ -130,7 +132,7 @@ async fn main() -> eyre::Result<()> {
let validator_keys =
read_validator_keys(&validators_path, &validator_keys_dir, &options.node_id);

let backend = Arc::new(RocksDBBackend::open("./data").expect("Failed to open RocksDB"));
let backend = Arc::new(RocksDBBackend::open(&options.data_dir).expect("Failed to open RocksDB"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 data_dir not logged at startup

node_key is logged at startup (line 107), but data_dir is not. Logging the resolved data directory path is useful for debugging and confirming the correct directory is in use, especially since it is now user-supplied rather than hardcoded. Consider adding a similar info! log line near the existing node_key log.

Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/ethlambda/src/main.rs
Line: 135

Comment:
**`data_dir` not logged at startup**

`node_key` is logged at startup (line 107), but `data_dir` is not. Logging the resolved data directory path is useful for debugging and confirming the correct directory is in use, especially since it is now user-supplied rather than hardcoded. Consider adding a similar `info!` log line near the existing `node_key` log.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


let store = fetch_initial_state(
options.checkpoint_sync_url.as_deref(),
Expand Down
Loading