updating log to print tracked validators size

This commit is contained in:
james-prysm
2024-10-21 15:23:28 -05:00
parent 073cf19b69
commit f11d80456c
2 changed files with 10 additions and 2 deletions

View File

@@ -47,3 +47,9 @@ func (t *TrackedValidatorsCache) Validating() bool {
defer t.Unlock()
return len(t.trackedValidators) > 0
}
func (t *TrackedValidatorsCache) Size() int {
t.Lock()
defer t.Unlock()
return len(t.trackedValidators)
}

View File

@@ -404,7 +404,7 @@ func (vs *Server) PrepareBeaconProposer(
_ context.Context, request *ethpb.PrepareBeaconProposerRequest,
) (*emptypb.Empty, error) {
var validatorIndices []primitives.ValidatorIndex
beforeCacheSize := vs.TrackedValidatorsCache.Size()
for _, r := range request.Recipients {
recipient := hexutil.Encode(r.FeeRecipient)
if !common.IsHexAddress(recipient) {
@@ -428,7 +428,9 @@ func (vs *Server) PrepareBeaconProposer(
}
if len(validatorIndices) != 0 {
log.WithFields(logrus.Fields{
"validatorCount": len(validatorIndices),
"validatorCount": len(validatorIndices),
"previousTotalTrackedValidators": beforeCacheSize,
"totalTrackedValidators": vs.TrackedValidatorsCache.Size(),
}).Debug("Updated fee recipient addresses for validator indices")
}
return &emptypb.Empty{}, nil