From 921263848adb65922078ea7e11a50ba0e2f80715 Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Thu, 23 Apr 2020 21:57:36 -0400 Subject: [PATCH] Fix activationEpoch=FarFutureEpoch in validator client logging (#5608) * Handle pending case where activation epoch is FarFuture * Fix logs for validators pending activation * Reword pending activation log --- validator/client/validator.go | 13 +++++++++---- validator/client/validator_test.go | 14 +++++++++++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index 146d6995086a..3eb02746a755 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -252,10 +252,15 @@ func (v *validator) checkAndLogValidatorStatus(validatorStatuses []*ethpb.Valida ).Info("Deposit processed, entering activation queue after finalization") } case ethpb.ValidatorStatus_PENDING: - log.WithFields(logrus.Fields{ - "positionInActivationQueue": status.Status.PositionInActivationQueue, - "activationEpoch": status.Status.ActivationEpoch, - }).Info("Waiting to be activated") + if status.Status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch { + log.WithFields(logrus.Fields{ + "positionInActivationQueue": status.Status.PositionInActivationQueue, + }).Info("Waiting to be assigned activation epoch") + } else { + log.WithFields(logrus.Fields{ + "activationEpoch": status.Status.ActivationEpoch, + }).Info("Waiting for activation") + } case ethpb.ValidatorStatus_ACTIVE: activatedKeys = append(activatedKeys, status.PublicKey) case ethpb.ValidatorStatus_EXITED: diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index d3883ffadd64..4a269eda6dd7 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -859,6 +859,18 @@ func TestCheckAndLogValidatorStatus_OK(t *testing.T) { }, log: "Deposit processed, entering activation queue after finalization\" positionInActivationQueue=30", }, + { + name: "PENDING", + status: ðpb.ValidatorActivationResponse_Status{ + PublicKey: pubKeys[0], + Status: ðpb.ValidatorStatusResponse{ + Status: ethpb.ValidatorStatus_PENDING, + ActivationEpoch: params.BeaconConfig().FarFutureEpoch, + PositionInActivationQueue: 6, + }, + }, + log: "Waiting to be assigned activation epoch\" positionInActivationQueue=6", + }, { name: "PENDING", status: ðpb.ValidatorActivationResponse_Status{ @@ -869,7 +881,7 @@ func TestCheckAndLogValidatorStatus_OK(t *testing.T) { PositionInActivationQueue: 5, }, }, - log: "Waiting to be activated\" activationEpoch=60 positionInActivationQueue=5", + log: "Waiting for activation\" activationEpoch=60", }, { name: "EXITED",