diff --git a/cmd/validator/accounts/exit_test.go b/cmd/validator/accounts/exit_test.go index 0b17b7acacd4..d2d94f69e43d 100644 --- a/cmd/validator/accounts/exit_test.go +++ b/cmd/validator/accounts/exit_test.go @@ -37,7 +37,7 @@ func TestExitAccountsCli_OK(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). @@ -133,7 +133,7 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). @@ -235,7 +235,7 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). @@ -324,7 +324,7 @@ func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). diff --git a/validator/client/attest_test.go b/validator/client/attest_test.go index 23308302f355..8f7307a7ffc7 100644 --- a/validator/client/attest_test.go +++ b/validator/client/attest_test.go @@ -81,7 +81,7 @@ func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) { Committee: make([]primitives.ValidatorIndex, 111), ValidatorIndex: 0, }}} - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -128,7 +128,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { beaconBlockRoot := bytesutil.ToBytes32([]byte("A")) targetRoot := bytesutil.ToBytes32([]byte("B")) sourceRoot := bytesutil.ToBytes32([]byte("C")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -206,7 +206,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) { sourceRoot := bytesutil.ToBytes32([]byte("C")) beaconBlockRoot2 := bytesutil.ToBytes32([]byte("D")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -214,7 +214,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) { Target: ðpb.Checkpoint{Root: targetRoot[:], Epoch: 4}, Source: ðpb.Checkpoint{Root: sourceRoot[:], Epoch: 3}, }, nil) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -261,7 +261,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) { targetRoot := bytesutil.ToBytes32([]byte("B")) sourceRoot := bytesutil.ToBytes32([]byte("C")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -269,7 +269,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) { Target: ðpb.Checkpoint{Root: targetRoot[:], Epoch: 2}, Source: ðpb.Checkpoint{Root: sourceRoot[:], Epoch: 1}, }, nil) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -317,7 +317,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) { targetRoot := bytesutil.ToBytes32([]byte("B")) sourceRoot := bytesutil.ToBytes32([]byte("C")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -339,7 +339,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) { validator.SubmitAttestation(context.Background(), 30, pubKey) require.LogsDoNotContain(t, hook, failedAttLocalProtectionErr) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -363,12 +363,12 @@ func TestAttestToBlockHead_DoesNotAttestBeforeDelay(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) validator.genesisTime = uint64(prysmTime.Now().Unix()) - m.validatorClient.EXPECT().GetDuties( + m.validatorClient.EXPECT().Duties( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.DutiesRequest{}), ).Times(0) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Times(0) @@ -408,7 +408,7 @@ func TestAttestToBlockHead_DoesAttestAfterDelay(t *testing.T) { ValidatorIndex: validatorIndex, }}} - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -450,7 +450,7 @@ func TestAttestToBlockHead_CorrectBitfieldLength(t *testing.T) { Committee: committee, ValidatorIndex: validatorIndex, }}} - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ diff --git a/validator/client/beacon-api/activation.go b/validator/client/beacon-api/activation.go index 61dd83bf04cf..5a3251cbed21 100644 --- a/validator/client/beacon-api/activation.go +++ b/validator/client/beacon-api/activation.go @@ -24,7 +24,7 @@ func (c *beaconApiValidatorClient) waitForActivation(ctx context.Context, in *et type waitForActivationClient struct { grpc.ClientStream ctx context.Context - beaconApiValidatorClient + *beaconApiValidatorClient *ethpb.ValidatorActivationRequest lastRecvTime time.Time } diff --git a/validator/client/beacon-api/stream_blocks.go b/validator/client/beacon-api/stream_blocks.go index ed7c63dde2d0..86e21b791f00 100644 --- a/validator/client/beacon-api/stream_blocks.go +++ b/validator/client/beacon-api/stream_blocks.go @@ -24,7 +24,7 @@ type abstractSignedBlockResponseJson struct { type streamBlocksAltairClient struct { grpc.ClientStream ctx context.Context - beaconApiClient beaconApiValidatorClient + beaconApiClient *beaconApiValidatorClient streamBlocksRequest *ethpb.StreamBlocksRequest prevBlockSlot primitives.Slot pingDelay time.Duration diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index 05ea95983937..ab75d9ec2013 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -199,7 +199,7 @@ func TestProposeBlock_RequestBlockFailed(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(nil /*response*/, errors.New("uh oh")) @@ -255,7 +255,7 @@ func TestProposeBlock_ProposeBlockFailed(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(tt.block, nil /*err*/) @@ -362,12 +362,12 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { gomock.Any(), // epoch ).Times(1).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(tt.blocks[0], nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(tt.blocks[1], nil /*err*/) @@ -414,7 +414,7 @@ func TestProposeBlock_BlocksDoubleProposal_After54KEpochs(t *testing.T) { testBlock := util.NewBeaconBlock() farFuture := params.BeaconConfig().SlotsPerEpoch.Mul(uint64(params.BeaconConfig().WeakSubjectivityPeriod + 9)) testBlock.Block.Slot = farFuture - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -428,7 +428,7 @@ func TestProposeBlock_BlocksDoubleProposal_After54KEpochs(t *testing.T) { var blockGraffiti [32]byte copy(blockGraffiti[:], "someothergraffiti") secondTestBlock.Block.Body.Graffiti = blockGraffiti[:] - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -491,7 +491,7 @@ func TestProposeBlock_AllowsOrNotPastProposals(t *testing.T) { blk := util.NewBeaconBlock() blk.Block.Slot = slot - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -520,7 +520,7 @@ func TestProposeBlock_AllowsOrNotPastProposals(t *testing.T) { blk2 := util.NewBeaconBlock() blk2.Block.Slot = tt.pastSlot - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -683,7 +683,7 @@ func testProposeBlock(t *testing.T, graffiti []byte) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).DoAndReturn(func(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { diff --git a/validator/client/sync_committee_test.go b/validator/client/sync_committee_test.go index 83bf6038eb87..175c4ee06da6 100644 --- a/validator/client/sync_committee_test.go +++ b/validator/client/sync_committee_test.go @@ -28,7 +28,7 @@ func TestSubmitSyncCommitteeMessage_ValidatorDutiesRequestFailure(t *testing.T) validator.duties = ðpb.DutiesResponse{CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{}} defer finish() - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -60,7 +60,7 @@ func TestSubmitSyncCommitteeMessage_BadDomainData(t *testing.T) { }} r := []byte{'a'} - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -96,7 +96,7 @@ func TestSubmitSyncCommitteeMessage_CouldNotSubmit(t *testing.T) { }} r := []byte{'a'} - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -141,7 +141,7 @@ func TestSubmitSyncCommitteeMessage_OK(t *testing.T) { }} r := []byte{'a'} - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -191,7 +191,7 @@ func TestSubmitSignedContributionAndProof_ValidatorDutiesRequestFailure(t *testi } } -func TestSubmitSignedContributionAndProof_GetSyncSubcommitteeIndexFailure(t *testing.T) { +func TestSubmitSignedContributionAndProof_SyncSubcommitteeIndexFailure(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { hook := logTest.NewGlobal() @@ -209,7 +209,7 @@ func TestSubmitSignedContributionAndProof_GetSyncSubcommitteeIndexFailure(t *tes var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -241,7 +241,7 @@ func TestSubmitSignedContributionAndProof_NothingToDo(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -273,7 +273,7 @@ func TestSubmitSignedContributionAndProof_BadDomain(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -319,7 +319,7 @@ func TestSubmitSignedContributionAndProof_CouldNotGetContribution(t *testing.T) var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -334,7 +334,7 @@ func TestSubmitSignedContributionAndProof_CouldNotGetContribution(t *testing.T) SignatureDomain: make([]byte, 32), }, nil) - m.validatorClient.EXPECT().GetSyncCommitteeContribution( + m.validatorClient.EXPECT().SyncCommitteeContribution( gomock.Any(), // ctx ðpb.SyncCommitteeContributionRequest{ Slot: 1, @@ -373,7 +373,7 @@ func TestSubmitSignedContributionAndProof_CouldNotSubmitContribution(t *testing. var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -390,7 +390,7 @@ func TestSubmitSignedContributionAndProof_CouldNotSubmitContribution(t *testing. aggBits := bitfield.NewBitvector128() aggBits.SetBitAt(0, true) - m.validatorClient.EXPECT().GetSyncCommitteeContribution( + m.validatorClient.EXPECT().SyncCommitteeContribution( gomock.Any(), // ctx ðpb.SyncCommitteeContributionRequest{ Slot: 1, @@ -455,7 +455,7 @@ func TestSubmitSignedContributionAndProof_Ok(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -472,7 +472,7 @@ func TestSubmitSignedContributionAndProof_Ok(t *testing.T) { aggBits := bitfield.NewBitvector128() aggBits.SetBitAt(0, true) - m.validatorClient.EXPECT().GetSyncCommitteeContribution( + m.validatorClient.EXPECT().SyncCommitteeContribution( gomock.Any(), // ctx ðpb.SyncCommitteeContributionRequest{ Slot: 1, diff --git a/validator/rpc/handlers_accounts_test.go b/validator/rpc/handlers_accounts_test.go index a011ab9ee80f..42f93b402dcd 100644 --- a/validator/rpc/handlers_accounts_test.go +++ b/validator/rpc/handlers_accounts_test.go @@ -253,7 +253,7 @@ func TestServer_VoluntaryExit(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). diff --git a/validator/rpc/handlers_beacon_test.go b/validator/rpc/handlers_beacon_test.go index 83042cb1e3d7..aac83632a582 100644 --- a/validator/rpc/handlers_beacon_test.go +++ b/validator/rpc/handlers_beacon_test.go @@ -22,7 +22,7 @@ import ( func TestGetBeaconStatus_NotConnected(t *testing.T) { ctrl := gomock.NewController(t) nodeClient := validatormock.NewMockNodeClient(ctrl) - nodeClient.EXPECT().GetSyncStatus( + nodeClient.EXPECT().SyncStatus( gomock.Any(), // ctx gomock.Any(), ).Return(nil /*response*/, errors.New("uh oh")) @@ -48,12 +48,12 @@ func TestGetBeaconStatus_OK(t *testing.T) { ctrl := gomock.NewController(t) nodeClient := validatormock.NewMockNodeClient(ctrl) chainClient := validatormock.NewMockChainClient(ctrl) - nodeClient.EXPECT().GetSyncStatus( + nodeClient.EXPECT().SyncStatus( gomock.Any(), // ctx gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: true}, nil) timeStamp := timestamppb.New(time.Unix(0, 0)) - nodeClient.EXPECT().GetGenesis( + nodeClient.EXPECT().Genesis( gomock.Any(), // ctx gomock.Any(), ).Return(ðpb.Genesis{ diff --git a/validator/rpc/handlers_health_test.go b/validator/rpc/handlers_health_test.go index bb983d9e5c66..ac46c31221a1 100644 --- a/validator/rpc/handlers_health_test.go +++ b/validator/rpc/handlers_health_test.go @@ -173,7 +173,7 @@ func TestServer_GetVersion(t *testing.T) { ctx: ctx, nodeClient: mockNodeClient, } - mockNodeClient.EXPECT().GetVersion(gomock.Any(), gomock.Any()).Return(ð.Version{ + mockNodeClient.EXPECT().Version(gomock.Any(), gomock.Any()).Return(ð.Version{ Version: "4.10.1", Metadata: "beacon node", }, nil) diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 7fb1f67d05b5..330340c37413 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -738,7 +738,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { Return(ð.DomainResponse{SignatureDomain: make([]byte, common.HashLength)}, nil /*err*/) mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Times(3). Return(ð.Genesis{GenesisTime: genesisTime}, nil) @@ -1102,7 +1102,7 @@ func TestServer_SetGasLimit(t *testing.T) { } if tt.beaconReturn != nil { - beaconClient.EXPECT().GetFeeRecipientByPubKey( + beaconClient.EXPECT().FeeRecipientByPubKey( gomock.Any(), gomock.Any(), ).Return(tt.beaconReturn.resp, tt.beaconReturn.error)