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

Fix: Log validator index, status and pubkey each epoch #5161

Merged

Conversation

maschad
Copy link
Contributor

@maschad maschad commented Feb 17, 2023

Closes #4785

packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
@maschad maschad changed the title Fix: Log validator index, status and pubkey each epoch (#4785) Fix: Log validator index, status and pubkey each epoch Feb 17, 2023
@maschad maschad marked this pull request as ready for review February 17, 2023 17:10
@maschad maschad requested a review from a team as a code owner February 17, 2023 17:10
@maschad maschad requested a review from nflaig February 17, 2023 17:10
nflaig
nflaig previously approved these changes Feb 17, 2023
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

looks good to me from a technical point of view, I am not really opinionated on how the log message should be displayed. Since this is a UX topic makes sense to get actual user feedback so we might just wanna push this out asap.

@maschad
Copy link
Contributor Author

maschad commented Feb 17, 2023

Would be good to get @g11tech opinion on this about log formatting

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

#4785 says
every epoch, we should log the pubkey count with the validator grouped by status
as lighthouse is doing

I don't think this is doing that. Also don't think this is necessarily the right place to add the log.

@g11tech
Copy link
Contributor

g11tech commented Feb 18, 2023

#4785 says every epoch, we should log the pubkey count with the validator grouped by status as lighthouse is doing

I don't think this is doing that. Also don't think this is necessarily the right place to add the log.

yes #4785 is meant to do as suggested by @wemeetagain 👍

@maschad maschad marked this pull request as draft February 20, 2023 19:26
@maschad maschad requested a review from wemeetagain February 22, 2023 01:47
@maschad maschad marked this pull request as ready for review February 22, 2023 01:47
@maschad maschad marked this pull request as draft February 22, 2023 02:14
@maschad maschad marked this pull request as ready for review February 22, 2023 02:27
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/prepareBeaconProposer.ts Outdated Show resolved Hide resolved
packages/validator/src/services/prepareBeaconProposer.ts Outdated Show resolved Hide resolved
@maschad maschad requested review from nflaig and removed request for wemeetagain February 22, 2023 16:56
@maschad
Copy link
Contributor Author

maschad commented Feb 22, 2023

Thanks for the feedback @nflaig :) made the updates!

@maschad maschad requested review from wemeetagain and removed request for nflaig February 22, 2023 16:56
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

Looks pretty clean now, great refactoring!

packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/indices.ts Outdated Show resolved Hide resolved
packages/validator/src/services/prepareBeaconProposer.ts Outdated Show resolved Hide resolved
@maschad maschad requested review from wemeetagain and nflaig and removed request for wemeetagain and nflaig March 2, 2023 14:30
@nflaig nflaig self-requested a review March 2, 2023 20:20
@maschad maschad force-pushed the fix/log-validator-status-and-pubkey branch from 1dce24b to d8094a4 Compare March 2, 2023 20:30
wemeetagain
wemeetagain previously approved these changes Mar 3, 2023
@maschad maschad requested review from wemeetagain and removed request for nflaig March 3, 2023 16:08
@wemeetagain wemeetagain merged commit 0d638ba into ChainSafe:unstable Mar 3, 2023
@maschad maschad deleted the fix/log-validator-status-and-pubkey branch March 3, 2023 20:01
const pubkeyHex = toHexString(validatorState.validator.pubkey);
if (!this.pubkey2index.has(pubkeyHex)) {
this.logger.debug("Discovered validator", {pubkey: pubkeyHex, index: validatorState.index});
this.logger.info("Validator exists in beacon chain", {
Copy link
Member

Choose a reason for hiding this comment

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

@maschad running this on goerli with quite a lot of validators and this inital log is quite noisy in my opinion, we are printing out Validator exists in beacon chain for each validator which seems bit redundant because these logs all happen after each other.

I think we should reconsider this and maybe only print out Validator exists in beacon chain once and then just list all the validators, with index, pubkey and ideally also fee recipient (if possible)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I've included that change in be5a7e4

@wemeetagain
Copy link
Member

🎉 This PR is included in v1.6.0 🎉

// The total number of validators
const total = pubkeysHex.length;

this.logger.info("Validator statuses", {...statuses, total});
Copy link
Member

@nflaig nflaig Apr 6, 2023

Choose a reason for hiding this comment

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

@maschad wondering here, wasn't this intended to be logged every epoch?

Once we discovered all pubkey we are not calling this due to this check

const pubkeysHexToDiscover = pubkeysHex.filter((pubkey) => !this.pubkey2index.has(pubkey));
if (pubkeysHexToDiscover.length === 0) {
return [];
}

I guess this should be fixed by the other PR #5239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve validator status logging
5 participants