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

add log for committee index on electra attesation #14993

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Feb 26, 2025

What type of PR is this?

Other

What does this PR do? Why is it needed?

electra attestations need to calculate their committee index from the committee bits, this should only be 1 set value, but we should log in the case of this not being true. It would mean this function is called improperly

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

@james-prysm james-prysm added the Electra electra hardfork label Feb 26, 2025
@james-prysm james-prysm requested a review from a team as a code owner February 26, 2025 22:08
@@ -291,6 +291,8 @@ func (a *AttestationElectra) GetCommitteeIndex() primitives.CommitteeIndex {
indices := a.CommitteeBits.BitIndices()
if len(indices) == 0 {
return 0
} else if len(indices) != 1 {
log.WithField("indices", a.CommitteeBits).Debugf("expected 1 committee bit indice got %d", len(indices))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

debug or error more appropriate here?

import "github.com/sirupsen/logrus"

var logger = logrus.StandardLogger()
var log = logger.WithField("prefix", "protobuf")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you think about this prefix?

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

Successfully merging this pull request may close these issues.

1 participant