add log for committee index on electra attesation (#14993)

* adding log in the case of debugging

* gaz
This commit is contained in:
james-prysm
2025-02-27 12:11:27 -06:00
committed by GitHub
parent bf62afb27c
commit e56f489d06
4 changed files with 14 additions and 0 deletions

View File

@@ -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",
],
)

View File

@@ -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]))
}

View File

@@ -0,0 +1,6 @@
package eth
import "github.com/sirupsen/logrus"
var logger = logrus.StandardLogger()
var log = logger.WithField("prefix", "protobuf")