Skip to content
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

Migrate validator client to clap derive #6300

Open
wants to merge 37 commits into
base: unstable
Choose a base branch
from

Conversation

eserilev
Copy link
Collaborator

@eserilev eserilev commented Aug 23, 2024

Issue Addressed

Partially #5900

Proposed Changes

Migrate the validator client cli to clap derive

@eserilev eserilev changed the title Migrate validator manager to clap derive Migrate validator client to clap derive Aug 23, 2024
Comment on lines +270 to +275
if validator_client_config.web3_signer_keep_alive_timeout == 0 {
config.web3_signer_keep_alive_timeout = None
} else {
config.web3_signer_keep_alive_timeout = Some(Duration::from_millis(
validator_client_config.web3_signer_keep_alive_timeout,
));
Copy link
Collaborator Author

@eserilev eserilev Aug 23, 2024

Choose a reason for hiding this comment

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

Note the breaking change here. Since I've defined web3_signer_keep_alive_timeout as a u64, null is no longer a valid option. Users will need to use 0 instead.

If this breaking change is too intrusive I can define web3_signer_keep_alive_timeout as a string and we can keep functionality as is.

@eserilev eserilev mentioned this pull request Aug 23, 2024
8 tasks
@eserilev eserilev marked this pull request as ready for review August 23, 2024 02:50
@eserilev eserilev added the ready-for-review The code is ready for review label Aug 23, 2024
@eserilev eserilev added work-in-progress PR is a work-in-progress and removed ready-for-review The code is ready for review labels Aug 23, 2024
@eserilev eserilev added ready-for-review The code is ready for review work-in-progress PR is a work-in-progress and removed work-in-progress PR is a work-in-progress ready-for-review The code is ready for review labels Sep 3, 2024
@eserilev eserilev added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels 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.

Pretty keen to get the clap derive migrations merged!

Will give it a more thorough review once the conflicts are fixed.

validator_client/src/cli.rs Outdated Show resolved Hide resolved
validator_client/src/cli.rs Show resolved Hide resolved
@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 18, 2024
@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 Oct 24, 2024
@@ -430,7 +437,7 @@ fn no_doppelganger_protection_flag() {
fn no_gas_limit_flag() {
CommandLineTest::new()
.run()
.with_config(|config| assert!(config.gas_limit.is_none()));
.with_config(|config| assert!(config.gas_limit == Some(30_000_000)));
Copy link
Member

Choose a reason for hiding this comment

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

Is there a functional difference between None and 30_000_000 here? Might be worth now renaming this test to gas_limit_flag_default to better match the naming scheme.

validator_client_config.enable_doppelganger_protection;
config.builder_proposals = validator_client_config.builder_proposals;
config.prefer_builder_proposals = validator_client_config.prefer_builder_proposals;
config.gas_limit = Some(validator_client_config.gas_limit);
Copy link
Member

Choose a reason for hiding this comment

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

If gas limit now defaults to Some, can we remove the Option altogether?

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.

Looks like some asserts in the tests need to be updated to match.

@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 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality 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.

2 participants