Skip to content

Conversation

@eserilev
Copy link
Member

Issue Addressed

Partially #5900

Proposed Changes

Migrate account-manager to clap derive

@eserilev eserilev mentioned this pull request Oct 16, 2024
8 tasks
@eserilev eserilev added the ready-for-review The code is ready for review label Oct 16, 2024
Copy link
Member

@macladson macladson left a comment

Choose a reason for hiding this comment

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

I think this PR needs some of the same love from #6300 since lighthouse am --help also doesn't work.

@macladson macladson added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 26, 2024
@jxs jxs mentioned this pull request Dec 18, 2024
@eserilev eserilev added the v7.0.0-beta.0 New release c. Q1 2025 label Jan 16, 2025
@eserilev eserilev added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jan 16, 2025
@michaelsproul michaelsproul added v7.1.0 Post-Electra release and removed v7.0.0-beta.0 New release c. Q1 2025 labels Feb 6, 2025
@mergify
Copy link

mergify bot commented Feb 6, 2025

This pull request has merge conflicts. Could you please resolve them @eserilev? 🙏

@eserilev
Copy link
Member Author

this one should be g2g for another review

Copy link
Member

@macladson macladson left a comment

Choose a reason for hiding this comment

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

Will leave a more thorough review soon, but noticed some comments that need updating

@mergify
Copy link

mergify bot commented Apr 24, 2025

This pull request has merge conflicts. Could you please resolve them @eserilev? 🙏

@eserilev
Copy link
Member Author

eserilev commented Jun 22, 2025

hi @chong-he could i bug you to review this PR when you get the chance :)

@eserilev eserilev added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jun 22, 2025
@chong-he
Copy link
Member

chong-he commented Jun 23, 2025

hi @chong-he could i bug you to review this PR when you get the chance :)

I wouldn't say I am capable to review this PR now, but I am happy to do some testing on this, will post if anything.

Thanks!

@eserilev eserilev removed the v7.1.0 Post-Electra release label Jun 24, 2025
@chong-he
Copy link
Member

chong-he commented Jul 3, 2025

After chatting with @michaelsproul , I am going to give reviewing this PR a try

Copy link
Member

@chong-he chong-he left a comment

Choose a reason for hiding this comment

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

Edit: after a closer look, I think the logging of No logfile path provided, logging to file is disabled is actually a feature, not a bug. It is telling users that logging to file is disabled, and it can be enabled with --logfile-dir to save all logs to a file. Please ignore the comments below

Looks pretty good overall. There is just this thing that I found:

For commands in lighthouse am, for example, when we run: lighthouse account wallet create --name test, this first line is printed when it shouldn't (unless --logfile-dir is specified):

No logfile path provided, logging to file is disabled
Running account manager for mainnet network
wallet-dir path: "/home/ck/.lighthouse/mainnet/wallets"

It's from here:

let file_logging_layer = match config.path {
None => {
eprintln!("No logfile path provided, logging to file is disabled");
None
}

This looks like is because from here:

let mut log_path: Option<PathBuf> = clap_utils::parse_optional(matches, "logfile-dir")?;
if log_path.is_none() {
log_path = match matches.subcommand() {
Some(("beacon_node", _)) => Some(
parse_path_or_default(matches, "datadir")?
.join(DEFAULT_BEACON_NODE_DIR)
.join("logs"),
),
Some(("validator_client", vc_matches)) => {
let base_path = if vc_matches.contains_id("validators-dir") {
parse_path_or_default(vc_matches, "validators-dir")?
} else {
parse_path_or_default(matches, "datadir")?.join(DEFAULT_VALIDATOR_DIR)
};
Some(base_path.join("logs"))
}
_ => None,
};
}

where account_manager falls into the None arm of the match automatically. We can add an if condition in the logging in lighthouse/lighthouse/environment/src/lib.rs to only print it for some subcommands, but that sounds a bit of a hack. I am sure you have a better solution for this.

I think logfile-dir for account_manager is not really relevant, so would be nice to not have that line printed (current lighthouse db also have this line printed)

Comment on lines +47 to +48
help = "Use the wallet identified by this name"
)]
Copy link
Member

Choose a reason for hiding this comment

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

Currently the flags are not sorted alphabetically. We can add display_order = 0 to make it sorted, as in the validator client and database cli files.

Suggested change
help = "Use the wallet identified by this name"
)]
help = "Use the wallet identified by this name",
display_order = 0
)]

This applies to all flags in the cli.rs file

}

/// If `path` is `Some`, return it, else return the default path
pub fn parse_path_with_default_in_home_dir_v2(
Copy link
Member

Choose a reason for hiding this comment

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

Small nit pick, would be good to put this after the function parse_path_with_default_in_home_dir for consistency

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Aug 18, 2025
@mergify mergify bot closed this Sep 17, 2025
@mergify
Copy link

mergify bot commented Sep 17, 2025

Hi @eserilev, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@mergify mergify bot added the stale Stale PRs that have been inactive and is now outdated label Sep 17, 2025
@eserilev eserilev reopened this Sep 17, 2025
@mergify mergify bot closed this Oct 17, 2025
@mergify
Copy link

mergify bot commented Oct 17, 2025

Hi @eserilev, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@mergify
Copy link

mergify bot commented Nov 30, 2025

Hi @eserilev, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@mergify mergify bot closed this Nov 30, 2025
@macladson macladson reopened this Nov 30, 2025
@mergify mergify bot closed this Dec 30, 2025
@mergify
Copy link

mergify bot commented Dec 30, 2025

Hi @eserilev, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@chong-he chong-he reopened this Jan 2, 2026
Copy link
Member

@macladson macladson left a comment

Choose a reason for hiding this comment

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

I'll be dedicating some cycles soon to getting the existing clap PRs merged as I'm keen to see these happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality stale Stale PRs that have been inactive and is now outdated waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants