-
Notifications
You must be signed in to change notification settings - Fork 15
cli: --data-dir #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: --data-dir #247
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,8 @@ struct CliOptions { | |
| #[arg(long, default_value = "5054")] | ||
| metrics_port: u16, | ||
| #[arg(long)] | ||
| data_dir: PathBuf, | ||
| #[arg(long)] | ||
| node_key: PathBuf, | ||
| /// The node ID to look up in annotated_validators.yaml (e.g., "ethlambda_0") | ||
| #[arg(long)] | ||
|
|
@@ -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")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Prompt To Fix With AIThis 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(), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--data-diris a breaking changeThe 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-diris 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: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