Add expected waiting time to pending validator log (#11213)

* Add expected waiting time to pending validator log

* fix TestValidator_HandleKeyReload

* test fix

* fix imports

* test fixes

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2022-08-16 20:05:56 +02:00
committed by GitHub
parent 85ad61ea83
commit ccfc09151f
6 changed files with 107 additions and 46 deletions

View File

@@ -3,6 +3,7 @@ package client
import (
"context"
"github.com/pkg/errors"
fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams"
eth "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
"go.opencensus.io/trace"
@@ -32,7 +33,11 @@ func (v *validator) HandleKeyReload(ctx context.Context, newKeys [][fieldparams.
index: resp.Indices[i],
}
}
anyActive = v.checkAndLogValidatorStatus(statuses)
vals, err := v.beaconClient.ListValidators(ctx, &eth.ListValidatorsRequest{Active: true, PageSize: 0})
if err != nil {
return false, errors.Wrap(err, "could not get active validator count")
}
anyActive = v.checkAndLogValidatorStatus(statuses, uint64(vals.TotalSize))
if anyActive {
logActiveValidatorStatus(statuses)
}

View File

@@ -37,10 +37,12 @@ func TestValidator_HandleKeyReload(t *testing.T) {
},
}
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
v := validator{
validatorClient: client,
keyManager: km,
genesisTime: 1,
beaconClient: beaconClient,
}
resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactivePubKey[:], activePubKey[:]})
@@ -52,6 +54,7 @@ func TestValidator_HandleKeyReload(t *testing.T) {
PublicKeys: [][]byte{inactivePubKey[:], activePubKey[:]},
},
).Return(resp, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
anyActive, err := v.HandleKeyReload(context.Background(), [][fieldparams.BLSPubkeyLength]byte{inactivePubKey, activePubKey})
require.NoError(t, err)
@@ -73,10 +76,12 @@ func TestValidator_HandleKeyReload(t *testing.T) {
},
}
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
v := validator{
validatorClient: client,
keyManager: km,
genesisTime: 1,
beaconClient: beaconClient,
}
resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactivePubKey[:]})
@@ -87,6 +92,7 @@ func TestValidator_HandleKeyReload(t *testing.T) {
PublicKeys: [][]byte{inactivePubKey[:]},
},
).Return(resp, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
anyActive, err := v.HandleKeyReload(context.Background(), [][fieldparams.BLSPubkeyLength]byte{inactivePubKey})
require.NoError(t, err)

View File

@@ -371,7 +371,10 @@ func (v *validator) ReceiveBlocks(ctx context.Context, connectionErrorChannel ch
}
}
func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus) bool {
func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, activeValCount uint64) bool {
activationsPerEpoch :=
uint64(math.Max(float64(params.BeaconConfig().MinPerEpochChurnLimit), float64(activeValCount/params.BeaconConfig().ChurnLimitQuotient)))
nonexistentIndex := types.ValidatorIndex(^uint64(0))
var validatorActivated bool
for _, status := range statuses {
@@ -397,9 +400,13 @@ func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus) bool
).Info("Deposit processed, entering activation queue after finalization")
}
case ethpb.ValidatorStatus_PENDING:
secondsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot))
expectedWaitingTime :=
time.Duration((status.status.PositionInActivationQueue+activationsPerEpoch)/activationsPerEpoch*secondsPerEpoch) * time.Second
if status.status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch {
log.WithFields(logrus.Fields{
"positionInActivationQueue": status.status.PositionInActivationQueue,
"expectedWaitingTime": expectedWaitingTime.String(),
}).Info("Waiting to be assigned activation epoch")
} else {
log.WithFields(logrus.Fields{

View File

@@ -357,7 +357,8 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) {
hook := logTest.NewGlobal()
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock2.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock2.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock2.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -368,14 +369,15 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) {
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE
clientStream := mock2.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
@@ -385,6 +387,7 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) {
resp,
nil,
)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
require.NoError(t, v.WaitForActivation(ctx, nil), "Could not wait for activation")
require.LogsContain(t, hook, "Validator activated")
}
@@ -392,7 +395,8 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) {
func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock2.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock2.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock2.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -403,16 +407,18 @@ func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) {
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE
clientStream := mock2.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
gomock.Any(),
).Return(clientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil).Times(2)
clientStream.EXPECT().Recv().Return(
&ethpb.ValidatorActivationResponse{},
nil,
@@ -805,7 +811,7 @@ func TestCheckAndLogValidatorStatus_OK(t *testing.T) {
PositionInActivationQueue: 6,
},
},
log: "Waiting to be assigned activation epoch\" index=50 positionInActivationQueue=6",
log: "Waiting to be assigned activation epoch\" expectedWaitingTime=12m48s index=50 positionInActivationQueue=6",
active: false,
},
{
@@ -873,7 +879,7 @@ func TestCheckAndLogValidatorStatus_OK(t *testing.T) {
},
}
active := v.checkAndLogValidatorStatus([]*validatorStatus{test.status})
active := v.checkAndLogValidatorStatus([]*validatorStatus{test.status}, 100)
require.Equal(t, test.active, active)
if test.log != "" {
require.LogsContain(t, hook, test.log)

View File

@@ -142,7 +142,12 @@ func (v *validator) handleWithRemoteKeyManager(ctx context.Context, accountsChan
}
}
valActivated := v.checkAndLogValidatorStatus(statuses)
vals, err := v.beaconClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{Active: true, PageSize: 0})
if err != nil {
return errors.Wrap(err, "could not get active validator count")
}
valActivated := v.checkAndLogValidatorStatus(statuses, uint64(vals.TotalSize))
if valActivated {
logActiveValidatorStatus(statuses)
} else {
@@ -189,7 +194,12 @@ func (v *validator) handleWithoutRemoteKeyManager(ctx context.Context, accountsC
}
}
valActivated := v.checkAndLogValidatorStatus(statuses)
vals, err := v.beaconClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{Active: true, PageSize: 0})
if err != nil {
return errors.Wrap(err, "could not get active validator count")
}
valActivated := v.checkAndLogValidatorStatus(statuses, uint64(vals.TotalSize))
if valActivated {
logActiveValidatorStatus(statuses)
} else {

View File

@@ -30,7 +30,8 @@ import (
func TestWaitActivation_ContextCanceled(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -41,12 +42,13 @@ func TestWaitActivation_ContextCanceled(t *testing.T) {
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
@@ -64,7 +66,8 @@ func TestWaitActivation_ContextCanceled(t *testing.T) {
func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -75,16 +78,18 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) {
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
},
).Return(clientStream, errors.New("failed stream")).Return(clientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE
clientStream.EXPECT().Recv().Return(resp, nil)
@@ -94,7 +99,8 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) {
func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -105,16 +111,18 @@ func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testin
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
},
).Return(clientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
// A stream fails the first time, but succeeds the second time.
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE
@@ -129,7 +137,8 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) {
hook := logTest.NewGlobal()
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -140,19 +149,21 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) {
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
genesisTime: 1,
beaconClient: beaconClient,
}
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE
clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
},
).Return(clientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
clientStream.EXPECT().Recv().Return(
resp,
nil,
@@ -164,7 +175,8 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) {
func TestWaitForActivation_Exiting(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -175,18 +187,20 @@ func TestWaitForActivation_Exiting(t *testing.T) {
},
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_EXITING
clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
},
).Return(clientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
clientStream.EXPECT().Recv().Return(
resp,
nil,
@@ -204,7 +218,8 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) {
hook := logTest.NewGlobal()
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
privKey, err := bls.RandKey()
require.NoError(t, err)
pubKey := [fieldparams.BLSPubkeyLength]byte{}
@@ -216,18 +231,20 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) {
fetchNoKeys: true,
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
resp := generateMockStatusResponse([][]byte{pubKey[:]})
resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE
clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{pubKey[:]},
},
).Return(clientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil)
clientStream.EXPECT().Recv().Return(
resp,
nil)
@@ -256,20 +273,23 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) {
inactivePubKey: inactivePrivKey,
},
}
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
beaconClient: beaconClient,
}
inactiveResp := generateMockStatusResponse([][]byte{inactivePubKey[:]})
inactiveResp.Statuses[0].Status.Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
inactiveClientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{inactivePubKey[:]},
},
).Return(inactiveClientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil).AnyTimes()
inactiveClientStream.EXPECT().Recv().Return(
inactiveResp,
nil,
@@ -279,7 +299,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) {
activeResp.Statuses[0].Status.Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
activeResp.Statuses[1].Status.Status = ethpb.ValidatorStatus_ACTIVE
activeClientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{inactivePubKey[:], activePubKey[:]},
@@ -327,22 +347,25 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) {
require.NoError(t, err)
err = km.RecoverAccountsFromMnemonic(ctx, constant.TestMnemonic, "", 1)
require.NoError(t, err)
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: km,
genesisTime: 1,
beaconClient: beaconClient,
}
inactiveResp := generateMockStatusResponse([][]byte{inactivePubKey[:]})
inactiveResp.Statuses[0].Status.Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
inactiveClientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{inactivePubKey[:]},
},
).Return(inactiveClientStream, nil)
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil).AnyTimes()
inactiveClientStream.EXPECT().Recv().Return(
inactiveResp,
nil,
@@ -352,7 +375,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) {
activeResp.Statuses[0].Status.Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
activeResp.Statuses[1].Status.Status = ethpb.ValidatorStatus_ACTIVE
activeClientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
&ethpb.ValidatorActivationRequest{
PublicKeys: [][]byte{inactivePubKey[:], activePubKey[:]},
@@ -382,12 +405,14 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
client := mock.NewMockBeaconNodeValidatorClient(ctrl)
validatorClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
beaconClient := mock.NewMockBeaconChainClient(ctrl)
stream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl)
client.EXPECT().WaitForActivation(
validatorClient.EXPECT().WaitForActivation(
gomock.Any(),
gomock.Any(),
).Return(stream, nil /* err */).AnyTimes()
beaconClient.EXPECT().ListValidators(gomock.Any(), gomock.Any()).Return(&ethpb.Validators{}, nil).AnyTimes()
inactiveKey := bytesutil.ToBytes48([]byte("inactive"))
activeKey := bytesutil.ToBytes48([]byte("active"))
@@ -403,9 +428,10 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
Channel: tickerChan,
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: &km,
ticker: ticker,
beaconClient: beaconClient,
}
go func() {
tickerChan <- slot
@@ -417,7 +443,7 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactiveKey[:], activeKey[:]})
resp.Statuses[0].Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
resp.Statuses[1].Status = ethpb.ValidatorStatus_ACTIVE
client.EXPECT().MultipleValidatorStatus(
validatorClient.EXPECT().MultipleValidatorStatus(
gomock.Any(),
&ethpb.MultipleValidatorStatusRequest{
PublicKeys: [][]byte{inactiveKey[:], activeKey[:]},
@@ -437,7 +463,7 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
Channel: tickerChan,
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: &km,
ticker: ticker,
}
@@ -459,9 +485,10 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
Channel: tickerChan,
}
v := validator{
validatorClient: client,
validatorClient: validatorClient,
keyManager: &remoteKm,
ticker: ticker,
beaconClient: beaconClient,
}
go func() {
tickerChan <- slot
@@ -475,7 +502,7 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactiveKey[:]})
resp.Statuses[0].Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
client.EXPECT().MultipleValidatorStatus(
validatorClient.EXPECT().MultipleValidatorStatus(
gomock.Any(),
&ethpb.MultipleValidatorStatusRequest{
PublicKeys: [][]byte{inactiveKey[:]},
@@ -484,7 +511,7 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) {
resp2 := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactiveKey[:], activeKey[:]})
resp2.Statuses[0].Status = ethpb.ValidatorStatus_UNKNOWN_STATUS
resp2.Statuses[1].Status = ethpb.ValidatorStatus_ACTIVE
client.EXPECT().MultipleValidatorStatus(
validatorClient.EXPECT().MultipleValidatorStatus(
gomock.Any(),
&ethpb.MultipleValidatorStatusRequest{
PublicKeys: [][]byte{inactiveKey[:], activeKey[:]},