diff --git a/changelog/james-prysm_committee-index-log.md b/changelog/james-prysm_committee-index-log.md new file mode 100644 index 0000000000..9624a88316 --- /dev/null +++ b/changelog/james-prysm_committee-index-log.md @@ -0,0 +1,3 @@ +### Added + +- add log to committee index when committeebits are not the expected length of 1 \ No newline at end of file diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 309f0e8d38..231268880e 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -333,6 +333,7 @@ go_library( srcs = [ "attestation.go", "beacon_block.go", + "log.go", "cloners.go", "eip_7521.go", "sync_committee_mainnet.go", @@ -373,6 +374,8 @@ go_library( "@org_golang_google_protobuf//runtime/protoimpl:go_default_library", "@org_golang_google_protobuf//types/descriptorpb:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", + "@com_github_sirupsen_logrus//hooks/test:go_default_library", ], ) diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index 493595d5a3..99f7698d00 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -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)) } return primitives.CommitteeIndex(uint64(indices[0])) } diff --git a/proto/prysm/v1alpha1/log.go b/proto/prysm/v1alpha1/log.go new file mode 100644 index 0000000000..bce408e97f --- /dev/null +++ b/proto/prysm/v1alpha1/log.go @@ -0,0 +1,6 @@ +package eth + +import "github.com/sirupsen/logrus" + +var logger = logrus.StandardLogger() +var log = logger.WithField("prefix", "protobuf")