Skip to content

Conversation

@chong-he
Copy link
Member

@chong-he chong-he commented Jul 1, 2025

@chong-he chong-he added val-client Relates to the validator client binary ready-for-review The code is ready for review UX-and-logs labels Jul 1, 2025
@mergify
Copy link

mergify bot commented Jul 1, 2025

Some required checks have failed. Could you please take a look @chong-he? 🙏

@mergify mergify bot 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 Jul 1, 2025
@chong-he chong-he 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 Jul 2, 2025
@mergify
Copy link

mergify bot commented Jul 2, 2025

Some required checks have failed. Could you please take a look @chong-he? 🙏

@mergify mergify bot 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 Jul 2, 2025
@chong-he chong-he 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 Jul 2, 2025
@michaelsproul michaelsproul requested a review from macladson July 10, 2025 05:14
@michaelsproul
Copy link
Member

@macladson would you mind reviewing this? 🙏

// Override the fields in validators.json file if the flag is supplied
for validator in &mut validators {
if let Some(override_fee_recipient) = fee_recipient {
validator.fee_recipient = Some(override_fee_recipient);
Copy link
Member

Choose a reason for hiding this comment

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

We could move the logging inside the for loop? I doubt we need to log anything in the case that validators.len() == 0 and it would consolidate the if lets

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review. I got what you mean.

Previously, before consolidating the if let, the message would be logged whenever the flags (e.g., -suggested-fee-recipient) are used together with lighthouse vm import, even though there are no validators

Now, after moving in the if loop, when there is no validators, the if loop will not be executed, so no message is logged. Makes complete sense

Revise in 6237ab3

@jimmygchen jimmygchen requested a review from macladson January 6, 2026 02:52
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.

This looks pretty good! Just needs some fixes for the logging behaviour

Comment on lines +261 to +263
eprintln!(
"Please note! --suggested-fee-recipient is provided. This will override existing fee recipient defined in validators.json with: {:?}",
override_fee_recipient
Copy link
Member

@macladson macladson Jan 7, 2026

Choose a reason for hiding this comment

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

Ah so as a consequence of moving the logs inside the for loop, this will log a separate instance of each Please note! log for every validator in your validator.json file. So we should either:

  1. Add the validator public key to the log line. This makes it clear that each validator will have the field overridden.
  2. Move the logging outside back outside the for loop but add a conditional that it doesn't run when validators.len() == 0.

I think I'm fine with either, it's just a matter of which we feel is more ergonomic (1 log per validator vs 1 log total for all validators). For 100s of validators, 1 log per validator would likely be too much. But if you had 2 validators, having a reminder that the override will apply to both might be nice

Copy link
Member Author

Choose a reason for hiding this comment

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

I am leaning towards no. 2, I will revise

Copy link
Member Author

@chong-he chong-he Jan 7, 2026

Choose a reason for hiding this comment

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

I added the check if !validators.is_empty() (for validators.len() == 0), but I am thinking that this may not be exactly accurate?

For example, when we import new validators and the VC has no validators, then the logs Please note! ... wouldn't be shown, which is not really the intention. i.e., it's not only about modifying existing validators, it can also be used to modify the fields for newly added validators (including the scenario when the VC has no validators)

@chong-he chong-he requested a review from macladson January 20, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review The code is ready for review UX-and-logs val-client Relates to the validator client binary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants