From fa9fa10c0a478571fa3b5cb4c7c7fd6b87812c51 Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Thu, 23 Apr 2020 21:03:14 -0400 Subject: [PATCH 1/3] Handle pending case where activation epoch is FarFuture --- validator/client/validator.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index 146d6995086a..93dc90cefb31 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 assigned activation epoch") + } else { + log.WithFields(logrus.Fields{ + "activationEpoch": status.Status.ActivationEpoch, + }).Info("Waiting to be activated") + } case ethpb.ValidatorStatus_ACTIVE: activatedKeys = append(activatedKeys, status.PublicKey) case ethpb.ValidatorStatus_EXITED: From 11e9c4c3d4be27271b76b929e4779c3ccdf615f0 Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Thu, 23 Apr 2020 21:10:08 -0400 Subject: [PATCH 2/3] Fix logs for validators pending activation --- validator/client/validator.go | 2 +- validator/client/validator_test.go | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index 93dc90cefb31..74279d157302 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -255,7 +255,7 @@ func (v *validator) checkAndLogValidatorStatus(validatorStatuses []*ethpb.Valida if status.Status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch { log.WithFields(logrus.Fields{ "positionInActivationQueue": status.Status.PositionInActivationQueue, - }).Info("Waiting to assigned activation epoch") + }).Info("Waiting to be assigned activation epoch") } else { log.WithFields(logrus.Fields{ "activationEpoch": status.Status.ActivationEpoch, diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index d3883ffadd64..83a438a21505 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 to be activated\" activationEpoch=60", }, { name: "EXITED", From 1c7ffb383fbd9863d02f0cc6e271a1fe8343e40a Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Thu, 23 Apr 2020 21:15:25 -0400 Subject: [PATCH 3/3] Reword pending activation log --- validator/client/validator.go | 2 +- validator/client/validator_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index 74279d157302..3eb02746a755 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -259,7 +259,7 @@ func (v *validator) checkAndLogValidatorStatus(validatorStatuses []*ethpb.Valida } else { log.WithFields(logrus.Fields{ "activationEpoch": status.Status.ActivationEpoch, - }).Info("Waiting to be activated") + }).Info("Waiting for activation") } case ethpb.ValidatorStatus_ACTIVE: activatedKeys = append(activatedKeys, status.PublicKey) diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 83a438a21505..4a269eda6dd7 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -881,7 +881,7 @@ func TestCheckAndLogValidatorStatus_OK(t *testing.T) { PositionInActivationQueue: 5, }, }, - log: "Waiting to be activated\" activationEpoch=60", + log: "Waiting for activation\" activationEpoch=60", }, { name: "EXITED",